Ejemplo n.º 1
0
 def _setup_input_callbacks(self):
     from nvidia.dali.external_source import _is_external_source_with_callback
     groups = set()
     for op in self._ops:
         if _is_external_source_with_callback(op):
             group = op._group
             groups.add(group)
     self._input_callbacks = list(groups)
Ejemplo n.º 2
0
        def _get_name_es_instance_map(self):
            """Return mappings between name of External Source and the op.

            Returns
            -------
            mapping for placeholders nodes, mapping for nodes with Python source
                Two mappings are returned, separating the placeholder nodes without a `source`
                and nodes that got a `source` parameter.
            """
            name_es = {}
            name_es_with_callback = {}
            for op in self._pipeline_instance._ops:
                if _is_external_source_with_callback(op):
                    # use the internal op name (generated automatically in most cases)
                    name_es_with_callback[op.name] = op
                elif _is_external_source(op):
                    self._assert_correct_external_sources(op)
                    # use the user provided name
                    name_es[op._op._name] = op
            return name_es, name_es_with_callback