MCPcopy Create free account
hub / github.com/alibaba/MNN / _Const

Function _Const

express/NeuralNetWorkOp.cpp:77–83  ·  view source on GitHub ↗

create a constant variable. Args: ptr: A pointer. Indicates the values. shape: A vector, the shape of the variable. format: A enum, NCHW/NHWC/NC4HW4 is allowed. type: The type of the elements of the resulting variable. Returns: output: A constant variable. */

Source from the content-addressed store, hash-verified

75output: A constant variable.
76*/
77VARP _Const(const void* ptr, INTS shape, Dimensionformat format, halide_type_t type) {
78 Variable::Info info;
79 info.dim = std::move(shape);
80 info.order = format;
81 info.type = type;
82 return (Variable::create(Expr::create(std::move(info), ptr, VARP::CONSTANT)));
83}
84
85VARP _Const(float value, INTS shape, Dimensionformat format) {
86 Variable::Info info;

Callers 15

filterFunction · 0.85
structralFunction · 0.85
calib3dFunction · 0.85
solvePnPFunction · 0.85
RodriguesFunction · 0.85
buildImgVARPFunction · 0.85
initMethod · 0.85
LabelingGranaFunction · 0.85
findContoursFunction · 0.85
boxPointsFunction · 0.85
PadForConvFunction · 0.85
getScharrKernelsFunction · 0.85

Calls 3

syncSizeMethod · 0.80
createFunction · 0.50
dataMethod · 0.45

Tested by 15

TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
createVarFunction · 0.68
_varFunction · 0.68
_zerosFunction · 0.68
funcMethod · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68