Skip to content

Commit 83b4dc6

Browse files
gchananfacebook-github-bot
authored andcommitted
Remove Type.tensor(). (pytorch#12360)
Summary: Use at::empty instead. Pull Request resolved: pytorch#12360 Reviewed By: ezyang Differential Revision: D10215119 Pulled By: gchanan fbshipit-source-id: f9bb257dff1b1bf1ecd3a6e358c4791d81b5bd31
1 parent 28e1571 commit 83b4dc6

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

aten/src/ATen/function_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ def emit_nn_body(option):
780780
# _out variants must create buffers and insert them in the
781781
# arguments list between output and input arguments
782782
for buffer in option['buffers']:
783-
body.append('Tensor {} = tensor();'.format(buffer['name']))
783+
body.append('Tensor {} = at::empty({{0}}, this->options());'.format(buffer['name']))
784784
actuals = [arg['name'] for arg in option['arguments'] if arg.get('output')]
785785
actuals += [buffer['name'] for buffer in option['buffers']]
786786
actuals += [arg['name'] for arg in option['arguments'] if not arg.get('output')]

aten/src/ATen/native/native_functions.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1901,9 +1901,6 @@
19011901
SparseCPU: new_with_size_sparse
19021902
SparseCUDA: new_with_size_sparse
19031903

1904-
- func: tensor(Type dtype) -> Tensor
1905-
variants: []
1906-
19071904
- func: tensor(Type dtype, IntList size) -> Tensor
19081905
variants: []
19091906

0 commit comments

Comments
 (0)