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

Function empty_batches

dali/test/python/operator_2/test_reduce.py:603–614  ·  view source on GitHub ↗
(rank, axes, batch_size, num_batches)

Source from the content-addressed store, hash-verified

601
602
603def empty_batches(rank, axes, batch_size, num_batches):
604 data = []
605 for _ in range(num_batches):
606 batch = []
607 for _ in range(batch_size):
608 shape = np.random.randint(1, 10, size=rank)
609 for a in axes:
610 shape[a] = 0
611 sample = np.empty(shape, dtype=np.float32)
612 batch.append(sample)
613 data.append(batch)
614 return data
615
616
617@nottest

Callers 1

_test_reduce_empty_dataFunction · 0.85

Calls 2

emptyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected