
    AVh"                     $   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z# ejH                  ejJ                   ed      dde#e!ejL                  f   de'de'de#e!ejP                  f   fd                     Z)  ed       ejT                  e)            Z+e)jX                  jZ                  Z.de#e!ejL                  f   de'de'de#e!ejP                  f   fdZ/y)zUPython wrappers around TensorFlow ops.

This file is MACHINE GENERATED! Do not edit.
    N)
pywrap_tfe)context)core)execute)dtypes)annotation_types)op_def_registry)ops)op_def_library)deprecated_endpoints)dispatch)	tf_export)TypeVarListAny)	Annotatedzio.encode_protosizesmessage_typedescriptor_sourcereturnc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S t        | |||||fd      }|t        ur|S t/        |t0        t2        f      st        d	|z        |D 
cg c]  }
t5        j6                  |
d       }}
t5        j6                  |d      }|d
}t5        j6                  |d      }	 t9        j:                  d| |||||      \  }}}}|dd }t5        j<                         rjd|j?                  d      d|j?                  d      d|j?                  d      d|j?                  d      f}|j@                  }t5        jB                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | |||||fd      }|t        ur|S t        | ||||||      S # t        j                  $ r Y t        t         f$ rL t#        j$                  t&        dt)        | |||||            }|t"        j*                  j,                  ur|cY S  w xY wc c}
w # t        t         f$ rL t#        j$                  t&        dt)        | |||||            }|t"        j*                  j,                  ur|cY S  w xY w)a
  The op serializes protobuf messages provided in the input tensors.

  The types of the tensors in `values` must match the schema for the fields
  specified in `field_names`. All the tensors in `values` must have a common
  shape prefix, *batch_shape*.

  The `sizes` tensor specifies repeat counts for each field.  The repeat count
  (last dimension) of a each tensor in `values` must be greater than or equal
  to corresponding repeat count in `sizes`.

  A `message_type` name must be provided to give context for the field names.
  The actual message descriptor can be looked up either in the linked-in
  descriptor pool or a filename provided by the caller using the
  `descriptor_source` attribute.

  For the most part, the mapping between Proto field types and TensorFlow dtypes
  is straightforward. However, there are a few special cases:

  - A proto field that contains a submessage or group can only be converted
  to `DT_STRING` (the serialized submessage). This is to reduce the complexity
  of the API. The resulting string can be used as input to another instance of
  the decode_proto op.

  - TensorFlow lacks support for unsigned integers. The ops represent uint64
  types as a `DT_INT64` with the same twos-complement bit pattern (the obvious
  way). Unsigned int32 values can be represented exactly by specifying type
  `DT_INT64`, or using twos-complement if the caller specifies `DT_INT32` in
  the `output_types` attribute.

  The `descriptor_source` attribute selects the source of protocol
  descriptors to consult when looking up `message_type`. This may be:

  - An empty string  or "local://", in which case protocol descriptors are
  created for C++ (not Python) proto definitions linked to the binary.

  - A file, in which case protocol descriptors are created from the file,
  which is expected to contain a `FileDescriptorSet` serialized as a string.
  NOTE: You can build a `descriptor_source` file using the `--descriptor_set_out`
  and `--include_imports` options to the protocol compiler `protoc`.

  - A "bytes://<bytes>", in which protocol descriptors are created from `<bytes>`,
  which is expected to be a `FileDescriptorSet` serialized as a string.

  Args:
    sizes: A `Tensor` of type `int32`.
      Tensor of int32 with shape `[batch_shape, len(field_names)]`.
    values: A list of `Tensor` objects.
      List of tensors containing values for the corresponding field.
    field_names: A list of `strings`.
      List of strings containing proto field names.
    message_type: A `string`. Name of the proto message type to decode.
    descriptor_source: An optional `string`. Defaults to `"local://"`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `string`.
  EncodeProtofield_namesr   r   N)r   r   r   namectx )r   valuesr   r   r   r   FExpected list for 'field_names' argument to 'encode_proto' Op, not %r.local://Tinput_types)"_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException_dispatcher_for_encode_protoNotImplementedencode_proto_eager_fallback_SymbolicException	TypeError
ValueError	_dispatchr   encode_protodictOpDispatcherNOT_SUPPORTED
isinstancelisttuple_executemake_str_op_def_library_apply_op_helpermust_record_gradientget_attrinputsrecord_gradient)r   r   r   r   r   r   _ctxtld_resulte_s__op_outputs_attrs_inputs_flats                   Z/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_encode_proto_ops.pyr1   r1      s2   z 
			0h..0$#\\11mT5&-&9;LNg n8 +	\3DdLG n$n	K$	/
	%'2	34 4 ALL"""2}5L+L""<@,"''(9;NO
)::U6{$0):GAq#x QK'""$S\\-8.ll>*,?ll./ll>*,F ::L|VW6('	.I && -
##At,,## 
,&+|5F
g 
	&(
[|-DdD D ## 
z" 
"""dv/:0<5F(,	.g 
	..<<	<
, M Z	  

  
DuV-8.:3D&*	,
G i,,:::n	

sV     F %J5!J G&2GG&%G&*H H J.AJJAK+)K+zraw_ops.EncodeProtoc                 @   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t	        j
                  |d      }|d}t	        j
                  |d      }t	        j                  ||      \  }}t        j                  | t        j                        } | gt        |      z   }	d|d|d|d|f}
t	        j                  dd|	|
||	      }t	        j                         rt	        j                  d
|	|
|       |\  }|S c c}w )Nr   r   r   r   r   r    s   EncodeProto   )r>   attrsr   r   r   )r5   r6   r7   r.   r8   r9   convert_to_mixed_eager_tensorsr'   convert_to_tensor_dtypesint32r   r<   r?   )r   r   r   r   r   r   r   rD   _attr_Tinput_typesrI   rH   rB   s               rJ   r,   r,      s-   	K$	/
	%'2	34 4 ALL"""2}5L+L""<@,"''(9;NO'FFvsSf

 
 
6%4<',;(.:LN&^Q|#)s?'""$|VW6('	.! Ms   D)r   N)0__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r!   r   r%   r   r8   tensorflow.python.frameworkr   rP   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r'   r   r:   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   r0    tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   add_fallback_dispatch_listadd_type_based_api_dispatcherInt32strStringr1   	to_raw_opr   _tf_type_based_dispatcherDispatchr*   r,   r       rJ   <module>ri      sg  
  6 7 1 7 9 F K 3 I C 8 6 % % '
%%
((
F	#w}}"45 FZ] Fqt F  PY  Z]  _f  _m  _m  Zm  Pn F  ) &FP /i-.~t~~l/KL+EENN ygmm1C'D il   BE   U^  _b  dk  dr  dr  _r  Us rh   