24 #ifndef TVM_TOPI_EINSUM_H_
25 #define TVM_TOPI_EINSUM_H_
27 #define LABELRANGE 128
28 #define NPY_MAXDIMS 16
29 #define NPY_MAXARGS 16
43 #include <unordered_set>
50 using namespace topi::detail;
74 std::string name =
"T_einsum", std::string tag =
kEinsum);
87 static constexpr
Label kEllipsis =
'\0';
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
Utility functions for handling constants in TVM expressions.
Layout expression to describe the data organization of a tensor. And BijectiveLayout to mapping two d...
Tensor expression language DSL.
Definition: extracted_task.h:33
constexpr auto kEinsum
Definition: tags.h:44
Array< PrimExpr > InferEinsumShape(const std::string &subscripts, const std::vector< Array< PrimExpr >> &operands)
Compute the shape of the output.
Tensor einsum(const std::string &subscripts_str, const Array< Tensor > inputs, std::string name="T_einsum", std::string tag=kEinsum)
Evaluates the Einstein summation convention on the operands.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Operation node can generate one or multiple Tensors.
Index ravel and unraval operations.
static EinsumEquation FromString(const std::string &equation)
Create EinsumEquation from a string. The result will be converted to the explicit mode of Einsum if i...
char Label
Definition: einsum.h:83
std::vector< Label > Subscript
Definition: einsum.h:84
std::vector< Subscript > inputs
Definition: einsum.h:89
Subscript output
Definition: einsum.h:91
Utility functions for handling tensor.