Skip to content

Commit 759e15f

Browse files
committed
Add backend parameter to the sample
1 parent 4843292 commit 759e15f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

samples/classification.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
help='Device to store the model.')
2828
parser.add_argument('--model', choices=list(pt_models.keys()),
2929
type=str, default='resnet18')
30+
parser.add_argument('--backend', choices=list(['pytorch', 'aten']),
31+
type=str, default='pytorch')
3032
parser.add_argument('--result', type=str, default=None)
3133
args = parser.parse_args()
3234

@@ -42,6 +44,7 @@
4244

4345
macs, params = get_model_complexity_info(net, (3, 224, 224),
4446
as_strings=True,
47+
backend=args.backend,
4548
print_per_layer_stat=True,
4649
ost=ost)
4750
print('{:<30} {:<8}'.format('Computational complexity: ', macs))

0 commit comments

Comments
 (0)