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. */
| 75 | output: A constant variable. |
| 76 | */ |
| 77 | VARP _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 | |
| 85 | VARP _Const(float value, INTS shape, Dimensionformat format) { |
| 86 | Variable::Info info; |