tvm
Namespaces | Classes | Typedefs | Functions | Variables
tvm::topi Namespace Reference

Namespaces

 contrib
 
 cuda
 
 generic
 
 nn
 
 relax
 
 rocm
 
 vision
 
 x86
 

Classes

struct  EinsumEquation
 

Typedefs

using FReduce = std::function< PrimExpr(PrimExpr source, const Array< IterVar > &axis, Array< PrimExpr > init, Span span)>
 The operation to use for CommReduce. More...
 
using FCommReduce = std::function< Array< PrimExpr >(Array< PrimExpr > exprs, const Array< IterVar > &axis, PrimExpr *condition)>
 The operation to use for CommReduceIdx. More...
 
using FCombine = std::function< Array< PrimExpr >(Array< Var > lhs, Array< Var > rhs)>
 A combiner function for a reduction. More...
 
using FIdentity = std::function< Array< PrimExpr >(std::vector< DataType > types)>
 An initializer function for a reduction. More...
 

Functions

tvm::te::Tensor broadcast_to (const tvm::te::Tensor &t, const tvm::Array< tvm::PrimExpr > &output_shape, std::string name="T_broadcast_to", std::string tag=kBroadcast)
 Creates an operation that broadcasts a tensor into a compatible shape according to numpy's rules. More...
 
tvm::PrimExpr logical_and (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor logical_and (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "logical_and", std::string tag=kBroadcast)
 
tvm::te::Tensor logical_and (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "logical_and", std::string tag=kElementWise)
 
tvm::te::Tensor logical_and (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "logical_and", std::string tag=kElementWise)
 
tvm::te::Tensor operator&& (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator&& (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator&& (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr logical_or (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor logical_or (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "logical_or", std::string tag=kBroadcast)
 
tvm::te::Tensor logical_or (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "logical_or", std::string tag=kElementWise)
 
tvm::te::Tensor logical_or (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "logical_or", std::string tag=kElementWise)
 
tvm::te::Tensor operator|| (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator|| (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator|| (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr logical_xor (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor logical_xor (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "logical_xor", std::string tag=kBroadcast)
 
tvm::te::Tensor logical_xor (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "logical_xor", std::string tag=kElementWise)
 
tvm::te::Tensor logical_xor (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "logical_xor", std::string tag=kElementWise)
 
tvm::PrimExpr bitwise_and (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor bitwise_and (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_and", std::string tag=kBroadcast)
 
tvm::te::Tensor bitwise_and (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "bitwise_and", std::string tag=kElementWise)
 
tvm::te::Tensor bitwise_and (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_and", std::string tag=kElementWise)
 
tvm::te::Tensor operator& (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator& (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator& (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr bitwise_or (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor bitwise_or (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_or", std::string tag=kBroadcast)
 
tvm::te::Tensor bitwise_or (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "bitwise_or", std::string tag=kElementWise)
 
tvm::te::Tensor bitwise_or (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_or", std::string tag=kElementWise)
 
tvm::te::Tensor operator| (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator| (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator| (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr bitwise_xor (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor bitwise_xor (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_xor", std::string tag=kBroadcast)
 
tvm::te::Tensor bitwise_xor (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "bitwise_xor", std::string tag=kElementWise)
 
tvm::te::Tensor bitwise_xor (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "bitwise_xor", std::string tag=kElementWise)
 
tvm::te::Tensor operator^ (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator^ (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator^ (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr add (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor add (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "add", std::string tag=kBroadcast)
 
tvm::te::Tensor add (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "add", std::string tag=kElementWise)
 
tvm::te::Tensor add (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "add", std::string tag=kElementWise)
 
tvm::te::Tensor operator+ (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator+ (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator+ (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr subtract (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor subtract (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "subtract", std::string tag=kBroadcast)
 
tvm::te::Tensor subtract (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "subtract", std::string tag=kElementWise)
 
tvm::te::Tensor subtract (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "subtract", std::string tag=kElementWise)
 
tvm::te::Tensor operator- (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator- (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator- (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr multiply (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor multiply (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "multiply", std::string tag=kBroadcast)
 
tvm::te::Tensor multiply (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "multiply", std::string tag=kElementWise)
 
tvm::te::Tensor multiply (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "multiply", std::string tag=kElementWise)
 
tvm::te::Tensor operator* (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator* (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator* (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr divide (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor divide (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "divide", std::string tag=kBroadcast)
 
tvm::te::Tensor divide (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "divide", std::string tag=kElementWise)
 
tvm::te::Tensor divide (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "divide", std::string tag=kElementWise)
 
tvm::PrimExpr floor_divide (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor floor_divide (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "floor_divide", std::string tag=kBroadcast)
 
tvm::te::Tensor floor_divide (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "floor_divide", std::string tag=kElementWise)
 
tvm::te::Tensor floor_divide (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "floor_divide", std::string tag=kElementWise)
 
tvm::PrimExpr trunc_divide (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor trunc_divide (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "trunc_divide", std::string tag=kBroadcast)
 
tvm::te::Tensor trunc_divide (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "trunc_divide", std::string tag=kElementWise)
 
tvm::te::Tensor trunc_divide (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "trunc_divide", std::string tag=kElementWise)
 
tvm::PrimExpr mod (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor mod (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "mod", std::string tag=kBroadcast)
 
tvm::te::Tensor mod (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "mod", std::string tag=kElementWise)
 
tvm::te::Tensor mod (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "mod", std::string tag=kElementWise)
 
tvm::PrimExpr floor_mod (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor floor_mod (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "floor_mod", std::string tag=kBroadcast)
 
tvm::te::Tensor floor_mod (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "floor_mod", std::string tag=kElementWise)
 
tvm::te::Tensor floor_mod (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "floor_mod", std::string tag=kElementWise)
 
tvm::PrimExpr trunc_mod (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor trunc_mod (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "trunc_mod", std::string tag=kBroadcast)
 
tvm::te::Tensor trunc_mod (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "trunc_mod", std::string tag=kElementWise)
 
tvm::te::Tensor trunc_mod (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "trunc_mod", std::string tag=kElementWise)
 
tvm::PrimExpr maximum (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor maximum (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "maximum", std::string tag=kBroadcast)
 
tvm::te::Tensor maximum (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "maximum", std::string tag=kElementWise)
 
tvm::te::Tensor maximum (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "maximum", std::string tag=kElementWise)
 
tvm::PrimExpr minimum (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor minimum (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "minimum", std::string tag=kBroadcast)
 
tvm::te::Tensor minimum (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "minimum", std::string tag=kElementWise)
 
tvm::te::Tensor minimum (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "minimum", std::string tag=kElementWise)
 
tvm::PrimExpr power (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor power (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "power", std::string tag=kBroadcast)
 
tvm::te::Tensor power (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "power", std::string tag=kElementWise)
 
tvm::te::Tensor power (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "power", std::string tag=kElementWise)
 
tvm::PrimExpr left_shift (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor left_shift (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "left_shift", std::string tag=kBroadcast)
 
tvm::te::Tensor left_shift (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "left_shift", std::string tag=kElementWise)
 
tvm::te::Tensor left_shift (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "left_shift", std::string tag=kElementWise)
 
tvm::te::Tensor operator<< (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator<< (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator<< (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr right_shift (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor right_shift (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "right_shift", std::string tag=kBroadcast)
 
tvm::te::Tensor right_shift (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "right_shift", std::string tag=kElementWise)
 
tvm::te::Tensor right_shift (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "right_shift", std::string tag=kElementWise)
 
tvm::te::Tensor operator>> (const tvm::te::Tensor &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator>> (const tvm::PrimExpr &A, const tvm::te::Tensor &B)
 
tvm::te::Tensor operator>> (const tvm::te::Tensor &A, const tvm::PrimExpr &B)
 
tvm::PrimExpr greater (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor greater (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "greater", std::string tag=kBroadcast)
 
tvm::te::Tensor greater (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "greater", std::string tag=kElementWise)
 
tvm::te::Tensor greater (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "greater", std::string tag=kElementWise)
 
tvm::PrimExpr less (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor less (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "less", std::string tag=kBroadcast)
 
tvm::te::Tensor less (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "less", std::string tag=kElementWise)
 
tvm::te::Tensor less (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "less", std::string tag=kElementWise)
 
tvm::PrimExpr equal (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor equal (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "equal", std::string tag=kBroadcast)
 
tvm::te::Tensor equal (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "equal", std::string tag=kElementWise)
 
tvm::te::Tensor equal (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "equal", std::string tag=kElementWise)
 
tvm::PrimExpr not_equal (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor not_equal (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "not_equal", std::string tag=kBroadcast)
 
tvm::te::Tensor not_equal (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "not_equal", std::string tag=kElementWise)
 
tvm::te::Tensor not_equal (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "not_equal", std::string tag=kElementWise)
 
tvm::PrimExpr greater_equal (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor greater_equal (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "greater_equal", std::string tag=kBroadcast)
 
tvm::te::Tensor greater_equal (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "greater_equal", std::string tag=kElementWise)
 
tvm::te::Tensor greater_equal (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "greater_equal", std::string tag=kElementWise)
 
tvm::PrimExpr less_equal (const tvm::PrimExpr &a, const tvm::PrimExpr &b)
 
tvm::te::Tensor less_equal (const tvm::te::Tensor &A, const tvm::te::Tensor &B, std::string name="T_" "less_equal", std::string tag=kBroadcast)
 
tvm::te::Tensor less_equal (const tvm::te::Tensor &A, const tvm::PrimExpr &B, std::string name="T_" "less_equal", std::string tag=kElementWise)
 
tvm::te::Tensor less_equal (const tvm::PrimExpr &A, const tvm::te::Tensor &B, std::string name="T_" "less_equal", std::string tag=kElementWise)
 
Array< PrimExprInferEinsumShape (const std::string &subscripts, const std::vector< Array< PrimExpr >> &operands)
 Compute the shape of the output. More...
 
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. More...
 
Tensor exp (const Tensor &x, std::string name="T_" "exp", std::string tag=kElementWise)
 
Tensor erf (const Tensor &x, std::string name="T_" "erf", std::string tag=kElementWise)
 
Tensor sigmoid (const Tensor &x, std::string name="T_" "sigmoid", std::string tag=kElementWise)
 
Tensor sqrt (const Tensor &x, std::string name="T_" "sqrt", std::string tag=kElementWise)
 
Tensor log (const Tensor &x, std::string name="T_" "log", std::string tag=kElementWise)
 
Tensor log2 (const Tensor &x, std::string name="T_" "log2", std::string tag=kElementWise)
 
Tensor log10 (const Tensor &x, std::string name="T_" "log10", std::string tag=kElementWise)
 
Tensor floor (const Tensor &x, std::string name="T_" "floor", std::string tag=kElementWise)
 
Tensor ceil (const Tensor &x, std::string name="T_" "ceil", std::string tag=kElementWise)
 
Tensor round (const Tensor &x, std::string name="T_" "round", std::string tag=kElementWise)
 
Tensor trunc (const Tensor &x, std::string name="T_" "trunc", std::string tag=kElementWise)
 
Tensor abs (const Tensor &x, std::string name="T_" "abs", std::string tag=kElementWise)
 
Tensor cos (const Tensor &x, std::string name="T_" "cos", std::string tag=kElementWise)
 
Tensor cosh (const Tensor &x, std::string name="T_" "cosh", std::string tag=kElementWise)
 
Tensor tan (const Tensor &x, std::string name="T_" "tan", std::string tag=kElementWise)
 
Tensor sin (const Tensor &x, std::string name="T_" "sin", std::string tag=kElementWise)
 
Tensor sinh (const Tensor &x, std::string name="T_" "sinh", std::string tag=kElementWise)
 
Tensor acos (const Tensor &x, std::string name="T_" "acos", std::string tag=kElementWise)
 
Tensor acosh (const Tensor &x, std::string name="T_" "acosh", std::string tag=kElementWise)
 
Tensor asin (const Tensor &x, std::string name="T_" "asin", std::string tag=kElementWise)
 
Tensor asinh (const Tensor &x, std::string name="T_" "asinh", std::string tag=kElementWise)
 
Tensor atan (const Tensor &x, std::string name="T_" "atan", std::string tag=kElementWise)
 
Tensor atanh (const Tensor &x, std::string name="T_" "atanh", std::string tag=kElementWise)
 
Tensor isnan (const Tensor &x, std::string name="T_" "isnan", std::string tag=kElementWise)
 
Tensor tanh (const Tensor &x, std::string name="T_" "tanh", std::string tag=kElementWise)
 
Tensor isfinite (const Tensor &x, std::string name="T_" "isfinite", std::string tag=kElementWise)
 
Tensor isinf (const Tensor &x, std::string name="T_" "isinf", std::string tag=kElementWise)
 
Tensor fast_tanh_float (const Tensor &in, std::string name, std::string tag)
 Fast_tanh_float implementation from Eigen https://github.com/eigenteam/eigen-git-mirror/blob/master/Eigen/src/Core/MathFunctionsImpl.h#L26. More...
 
Tensor fast_tanh (const Tensor &x, std::string name="T_fast_tanh", std::string tag=kElementWise)
 Creates an operation that returns hyperbolic tanh of a given tensor. More...
 
Tensor identity (const Tensor &x, std::string name="T_identity", std::string tag=kElementWise)
 Creates an operation that returns identity of a given tensor. More...
 
Tensor negative (const Tensor &x, std::string name="T_negative", std::string tag=kElementWise)
 Creates an operation that returns the negation of a given tensor. More...
 
Tensor logical_not (const Tensor &x, std::string name="T_logical_not", std::string tag=kElementWise)
 Creates an operation that returns the logical NOT of a given tensor. More...
 
Tensor bitwise_not (const Tensor &x, std::string name="T_bitwise_not", std::string tag=kElementWise)
 Creates an operation that returns the bitwise NOT of a given tensor. More...
 
Tensor sign (const Tensor &x, std::string name="T_sign", std::string tag=kElementWise)
 Returns the sign of the tensor. More...
 
Tensor rsqrt (const Tensor &x, std::string name="tensor", std::string tag=kElementWise)
 Creates an operation that returns rsqrt of a given tensor. More...
 
Tensor clip (const Tensor &x, const PrimExpr &a_min, const PrimExpr &a_max, std::string name="T_clip", std::string tag=kElementWise)
 Creates an operation that clips each element of a tensor to the interval [a_min, a_max]. More...
 
Tensor cast (const Tensor &x, DataType type, std::string name="T_cast", std::string tag=kElementWise)
 Cast each element of x to the given type. If expr is scalar and type is a corresponding vector type, a Broadcast is generated, otherwise a Cast is generated. More...
 
Tensor reinterpret (const Tensor &x, DataType type, std::string name="tensor", std::string tag=kElementWise)
 Reinterpret each element of x to the given type. More...
 
Tensor elemwise_sum (const Array< Tensor > &xs, std::string name="T_elemwise_sum", std::string tag=kElementWise)
 Creates an operation that sum each element of a tensor. More...
 
Tensor full (const Array< PrimExpr > &shape, DataType dtype, const PrimExpr fill_value, std::string name="T_full", std::string tag=kElementWise)
 Creates an operation that fill a tensor with fill_value. More...
 
Tensor full_like (const Tensor &x, const PrimExpr fill_value, std::string name="T_full_like", std::string tag=kElementWise)
 Creates an operation that construct a tensor with same shape as input tensor, then fill a tensor with fill_value. More...
 
Tensor fast_exp_float32 (const Tensor &_x, std::string name, std::string tag)
 Fast exponential function implementation. More...
 
Tensor fast_exp (const Tensor &x, std::string name="T_fast_exp", std::string tag=kElementWise)
 Fast exponential function implementation. More...
 
Tensor fast_erf_float32 (const Tensor &data, std::string name, std::string tag)
 Fast_erf_float expression from Eigen. More...
 
Tensor fast_erf_float16 (const Tensor &data, std::string name, std::string tag)
 Fast_erf_float expression from Eigen for float16. More...
 
Tensor fast_erf (const Tensor &x, std::string name="T_fast_erf", std::string tag=kElementWise)
 Fast erf implementation. More...
 
template<typename T >
tvm::te::Tensor relu (const tvm::te::Tensor &t, T threshold=static_cast< T >(0), std::string name="T_relu", std::string tag=kElementWise)
 Creates an operation that performs a rectified linear unit. More...
 
tvm::te::Tensor leaky_relu (const tvm::te::Tensor &t, double alpha=0.1, std::string name="T_leaky_relu", std::string tag=kElementWise)
 Creates an operation that performs a leaky rectified linear unit. More...
 
tvm::te::Tensor prelu (const tvm::te::Tensor &x, const tvm::te::Tensor &slope, const int axis=1, std::string name="T_prelu", std::string tag=kBroadcast)
 Creates an operation that performs a parametric rectified linear unit. More...
 
tvm::te::Tensor pad (const tvm::te::Tensor &t, const tvm::Array< tvm::PrimExpr > &pad_before, tvm::Array< tvm::PrimExpr > pad_after=tvm::Array< tvm::PrimExpr >(), PrimExpr pad_value=PrimExpr(), std::string name="T_pad", std::string tag=kElementWise, std::string pad_mode="constant", const Array< PrimExpr > *dyn_output_shape=nullptr)
 Creates an operation that performs padding. More...
 
tvm::te::Tensor conv2d_nchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_conv2d_nchw", std::string tag=kConv2dNCHW)
 Creates an operation that performs a 2-D convolution with an NCHW-layout. More...
 
tvm::te::Tensor conv2d_hwcn (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_conv2d_hwcn", std::string tag=kConv2dHWCN)
 Creates an operation for 2-D convolution layer with an HWCN-layout. More...
 
tvm::te::Tensor depthwise_conv2d_nchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_depthwise_conv2d_nchw", std::string tag=kDepthwiseConv2dNCHW)
 Creates an operation that performs a 2-D depthwise convolution with an NCHW-layout. More...
 
tvm::te::Tensor depthwise_conv2d_nhwc (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_depthwise_conv2d_nhwc", std::string tag=kDepthwiseConv2dNHWC)
 
tvm::te::Tensor group_conv2d_ngchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_group_conv2d_ngchw", std::string tag=kGroupConv2d)
 Creates an operation that performs a 2-D group convolution with an NGCHW-layout. More...
 
tvm::te::Tensor space_to_batch_nd (const tvm::te::Tensor &data, const tvm::Array< Integer > &block_shape, const tvm::Array< tvm::PrimExpr > &pad_before, const tvm::Array< tvm::PrimExpr > &pad_after, PrimExpr pad_value=PrimExpr(), std::string name="space_to_batch_nd", std::string tag=kInjective)
 Divide spatial dimensions of the input into a grid of blocks. More...
 
tvm::te::Tensor batch_to_space_nd (const tvm::te::Tensor &data, const tvm::Array< Integer > &block_shape, const tvm::Array< tvm::PrimExpr > &crop_begin_list, const tvm::Array< tvm::PrimExpr > &crop_end_list, std::string name="batch_to_space_nd", std::string tag=kInjective)
 Reshape the batch dimension into spatial dimensions. More...
 
Tensor nll_loss (const Tensor &predictions, const Tensor &targets, const Tensor &weights, std::string reduction="mean", int ignore_index=-100, const std::string name="nll_loss", const std::string tag=kBroadcast)
 Negative log likelihood loss. More...
 
std::vector< int > GetRealAxis (int ndim, const Array< Integer > &axis)
 Convert a reduction axis which could be empty or have negative elements into a real axis with valid dimension indices. More...
 
Array< IterVarMakeReduceAxes (const std::vector< int > &real_axis, const Tensor &data)
 Enumerate the axes for a reduce op. More...
 
Array< PrimExprMakeReduceTargetShape (const std::vector< int > &real_axis, const Tensor &data, bool keepdims, bool atleast1d)
 Calculate the target shape for a reduce op. More...
 
Tensor DoCommReduce (const Tensor &data, FReduce func, const Array< PrimExpr > &target_shape, const std::vector< int > &reduce_axes, const std::vector< int > &squeeze_axes, Span span=Span())
 Create a reduction operation. More...
 
Tensor CommReduce (const Tensor &data, const Array< Integer > &axis, FReduce func, bool keepdims, bool atleast1d)
 Create a reduction operation. More...
 
Tensor CommReduceIdx (const Tensor &data, const Array< Integer > &axis, FCommReduce func, bool keepdims, bool atleast1d)
 Create an index reduction operation. More...
 
FCommReduce MakeCommReducer (FCombine fcombine, FIdentity fidentity, std::string name="reduce")
 Create a commutative reducer for a reduction. More...
 
PrimExpr MinOp (PrimExpr source, Array< IterVar > axis, Array< PrimExpr > init={}, Span span=Span())
 Wrap tvm::min to ensure we get the correct overload. More...
 
PrimExpr MaxOp (PrimExpr source, Array< IterVar > axis, Array< PrimExpr > init={}, Span span=Span())
 Wrap tvm::max to ensure we get the correct overload. More...
 
PrimExpr ProdOp (PrimExpr source, Array< IterVar > axis, Array< PrimExpr > init={}, Span span=Span())
 Wrap tvm::prod to ensure we get the correct overload. More...
 
Tensor sum (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates an operation that sums array elements over a given axis. More...
 
Tensor collapse_sum (const Tensor &data, Array< PrimExpr > target_shape)
 
Tensor all (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates an operation that computes the logical AND of elements over a given axis. More...
 
Tensor any (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates an operation that computes the logical OR of elements over a given axis. More...
 
Tensor min (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates an operation that finds the minimum of elements over a given axis. More...
 
Tensor max (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates an operation that finds the maximum of elements over a given axis. More...
 
FCommReduce MakeArgminReducer (bool select_last_index=false)
 
Tensor argmin (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false, bool select_last_index=false)
 Creates an operation that finds the indices of the minimum values over a given axis. More...
 
FCommReduce MakeArgmaxReducer (bool select_last_index=false)
 
Tensor argmax (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false, bool select_last_index=false)
 Creates an operation that finds the indices of the maximum values over a given axis. More...
 
Tensor prod (const Tensor &data, const Array< Integer > &axis, bool keepdims=false, bool atleast1d=false)
 Creates product operation over given axis. More...
 
FCommReduce MakeTupleSumReducer ()
 Create communitive reducer summing over tuples. More...
 
bool is_broadcast (std::string tag)
 
bool is_injective (std::string tag)
 
Tensor sliding_window (const Tensor &x, int axis, Array< Integer > window_shape, Array< Integer > strides, std::string name="T_sliding_window", std::string tag="")
 Creates an operation to slide a window over the input x. More...
 
Tensor expand_dims (const Tensor &x, int axis, int num_newaxis=1, std::string name="T_expand_dims", std::string tag=kBroadcast)
 Creates an operation to insert new dimensions of length 1. More...
 
Tensor transpose (const Tensor &x, Array< Integer > axes, std::string name="T_transpose", std::string tag=kInjective)
 Permute the dimensions of an array. More...
 
Tensor reverse_sequence (const Tensor &x, const Tensor &seq_lengths, int seq_axis=1, int batch_axis=0, std::string name="T_reverse_sequence", std::string tag=kInjective)
 Reverse the tensor for variable length slices. Input is first sliced along batch axis and then elements are reversed along seq axis. More...
 
Tensor reshape (const Tensor &x, Array< PrimExpr > newshape, std::string name="T_reshape", std::string tag=kInjective)
 Reshape a tensor. More...
 
Tensor unravel_index (const Tensor &x, const Tensor &shape, std::string name="T_unravel", std::string tag=kInjective)
 Converts a flat index or array of flat indices into a tuple of coordinate arrays. More...
 
Tensor squeeze (const Tensor &x, Array< Integer > axis, bool atleast1d=false, std::string name="T_squeeze", std::string tag=kInjective)
 Remove size 1 dimensions from the shape of a tensor. The removed dimensions must have a constant size of 1. More...
 
Tensor concatenate (const Array< Tensor > &inputs, int axis=0, std::string name="T_concat", std::string tag=kInjective)
 Join a sequence of tensors along an existing axis. More...
 
Tensor stack (const Array< Tensor > &inputs, int axis=0, std::string name="T_stack", std::string tag=kInjective)
 Join a sequence of tensors along a new axis. More...
 
Array< Tensorsplit (const Tensor &x, Array< PrimExpr > split_indices, int axis, std::string name="T_split", std::string tag=kInjective)
 Split a tensor into multiple sub-tensors. More...
 
Tensor dynamic_strided_slice_with_axes (const Tensor &x, const Array< PrimExpr > &begin, const Array< PrimExpr > &end, const Array< PrimExpr > &strides, const Array< Integer > &axes, std::string name="T_dynamic_strided_slice_with_axes", std::string tag=kInjective)
 strided_slice of a tensor where begin/end/stride can be mixed static and dynamic More...
 
Tensor dynamic_strided_slice (const Tensor &x, const Array< PrimExpr > &begin, const Array< PrimExpr > &end, const Array< PrimExpr > &strides, std::string name="T_dynamic_strided_slice", std::string tag=kInjective)
 strided_slice of a tensor where begin/end/stride can be mixed static and dynamic More...
 
te::Tensor dynamic_strided_slice (const te::Tensor &x, const te::Tensor &begin, const te::Tensor &end, const te::Tensor &strides, std::string name="T_strided_slice_dynamic", std::string tag=topi::kInjective)
 strided_slice of a tensor with dynamic begin/end/stride More...
 
Array< PrimExprStridedSliceOutputShape (const Array< PrimExpr > &ishape, const Array< Integer > &begin, const Array< Integer > &end, const Array< Integer > &strides, const Array< Integer > &axes, const std::string &slice_mode)
 Calculate the output shape of strided_slice, the entry point for Relay type relation. More...
 
Tensor strided_slice_with_axes (const Tensor &x, const Array< Integer > &begin, const Array< Integer > &end, const Array< Integer > &strides, const Array< Integer > &axes, std::string slice_mode="end", std::string name="T_strided_slice_with_axes", std::string tag=kInjective)
 strided_slice of a tensor More...
 
Tensor strided_slice (const Tensor &x, const Array< Integer > &begin, const Array< Integer > &end, const Array< Integer > &strides, std::string slice_mode="end", std::string name="T_strided_slice", std::string tag=kInjective)
 strided_slice of a tensor More...
 
Array< Tensorsplit_sections (const Tensor &x, int num_sections, int axis, std::string name="T_split_sections", std::string tag=kInjective)
 Split a tensor into a number of sub-tensors. More...
 
Tensor take (const Tensor &a, const Tensor &indices, int batch_dims, std::string mode="clip", std::string name="T_take", std::string tag=kInjective)
 Take elements from an flattened input array when axis is None. More...
 
Tensor sequence_mask (const Tensor &data, const Tensor &valid_length, double mask_value, int axis, std::string name="T_sequence_mask", std::string tag=kInjective)
 Mask the out-of-boundary elements of each sequence. More...
 
Tensor take (const Tensor &a, Variant< Tensor, PrimExpr > indices, int batch_dims, int axis, std::string mode="clip", std::string name="T_take", std::string tag=kInjective)
 Take elements from an array along an axis. More...
 
Tensor where (const Tensor &condition, const Tensor &x, const Tensor &y, std::string name="T_where", std::string tag=kBroadcast)
 Return the elements, either from x or y, depending on the condition. More...
 
Tensor repeat (const Tensor &x, int repeats, int axis, std::string name="T_repeat", std::string tag=kBroadcast)
 Creates an operation to repeat elements of an array. More...
 
Tensor tile (const Tensor &x, Array< Integer > reps, std::string name="T_tile", std::string tag=kBroadcast)
 Creates an operation to tile elements of an array. More...
 
Tensor dyn_tile (const Tensor &x, Array< PrimExpr > new_shape, size_t rdim, std::string name="T_tile", std::string tag=kBroadcast)
 Creates an operation to tile elements of an array. More...
 
Tensor gather (const Tensor &data, int axis, const Tensor &indices, std::string name="T_gather", std::string tag=kInjective)
 Gather values along given axis from given indices. More...
 
Tensor gather_nd (const Tensor &data, const Tensor &indices, int batch_dims=0, std::string name="T_gather_nd", std::string tag=kInjective)
 Gather elements from a n-dimension array. More...
 
tvm::te::Tensor matmul (const tvm::te::Tensor &A, const tvm::te::Tensor &B, bool trans_a=false, bool trans_b=false, std::string name="T_matmul", std::string tag=kMatMul)
 Creates an operation that calculates a matrix multiplication (row-major notation): A(i, k) * B(k, j), if trans_a == trans_b the usual transposed combinations, otherwise. More...
 
Tensor tensordot (const Tensor &A, const tvm::te::Tensor &B, int axes=2, std::string name="T_tensordot", std::string tag=kMatMul)
 A generalization of matrix multiplication to tensors. More...
 
Tensor tensordot (const Tensor &A, const tvm::te::Tensor &B, Array< PrimExpr > A_axes, Array< PrimExpr > B_axes, std::string name="T_tensordot", std::string tag=kMatMul)
 A generalization of matrix multiplication to tensors. More...
 
Tensor arange (const PrimExpr &start, const PrimExpr &stop, const PrimExpr &step, DataType dtype, std::string name="T_arange", std::string tag=kInjective)
 
Array< Tensormeshgrid (const Array< Tensor > &inputs, const std::string &indexing, std::string name="T_meshgrid", std::string tag=kInjective)
 Produce grids by expanding input over dimensions defined by other inputs. More...
 
Tensor layout_transform (const Tensor &src, const std::string &src_layout, const std::string &dst_layout, const std::string schedule_rule="None", const std::string name="T_layout_trans", const std::string tag=kInjective)
 Transform the layout according to src_layout and dst_layout. More...
 
void parse_auto_scheduler_layout (const String &layout, Array< PrimExpr > *shape, std::vector< std::string > *axes)
 Utility function for auto_scheduler_layout_transform. More...
 
Tensor auto_scheduler_layout_transform (const Tensor &src, const String &src_layout, const String &dst_layout, const String name="T_auto_scheduler_layout_trans", const String tag=kInjective)
 Transform the auto-scheduler generated layout according to src_layout and dst_layout. More...
 
Tensor meta_schedule_layout_transform (const Tensor &src, const tir::IndexMap &index_map, const String name="T_meta_schedule_layout_trans", const String tag=kInjective)
 Transform the meta-schedule generated layout according to TIR's IndexMap. More...
 
Tensor shape (const Tensor &src, DataType dtype, const std::string name="T_shape", const std::string tag=kInjective)
 Get the shape of input tensor. More...
 
Tensor ndarray_size (const Tensor &src, const DataType &dtype, const std::string &name="ndarray_size", const std::string &tag=kInjective)
 Get the size of input tensor. More...
 
Tensor one_hot (const Tensor &indices, const PrimExpr on_value, const PrimExpr off_value, int depth, int axis, const DataType &dtype, Array< PrimExpr > oshape=Array< PrimExpr >(), const std::string name="T_one_hot", const std::string tag=kInjective)
 Returns a one-hot tensor where the locations repsented by indices take value on_value, other locations take value off_value. More...
 
Tensor sparse_to_dense (const Tensor &sparse_indices, const Array< PrimExpr > &output_shape, const Tensor &sparse_values, const PrimExpr &default_value, const std::string name="T_sparse_to_dense", const std::string tag=kInjective)
 Get a dense tensor. More...
 
Tensor matrix_set_diag (const Tensor &input, const Tensor &diagonal, int k1, int k2, bool super_diag_right_align, bool sub_diag_right_align, const std::string name="T_matrix_set_diag", const std::string tag=kInjective)
 Returns a tensor with the diagonal of input tensor replaced with the provided diagonals. More...
 
Tensor adv_index (const Tensor &data, const Array< Tensor > &indices, const std::string name="advanced_index", const std::string tag=kInjective)
 Numpy style advanced indexing with tensor. More...
 
Array< IntegerArrayOrInt (TVMArgValue arg)
 Canonicalize an argument that may be Array<Expr> or int to Array<Expr> More...
 

Variables

constexpr auto kElementWise = "elemwise"
 
constexpr auto kInjective = "injective"
 
constexpr auto kCommReduce = "comm_reduce"
 
constexpr auto kCommReduceIdx = "comm_reduce_idx"
 
constexpr auto kBroadcast = "broadcast"
 
constexpr auto kMatMul = "matmul"
 
constexpr auto kConv2dNCHW = "conv2d_nchw"
 
constexpr auto kConv2dHWCN = "conv2d_hwcn"
 
constexpr auto kDepthwiseConv2dNCHW = "depthwise_conv2d_nchw"
 
constexpr auto kDepthwiseConv2dNHWC = "depthwise_conv2d_nhwc"
 
constexpr auto kDepthwiseConv2dBackInputNHWC = "depthwise_conv2d_back_input_nhwc"
 
constexpr auto kDepthwiseConv2dBackWeightNHWC = "depthwise_conv2d_back_weight_nhwc"
 
constexpr auto kEinsum = "einsum"
 
constexpr auto kGroupConv2d = "group_conv2d"
 

Typedef Documentation

◆ FCombine

using tvm::topi::FCombine = typedef std::function<Array<PrimExpr>(Array<Var> lhs, Array<Var> rhs)>

A combiner function for a reduction.

◆ FCommReduce

using tvm::topi::FCommReduce = typedef std::function<Array<PrimExpr>(Array<PrimExpr> exprs, const Array<IterVar>& axis, PrimExpr* condition)>

The operation to use for CommReduceIdx.

◆ FIdentity

using tvm::topi::FIdentity = typedef std::function<Array<PrimExpr>(std::vector<DataType> types)>

An initializer function for a reduction.

◆ FReduce

using tvm::topi::FReduce = typedef std::function<PrimExpr(PrimExpr source, const Array<IterVar>& axis, Array<PrimExpr> init, Span span)>

The operation to use for CommReduce.

Function Documentation

◆ abs()

Tensor tvm::topi::abs ( const Tensor x,
std::string  name = "T_" "abs",
std::string  tag = kElementWise 
)
inline

◆ acos()

Tensor tvm::topi::acos ( const Tensor x,
std::string  name = "T_" "acos",
std::string  tag = kElementWise 
)
inline

◆ acosh()

Tensor tvm::topi::acosh ( const Tensor x,
std::string  name = "T_" "acosh",
std::string  tag = kElementWise 
)
inline

◆ add() [1/4]

tvm::PrimExpr tvm::topi::add ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ add() [2/4]

tvm::te::Tensor tvm::topi::add ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "add",
std::string  tag = kElementWise 
)
inline

◆ add() [3/4]

tvm::te::Tensor tvm::topi::add ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "add",
std::string  tag = kElementWise 
)
inline

◆ add() [4/4]

tvm::te::Tensor tvm::topi::add ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "add",
std::string  tag = kBroadcast 
)
inline

◆ adv_index()

Tensor tvm::topi::adv_index ( const Tensor data,
const Array< Tensor > &  indices,
const std::string  name = "advanced_index",
const std::string  tag = kInjective 
)
inline

Numpy style advanced indexing with tensor.

Parameters
datais input data.
indicesis list of indexing tensors.
nameoutput tensor name.
tagoutput tensor tag.
Returns
Output tensor.

◆ all()

Tensor tvm::topi::all ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates an operation that computes the logical AND of elements over a given axis.

Parameters
dataThe input boolean tensor
axisThe axes to reduce. If axis is empty, the operation will perform logical AND over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the all operation

◆ any()

Tensor tvm::topi::any ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates an operation that computes the logical OR of elements over a given axis.

Parameters
dataThe input boolean tensor
axisThe axes to reduce. If axis is empty, the operation will perform logical OR over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the all operation

◆ arange()

Tensor tvm::topi::arange ( const PrimExpr start,
const PrimExpr stop,
const PrimExpr step,
DataType  dtype,
std::string  name = "T_arange",
std::string  tag = kInjective 
)
inline

◆ argmax()

Tensor tvm::topi::argmax ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false,
bool  select_last_index = false 
)
inline

Creates an operation that finds the indices of the maximum values over a given axis.

Parameters
dataThe input tensor
axisThe axis along which the argmax is performed. If axis is empty, the operation will find the maximum index over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
select_last_indexWhether to select the last index if the maximum element appears multiple times, else select the first index.
Returns
A Tensor whose op member is the argmax operation

◆ argmin()

Tensor tvm::topi::argmin ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false,
bool  select_last_index = false 
)
inline

Creates an operation that finds the indices of the minimum values over a given axis.

Parameters
dataThe input tensor
axisThe axis along which the argmin is performed. If axis is empty, the operation will find the minimum index over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
select_last_indexWhether to select the last index if the minimum element appears multiple times, else select the first index.
Returns
A Tensor whose op member is the argmin operation

◆ ArrayOrInt()

Array<Integer> tvm::topi::ArrayOrInt ( TVMArgValue  arg)
inline

Canonicalize an argument that may be Array<Expr> or int to Array<Expr>

◆ asin()

Tensor tvm::topi::asin ( const Tensor x,
std::string  name = "T_" "asin",
std::string  tag = kElementWise 
)
inline

◆ asinh()

Tensor tvm::topi::asinh ( const Tensor x,
std::string  name = "T_" "asinh",
std::string  tag = kElementWise 
)
inline

◆ atan()

Tensor tvm::topi::atan ( const Tensor x,
std::string  name = "T_" "atan",
std::string  tag = kElementWise 
)
inline

◆ atanh()

Tensor tvm::topi::atanh ( const Tensor x,
std::string  name = "T_" "atanh",
std::string  tag = kElementWise 
)
inline

◆ auto_scheduler_layout_transform()

Tensor tvm::topi::auto_scheduler_layout_transform ( const Tensor src,
const String src_layout,
const String dst_layout,
const String  name = "T_auto_scheduler_layout_trans",
const String  tag = kInjective 
)
inline

Transform the auto-scheduler generated layout according to src_layout and dst_layout.

Parameters
srcthe source input.
src_layoutthe source layout.
dst_layoutthe destination layout.
nameoutput tensor name.
tagoutput tensor tag.
Returns
A tensor with shape in dst_layout

◆ batch_to_space_nd()

tvm::te::Tensor tvm::topi::batch_to_space_nd ( const tvm::te::Tensor data,
const tvm::Array< Integer > &  block_shape,
const tvm::Array< tvm::PrimExpr > &  crop_begin_list,
const tvm::Array< tvm::PrimExpr > &  crop_end_list,
std::string  name = "batch_to_space_nd",
std::string  tag = kInjective 
)
inline

Reshape the batch dimension into spatial dimensions.

Parameters
dataThe input tensor.
block_shapeThe size of the spatial block.
crop_begin_listThe begin crop size for each spatial dimension.
crop_end_listThe end crop size for each spatial dimension.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the batch_to_space_nd operation

◆ bitwise_and() [1/4]

tvm::PrimExpr tvm::topi::bitwise_and ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ bitwise_and() [2/4]

tvm::te::Tensor tvm::topi::bitwise_and ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_and",
std::string  tag = kElementWise 
)
inline

◆ bitwise_and() [3/4]

tvm::te::Tensor tvm::topi::bitwise_and ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "bitwise_and",
std::string  tag = kElementWise 
)
inline

◆ bitwise_and() [4/4]

tvm::te::Tensor tvm::topi::bitwise_and ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_and",
std::string  tag = kBroadcast 
)
inline

◆ bitwise_not()

Tensor tvm::topi::bitwise_not ( const Tensor x,
std::string  name = "T_bitwise_not",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns the bitwise NOT of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the bitwise NOT operation

◆ bitwise_or() [1/4]

tvm::PrimExpr tvm::topi::bitwise_or ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ bitwise_or() [2/4]

tvm::te::Tensor tvm::topi::bitwise_or ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_or",
std::string  tag = kElementWise 
)
inline

◆ bitwise_or() [3/4]

tvm::te::Tensor tvm::topi::bitwise_or ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "bitwise_or",
std::string  tag = kElementWise 
)
inline

◆ bitwise_or() [4/4]

tvm::te::Tensor tvm::topi::bitwise_or ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_or",
std::string  tag = kBroadcast 
)
inline

◆ bitwise_xor() [1/4]

tvm::PrimExpr tvm::topi::bitwise_xor ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ bitwise_xor() [2/4]

tvm::te::Tensor tvm::topi::bitwise_xor ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_xor",
std::string  tag = kElementWise 
)
inline

◆ bitwise_xor() [3/4]

tvm::te::Tensor tvm::topi::bitwise_xor ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "bitwise_xor",
std::string  tag = kElementWise 
)
inline

◆ bitwise_xor() [4/4]

tvm::te::Tensor tvm::topi::bitwise_xor ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "bitwise_xor",
std::string  tag = kBroadcast 
)
inline

◆ broadcast_to()

tvm::te::Tensor tvm::topi::broadcast_to ( const tvm::te::Tensor t,
const tvm::Array< tvm::PrimExpr > &  output_shape,
std::string  name = "T_broadcast_to",
std::string  tag = kBroadcast 
)
inline

Creates an operation that broadcasts a tensor into a compatible shape according to numpy's rules.

Parameters
tThe input tensor
output_shapeThe target output shape, must be compatible
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is a broadcast operation

◆ cast()

Tensor tvm::topi::cast ( const Tensor x,
DataType  type,
std::string  name = "T_cast",
std::string  tag = kElementWise 
)
inline

Cast each element of x to the given type. If expr is scalar and type is a corresponding vector type, a Broadcast is generated, otherwise a Cast is generated.

Parameters
xThe input tensor
typeThe type to cast to
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the cast operation

◆ ceil()

Tensor tvm::topi::ceil ( const Tensor x,
std::string  name = "T_" "ceil",
std::string  tag = kElementWise 
)
inline

◆ clip()

Tensor tvm::topi::clip ( const Tensor x,
const PrimExpr a_min,
const PrimExpr a_max,
std::string  name = "T_clip",
std::string  tag = kElementWise 
)
inline

Creates an operation that clips each element of a tensor to the interval [a_min, a_max].

Parameters
xThe input tensor
a_minThe inclusive lower bound of the interval
a_maxThe inclusive upper bound of the interval
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the clip operation

◆ collapse_sum()

Tensor tvm::topi::collapse_sum ( const Tensor data,
Array< PrimExpr target_shape 
)
inline

◆ CommReduce()

Tensor tvm::topi::CommReduce ( const Tensor data,
const Array< Integer > &  axis,
FReduce  func,
bool  keepdims,
bool  atleast1d 
)
inline

Create a reduction operation.

Parameters
dataThe input tensor.
axisThe axes along which the reduction is performed.
funcThe reduction function eg. tvm::sum
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
The result tensor.

◆ CommReduceIdx()

Tensor tvm::topi::CommReduceIdx ( const Tensor data,
const Array< Integer > &  axis,
FCommReduce  func,
bool  keepdims,
bool  atleast1d 
)
inline

Create an index reduction operation.

Parameters
dataThe input tensor.
axisThe axes along which the reduction is performed.
funcThe reduction function
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
The result tensor.

◆ concatenate()

Tensor tvm::topi::concatenate ( const Array< Tensor > &  inputs,
int  axis = 0,
std::string  name = "T_concat",
std::string  tag = kInjective 
)
inline

Join a sequence of tensors along an existing axis.

Parameters
inputsThe input tensors
axisThe axis along which the tensors will be joined
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the concatenate operation

◆ conv2d_hwcn()

tvm::te::Tensor tvm::topi::conv2d_hwcn ( const tvm::te::Tensor I,
const tvm::te::Tensor W,
int  pad_h = 0,
int  pad_w = 0,
int  stride_h = 1,
int  stride_w = 1,
std::string  name = "T_conv2d_hwcn",
std::string  tag = kConv2dHWCN 
)
inline

Creates an operation for 2-D convolution layer with an HWCN-layout.

Parameters
IThe 4-D input tensor
WThe 4-D weight tensor
pad_hA static constant padding amount applied to the height of the image, before and after (symmetric padding)
pad_wA static constant padding amount applied to the width of the image, before and after (symmetric padding)
stride_hA static constant striding amount applied to the height of the image, before and after (symmetric padding)
stride_wA static constant strindingamount applied to the width of the image, before and after (symmetric padding)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the 2-D convolution operation (HWCN layout)

◆ conv2d_nchw()

tvm::te::Tensor tvm::topi::conv2d_nchw ( const tvm::te::Tensor I,
const tvm::te::Tensor W,
int  pad_h = 0,
int  pad_w = 0,
int  stride_h = 1,
int  stride_w = 1,
std::string  name = "T_conv2d_nchw",
std::string  tag = kConv2dNCHW 
)
inline

Creates an operation that performs a 2-D convolution with an NCHW-layout.

Parameters
IThe 4-D input tensor
WThe 4-D weight tensor
pad_hA static constant padding amount applied to the height of the image, before and after (symmetric padding)
pad_wA static constant padding amount applied to the width of the image, before and after (symmetric padding)
stride_hA static constant striding amount applied to the height of the image, before and after (symmetric padding)
stride_wA static constant strindingamount applied to the width of the image, before and after (symmetric padding)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the 2-D convolution operation (NCHW layout)

◆ cos()

Tensor tvm::topi::cos ( const Tensor x,
std::string  name = "T_" "cos",
std::string  tag = kElementWise 
)
inline

◆ cosh()

Tensor tvm::topi::cosh ( const Tensor x,
std::string  name = "T_" "cosh",
std::string  tag = kElementWise 
)
inline

◆ depthwise_conv2d_nchw()

tvm::te::Tensor tvm::topi::depthwise_conv2d_nchw ( const tvm::te::Tensor I,
const tvm::te::Tensor W,
int  pad_h = 0,
int  pad_w = 0,
int  stride_h = 1,
int  stride_w = 1,
std::string  name = "T_depthwise_conv2d_nchw",
std::string  tag = kDepthwiseConv2dNCHW 
)
inline

Creates an operation that performs a 2-D depthwise convolution with an NCHW-layout.

Parameters
IThe 4-D input tensor
WThe 4-D weight tensor
pad_hA static constant padding amount applied to the height of the image, before and after (symmetric padding)
pad_wA static constant padding amount applied to the width of the image, before and after (symmetric padding)
stride_hA static constant striding amount applied to the height of the image, before and after (symmetric padding)
stride_wA static constant strindingamount applied to the width of the image, before and after (symmetric padding)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the 2-D depthwise convolution operation (NCHW layout)

◆ depthwise_conv2d_nhwc()

tvm::te::Tensor tvm::topi::depthwise_conv2d_nhwc ( const tvm::te::Tensor I,
const tvm::te::Tensor W,
int  pad_h = 0,
int  pad_w = 0,
int  stride_h = 1,
int  stride_w = 1,
std::string  name = "T_depthwise_conv2d_nhwc",
std::string  tag = kDepthwiseConv2dNHWC 
)
inline

◆ divide() [1/4]

tvm::PrimExpr tvm::topi::divide ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ divide() [2/4]

tvm::te::Tensor tvm::topi::divide ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "divide",
std::string  tag = kElementWise 
)
inline

◆ divide() [3/4]

tvm::te::Tensor tvm::topi::divide ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "divide",
std::string  tag = kElementWise 
)
inline

◆ divide() [4/4]

tvm::te::Tensor tvm::topi::divide ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "divide",
std::string  tag = kBroadcast 
)
inline

◆ DoCommReduce()

Tensor tvm::topi::DoCommReduce ( const Tensor data,
FReduce  func,
const Array< PrimExpr > &  target_shape,
const std::vector< int > &  reduce_axes,
const std::vector< int > &  squeeze_axes,
Span  span = Span() 
)
inline

Create a reduction operation.

Parameters
dataThe input tensor.
funcThe reduction function eg. tvm::sum
target_shapeThe output Tensor shape.
reduce_axesThe real axes along which the reduction is performed.
squeeze_axesThe real axes to squeeze. Unsqueezed, reduced axes will have shape 1 in the output tensor.
spanThe location of this reducer in the source.
Returns
The result tensor.

◆ dyn_tile()

Tensor tvm::topi::dyn_tile ( const Tensor x,
Array< PrimExpr new_shape,
size_t  rdim,
std::string  name = "T_tile",
std::string  tag = kBroadcast 
)
inline

Creates an operation to tile elements of an array.

Parameters
xThe input tensor
new_shapeThe shape of the output after tiling
rdimThe rank of the reps, provided by caller
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the tile operation

◆ dynamic_strided_slice() [1/2]

te::Tensor tvm::topi::dynamic_strided_slice ( const te::Tensor x,
const te::Tensor begin,
const te::Tensor end,
const te::Tensor strides,
std::string  name = "T_strided_slice_dynamic",
std::string  tag = topi::kInjective 
)
inline

strided_slice of a tensor with dynamic begin/end/stride

Parameters
xThe input tensor
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the dynamic_strided_slice operation

◆ dynamic_strided_slice() [2/2]

Tensor tvm::topi::dynamic_strided_slice ( const Tensor x,
const Array< PrimExpr > &  begin,
const Array< PrimExpr > &  end,
const Array< PrimExpr > &  strides,
std::string  name = "T_dynamic_strided_slice",
std::string  tag = kInjective 
)
inline

strided_slice of a tensor where begin/end/stride can be mixed static and dynamic

Parameters
xThe input tensor
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the dynamic_strided_slice operation

◆ dynamic_strided_slice_with_axes()

Tensor tvm::topi::dynamic_strided_slice_with_axes ( const Tensor x,
const Array< PrimExpr > &  begin,
const Array< PrimExpr > &  end,
const Array< PrimExpr > &  strides,
const Array< Integer > &  axes,
std::string  name = "T_dynamic_strided_slice_with_axes",
std::string  tag = kInjective 
)
inline

strided_slice of a tensor where begin/end/stride can be mixed static and dynamic

Parameters
xThe input tensor
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
axesSpecifies which axes will be updated.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the dynamic_strided_slice operation

◆ einsum()

Tensor tvm::topi::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.

Parameters
subscripts_strSpecifies the subscripts for summation as comma separated list of subscript labels.
inputsArrays for the operation.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
The calculation based on the Einstein summation convention.

◆ elemwise_sum()

Tensor tvm::topi::elemwise_sum ( const Array< Tensor > &  xs,
std::string  name = "T_elemwise_sum",
std::string  tag = kElementWise 
)
inline

Creates an operation that sum each element of a tensor.

Parameters
xsThe input tensor array
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the sum operation

◆ equal() [1/4]

tvm::PrimExpr tvm::topi::equal ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ equal() [2/4]

tvm::te::Tensor tvm::topi::equal ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "equal",
std::string  tag = kElementWise 
)
inline

◆ equal() [3/4]

tvm::te::Tensor tvm::topi::equal ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "equal",
std::string  tag = kElementWise 
)
inline

◆ equal() [4/4]

tvm::te::Tensor tvm::topi::equal ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "equal",
std::string  tag = kBroadcast 
)
inline

◆ erf()

Tensor tvm::topi::erf ( const Tensor x,
std::string  name = "T_" "erf",
std::string  tag = kElementWise 
)
inline

◆ exp()

Tensor tvm::topi::exp ( const Tensor x,
std::string  name = "T_" "exp",
std::string  tag = kElementWise 
)
inline

◆ expand_dims()

Tensor tvm::topi::expand_dims ( const Tensor x,
int  axis,
int  num_newaxis = 1,
std::string  name = "T_expand_dims",
std::string  tag = kBroadcast 
)
inline

Creates an operation to insert new dimensions of length 1.

Parameters
xThe input tensor
axisThe index of the first new dimension (allows negative indices as offsets from the last dimension)
num_newaxisThe number of new dimensions to insert
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the dim expansion operation

◆ fast_erf()

Tensor tvm::topi::fast_erf ( const Tensor x,
std::string  name = "T_fast_erf",
std::string  tag = kElementWise 
)
inline

Fast erf implementation.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is erf operation

◆ fast_erf_float16()

Tensor tvm::topi::fast_erf_float16 ( const Tensor data,
std::string  name,
std::string  tag 
)
inline

Fast_erf_float expression from Eigen for float16.

◆ fast_erf_float32()

Tensor tvm::topi::fast_erf_float32 ( const Tensor data,
std::string  name,
std::string  tag 
)
inline

Fast_erf_float expression from Eigen.

◆ fast_exp()

Tensor tvm::topi::fast_exp ( const Tensor x,
std::string  name = "T_fast_exp",
std::string  tag = kElementWise 
)
inline

Fast exponential function implementation.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is exponent operation

◆ fast_exp_float32()

Tensor tvm::topi::fast_exp_float32 ( const Tensor _x,
std::string  name,
std::string  tag 
)
inline

Fast exponential function implementation.

Parameters
_xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is exponent operation
Note
Function computes: log2(e^x) = x * log2(e) * log2(2) => log2(e^x) = log2(2^(x*log2(e))) => e^x = 2^(x*log2(e)) Splitting power x*log2(e) into integer and fractional parts: e^(n+f) = e^n * e^f n = floor(x*log2(e) + 1/2) f = x - n * ln(2) exp(x) = 2^n * exp(y) Approximation for fractional part: y = exp(f) = 1 + 2 * P(x**2)/(Q(x**2) - P(x**2))

◆ fast_tanh()

Tensor tvm::topi::fast_tanh ( const Tensor x,
std::string  name = "T_fast_tanh",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns hyperbolic tanh of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is tanh

◆ fast_tanh_float()

Tensor tvm::topi::fast_tanh_float ( const Tensor in,
std::string  name,
std::string  tag 
)
inline

◆ floor()

Tensor tvm::topi::floor ( const Tensor x,
std::string  name = "T_" "floor",
std::string  tag = kElementWise 
)
inline

◆ floor_divide() [1/4]

tvm::PrimExpr tvm::topi::floor_divide ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ floor_divide() [2/4]

tvm::te::Tensor tvm::topi::floor_divide ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "floor_divide",
std::string  tag = kElementWise 
)
inline

◆ floor_divide() [3/4]

tvm::te::Tensor tvm::topi::floor_divide ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "floor_divide",
std::string  tag = kElementWise 
)
inline

◆ floor_divide() [4/4]

tvm::te::Tensor tvm::topi::floor_divide ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "floor_divide",
std::string  tag = kBroadcast 
)
inline

◆ floor_mod() [1/4]

tvm::PrimExpr tvm::topi::floor_mod ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ floor_mod() [2/4]

tvm::te::Tensor tvm::topi::floor_mod ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "floor_mod",
std::string  tag = kElementWise 
)
inline

◆ floor_mod() [3/4]

tvm::te::Tensor tvm::topi::floor_mod ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "floor_mod",
std::string  tag = kElementWise 
)
inline

◆ floor_mod() [4/4]

tvm::te::Tensor tvm::topi::floor_mod ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "floor_mod",
std::string  tag = kBroadcast 
)
inline

◆ full()

Tensor tvm::topi::full ( const Array< PrimExpr > &  shape,
DataType  dtype,
const PrimExpr  fill_value,
std::string  name = "T_full",
std::string  tag = kElementWise 
)
inline

Creates an operation that fill a tensor with fill_value.

Parameters
shapeThe shape of a tensor
dtypeThe Type of fill_value
fill_valueThe value to be filled
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the full operation

◆ full_like()

Tensor tvm::topi::full_like ( const Tensor x,
const PrimExpr  fill_value,
std::string  name = "T_full_like",
std::string  tag = kElementWise 
)
inline

Creates an operation that construct a tensor with same shape as input tensor, then fill a tensor with fill_value.

Parameters
xThe input tensor
fill_valueThe value to be filled
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op memeber is the full_like operation

◆ gather()

Tensor tvm::topi::gather ( const Tensor data,
int  axis,
const Tensor indices,
std::string  name = "T_gather",
std::string  tag = kInjective 
)
inline

Gather values along given axis from given indices.

Parameters
dataThe input data to the operator.
axisThe axis along which to index.
indicesThe indices of values to gather.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the gather operation

◆ gather_nd()

Tensor tvm::topi::gather_nd ( const Tensor data,
const Tensor indices,
int  batch_dims = 0,
std::string  name = "T_gather_nd",
std::string  tag = kInjective 
)
inline

Gather elements from a n-dimension array.

Parameters
dataThe source array.
indicesThe indices of the values to extract.
batch_dimsThe number of batch dimensions.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the gather_nd operation

◆ GetRealAxis()

std::vector<int> tvm::topi::GetRealAxis ( int  ndim,
const Array< Integer > &  axis 
)
inline

Convert a reduction axis which could be empty or have negative elements into a real axis with valid dimension indices.

Parameters
ndimNumber of dimensions in the target.
axisThe axis parameter.
Returns
A sorted array of valid dimension indices, with no duplicates. If the input axis is None, the result will be an axis including all dimensions. If any input element is negative, it will be treated as an offset from the last dimension (same as python indexing rules).

◆ greater() [1/4]

tvm::PrimExpr tvm::topi::greater ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ greater() [2/4]

tvm::te::Tensor tvm::topi::greater ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "greater",
std::string  tag = kElementWise 
)
inline

◆ greater() [3/4]

tvm::te::Tensor tvm::topi::greater ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "greater",
std::string  tag = kElementWise 
)
inline

◆ greater() [4/4]

tvm::te::Tensor tvm::topi::greater ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "greater",
std::string  tag = kBroadcast 
)
inline

◆ greater_equal() [1/4]

tvm::PrimExpr tvm::topi::greater_equal ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ greater_equal() [2/4]

tvm::te::Tensor tvm::topi::greater_equal ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "greater_equal",
std::string  tag = kElementWise 
)
inline

◆ greater_equal() [3/4]

tvm::te::Tensor tvm::topi::greater_equal ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "greater_equal",
std::string  tag = kElementWise 
)
inline

◆ greater_equal() [4/4]

tvm::te::Tensor tvm::topi::greater_equal ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "greater_equal",
std::string  tag = kBroadcast 
)
inline

◆ group_conv2d_ngchw()

tvm::te::Tensor tvm::topi::group_conv2d_ngchw ( const tvm::te::Tensor I,
const tvm::te::Tensor W,
int  pad_h = 0,
int  pad_w = 0,
int  stride_h = 1,
int  stride_w = 1,
std::string  name = "T_group_conv2d_ngchw",
std::string  tag = kGroupConv2d 
)
inline

Creates an operation that performs a 2-D group convolution with an NGCHW-layout.

Parameters
IThe 5-D input tensor
WThe 5-D weight tensor
pad_hA static constant padding amount applied to the height of the image, before and after (symmetric padding)
pad_wA static constant padding amount applied to the width of the image, before and after (symmetric padding)
stride_hA static constant striding amount applied to the height of the image, before and after (symmetric padding)
stride_wA static constant strindingamount applied to the width of the image, before and after (symmetric padding)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the 2-D groupconvolution operation (NCHW layout)

◆ identity()

Tensor tvm::topi::identity ( const Tensor x,
std::string  name = "T_identity",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns identity of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the identity operation

◆ InferEinsumShape()

Array<PrimExpr> tvm::topi::InferEinsumShape ( const std::string &  subscripts,
const std::vector< Array< PrimExpr >> &  operands 
)

Compute the shape of the output.

Parameters
subscriptsinput subscripts.
operandsoperand tensors.
Returns
the shape of the output.

◆ is_broadcast()

bool tvm::topi::is_broadcast ( std::string  tag)
inline

◆ is_injective()

bool tvm::topi::is_injective ( std::string  tag)
inline

◆ isfinite()

Tensor tvm::topi::isfinite ( const Tensor x,
std::string  name = "T_" "isfinite",
std::string  tag = kElementWise 
)
inline

◆ isinf()

Tensor tvm::topi::isinf ( const Tensor x,
std::string  name = "T_" "isinf",
std::string  tag = kElementWise 
)
inline

◆ isnan()

Tensor tvm::topi::isnan ( const Tensor x,
std::string  name = "T_" "isnan",
std::string  tag = kElementWise 
)
inline

◆ layout_transform()

Tensor tvm::topi::layout_transform ( const Tensor src,
const std::string &  src_layout,
const std::string &  dst_layout,
const std::string  schedule_rule = "None",
const std::string  name = "T_layout_trans",
const std::string  tag = kInjective 
)
inline

Transform the layout according to src_layout and dst_layout.

Parameters
srcthe source input.
src_layoutthe source layout.
dst_layoutthe destination layout.
nameoutput tensor name.
tagoutput tensor tag.
schedule_rulename of specialized schedule rule to use.
Returns
A tensor with shape in dst_layout

◆ leaky_relu()

tvm::te::Tensor tvm::topi::leaky_relu ( const tvm::te::Tensor t,
double  alpha = 0.1,
std::string  name = "T_leaky_relu",
std::string  tag = kElementWise 
)
inline

Creates an operation that performs a leaky rectified linear unit.

Parameters
tThe input tensor
alphaThe slope for the small gradient when t < 0
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the leaky relu operation

◆ left_shift() [1/4]

tvm::PrimExpr tvm::topi::left_shift ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ left_shift() [2/4]

tvm::te::Tensor tvm::topi::left_shift ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "left_shift",
std::string  tag = kElementWise 
)
inline

◆ left_shift() [3/4]

tvm::te::Tensor tvm::topi::left_shift ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "left_shift",
std::string  tag = kElementWise 
)
inline

◆ left_shift() [4/4]

tvm::te::Tensor tvm::topi::left_shift ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "left_shift",
std::string  tag = kBroadcast 
)
inline

◆ less() [1/4]

tvm::PrimExpr tvm::topi::less ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ less() [2/4]

tvm::te::Tensor tvm::topi::less ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "less",
std::string  tag = kElementWise 
)
inline

◆ less() [3/4]

tvm::te::Tensor tvm::topi::less ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "less",
std::string  tag = kElementWise 
)
inline

◆ less() [4/4]

tvm::te::Tensor tvm::topi::less ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "less",
std::string  tag = kBroadcast 
)
inline

◆ less_equal() [1/4]

tvm::PrimExpr tvm::topi::less_equal ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ less_equal() [2/4]

tvm::te::Tensor tvm::topi::less_equal ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "less_equal",
std::string  tag = kElementWise 
)
inline

◆ less_equal() [3/4]

tvm::te::Tensor tvm::topi::less_equal ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "less_equal",
std::string  tag = kElementWise 
)
inline

◆ less_equal() [4/4]

tvm::te::Tensor tvm::topi::less_equal ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "less_equal",
std::string  tag = kBroadcast 
)
inline

◆ log()

Tensor tvm::topi::log ( const Tensor x,
std::string  name = "T_" "log",
std::string  tag = kElementWise 
)
inline

◆ log10()

Tensor tvm::topi::log10 ( const Tensor x,
std::string  name = "T_" "log10",
std::string  tag = kElementWise 
)
inline

◆ log2()

Tensor tvm::topi::log2 ( const Tensor x,
std::string  name = "T_" "log2",
std::string  tag = kElementWise 
)
inline

◆ logical_and() [1/4]

tvm::PrimExpr tvm::topi::logical_and ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ logical_and() [2/4]

tvm::te::Tensor tvm::topi::logical_and ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_and",
std::string  tag = kElementWise 
)
inline

◆ logical_and() [3/4]

tvm::te::Tensor tvm::topi::logical_and ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "logical_and",
std::string  tag = kElementWise 
)
inline

◆ logical_and() [4/4]

tvm::te::Tensor tvm::topi::logical_and ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_and",
std::string  tag = kBroadcast 
)
inline

◆ logical_not()

Tensor tvm::topi::logical_not ( const Tensor x,
std::string  name = "T_logical_not",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns the logical NOT of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the logical NOT operation

◆ logical_or() [1/4]

tvm::PrimExpr tvm::topi::logical_or ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ logical_or() [2/4]

tvm::te::Tensor tvm::topi::logical_or ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_or",
std::string  tag = kElementWise 
)
inline

◆ logical_or() [3/4]

tvm::te::Tensor tvm::topi::logical_or ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "logical_or",
std::string  tag = kElementWise 
)
inline

◆ logical_or() [4/4]

tvm::te::Tensor tvm::topi::logical_or ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_or",
std::string  tag = kBroadcast 
)
inline

◆ logical_xor() [1/4]

tvm::PrimExpr tvm::topi::logical_xor ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ logical_xor() [2/4]

tvm::te::Tensor tvm::topi::logical_xor ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_xor",
std::string  tag = kElementWise 
)
inline

◆ logical_xor() [3/4]

tvm::te::Tensor tvm::topi::logical_xor ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "logical_xor",
std::string  tag = kElementWise 
)
inline

◆ logical_xor() [4/4]

tvm::te::Tensor tvm::topi::logical_xor ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "logical_xor",
std::string  tag = kBroadcast 
)
inline

◆ MakeArgmaxReducer()

FCommReduce tvm::topi::MakeArgmaxReducer ( bool  select_last_index = false)
inline

◆ MakeArgminReducer()

FCommReduce tvm::topi::MakeArgminReducer ( bool  select_last_index = false)
inline

◆ MakeCommReducer()

FCommReduce tvm::topi::MakeCommReducer ( FCombine  fcombine,
FIdentity  fidentity,
std::string  name = "reduce" 
)
inline

Create a commutative reducer for a reduction.

Parameters
fcombineA function to combine exprs
fidentityA function to initialize elements
nameThe name of the operation
Returns
A reducer function which creates a reduce expression over an axis.

◆ MakeReduceAxes()

Array<IterVar> tvm::topi::MakeReduceAxes ( const std::vector< int > &  real_axis,
const Tensor data 
)
inline

Enumerate the axes for a reduce op.

◆ MakeReduceTargetShape()

Array<PrimExpr> tvm::topi::MakeReduceTargetShape ( const std::vector< int > &  real_axis,
const Tensor data,
bool  keepdims,
bool  atleast1d 
)
inline

Calculate the target shape for a reduce op.

◆ MakeTupleSumReducer()

FCommReduce tvm::topi::MakeTupleSumReducer ( )
inline

Create communitive reducer summing over tuples.

◆ matmul()

tvm::te::Tensor tvm::topi::matmul ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
bool  trans_a = false,
bool  trans_b = false,
std::string  name = "T_matmul",
std::string  tag = kMatMul 
)
inline

Creates an operation that calculates a matrix multiplication (row-major notation): A(i, k) * B(k, j), if trans_a == trans_b the usual transposed combinations, otherwise.

Parameters
AThe matrix A
BThe matrix B
trans_aIs A's layout transposed?
trans_bIs B's layout transposed?
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the matmul operation

◆ matrix_set_diag()

Tensor tvm::topi::matrix_set_diag ( const Tensor input,
const Tensor diagonal,
int  k1,
int  k2,
bool  super_diag_right_align,
bool  sub_diag_right_align,
const std::string  name = "T_matrix_set_diag",
const std::string  tag = kInjective 
)
inline

Returns a tensor with the diagonal of input tensor replaced with the provided diagonals.

Parameters
inputinput tensor.
diagonalvalues to be filled in the diagonals.
k1lower limit (included) of the range of diagonals.
k2upper limit (included) of the range of diagonals.
super_diag_right_alignbool, true iff super-diagonal is right aligned (left-padded).
sub_diag_right_alignbool, true iff sub-diagonal is right aligned (left-padded).
nameoutput tensor name.
tagoutput tensor tag.
Returns
new tensor with given diagonal values.

◆ max()

Tensor tvm::topi::max ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates an operation that finds the maximum of elements over a given axis.

Parameters
dataThe input tensor
axisThe axis to find the maximum over. If axis is empty, the operation will find the maximum over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the max operation

◆ maximum() [1/4]

tvm::PrimExpr tvm::topi::maximum ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ maximum() [2/4]

tvm::te::Tensor tvm::topi::maximum ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "maximum",
std::string  tag = kElementWise 
)
inline

◆ maximum() [3/4]

tvm::te::Tensor tvm::topi::maximum ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "maximum",
std::string  tag = kElementWise 
)
inline

◆ maximum() [4/4]

tvm::te::Tensor tvm::topi::maximum ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "maximum",
std::string  tag = kBroadcast 
)
inline

◆ MaxOp()

PrimExpr tvm::topi::MaxOp ( PrimExpr  source,
Array< IterVar axis,
Array< PrimExpr init = {},
Span  span = Span() 
)
inline

Wrap tvm::max to ensure we get the correct overload.

◆ meshgrid()

Array<Tensor> tvm::topi::meshgrid ( const Array< Tensor > &  inputs,
const std::string &  indexing,
std::string  name = "T_meshgrid",
std::string  tag = kInjective 
)
inline

Produce grids by expanding input over dimensions defined by other inputs.

Parameters
inputsThe input tensors
indexingThe indexing mode, either "xy" or "ij"
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the meshgrid operation

◆ meta_schedule_layout_transform()

Tensor tvm::topi::meta_schedule_layout_transform ( const Tensor src,
const tir::IndexMap index_map,
const String  name = "T_meta_schedule_layout_trans",
const String  tag = kInjective 
)
inline

Transform the meta-schedule generated layout according to TIR's IndexMap.

Parameters
srcthe source input.
index_mapThe TIR IndexMap
nameoutput tensor name.
tagoutput tensor tag.
Returns
A tensor. The layout transformation method
Note
Example:

For the indexing pattern below:

for i in range(32): for j in range(64): load A[ i / 16 * 4 + j / 16, i % 16 * 16 + j % 16, ]

The corresponding indexing pattern in TIR is:

A[i, j] => A'[i / 4, j / 16, i % 4, j % 16]

which converts the pattern to:

for i in range(32): for j in range(64): load A'[ i / 16 + j / 64, i % 16, j % 64 / 16, j % 16, ]

In this case, the transformation pattern is: A'[a, b, c, d] = A[a * 4 + c, b * 16 + d]

◆ min()

Tensor tvm::topi::min ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates an operation that finds the minimum of elements over a given axis.

Parameters
dataThe input tensor
axisThe axis to find the minimum over. If axis is empty, the operation will find the minimum over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the min operation

◆ minimum() [1/4]

tvm::PrimExpr tvm::topi::minimum ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ minimum() [2/4]

tvm::te::Tensor tvm::topi::minimum ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "minimum",
std::string  tag = kElementWise 
)
inline

◆ minimum() [3/4]

tvm::te::Tensor tvm::topi::minimum ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "minimum",
std::string  tag = kElementWise 
)
inline

◆ minimum() [4/4]

tvm::te::Tensor tvm::topi::minimum ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "minimum",
std::string  tag = kBroadcast 
)
inline

◆ MinOp()

PrimExpr tvm::topi::MinOp ( PrimExpr  source,
Array< IterVar axis,
Array< PrimExpr init = {},
Span  span = Span() 
)
inline

Wrap tvm::min to ensure we get the correct overload.

◆ mod() [1/4]

tvm::PrimExpr tvm::topi::mod ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ mod() [2/4]

tvm::te::Tensor tvm::topi::mod ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "mod",
std::string  tag = kElementWise 
)
inline

◆ mod() [3/4]

tvm::te::Tensor tvm::topi::mod ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "mod",
std::string  tag = kElementWise 
)
inline

◆ mod() [4/4]

tvm::te::Tensor tvm::topi::mod ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "mod",
std::string  tag = kBroadcast 
)
inline

◆ multiply() [1/4]

tvm::PrimExpr tvm::topi::multiply ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ multiply() [2/4]

tvm::te::Tensor tvm::topi::multiply ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "multiply",
std::string  tag = kElementWise 
)
inline

◆ multiply() [3/4]

tvm::te::Tensor tvm::topi::multiply ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "multiply",
std::string  tag = kElementWise 
)
inline

◆ multiply() [4/4]

tvm::te::Tensor tvm::topi::multiply ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "multiply",
std::string  tag = kBroadcast 
)
inline

◆ ndarray_size()

Tensor tvm::topi::ndarray_size ( const Tensor src,
const DataType dtype,
const std::string &  name = "ndarray_size",
const std::string &  tag = kInjective 
)
inline

Get the size of input tensor.

Parameters
srcthe input tensor.
dtypethe type of the elements in the tensor.
nameoutput tensor name.
tagoutput tensor tag.
Returns
Tensor of input shape.

◆ negative()

Tensor tvm::topi::negative ( const Tensor x,
std::string  name = "T_negative",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns the negation of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the negation operation

◆ nll_loss()

Tensor tvm::topi::nll_loss ( const Tensor predictions,
const Tensor targets,
const Tensor weights,
std::string  reduction = "mean",
int  ignore_index = -100,
const std::string  name = "nll_loss",
const std::string  tag = kBroadcast 
)
inline

Negative log likelihood loss.

Parameters
predictionsThe prediction tensor.
targetsThe target tensor.
weightsA manual rescaling weight given to each class.
reductionThe reduction method to apply to the output.
ignore_indexThe target value to ignore.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
The negative log likelihood loss of the predictions and targets.

◆ not_equal() [1/4]

tvm::PrimExpr tvm::topi::not_equal ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ not_equal() [2/4]

tvm::te::Tensor tvm::topi::not_equal ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "not_equal",
std::string  tag = kElementWise 
)
inline

◆ not_equal() [3/4]

tvm::te::Tensor tvm::topi::not_equal ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "not_equal",
std::string  tag = kElementWise 
)
inline

◆ not_equal() [4/4]

tvm::te::Tensor tvm::topi::not_equal ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "not_equal",
std::string  tag = kBroadcast 
)
inline

◆ one_hot()

Tensor tvm::topi::one_hot ( const Tensor indices,
const PrimExpr  on_value,
const PrimExpr  off_value,
int  depth,
int  axis,
const DataType dtype,
Array< PrimExpr oshape = Array<PrimExpr>(),
const std::string  name = "T_one_hot",
const std::string  tag = kInjective 
)
inline

Returns a one-hot tensor where the locations repsented by indices take value on_value, other locations take value off_value.

Parameters
indiceslocations to set to on_value.
on_valuevalue that locations represented by indices take on.
off_valuevalue that other locations take on.
depthdepth of the one-hot dimension.
axisaxis to fill.
dtypedata type of the output tensor.
oshapeshape of the output tensor.
nameoutput tensor name.
tagoutput tensor tag.
Returns
one-hot tensor.

◆ operator&() [1/3]

tvm::te::Tensor tvm::topi::operator& ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator&() [2/3]

tvm::te::Tensor tvm::topi::operator& ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator&() [3/3]

tvm::te::Tensor tvm::topi::operator& ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator&&() [1/3]

tvm::te::Tensor tvm::topi::operator&& ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator&&() [2/3]

tvm::te::Tensor tvm::topi::operator&& ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator&&() [3/3]

tvm::te::Tensor tvm::topi::operator&& ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator*() [1/3]

tvm::te::Tensor tvm::topi::operator* ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator*() [2/3]

tvm::te::Tensor tvm::topi::operator* ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator*() [3/3]

tvm::te::Tensor tvm::topi::operator* ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator+() [1/3]

tvm::te::Tensor tvm::topi::operator+ ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator+() [2/3]

tvm::te::Tensor tvm::topi::operator+ ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator+() [3/3]

tvm::te::Tensor tvm::topi::operator+ ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator-() [1/3]

tvm::te::Tensor tvm::topi::operator- ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator-() [2/3]

tvm::te::Tensor tvm::topi::operator- ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator-() [3/3]

tvm::te::Tensor tvm::topi::operator- ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator<<() [1/3]

tvm::te::Tensor tvm::topi::operator<< ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator<<() [2/3]

tvm::te::Tensor tvm::topi::operator<< ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator<<() [3/3]

tvm::te::Tensor tvm::topi::operator<< ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator>>() [1/3]

tvm::te::Tensor tvm::topi::operator>> ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator>>() [2/3]

tvm::te::Tensor tvm::topi::operator>> ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator>>() [3/3]

tvm::te::Tensor tvm::topi::operator>> ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator^() [1/3]

tvm::te::Tensor tvm::topi::operator^ ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator^() [2/3]

tvm::te::Tensor tvm::topi::operator^ ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator^() [3/3]

tvm::te::Tensor tvm::topi::operator^ ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator|() [1/3]

tvm::te::Tensor tvm::topi::operator| ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator|() [2/3]

tvm::te::Tensor tvm::topi::operator| ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator|() [3/3]

tvm::te::Tensor tvm::topi::operator| ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ operator||() [1/3]

tvm::te::Tensor tvm::topi::operator|| ( const tvm::PrimExpr A,
const tvm::te::Tensor B 
)
inline

◆ operator||() [2/3]

tvm::te::Tensor tvm::topi::operator|| ( const tvm::te::Tensor A,
const tvm::PrimExpr B 
)
inline

◆ operator||() [3/3]

tvm::te::Tensor tvm::topi::operator|| ( const tvm::te::Tensor A,
const tvm::te::Tensor B 
)
inline

◆ pad()

tvm::te::Tensor tvm::topi::pad ( const tvm::te::Tensor t,
const tvm::Array< tvm::PrimExpr > &  pad_before,
tvm::Array< tvm::PrimExpr pad_after = tvm::Array<tvm::PrimExpr>(),
PrimExpr  pad_value = PrimExpr(),
std::string  name = "T_pad",
std::string  tag = kElementWise,
std::string  pad_mode = "constant",
const Array< PrimExpr > *  dyn_output_shape = nullptr 
)
inline

Creates an operation that performs padding.

Parameters
tThe input tensor
pad_beforeAn Array of Expr describing the padding before the respective iterator
pad_afterAn Array of Expr describing the padding after the respective iterator
pad_valueThe value to fill padding elements with
pad_modePadding type to use. "constant" pads with constant_value; "edge" pads using the edge values of the input array; "reflect" pads by reflecting values with respect to the edges.
dyn_output_shapeOutput shape of the pad op, default nullptr. You only need to pass this in if the shape was evaluated dynamically.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the padding operation
Note
The pad_after Array must either be empty or have the same length as pad_before When pad_after is empty, it takes the same values as pad_before (symmetric padding) The pad Array applies from the leading dimensions and skips missing trailing dimensions:
pad(t(i, j, k), {1}, {0}) returns the equivalent operation for
    the following pseudocode:
        for i in [1, t.shape[0] + 2]:
            for i in [1, t.shape[0] + 2]:
                for i in [1, t.shape[0] + 2]:
                   name(i,j,k) =
                       (1 <= i <= t.shape[0] + 1) ?
                           t(i-1, j, k) : 0;

◆ parse_auto_scheduler_layout()

void tvm::topi::parse_auto_scheduler_layout ( const String layout,
Array< PrimExpr > *  shape,
std::vector< std::string > *  axes 
)
inline

Utility function for auto_scheduler_layout_transform.

◆ power() [1/4]

tvm::PrimExpr tvm::topi::power ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ power() [2/4]

tvm::te::Tensor tvm::topi::power ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "power",
std::string  tag = kElementWise 
)
inline

◆ power() [3/4]

tvm::te::Tensor tvm::topi::power ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "power",
std::string  tag = kElementWise 
)
inline

◆ power() [4/4]

tvm::te::Tensor tvm::topi::power ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "power",
std::string  tag = kBroadcast 
)
inline

◆ prelu()

tvm::te::Tensor tvm::topi::prelu ( const tvm::te::Tensor x,
const tvm::te::Tensor slope,
const int  axis = 1,
std::string  name = "T_prelu",
std::string  tag = kBroadcast 
)
inline

Creates an operation that performs a parametric rectified linear unit.

Parameters
xThe input data tensor
slopeThe channel-wise slope tensor
axisThe axis where the channel data needs to be applied
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the parametric relu operation

◆ prod()

Tensor tvm::topi::prod ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates product operation over given axis.

Parameters
dataThe input tensor
axisThe axis to do product over. If axis is empty, the operation will do the product over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the prod operation

◆ ProdOp()

PrimExpr tvm::topi::ProdOp ( PrimExpr  source,
Array< IterVar axis,
Array< PrimExpr init = {},
Span  span = Span() 
)
inline

Wrap tvm::prod to ensure we get the correct overload.

◆ reinterpret()

Tensor tvm::topi::reinterpret ( const Tensor x,
DataType  type,
std::string  name = "tensor",
std::string  tag = kElementWise 
)
inline

Reinterpret each element of x to the given type.

Parameters
xThe input tensor
typeThe type to cast to
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the reinterpret operation

◆ relu()

template<typename T >
tvm::te::Tensor tvm::topi::relu ( const tvm::te::Tensor t,
threshold = static_cast<T>(0),
std::string  name = "T_relu",
std::string  tag = kElementWise 
)
inline

Creates an operation that performs a rectified linear unit.

Parameters
tThe input tensor
thresholdThe relu threshold (default 0)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the relu operation

◆ repeat()

Tensor tvm::topi::repeat ( const Tensor x,
int  repeats,
int  axis,
std::string  name = "T_repeat",
std::string  tag = kBroadcast 
)
inline

Creates an operation to repeat elements of an array.

Parameters
xThe input tensor
repeatsThe number of repetitions for each element
axisThe axis along which to repeat values (allows negative indices as offsets from the last dimension)
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the repeat operation

◆ reshape()

Tensor tvm::topi::reshape ( const Tensor x,
Array< PrimExpr newshape,
std::string  name = "T_reshape",
std::string  tag = kInjective 
)
inline

Reshape a tensor.

Parameters
xThe input tensor
newshapeThe new shape
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the reshape operation

◆ reverse_sequence()

Tensor tvm::topi::reverse_sequence ( const Tensor x,
const Tensor seq_lengths,
int  seq_axis = 1,
int  batch_axis = 0,
std::string  name = "T_reverse_sequence",
std::string  tag = kInjective 
)
inline

Reverse the tensor for variable length slices. Input is first sliced along batch axis and then elements are reversed along seq axis.

Parameters
xThe input tensor
seq_lengthsA 1D Tensor with length x.dims[batch_axis]. Optional Tensor() can be passed. If not defined batch axis is ignored and tensor is reversed along seq_axis.
seq_axisThe axis along which the elements will be reveresed
batch_axisThe axis along which the tensor will be sliced
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the reverse_sequence operation

◆ right_shift() [1/4]

tvm::PrimExpr tvm::topi::right_shift ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ right_shift() [2/4]

tvm::te::Tensor tvm::topi::right_shift ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "right_shift",
std::string  tag = kElementWise 
)
inline

