o
    i eE                     @   s  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  e!dg dZ"edej#ej$Z%edej&ej'ej#ej$Z(d2dej)e% dej)e( de*de+de+f
ddZ,ede-e,Z.dej)e% dej)e( de*de+de+f
ddZ/e!dg dZ0ed ej#ej$Z1ed!ej&ej'ej#ej$Z2d2d"ej)ej$ dej)e1 dej)e2 de*de+de+fd#d$Z3ed%e-e3Z4d"ej)ej$ dej)e1 dej)e2 de*de+de+fd&d'Z5e!d(g dZ6ed)ej#ej$Z7ed*ej&ej'ej#ej$Z8d2d+ej)ej$ dej)e7 d,ej)ej$ dej)e8 de*de+de+fd-d.Z9ed/e-e9Z:d+ej)ej$ dej)e7 d,ej)ej$ dej)e8 de*de+de+fd0d1Z;dS )3zUPython 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DenseCountSparseOutput)output_indicesoutput_valuesoutput_dense_shapeTV_DenseCountSparseOutput_T%TV_DenseCountSparseOutput_output_typevaluesweightsbinary_output	minlength	maxlengthc                 C   s  t j pt  }|j}|jr^zt|d|| |d|d|d|}t|}|W S  tj	y= }	 zt
|	| W Y d}	~	nd}	~	w tjyF   Y nw zt| ||||||dW S  tjy]   Y nw t|d}|du rjd}t|d}|du rvd}t|d}tjd| |||||d\}
}
}}|dd }t rd	|d	d|dd|dd|dd
|d
f
}|j}td||| t|}|S )a  Performs sparse-output bin counting for a tf.tensor input.

    Counts the number of times each value occurs in the input.

  Args:
    values: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      Tensor containing data to count.
    weights: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`.
      A Tensor of the same shape as indices containing per-index weight values. May
      also be the empty tensor if no weights are used.
    binary_output: A `bool`.
      Whether to output the number of occurrences of each value or 1.
    minlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Minimum value to count. Can be set to -1 for no minimum.
    maxlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Maximum value to count. Can be set to -1 for no maximum.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_dense_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `weights`.
    output_dense_shape: A `Tensor` of type `int64`.
  r   r   r   r   Nr   r   r   namectxr   )r   r   r   r   r   r   Toutput_type)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_DenseCountSparseOutputOutput_make_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException(dense_count_sparse_output_eager_fallback_SymbolicException_execute	make_boolmake_int_op_def_library_apply_op_helpermust_record_gradient_get_attr_type_get_attr_int_get_attr_boolinputsrecord_gradient)r   r   r   r   r   r   _ctxtld_resulte__op_outputs_attrs_inputs_flat rB   R/var/www/myenv/lib/python3.10/site-packages/tensorflow/python/ops/gen_count_ops.pydense_count_sparse_output   sf   





rD   zraw_ops.DenseCountSparseOutputc              
   C   s   t |d}|d u rd}t |d}|d u rd}t |d}t | g|tjtjg\}\} t |g|tjtjtjtjg\}\}| |g}	d|d|d|d|d|f
}
t j	dd|	|
||d	}t 
 rgt d
|	|
| t|}|S )Nr   r   r   r   r   r    s   DenseCountSparseOutput   r7   attrsr   r   r   )r.   r/   r0   args_to_matching_eager_dtypesint32int64float32float64r   r3   r8   r%   r&   )r   r   r   r   r   r   r   _attr_T_attr_output_typerA   r@   r;   rB   rB   rC   r,   i   s.   &
r,   RaggedCountSparseOutputTV_RaggedCountSparseOutput_T&TV_RaggedCountSparseOutput_output_typesplitsc                 C   s  t j pt  }|j}|jr`zt|d|| ||d|d|d|}	t|	}	|	W S  tj	y> }
 zt
