pytorch
17925122 - Rewrite new_zeros, new_ones, new_full decomp with aten.full (#84946)

Commit
2 years ago
Rewrite new_zeros, new_ones, new_full decomp with aten.full (#84946) We should **NOT** introducing non-functional op for decomps of functional op. For example ``` make_fx(functionalize(lambda x: x.new_zeros(3)), decomposition_table=decomposition_table)(x) ``` is producing ``` def forward(self, x_1): empty = torch.ops.aten.empty.memory_format([3, 4], dtype = torch.float32, layout = torch.strided, device = device(type='cpu'), pin_memory = False) zero_ = torch.ops.aten.zero_.default(empty); empty = None return zero_ ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/84946 Approved by: https://github.com/ngimel
Author
Committer
Parents
Loading