24 #ifndef TVM_TOPI_NN_MAPPING_H_
25 #define TVM_TOPI_NN_MAPPING_H_
50 std::string name =
"ScaleShift", std::string tag =
kBroadcast) {
52 x->shape, [&](
Var b,
Var c,
Var h,
Var w) { return x(b, c, h, w) * scale(c) + shift(c); },
68 std::string name =
"ScaleShift", std::string tag =
kBroadcast) {
70 x->shape, [&](
Var b,
Var h,
Var w,
Var c) { return x(b, h, w, c) * scale(c) + shift(c); },
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
a named variable in TIR
Definition: var.h:89
Tensor expression language DSL.
Definition: extracted_task.h:33
Tensor compute(Array< PrimExpr > shape, FCompute fcompute, std::string name="tensor", std::string tag="", Map< String, ObjectRef > attrs={})
Construct a new tensor by computing over shape, using the computation rule: result_tensor[axis] = fco...
Tensor scale_shift_nchw(const Tensor &x, const Tensor &scale, const Tensor &shift, std::string name="ScaleShift", std::string tag=kBroadcast)
Scale and shift with NCHW order.
Definition: mapping.h:49
Tensor scale_shift_nhwc(const Tensor &x, const Tensor &scale, const Tensor &shift, std::string name="ScaleShift", std::string tag=kBroadcast)
Scale and shift with NHWC order.
Definition: mapping.h:67
constexpr auto kBroadcast
Definition: tags.h:36
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Operation node can generate one or multiple Tensors.