MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_output_var_shape

Method get_output_var_shape

src/serialization/impl/extern_c_opr.cpp:301–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void ExternCOprRunner::get_output_var_shape(
302 const TensorShapeArray& inp_shape, TensorShapeArray& out_shape) const {
303 SmallVector<MGBTensorShape> c_inp(inp_shape.size()), c_out(out_shape.size());
304 for (size_t i = 0; i < inp_shape.size(); ++i) {
305 c_inp[i] = tensor_shape_to_c(inp_shape[i]);
306 }
307 m_desc->infer_shape(m_desc.get(), c_inp.data(), c_out.data());
308 for (size_t i = 0; i < out_shape.size(); ++i) {
309 out_shape[i] = tensor_shape_from_c(c_out[i]);
310 }
311}
312
313void ExternCOprRunner::init_output_dtype() {
314 if (!m_desc->infer_dtype) {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
infer_shapeMethod · 0.45
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected