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

Function get_numpy_input

dali/test/python/operator_1/test_arithmetic_ops.py:451–462  ·  view source on GitHub ↗

:param orig_type: the original type of used input :param target_type: the type of the result after type promotions

(input, kind, orig_type, target_type)

Source from the content-addressed store, hash-verified

449
450
451def get_numpy_input(input, kind, orig_type, target_type):
452 """
453 :param orig_type: the original type of used input
454 :param target_type: the type of the result after type promotions
455 """
456 if kind == "const":
457 return target_type(orig_type(magic_number))
458 else:
459 if "scalar" in kind:
460 return input.astype(target_type).reshape(input.shape)
461 else:
462 return input.astype(target_type)
463
464
465def extract_un_data(pipe_out, sample_id, kind, target_type):

Callers 2

extract_un_dataFunction · 0.85
extract_dataFunction · 0.85

Calls 1

reshapeMethod · 0.45

Tested by

no test coverage detected