MCPcopy Create free account
hub / github.com/NVIDIA/DALI / generate

Method generate

dali/test/python/test_external_source_impl.py:673–678  ·  view source on GitHub ↗
(dim)

Source from the content-addressed store, hash-verified

671 random_seed(12345 * self.i + 4321)
672
673 def generate(dim):
674 shape = random_int(1, 10, [dim]).tolist()
675 if self.as_tensor:
676 return random_array([self.batch_size] + shape)
677 else:
678 return [random_array(shape) for _ in range(self.batch_size)]
679
680 if self.i < self.n:
681 self.i += 1

Callers

nothing calls this directly

Calls 2

random_arrayFunction · 0.85
tolistMethod · 0.80

Tested by

no test coverage detected