◆ right_shift() [3/4]

tvm::te::Tensor tvm::topi::right_shift ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "right_shift",
std::string  tag = kElementWise 
)
inline

◆ right_shift() [4/4]

tvm::te::Tensor tvm::topi::right_shift ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "right_shift",
std::string  tag = kBroadcast 
)
inline

◆ round()

Tensor tvm::topi::round ( const Tensor x,
std::string  name = "T_" "round",
std::string  tag = kElementWise 
)
inline

◆ rsqrt()

Tensor tvm::topi::rsqrt ( const Tensor x,
std::string  name = "tensor",
std::string  tag = kElementWise 
)
inline

Creates an operation that returns rsqrt of a given tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the rsqrt operation

◆ sequence_mask()

Tensor tvm::topi::sequence_mask ( const Tensor data,
const Tensor valid_length,
double  mask_value,
int  axis,
std::string  name = "T_sequence_mask",
std::string  tag = kInjective 
)
inline

Mask the out-of-boundary elements of each sequence.

Parameters
dataThe source array.
valid_lengthThe real length of each sequence.
mask_valueThe masking value.
axisThe axis of the temporal dimension of the sequence
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the sequence_mask operation

◆ shape()

Tensor tvm::topi::shape ( const Tensor src,
DataType  dtype,
const std::string  name = "T_shape",
const std::string  tag = kInjective 
)
inline

