tvm.relay.op.reshape(data, newshape) only accepts fixed newshape
. If it accepts an Expr
as newshape, the shape of output of this op will depend on both shape of data and data of newshape.
ShapeFunc can’t support this case for now. I’d suggest to enhance this function from
using FShapeFunc = runtime::TypedPackedFunc<
Array<te::Tensor>(const Attrs& attrs,
const Array<te::Tensor>& inputs,
const Array<IndexExpr>& out_ndims)>
to
using FShapeFunc = runtime::TypedPackedFunc<
Array<te::Tensor>(const Attrs& attrs,
const Array<te::Tensor>& shape_inputs,
const Array<te::Tensor>& data_inputs,
const Array<IndexExpr>& out_ndims)>
Then each op determines the usage of shape_inputs or data_inputs.