|
| W Y d}
~
nd}
~
w tjyG   Y nw zt| |||||||dW S  tjy_   Y nw t|d}|du rld}t|d}|du rxd}t|d}tjd| ||||||d\}}}}|dd }	t rd	|d	d|dd|dd|dd
|d
f
}|j}td|||	 t|	}	|	S )a  Performs sparse-output bin counting for a ragged tensor input.

    Counts the number of times each value occurs in the input.

  Args:
    splits: A `Tensor` of type `int64`.
      Tensor containing the row splits of the ragged tensor to count.
    values: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      Tensor containing values of the sparse tensor to count.
    weights: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`.
      A Tensor of the same shape as indices containing per-index weight values.
      May also be the empty tensor if no weights are used.
    binary_output: A `bool`.
      Whether to output the number of occurrences of each value or 1.
    minlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Minimum value to count. Can be set to -1 for no minimum.
    maxlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Maximum value to count. Can be set to -1 for no maximum.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_dense_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `weights`.
    output_dense_shape: A `Tensor` of type `int64`.
  rP   r   r   r   Nr   r   )rS   r   r   r   r   r   r   r   r    )r!   r   r"   r#   r   r$   _RaggedCountSparseOutputOutputr&   r'   r(   r)   r*   r+   )ragged_count_sparse_output_eager_fallbackr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   )rS   r   r   r   r   r   r   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rB   rC   ragged_count_sparse_output   sj   






rV   zraw_ops.RaggedCountSparseOutputc              
   C   s   t |d}|d u rd}t |d}|d u rd}t |d}t |g|tjtjg\}\}t |g|tjtjtjtjg\}	\}t	
| tj} | ||g}
d|d|d|d|d|	f
}t jdd|
|||d	}t  rot d
|
|| t|}|S )Nr   r   r   r   r   r    s   RaggedCountSparseOutputrE   rF   rP   )r.   r/   r0   rH   rI   rJ   rK   rL   rM   r)   convert_to_tensorr   r3   r8   rT   r&   )rS   r   r   r   r   r   r   r   rN   rO   rA   r@   r;   rB   rB   rC   rU      s0   &

rU   SparseCountSparseOutputTV_SparseCountSparseOutput_T&TV_SparseCountSparseOutput_output_typeindicesdense_shapec                 C   s  t j pt  }|j}	|	jrbzt|d|| |||d|d|d|}
t|
}
|
W S  tj	y? } zt
|| W Y d}~nd}~w tjyH   Y nw zt| ||||||||d	W S  tjya   Y nw t|d}|du rnd}t|d}|du rzd}t|d}tjd| |||||||d	\}}}}|dd }
t rd	|d	d|dd|dd|dd
|d
f
}|j}td|||
 t|
}
|
S )a  Performs sparse-output bin counting for a sparse tensor input.

    Counts the number of times each value occurs in the input.

  Args:
    indices: A `Tensor` of type `int64`.
      Tensor containing the indices of the sparse tensor to count.
    values: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      Tensor containing values of the sparse tensor to count.
    dense_shape: A `Tensor` of type `int64`.
      Tensor containing the dense shape of the sparse tensor to count.
    weights: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`.
      A Tensor of the same shape as indices containing per-index weight values.
      May also be the empty tensor if no weights are used.
    binary_output: A `bool`.
      Whether to output the number of occurrences of each value or 1.
    minlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Minimum value to count. Can be set to -1 for no minimum.
    maxlength: An optional `int` that is `>= -1`. Defaults to `-1`.
      Maximum value to count. Can be set to -1 for no maximum.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_dense_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `weights`.
    output_dense_shape: A `Tensor` of type `int64`.
  rX   r   r   r   Nr   r   )r[   r   r\   r   r   r   r   r   r   r    )r!   r   r"   r#   r   r$   _SparseCountSparseOutputOutputr&   r'   r(   r)   r*   r+   )sparse_count_sparse_output_eager_fallbackr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   )r[   r   r\   r   r   r   r   r   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rB   rC   sparse_count_sparse_output   sl   






r_   zraw_ops.SparseCountSparseOutputc	              
   C   s   t |d}|d u rd}t |d}|d u rd}t |d}t |g|tjtjg\}	\}t |g|tjtjtjtjg\}
\}t	
| tj} t	
|tj}| |||g}d|	d|d|d|d|
f
}t jdd||||d	}t  rwt d
||| t|}|S )Nr   r   r   r   r   r    s   SparseCountSparseOutputrE   rF   rX   )r.   r/   r0   rH   rI   rJ   rK   rL   rM   r)   rW   r   r3   r8   r]   r&   )r[   r   r\   r   r   r   r   r   r   rN   rO   rA   r@   r;   rB   rB   rC   r^   E  s2   &
r^   )r   r   N)<__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r!   r   r'   r   r.   tensorflow.python.frameworkr   rI   tensorflow.security.fuzzing.pyr   _atypesr   _op_def_registryr	   r)   r
   r1   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   
namedtupler%   Int32Int64r   Float32Float64r   TensorFuzzingAnnotationboolintrD   	to_raw_opr   r,   rT   rQ   rR   rV   rP   rU   r]   rY   rZ   r_   rX   r^   rB   rB   rB   rC   <module>   sT    ,G*8K6DNF