Get the shape of input tensor.

Parameters
srcthe input tensor.
dtypethe type of the elements in the tensor.
nameoutput tensor name.
tagoutput tensor tag.
Returns
Tensor of input shape.

◆ sigmoid()

Tensor tvm::topi::sigmoid ( const Tensor x,
std::string  name = "T_" "sigmoid",
std::string  tag = kElementWise 
)
inline

◆ sign()

Tensor tvm::topi::sign ( const Tensor x,
std::string  name = "T_sign",
std::string  tag = kElementWise 
)
inline

Returns the sign of the tensor.

Parameters
xThe input tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the sign

◆ sin()

Tensor tvm::topi::sin ( const Tensor x,
std::string  name = "T_" "sin",
std::string  tag = kElementWise 
)
inline

◆ sinh()

Tensor tvm::topi::sinh ( const Tensor x,
std::string  name = "T_" "sinh",
std::string  tag = kElementWise 
)
inline

◆ sliding_window()

Tensor tvm::topi::sliding_window ( const Tensor x,
int  axis,
Array< Integer window_shape,
Array< Integer strides,
std::string  name = "T_sliding_window",
std::string  tag = "" 
)
inline

Creates an operation to slide a window over the input x.

Parameters
xThe input tensor.
axisWhat axis the window begins sliding over. Window will be slid over this axis and all following axes. The axis value determines the window shape (and thus, the number of strides): window shape and strides must both be of length data.ndim-axis.
window_shapeThe window shape to form over the input. Window shape must be of length data.ndim-axis.
stridesHow to stride the window along each dimension. Strides must be of length data.ndim-axis.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the sliding_window operation

