Skip to content

Commit

Permalink
make bench_gen.py work for 3d conv (pytorch#12433)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#12433

To test 3d conv, we need to pass lists in spec argument. We also don't want to set use_cudnn=True which is the default in brew.

Reviewed By: llyfacebook, csummersea

Differential Revision: D10234315

fbshipit-source-id: 96a39992a97e020d6e9dac103e6d64df0cc1020b
  • Loading branch information
jspark1105 authored and facebook-github-bot committed Oct 8, 2018
1 parent 00aedfc commit f1f521f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions binaries/bench_gen/bench_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from __future__ import unicode_literals

import argparse
import ast

from caffe2.python.model_helper import ModelHelper
from caffe2.python.predictor import mobile_exporter
Expand All @@ -15,18 +16,15 @@
def parse_kwarg(kwarg_str):
key, value = kwarg_str.split('=')
try:
value = int(value)
value = ast.literal_eval(value)
except ValueError:
try:
value = float(value)
except ValueError:
pass
pass
return key, value


def main(args):
# User defined keyword arguments
kwargs = {"order": "NCHW"}
kwargs = {"order": "NCHW", "use_cudnn": False}
kwargs.update(dict(args.kwargs))

model = ModelHelper(name=args.benchmark_name)
Expand Down

0 comments on commit f1f521f

Please sign in to comment.