torch-mlir/python
Ashay Rane a893c7d5cf
Add shape transfer function and lowering to linalg for aten.neg (#759)
* shape: add shape transfer function for aten.neg

Prior to this patch, the list of shape transfer functions did not
include `aten.neg`, which resulted in errors like below.

```
error: unsupported by backend lowering: tensor with unknown rank or dtype
note: see current operation: %0 = "torch.aten.neg"(%arg0) :
  (!torch.vtensor<[256,256],f32>) -> !torch.vtensor<*,f32>
note: this is likely due to a missing shape transfer function in shape_lib_gen.py
```

This patch fixes the problem by adding a shape transfer function to
reflect the point-wise nature of this operation.

* linalg: add translation of aten.neg operation

This patch adds a translation rule to lower `aten.neg` operations on
tensors to an `arith.negf` operation wrapped inside a `linalg.generic`
operation.  This patch also adds a rudimentary test.
2022-04-15 11:11:22 -07:00
..
test Fix kwarg annotation in eager (#747) 2022-04-11 17:35:42 -05:00
torch_mlir Add shape transfer function and lowering to linalg for aten.neg (#759) 2022-04-15 11:11:22 -07:00
torch_mlir_e2e_test [MLIR][TORCH] Add E2E support for aten::max_pool2d_with_indices_backward op 2022-04-14 21:46:47 +05:30
CMakeLists.txt This PR implements an eager mode backend for PyTorch through the torch-mlir framework. This is accomplished by overriding the `__torch_dispatch__` class method on wrapper subclass `TorchMLIRTensor(torch.Tensor)`. 2022-03-22 14:42:57 -07:00
TorchMLIRModule.cpp Dual license the torch-mlir project. 2021-10-01 10:46:08 -07:00