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

Function compare

dali/test/python/test_utils_tensorflow.py:273–288  ·  view source on GitHub ↗
(dataset_results, standalone_results, iterations=-1, num_devices=1)

Source from the content-addressed store, hash-verified

271
272
273def compare(dataset_results, standalone_results, iterations=-1, num_devices=1):
274 if iterations == -1:
275 iterations = len(standalone_results)
276
277 # list [iterations] of tuple [devices] of tuple [outputs] of tensors representing batch
278 assert (
279 len(dataset_results) == iterations
280 ), f"Got {len(dataset_results)} dataset results for {iterations} iterations"
281 for it in range(iterations):
282 for device_id in range(num_devices):
283 for tf_data, dali_data in zip(
284 dataset_results[it][device_id], standalone_results[it][device_id]
285 ):
286 np.testing.assert_array_equal(
287 tf_data, dali_data, f"Iteration {it}, x = tf_data, y = DALI baseline"
288 )
289
290
291def run_tf_dataset_graph(

Calls

no outgoing calls

Tested by

no test coverage detected