0

I'm now writing a custom op, and it's output shape is dynamic, how to define the output_shape in infer_shape function.

Zehao Shi
  • 99
  • 8

1 Answers1

1

The infer_shape function of CustomOpProp has an in_shape parameter. You can use it to calculate the output_shape dynamically.

If you cannot infer input shape without input data, but can infer maximum shape, then you can use it as commented here: https://github.com/apache/incubator-mxnet/issues/9758

Sergei
  • 1,617
  • 15
  • 31