MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / generate_index

Function generate_index

tensorflow/lite/testing/generate_examples_lib.py:4354–4361  ·  view source on GitHub ↗
(dense_shape)

Source from the content-addressed store, hash-verified

4352
4353 # Return a single value for 1-D dense shape, but a tuple for other shapes.
4354 def generate_index(dense_shape):
4355 if len(dense_shape) == 1:
4356 return np.random.randint(dense_shape[0])
4357 else:
4358 index = []
4359 for shape in dense_shape:
4360 index.append(np.random.randint(shape))
4361 return tuple(index)
4362
4363 def build_graph(parameters):
4364 """Build the sparse_to_dense op testing graph."""

Callers 1

build_graphFunction · 0.85

Calls 2

tupleFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected