Implement Variable.new (#4080)

This commit is contained in:
Sam Gross
2017-12-11 15:45:43 -05:00
committed by GitHub
parent 8612b0bbd8
commit aeb7a3668d
21 changed files with 313 additions and 39 deletions

View File

@ -113,7 +113,10 @@ def create_python_bindings(
typename = 'Tensor'
unpack = unpack_methods.get(typename, typename.lower())
actuals.append('r.{}({})'.format(unpack, arg_idx))
expr = 'r.{}({})'.format(unpack, arg_idx)
if typename == 'Storage &':
expr = '*' + expr
actuals.append(expr)
dispatch_type = typename
if dispatch_type == 'Tensor':
dispatch_type = 'const Tensor &'