tvm
|
Tensor expression language DSL. More...
Classes | |
struct | TensorDom |
Temporary data structure to store union of bounds of each axis of Tensor. More... | |
class | OperationNode |
Base class of all operation nodes. More... | |
class | PlaceholderOpNode |
A placeholder op represents an input placeholder. More... | |
class | PlaceholderOp |
Managed reference to PlaceholderOpNode. More... | |
class | BaseComputeOpNode |
A Compute op that compute a tensor on certain domain. This is the base class for ComputeOp (operating on a scalar at a time) More... | |
class | ComputeOpNode |
A Compute op that compute a tensor on certain domain. More... | |
class | ComputeOp |
Managed reference to ComputeOpNode. More... | |
class | ScanOpNode |
Symbolic scan. More... | |
class | ScanOp |
Managed reference to ScanOpNode. More... | |
class | ExternOpNode |
External computation that cannot be splitted. More... | |
class | ExternOp |
Managed reference to ExternOpNode. More... | |
class | Operation |
Operation that produces tensors. More... | |
class | TensorNode |
Node to represent a tensor. More... | |
class | Tensor |
Tensor structure representing a possible input, or intermediate computation result. More... | |
Typedefs | |
using | FCompute = std::function< PrimExpr(const Array< Var > &i)> |
The compute function to specify the input source of a Tensor. More... | |
using | FBatchCompute = std::function< Array< PrimExpr >(const Array< Var > &i)> |
The compute function to specify the inputs source of Tensors. More... | |
Functions | |
Var | var (std::string name_hint, DataType t=DataType::Int(32)) |
Construct a new Var expression. More... | |
IterVar | thread_axis (Range dom, std::string tag) |
Create a new IterVar that represents an axis in thread. More... | |
IterVar | reduce_axis (Range dom, std::string name="rv") |
Create a new IterVar for reduction operations. More... | |
Tensor | placeholder (Array< PrimExpr > shape, DataType dtype=DataType::Float(32), std::string name="placeholder") |
create a place holder tensor. More... | |
Tensor | compute (Array< PrimExpr > shape, FCompute fcompute, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fcompute(axis) More... | |
Array< Tensor > | compute (Array< PrimExpr > shape, FBatchCompute fcompute, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fcompute(axis) More... | |
Array< Tensor > | scan (Array< Tensor > init, Array< Tensor > update, Array< Tensor > state_placeholder, Array< Tensor > inputs=Array< Tensor >(), std::string name="scan", std::string tag="", Map< String, ObjectRef > attrs={}) |
Construct new tensors by scan. More... | |
Tensor | compute (Array< PrimExpr > shape, std::function< PrimExpr(Var)> f, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
Tensor | compute (Array< PrimExpr > shape, std::function< PrimExpr(Var, Var)> f, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
Tensor | compute (Array< PrimExpr > shape, std::function< PrimExpr(Var, Var, Var)> f, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
Tensor | compute (Array< PrimExpr > shape, std::function< PrimExpr(Var, Var, Var, Var)> f, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={}) |
PrimExpr | operator! (const Tensor::Slice &a) |
PrimExpr | operator- (const Tensor::Slice &a) |
template<typename T > | |
PrimExpr | operator+ (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator+ (const T &a, const Tensor::Slice &b) |
PrimExpr | operator+ (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator- (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator- (const T &a, const Tensor::Slice &b) |
PrimExpr | operator- (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator* (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator* (const T &a, const Tensor::Slice &b) |
PrimExpr | operator* (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator== (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator== (const T &a, const Tensor::Slice &b) |
PrimExpr | operator== (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator<= (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator<= (const T &a, const Tensor::Slice &b) |
PrimExpr | operator<= (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator>= (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator>= (const T &a, const Tensor::Slice &b) |
PrimExpr | operator>= (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator!= (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator!= (const T &a, const Tensor::Slice &b) |
PrimExpr | operator!= (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator&& (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator&& (const T &a, const Tensor::Slice &b) |
PrimExpr | operator&& (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator|| (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator|| (const T &a, const Tensor::Slice &b) |
PrimExpr | operator|| (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator>> (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator>> (const T &a, const Tensor::Slice &b) |
PrimExpr | operator>> (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator<< (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator<< (const T &a, const Tensor::Slice &b) |
PrimExpr | operator<< (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator> (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator> (const T &a, const Tensor::Slice &b) |
PrimExpr | operator> (const Tensor::Slice &a, const Tensor::Slice &b) |
template<typename T > | |
PrimExpr | operator< (const Tensor::Slice &a, const T &b) |
template<typename T > | |
PrimExpr | operator< (const T &a, const Tensor::Slice &b) |
PrimExpr | operator< (const Tensor::Slice &a, const Tensor::Slice &b) |
Tensor expression language DSL.
using tvm::te::FBatchCompute = typedef std::function<Array<PrimExpr>(const Array<Var>& i)> |
The compute function to specify the inputs source of Tensors.
using tvm::te::FCompute = typedef std::function<PrimExpr(const Array<Var>& i)> |
The compute function to specify the input source of a Tensor.
Array<Tensor> tvm::te::compute | ( | Array< PrimExpr > | shape, |
FBatchCompute | fcompute, | ||
std::string | name = "tensor" , |
||
std::string | tag = "" , |
||
Map< String, ObjectRef > | attrs = {} |
||
) |
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fcompute(axis)
shape | Shape of the tensor. |
fcompute | The compute function to create the tensors. |
name | The optional name of the tensor. |
tag | The optional tag of the tensor. |
attrs | Optional additional attributes of the compute. |
Tensor tvm::te::compute | ( | Array< PrimExpr > | shape, |
FCompute | fcompute, | ||
std::string | name = "tensor" , |
||
std::string | tag = "" , |
||
Map< String, ObjectRef > | attrs = {} |
||
) |
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fcompute(axis)
shape | Shape of the tensor. |
fcompute | The compute function to create the tensor. |
name | The optional name of the tensor. |
tag | The optional tag of the tensor. |
attrs | Optional additional attributes of the compute. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tensor tvm::te::placeholder | ( | Array< PrimExpr > | shape, |
DataType | dtype = DataType::Float(32) , |
||
std::string | name = "placeholder" |
||
) |
create a place holder tensor.
shape | The shape of the tensor. |
dtype | the data type of the tensor. |
name | The name of the Tensor. |
Create a new IterVar for reduction operations.
dom | The domain of the reduction axis. |
name | The name of the reduction axis. |
Array<Tensor> tvm::te::scan | ( | Array< Tensor > | init, |
Array< Tensor > | update, | ||
Array< Tensor > | state_placeholder, | ||
Array< Tensor > | inputs = Array< Tensor >() , |
||
std::string | name = "scan" , |
||
std::string | tag = "" , |
||
Map< String, ObjectRef > | attrs = {} |
||
) |
Construct new tensors by scan.
init | The intialize tensor of first K steps. |
update | The update tensor indicated the updated result after each timestamp. |
state_placeholder | The placeholder for the states. |
inputs | The inputs to the scan body, this is optional, but recommended to provide concrete information about scan body. |
name | The optional name of the tensor. |
tag | The optional tag of the tensor. |
attrs | Optional additional attributes of the compute. |
Create a new IterVar that represents an axis in thread.
dom | Optional, domain of the thread axis. |
tag | The thread tag of the axis. |
Var tvm::te::var | ( | std::string | name_hint, |
DataType | t = DataType::Int(32) |
||
) |
Construct a new Var expression.
name_hint | The name hint for the expression |
t | The type of the expression |