summaryrefslogtreecommitdiff
path: root/tools/jit/gen_jit_dispatch.py
diff options
context:
space:
mode:
authorWei Yang <weiyang@fb.com>2018-07-25 14:59:35 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-07-25 15:11:44 -0700
commit302adb7cc827adbcf5cd29c531cd8cbe52b2f7dc (patch)
treed725fc853648b9b47b9cbb78bf95551f29443c55 /tools/jit/gen_jit_dispatch.py
parent2f5c0c30cd9a6f3477bf892f753a1fd49e5e718c (diff)
downloadpytorch-302adb7cc827adbcf5cd29c531cd8cbe52b2f7dc.tar.gz
pytorch-302adb7cc827adbcf5cd29c531cd8cbe52b2f7dc.tar.bz2
pytorch-302adb7cc827adbcf5cd29c531cd8cbe52b2f7dc.zip
added torch.rot90() to ATen (#8628)
Summary: 1. fixes #6271 2. implemented torch.rot90() following [numpy.rot90()](https://github.com/numpy/numpy/blob/6a58e25703cbecb6786faa09a04ae2ec8221348b/numpy/lib/function_base.py#L54-L138) Pull Request resolved: https://github.com/pytorch/pytorch/pull/8628 Reviewed By: ezyang Differential Revision: D8987860 Pulled By: weiyangfb fbshipit-source-id: 8dac3b2a1f6d3288672977aba8b547706ce97fe9
Diffstat (limited to 'tools/jit/gen_jit_dispatch.py')
-rw-r--r--tools/jit/gen_jit_dispatch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/jit/gen_jit_dispatch.py b/tools/jit/gen_jit_dispatch.py
index 49948de718..18c043a6c1 100644
--- a/tools/jit/gen_jit_dispatch.py
+++ b/tools/jit/gen_jit_dispatch.py
@@ -419,7 +419,9 @@ def signature(decl):
.replace('false', 'False') \
.replace('nullptr', 'None') \
.replace('Reduction::ElementwiseMean', 'ElementwiseMean') \
- .replace('{}', 'None' if is_tensor_arg(arg) else '[]')
+ .replace('{}', 'None' if is_tensor_arg(arg) else '[]') \
+ .replace('{', '[') \
+ .replace('}', ']')
default = default_map.get(default, default)
decl = '{}={}'.format(decl, default)