torch-mlir/lib/Dialect/Numpy/Transforms
Sean Silva 6431b0f11f Add primitive ArrayToTensor (numpy-array-to-tensor) pass.
The current implementation is just sufficient to do a unary aten.tanh
from the e2e spike, and just applies some local rewrite patterns.  I've
sketched out the more full explanation of where this pass eventually
need to go in the pass docs.

Adding this required adding `numpy.tensor_static_info_cast`, which is
the tensor analog of `numpy.static_info_cast`. This op encapsulates the
same numpy-specific "no runtime code" casting semantics, in particular
the interpretation of `!numpy.any_dtype`. The
`numpy.tensor_static_info_cast` I see in practice now are "information
erasing" and will be removed by a later pass that exploits the fact that
aten ops are agnostic to the static info in the operand types (so
substituting a type with more static info is fine).

Side note: we *need* to do dtype and rank inference before aten->tcf
(which will eventually mostly be aten->linalg+guards), because each aten
op is idiosyncratically overloaded based on dtype and rank. Without
copying that idiosyncratic overloading into lower layers (layering
violation), we cannot really lower it to anything until we do that.
2021-04-05 17:56:35 -07:00
..
ArrayToTensor.cpp Add primitive ArrayToTensor (numpy-array-to-tensor) pass. 2021-04-05 17:56:35 -07:00
CMakeLists.txt Add primitive ArrayToTensor (numpy-array-to-tensor) pass. 2021-04-05 17:56:35 -07:00
PassDetail.h Add NumpyPublicFunctionsToTensor pass. 2020-07-08 22:51:54 -07:00
Passes.cpp Bump submodule versions. 2020-09-08 13:26:42 -07:00
PublicFunctionToTensor.cpp Bump llvm-project to 16c6e9c58e9ae50a775945e6b407f1891f353d2f 2021-01-05 16:12:11 -08:00