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

Function _format_values

dali/test/python/test_tensor_formatting.py:108–113  ·  view source on GitHub ↗

Format array values as strings matching the output format.

(arr, count=2)

Source from the content-addressed store, hash-verified

106
107
108def _format_values(arr, count=2):
109 """Format array values as strings matching the output format."""
110 return [
111 np.format_float_positional(v, trim="-") if arr.dtype.kind == "f" else str(int(v))
112 for v in arr.flat[:count]
113 ]
114
115
116@params(*product(TENSOR_TEST_CASES, DEVICES))

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected