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

Function __test_empty_es

dali/test/python/test_external_source_dali.py:596–608  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

594
595
596def __test_empty_es():
597 max_batch_size = 16
598
599 @pipeline_def
600 def pipeline():
601 return fn.external_source(source=lambda: [])
602
603 # Providing an empty batch was legal, but it failed on MakeContiguous node.
604 # This checks proper validation in External Source which is the only way that could provide
605 # empty batch as input into DALI graph.
606 with assert_raises(RuntimeError, glob="*ExternalSource expects non-empty batches*"):
607 pipe = pipeline(batch_size=max_batch_size, num_threads=4, device_id=0)
608 pipe.run()
609
610
611def to_tensor_list_gpu(data):

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
pipelineFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected