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

Method get_output_var_shape

src/opr/impl/imgproc.cpp:674–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672} // namespace mgb
673
674void DctChannelSelectForward::get_output_var_shape(
675 const TensorShapeArray& inp_shape, TensorShapeArray& out_shape) const {
676 auto mo = megdnn_opr();
677 TensorLayout dst;
678 dst.dtype = output(0)->dtype();
679 if (inp_shape.size() == 1) {
680 mo->deduce_layout(
681 {inp_shape[0], input(0)->dtype(), input(0)->format()}, {}, {}, dst);
682 } else {
683 mgb_assert(
684 inp_shape.size() == 3, "no support input tensor num %zu",
685 inp_shape.size());
686 mo->deduce_layout(
687 {inp_shape[0], input(0)->dtype(), input(0)->format()},
688 {inp_shape[1], input(1)->dtype(), input(1)->format()},
689 {inp_shape[2], input(2)->dtype(), input(2)->format()}, dst);
690 }
691 out_shape[0] = dst;
692}
693
694size_t DctChannelSelectForward::get_workspace_size_bytes(
695 const TensorShapeArray& input_shapes,

Callers

nothing calls this directly

Calls 4

dtypeMethod · 0.45
sizeMethod · 0.45
deduce_layoutMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected