MCPcopy Create free account
hub / github.com/ddkang/zkml / get_shape

Function get_shape

python/converter.py:9–13  ·  view source on GitHub ↗
(interpreter: tf.lite.Interpreter, tensor_idx)

Source from the content-addressed store, hash-verified

7import msgpack
8
9def get_shape(interpreter: tf.lite.Interpreter, tensor_idx):
10 if tensor_idx == -1:
11 return []
12 tensor = interpreter.get_tensor(tensor_idx)
13 return list(tensor.shape)
14
15def handle_numpy_or_literal(inp: Union[np.ndarray, Literal[0]]):
16 if isinstance(inp, int):

Callers 1

to_dictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected