lixiaoquan commented on a change in pull request #5699: URL: https://github.com/apache/incubator-tvm/pull/5699#discussion_r433034145
########## File path: python/tvm/relay/frontend/tensorflow.py ########## @@ -788,52 +797,21 @@ def _impl(inputs, attr, params, mod): def _tensor_array(): def _impl(inputs, attr, params, prelude): - try: - from tensorflow.python.framework import tensor_util - except ImportError as e: - raise ImportError( - "Unable to import tensorflow which is required {}".format(e)) - dtype_str = attr.get('dtype').name assert not attr["dynamic_size"], "Dynamic size tensor array is " \ "not supported in TVM yet." - raw_elem_shape = tensor_util.TensorShapeProtoToList(attr['element_shape']) - elem_shape = [] - for dim in raw_elem_shape: - if dim < 0: - elem_shape.append(Any()) - else: - elem_shape.append(dim) - - if elem_shape: - # Element shape is specified. - # Directly create static tensor array with given shape. + if attr['identical_element_shapes']: + assert "shape" in attr, "Shape is required for static tensor array." Review comment: Should it be element_shape? I run into some pb files which don't have attr['shape'] and they can be imported by old code https://github.com/tensorflow/tensorflow/blob/a34091e538540aad57a7a941575538944f38db24/tensorflow/core/kernels/tensor_array_ops.cc#L165 ---------------------------------------------------------------- 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