Skip to content

tflite scalar support #27211

@robtfm

Description

@robtfm

Describe the feature and motivation

on 4.11, attempting to run the mediapipe blendshape model (from the task here) fails on this assert that a tensor has a shape.

the model runs correctly using the tf.lite.Interpreter in python.

investigating the tensor shapes, this model has some entries with scalar values like {'name': 'model_1/GhumMarkerPoserMlpMixerGeneral/tf.math.truediv/truediv;model_1/GhumMarkerPoserMlpMixerGeneral/tf.math.truediv/truediv/y', 'index': 58, 'shape': array([], dtype=int32), 'shape_signature': array([], dtype=int32), 'dtype': <class 'numpy.float16'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}

note 'shape_signature': array([], dtype=int32) in particular. i don't see anything with an empty shape in other models that import correctly so i suspect this is the issue.

apparently this should be interpreted as a scalar. can the importer fall back to a [1] shape in these cases?

apologies if my analysis is wrong, or if this is considered a bug instead of a feature.

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions