
    BVh                     6    d Z ddlmZ ddlmZ ddlmZ 	 ddZy)z4Experimental API for optimizing `tf.data` pipelines.    )ops)tensor_shape)gen_dataset_opsc                    t        |t              st        d| d      t        |t              st        d| d      t        |t              st        d| d      | j                         }|D cg c]  }t	        j
                  |       }}|D cg c]  }t        j                  |       }}t        j                  ||j                  ||||      S c c}w c c}w )a  Map a function on the list of tensors unpacked from `elems` on dimension 0.

  Args:
    fn: A function (`function.defun`) that takes a list of tensors and returns
      another list of tensors. The output list has the same types as
      output_dtypes. The elements of the output list have the same dimension 0
      as `elems`, and the remaining dimensions correspond to those of
      `fn_output_shapes`.
    elems: A list of tensors.
    output_dtypes: A list of dtypes corresponding to the output types of the
      function.
    output_shapes: A list of `TensorShape`s corresponding to the output shapes
      from each invocation of the function on slices of inputs.
    max_intra_op_parallelism: An integer. If positive, sets the max parallelism
      limit of each function call to this.

  Raises:
    ValueError: if any of the inputs are malformed.

  Returns:
    A list of `Tensor` objects with the same types as `output_dtypes`.
  z+`elems` must be a list of tensors, but was .z>`output_dtypes` must be a list of `tf.DType` objects, but was zD`output_shapes` must be a list of `tf.TensorShape` objects, but was )
isinstancelist
ValueErrorget_concrete_functionr   convert_to_tensorr   TensorShaper   	map_defuncaptured_inputs)fnelemsoutput_dtypesoutput_shapesmax_intra_op_parallelismconcrete_fness           a/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/data/experimental/ops/map_defun.pyr   r      s    6 
E4	 
B5'K
LL	M4	(
   -a1 2 2	M4	(
 ))6q: ; ; ((*+ .3
33  #
3%
38EF1<++A.F-F		"	"5+*E*E#0-#;
= = 4Fs   2CCN)   )__doc__tensorflow.python.frameworkr   r   tensorflow.python.opsr   r        r   <module>r      s    ; + 4 1 ()	+=r   