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

Function _get_external_source_param

dali/python/nvidia/dali/plugin/tf.py:355–386  ·  view source on GitHub ↗

Get value of the parameter `param_name` specified for the External Source node named `input_name`. It can be specified either via `input_value` or in the op instance passed in `name_es_map`. Not `None` value in `input_value` overwrites the one specified in the Operator instances

(input_name, input_value, name_es_map, param_name)

Source from the content-addressed store, hash-verified

353
354
355def _get_external_source_param(input_name, input_value, name_es_map, param_name):
356 """Get value of the parameter `param_name` specified for the External Source node
357 named `input_name`. It can be specified either via `input_value` or in the op instance
358 passed in `name_es_map`.
359 Not `None` value in `input_value` overwrites the one specified in the Operator instances.
360 Otherwise, the one from pipeline definition (the op instance) is used.
361
362 Parameters
363 ----------
364 input_name : str
365 Name of the input
366 input_value : Input, optional
367 Description of the input
368 name_es_map : dict[str, ExternalSource]
369 Mapping from the External Source names to operator nodes.
370 param_name : str
371 name of the parameter we want to access
372 """
373
374 def get_param_from_pipe(input_name, name_es_map, param_name):
375 es_op = name_es_map[input_name]
376 # Check the OpInstance and the `_op`
377 try:
378 return getattr(es_op, "_" + param_name)
379 except AttributeError:
380 return getattr(es_op._op, "_" + param_name, None)
381
382 # We didn't get input through input_datasets
383 if input_value is None or getattr(input_value, param_name) is None:
384 return get_param_from_pipe(input_name, name_es_map, param_name)
385 else:
386 return getattr(input_value, param_name)
387
388
389def _get_signature(dtype, shape):

Calls 1

get_param_from_pipeFunction · 0.85

Tested by

no test coverage detected