◆ space_to_batch_nd()

tvm::te::Tensor tvm::topi::space_to_batch_nd ( const tvm::te::Tensor data,
const tvm::Array< Integer > &  block_shape,
const tvm::Array< tvm::PrimExpr > &  pad_before,
const tvm::Array< tvm::PrimExpr > &  pad_after,
PrimExpr  pad_value = PrimExpr(),
std::string  name = "space_to_batch_nd",
std::string  tag = kInjective 
)
inline

Divide spatial dimensions of the input into a grid of blocks.

Parameters
dataThe input tensor.
block_shapeThe size of the spatial block.
pad_beforeThe zero-padding size before each spatial dimension.
pad_afterThe zero-padding size after each spatial dimension.
pad_valueThe value used for padding.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the space_to_batch_nd operation

◆ sparse_to_dense()

Tensor tvm::topi::sparse_to_dense ( const Tensor sparse_indices,
const Array< PrimExpr > &  output_shape,
const Tensor sparse_values,
const PrimExpr default_value,
const std::string  name = "T_sparse_to_dense",
const std::string  tag = kInjective 
)
inline

Get a dense tensor.

Parameters
sparse_indicessparse_indices[i] contains sparse_values[i] will be placed.
output_shapeis the shape of the dense output tensor .
sparse_valuesis a 0-D or 1-D tensor. Values for each row of sparse_indices.
default_valueis a 0-D tensor. Defaults to zero.
nameoutput tensor name.
tagoutput tensor tag.
Returns
Tensor of output_shape.

