24 #ifndef TVM_TOPI_NN_BIAS_ADD_H_
25 #define TVM_TOPI_NN_BIAS_ADD_H_
48 int data_ndim = data->shape.size();
52 int num_newaxis = data_ndim - axis - 1;
53 return add(data, (num_newaxis ?
expand_dims(bias, 1, num_newaxis) : bias));
Broadcast op constructions.
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
tvm::te::Tensor bias_add(const tvm::te::Tensor &data, const tvm::te::Tensor &bias, int axis)
Creates an operation that calculates data + bias.
Definition: bias_add.h:46
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.
Definition: transform.h:154
tvm::PrimExpr add(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:197
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Operation node can generate one or multiple Tensors.