hcho3 opened a new pull request #4707: [Relay][Frontend][TF] Fix handling of 0D scalar Constant URL: https://github.com/apache/incubator-tvm/pull/4707 Consider the following snippet of a TensorFlow model: ``` node { name: "flatten_1/stack/0" op: "Const" attr { key: "dtype" value { type: DT_INT32 } } attr { key: "value" value { tensor { dtype: DT_INT32 tensor_shape { } int_val: -1 } } } } node { name: "flatten_1/stack" op: "Pack" input: "flatten_1/stack/0" input: "flatten_1/Prod" attr { key: "N" value { i: 2 } } attr { key: "T" value { type: DT_INT32 } } attr { key: "axis" value { i: 0 } } } ``` The Pack operator accepts two inputs: the 0D constant `flatten_1/stack/0` and a 0D tensor `flatten_1/Prod`. Currently, the TF frontend cannot handle this model because it turns the 0D constant `flatten_1/stack/0` into a 1D constant of dimension `(1,)`: https://github.com/apache/incubator-tvm/blob/f4c4fde4a07d2346c159f1d5c6ccd00fb8fb7c7d/python/tvm/relay/frontend/tensorflow.py#L2402-L2405 This PR modifies the frontend to handle 0D constants properly.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services