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

Function _inspect_data

dali/python/nvidia/dali/_utils/external_source_impl.py:362–372  ·  view source on GitHub ↗
(data, is_batched)

Source from the content-addressed store, hash-verified

360
361# TODO(klecki): Maybe keep this data here instead of doing the copy twice
362def _inspect_data(data, is_batched):
363 # TODO(klecki): Add asserts for uniform input batches (as well as output batches)
364 if is_batched:
365 as_numpy = batch_to_numpy(data, _tf_batch_error_msg, non_uniform_str=_tf_uniform_error_msg)
366 if isinstance(as_numpy, list):
367 return as_numpy[0].dtype, (None,) * (as_numpy[0].ndim + 1)
368 else:
369 return as_numpy.dtype, (None,) * as_numpy.ndim
370 else:
371 as_numpy = sample_to_numpy(data, _tf_sample_error_msg)
372 return as_numpy.dtype, (None,) * as_numpy.ndim
373
374
375def get_batch_iterable_from_callback(source_desc: SourceDescription):

Calls 2

batch_to_numpyFunction · 0.85
sample_to_numpyFunction · 0.85

Tested by

no test coverage detected