Class CinnBuilder

Inheritance Relationships

Base Type

Class Documentation

class cinn::frontend::CinnBuilder : public cinn::frontend::BaseBuilder

Public Functions

template<typename T>
Variable ConstScalar(T value, const std::string &name)

Create scalar with the specific value and type.

Return

The result variable.

Parameters
  • value: The scalar value to be set.

  • name: The name of output variable.

Variable Exp(const Variable &operand)
Variable Erf(const Variable &operand)
Variable Sqrt(const Variable &operand)
Variable Rsqrt(const Variable &operand)
Variable Log(const Variable &operand)
Variable Log2(const Variable &operand)
Variable Log10(const Variable &operand)
Variable Floor(const Variable &operand)
Variable Ceil(const Variable &operand)
Variable Round(const Variable &operand)
Variable Trunc(const Variable &operand)
Variable Sin(const Variable &operand)
Variable Cos(const Variable &operand)
Variable Tan(const Variable &operand)
Variable Sinh(const Variable &operand)
Variable Cosh(const Variable &operand)
Variable Tanh(const Variable &operand)
Variable Asin(const Variable &operand)
Variable Acos(const Variable &operand)
Variable Atan(const Variable &operand)
Variable Asinh(const Variable &operand)
Variable Acosh(const Variable &operand)
Variable Atanh(const Variable &operand)
Variable IsNan(const Variable &operand)
Variable IsFinite(const Variable &operand)
Variable IsInf(const Variable &operand)
Variable LogicalNot(const Variable &operand)
Variable BitwiseNot(const Variable &operand)
Variable Negative(const Variable &operand)
Variable Sign(const Variable &operand)
Variable Abs(const Variable &operand)
Variable Identity(const Variable &operand)
Variable Dot(const Variable &lhs, const Variable &rhs)
Variable Add(const Variable &lhs, const Variable &rhs)
Variable Sub(const Variable &lhs, const Variable &rhs)
Variable Mul(const Variable &lhs, const Variable &rhs)
Variable Div(const Variable &lhs, const Variable &rhs)
Variable FloorDiv(const Variable &lhs, const Variable &rhs)
Variable Mod(const Variable &lhs, const Variable &rhs)
Variable FloorMod(const Variable &lhs, const Variable &rhs)
Variable Max(const Variable &lhs, const Variable &rhs)
Variable Min(const Variable &lhs, const Variable &rhs)
Variable Power(const Variable &lhs, const Variable &rhs)
Variable LogicalAnd(const Variable &lhs, const Variable &rhs)
Variable LogicalOr(const Variable &lhs, const Variable &rhs)
Variable LogicalXor(const Variable &lhs, const Variable &rhs)
Variable BitwiseAnd(const Variable &lhs, const Variable &rhs)
Variable BitwiseOr(const Variable &lhs, const Variable &rhs)
Variable BitwiseXor(const Variable &lhs, const Variable &rhs)
Variable LeftShift(const Variable &lhs, const Variable &rhs)
Variable RightShift(const Variable &lhs, const Variable &rhs)
Variable Concat(const std::vector<Variable> &input_vars, int axis = 0)
Variable Conv(const Variable &lhs, const Variable &rhs, const std::vector<int> &strides = {1, 1}, const std::vector<int> &paddings = {0, 0}, const std::vector<int> &dilations = {1, 1}, int groups = 1, const std::string &conv_type = "forward", const std::string &data_format = "NCHW", const std::string &padding_algorithm = "EXPLICIT", const std::vector<int> &output_shape = {})
Variable Compare(const Variable &lhs, const Variable &rhs, ComparisonKind kind)
Variable Reduce(const Variable &operand, ReduceKind kind, const std::vector<int> &dim, bool keep_dim = false)

Reduce array elements over the given dims.

Return

The result variable.

Parameters
  • operand: The input variable.

  • dim: The dims along which a sum is performed. If dim is empty, the operation will sum over all elements of the input array. If the dim has negative value, it should count from the last dim to the first.

  • keep_dim: If it is set true, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

Variable BroadcastTo(const Variable &operand, const std::vector<int> &out_shape, const std::vector<int> &broadcast_axes)
Variable Reshape(const Variable &operand, const std::vector<int> &shape)
Variable Transpose(const Variable &operand, const std::vector<int> &axis)
Variable Slice(const Variable &operand, const std::vector<int> &axes, const std::vector<int> &starts = {}, const std::vector<int> &ends = {})
Variable Select(const Variable &condition, const Variable &true_value, const Variable &false_value)
Variable Reverse(const Variable &operand, const std::vector<int> &axis)
std::vector<Variable> BnMeanVariance(const Variable &x)
std::vector<Variable> BnGradBiasScale(const Variable &x, const Variable &x_mean, const Variable &y_grad)