24#ifndef TVM_TOPI_NN_FLATTEN_H_
25#define TVM_TOPI_NN_FLATTEN_H_
53 for (
size_t i = 1;
i <
ishape.size(); ++
i) {
60 for (
size_t i = 1;
i <
ishape.size(); ++
i) {
69 std::vector<PrimExpr> index;
75 std::reverse(index.begin(), index.end());
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition base_expr.h:401
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
Tensor structure representing a possible input, or intermediate computation result.
Definition tensor.h:98
Checked scalar view over a VarNode.
Definition var.h:46
Utility functions for handling constants in TVM expressions.
Tensor expression language DSL.
Definition extracted_task.h:33
Tensor compute(ffi::Array< PrimExpr > shape, FCompute fcompute, std::string name="tensor", std::string tag="", ffi::Map< ffi::String, ffi::Any > attrs={})
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fco...
Tensor flatten(const Tensor &x, std::string name="tensor", std::string tag=kInjective)
Flattens the input tensor into a 2-D tensor by collapsing higher dimensions. This requires the input ...
Definition flatten.h:50
constexpr auto kInjective
Definition tags.h:33
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
PrimExpr indexdiv(PrimExpr a, PrimExpr b, Span span=Span())
compute floor(a / b) where a and b are non-negative.
PrimExpr indexmod(PrimExpr a, PrimExpr b, Span span=Span())
compute the remainder floor(a / b) where a and b are non-negative.
Operation node can generate one or multiple Tensors.