Esempio n. 1
0
 def _as_variant_tensor(self):
   input_t = self._input_dataset._as_variant_tensor()  # pylint: disable=protected-access
   return gen_dataset_ops.map_dataset(
       input_t,
       self._map_func.captured_inputs,
       f=self._map_func,
       **dataset_ops.flat_structure(self))
Esempio n. 2
0
 def _as_variant_tensor(self):
   input_t = self._input_dataset._as_variant_tensor()  # pylint: disable=protected-access
   return gen_dataset_ops.map_dataset(
       input_t,
       self._map_func.captured_inputs,
       f=self._map_func,
       **dataset_ops.flat_structure(self))
Esempio n. 3
0
    def __init__(self,
                 input_dataset,
                 map_func,
                 use_inter_op_parallelism=True,
                 preserve_cardinality=False,
                 use_legacy_function=False):
        """See `Dataset.map()` for details."""
        self._input_dataset = input_dataset
        self._use_inter_op_parallelism = use_inter_op_parallelism
        self._preserve_cardinality = preserve_cardinality
        self._map_func = map_func  # StructuredFunctionWrapper

        variant_tensor = gen_dataset_ops.map_dataset(
            input_dataset._variant_tensor,  # pylint: disable=protected-access
            self._map_func.function.captured_inputs,
            f=self._map_func.function,
            use_inter_op_parallelism=self._use_inter_op_parallelism,
            preserve_cardinality=self._preserve_cardinality,
            **self._flat_structure)
        super(TntMapDataset, self).__init__(input_dataset, variant_tensor)