◆ split()

Array<Tensor> tvm::topi::split ( const Tensor x,
Array< PrimExpr split_indices,
int  axis,
std::string  name = "T_split",
std::string  tag = kInjective 
)
inline

Split a tensor into multiple sub-tensors.

Parameters
xThe input tensor
split_indicesThe indices to split the input at. This must be in ascending order.
axisThe axis to split along.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the split operation

◆ split_sections()

Array<Tensor> tvm::topi::split_sections ( const Tensor x,
int  num_sections,
int  axis,
std::string  name = "T_split_sections",
std::string  tag = kInjective 
)
inline

Split a tensor into a number of sub-tensors.

Parameters
xThe input tensor
num_sectionsThe number of sections to split the tensor into. this must be an integer factor of the size of the axis being split.
axisThe axis to split along.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the split operation

◆ sqrt()

Tensor tvm::topi::sqrt ( const Tensor x,
std::string  name = "T_" "sqrt",
std::string  tag = kElementWise 
)
inline

◆ squeeze()

Tensor tvm::topi::squeeze ( const Tensor x,
Array< Integer axis,
bool  atleast1d = false,
std::string  name = "T_squeeze",
std::string  tag = kInjective 
)
inline

Remove size 1 dimensions from the shape of a tensor. The removed dimensions must have a constant size of 1.

