Open
Description
Hi, I want to understand the use of dynamic_shape in ai_edge_torch.convert for a CNN model. I'm trying the following:
batch = torch.export.Dim('batch', min=1, max=64)
tfl_converter_flags = {'target_spec': {'supported_ops': [tf.lite.OpsSet.TFLITE_BUILTINS]}}
dynamic_shape = {
'x':{0:batch}
}
edge_model = ai_edge_torch.convert(resnet18.eval(), sample_inputs, dynamic_shapes=dynamic_shape, _ai_edge_converter_flags=tfl_converter_flags)
However, this returns the following TypeError: Only non-negative indices are allowed when broadcasting static shapes, but got shape (-9223372036854775808, 112, 112, 64).
My goal is to make the batch size dynamic. Below is the colab for reproduce my error:
https://colab.research.google.com/drive/1r0qCp1w3GHNBHeGHQtGeHI9eESiNoaHE?usp=sharing