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
42 #include <unordered_set>
49 using namespace topi::detail;
59 const std::vector<ffi::Array<PrimExpr>>& operands);
72 Tensor einsum(
const std::string& subscripts_str,
const ffi::Array<Tensor> inputs,
73 std::string name =
"T_einsum", std::string tag =
kEinsum);
86 static constexpr
Label kEllipsis =
'\0';
Managed Tensor. The array is backed by reference counted blocks.
Definition: tensor.h:54
Utility functions for handling constants in TVM expressions.
Tensor expression language DSL.
Definition: extracted_task.h:33
Tensor einsum(const std::string &subscripts_str, const ffi::Array< Tensor > inputs, std::string name="T_einsum", std::string tag=kEinsum)
Evaluates the Einstein summation convention on the operands.
ffi::Array< PrimExpr > InferEinsumShape(const std::string &subscripts, const std::vector< ffi::Array< PrimExpr >> &operands)
Compute the shape of the output.
constexpr auto kEinsum
Definition: tags.h:44
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
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:82
std::vector< Label > Subscript
Definition: einsum.h:83
std::vector< Subscript > inputs
Definition: einsum.h:88
Subscript output
Definition: einsum.h:90
Utility functions for handling tensor.