Parameters
xThe input tensor
axisIndices of the dimensions to remove. If this is None, all entries with a constant size of 1 will be removed.
atleast1dWhether the output need to be atleast1d.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the squeeze operation

◆ stack()

Tensor tvm::topi::stack ( const Array< Tensor > &  inputs,
int  axis = 0,
std::string  name = "T_stack",
std::string  tag = kInjective 
)
inline

Join a sequence of tensors along a new axis.

Parameters
inputsThe input tensors
axisThe axis along which the tensors will be stacked
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the stack operation

◆ strided_slice()

Tensor tvm::topi::strided_slice ( const Tensor x,
const Array< Integer > &  begin,
const Array< Integer > &  end,
const Array< Integer > &  strides,
std::string  slice_mode = "end",
std::string  name = "T_strided_slice",
std::string  tag = kInjective 
)
inline

strided_slice of a tensor

Parameters
xThe input tensor
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
slice_modeSpecifies the slice mode
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the strided_slice operation

◆ strided_slice_with_axes()

Tensor tvm::topi::strided_slice_with_axes ( const Tensor x,
const Array< Integer > &  begin,
const Array< Integer > &  end,
const Array< Integer > &  strides,
const Array< Integer > &  axes,
std::string  slice_mode = "end",
std::string  name = "T_strided_slice_with_axes",
std::string  tag = kInjective 
)
inline

strided_slice of a tensor

Parameters
xThe input tensor
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
axesAxes along which slicing is applied. When it is specified, the length of begin, end, strides, and axes argument must be equal
slice_modeSpecifies the slice mode
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the sstrided_slice operation

◆ StridedSliceOutputShape()

Array<PrimExpr> tvm::topi::StridedSliceOutputShape ( const Array< PrimExpr > &  ishape,
const Array< Integer > &  begin,
const Array< Integer > &  end,
const Array< Integer > &  strides,
const Array< Integer > &  axes,
const std::string &  slice_mode 
)
inline

Calculate the output shape of strided_slice, the entry point for Relay type relation.

Parameters
ishapeThe input tensor shape
beginThe indices to begin with in the slicing
endIndices indicating end of the slice
stridesSpecifies the stride values, it can be negative in that case, the input tensor will be reversed in that particular axis
axesAxes along which slicing is applied. When it is specified, the length of begin, end, strides, and axes argument must be equal
slice_modeSpecifies the slice mode
Returns
The output shape of strided_slice using the arguments above

◆ subtract() [1/4]

tvm::PrimExpr tvm::topi::subtract ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ subtract() [2/4]

tvm::te::Tensor tvm::topi::subtract ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "subtract",
std::string  tag = kElementWise 
)
inline

◆ subtract() [3/4]

tvm::te::Tensor tvm::topi::subtract ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "subtract",
std::string  tag = kElementWise 
)
inline

◆ subtract() [4/4]

tvm::te::Tensor tvm::topi::subtract ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "subtract",
std::string  tag = kBroadcast 
)
inline

◆ sum()

Tensor tvm::topi::sum ( const Tensor data,
const Array< Integer > &  axis,
bool  keepdims = false,
bool  atleast1d = false 
)
inline

Creates an operation that sums array elements over a given axis.

Parameters
dataThe input tensor
axisThe axis to sum over. If axis is empty, the operation will sum over all elements of the array.
keepdimsIf this is set to true, the axes which are reduced are left in the result as dimensions with size one. This enables the result to broadcast correctly against the input array.
atleast1dWhether the output need to be atleast1d.
Returns
A Tensor whose op member is the sum operation

◆ take() [1/2]

Tensor tvm::topi::take ( const Tensor a,
const Tensor indices,
int  batch_dims,
std::string  mode = "clip",
std::string  name = "T_take",
std::string  tag = kInjective 
)
inline

Take elements from an flattened input array when axis is None.

Parameters
aThe source array.
indicesThe indices of the values to extract.
batch_dimsThe number of batch dimensions.
modeThe mode of the operation.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the take operation

◆ take() [2/2]

Tensor tvm::topi::take ( const Tensor a,
Variant< Tensor, PrimExpr indices,
int  batch_dims,
int  axis,
std::string  mode = "clip",
std::string  name = "T_take",
std::string  tag = kInjective 
)
inline

Take elements from an array along an axis.

Parameters
aThe source array.
indicesThe indices of the values to extract.
batch_dimsThe number of batch dimensions. By default is 0.
axisThe axis over which to select values. By default, the flattened input array is used.
modeThe mode for handling out of bound indices.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor whose op member is the take operation

◆ tan()

Tensor tvm::topi::tan ( const Tensor x,
std::string  name = "T_" "tan",
std::string  tag = kElementWise 
)
inline

◆ tanh()

Tensor tvm::topi::tanh ( const Tensor x,
std::string  name = "T_" "tanh",
std::string  tag = kElementWise 
)
inline

◆ tensordot() [1/2]

Tensor tvm::topi::tensordot ( const Tensor A,
const tvm::te::Tensor B,
Array< PrimExpr A_axes,
Array< PrimExpr B_axes,
std::string  name = "T_tensordot",
std::string  tag = kMatMul 
)
inline

A generalization of matrix multiplication to tensors.

Parameters
AThe tensor A
BThe tensor B
A_axesThe indices of the dimensions of tensor A to reduce over
B_axesThe indices of the dimensions of tensor B to reduce over
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor computing the result

◆ tensordot() [2/2]

Tensor tvm::topi::tensordot ( const Tensor A,
const tvm::te::Tensor B,
int  axes = 2,
std::string  name = "T_tensordot",
std::string  tag = kMatMul 
)
inline

A generalization of matrix multiplication to tensors.

Parameters
AThe tensor A
BThe tensor B
axesThe number of the dimensions to reduce over
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor computing the result

◆ tile()

Tensor tvm::topi::tile ( const Tensor x,
Array< Integer reps,
std::string  name = "T_tile",
std::string  tag = kBroadcast 
)
inline

Creates an operation to tile elements of an array.

Parameters
xThe input tensor
repsThe number of times for repeating the tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the tile operation

◆ transpose()

Tensor tvm::topi::transpose ( const Tensor x,
Array< Integer axes,
std::string  name = "T_transpose",
std::string  tag = kInjective 
)
inline

Permute the dimensions of an array.

Parameters
xThe input tensor
axesThe indices of the permutation. If this is empty, the dimensions will be reversed.
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor whose op member is the transpose operation

◆ trunc()

Tensor tvm::topi::trunc ( const Tensor x,
std::string  name = "T_" "trunc",
std::string  tag = kElementWise 
)
inline

◆ trunc_divide() [1/4]

tvm::PrimExpr tvm::topi::trunc_divide ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ trunc_divide() [2/4]

tvm::te::Tensor tvm::topi::trunc_divide ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "trunc_divide",
std::string  tag = kElementWise 
)
inline

◆ trunc_divide() [3/4]

tvm::te::Tensor tvm::topi::trunc_divide ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "trunc_divide",
std::string  tag = kElementWise 
)
inline

◆ trunc_divide() [4/4]

tvm::te::Tensor tvm::topi::trunc_divide ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "trunc_divide",
std::string  tag = kBroadcast 
)
inline

◆ trunc_mod() [1/4]

tvm::PrimExpr tvm::topi::trunc_mod ( const tvm::PrimExpr a,
const tvm::PrimExpr b 
)
inline

◆ trunc_mod() [2/4]

tvm::te::Tensor tvm::topi::trunc_mod ( const tvm::PrimExpr A,
const tvm::te::Tensor B,
std::string  name = "T_" "trunc_mod",
std::string  tag = kElementWise 
)
inline

◆ trunc_mod() [3/4]

tvm::te::Tensor tvm::topi::trunc_mod ( const tvm::te::Tensor A,
const tvm::PrimExpr B,
std::string  name = "T_" "trunc_mod",
std::string  tag = kElementWise 
)
inline

◆ trunc_mod() [4/4]

tvm::te::Tensor tvm::topi::trunc_mod ( const tvm::te::Tensor A,
const tvm::te::Tensor B,
std::string  name = "T_" "trunc_mod",
std::string  tag = kBroadcast 
)
inline

◆ unravel_index()

Tensor tvm::topi::unravel_index ( const Tensor x,
const Tensor shape,
std::string  name = "T_unravel",
std::string  tag = kInjective 
)
inline

Converts a flat index or array of flat indices into a tuple of coordinate arrays.

Parameters
xThe input tensor having indices.
shapeThe shape tensor
nameThe name of the operation
tagThe tag to mark the operation
Returns
A Tensor of coordinate arrays.

◆ where()

Tensor tvm::topi::where ( const Tensor condition,
const Tensor x,
const Tensor y,
std::string  name = "T_where",
std::string  tag = kBroadcast 
)
inline

Return the elements, either from x or y, depending on the condition.

Parameters
conditionThe condition array.
xFirst array to be selected.
ySecond array to be selected.
nameThe name of the operation.
tagThe tag to mark the operation.
Returns
A Tensor selected from x or y depending on condition.

Variable Documentation

◆ kBroadcast

constexpr auto tvm::topi::kBroadcast = "broadcast"
constexpr

◆ kCommReduce

constexpr auto tvm::topi::kCommReduce = "comm_reduce"
constexpr

◆ kCommReduceIdx

constexpr auto tvm::topi::kCommReduceIdx = "comm_reduce_idx"
constexpr

◆ kConv2dHWCN

constexpr auto tvm::topi::kConv2dHWCN = "conv2d_hwcn"
constexpr

◆ kConv2dNCHW

constexpr auto tvm::topi::kConv2dNCHW = "conv2d_nchw"
constexpr

◆ kDepthwiseConv2dBackInputNHWC

constexpr auto tvm::topi::kDepthwiseConv2dBackInputNHWC = "depthwise_conv2d_back_input_nhwc"
constexpr

◆ kDepthwiseConv2dBackWeightNHWC

constexpr auto tvm::topi::kDepthwiseConv2dBackWeightNHWC = "depthwise_conv2d_back_weight_nhwc"
constexpr

◆ kDepthwiseConv2dNCHW

constexpr auto tvm::topi::kDepthwiseConv2dNCHW = "depthwise_conv2d_nchw"
constexpr

◆ kDepthwiseConv2dNHWC

constexpr auto tvm::topi::kDepthwiseConv2dNHWC = "depthwise_conv2d_nhwc"
constexpr

◆ kEinsum

constexpr auto tvm::topi::kEinsum = "einsum"
constexpr

◆ kElementWise

constexpr auto tvm::topi::kElementWise = "elemwise"
constexpr

◆ kGroupConv2d

constexpr auto tvm::topi::kGroupConv2d = "group_conv2d"
constexpr

◆ kInjective

constexpr auto tvm::topi::kInjective = "injective"
constexpr

◆ kMatMul

constexpr auto tvm::topi::kMatMul = "matmul"
constexpr