
    AVh"/                    J*   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# dde#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   de&de&de#e!ejJ                  f   fdZ'  ed       ejP                  e'            Z)de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   de&de&de#e!ejJ                  f   fdZ*dde#e e!   ejJ                  f   de#e e!   ejJ                  f   fdZ+  ed       ejP                  e+            Z,de#e e!   ejJ                  f   de#e e!   ejJ                  f   fdZ- ej\                  d g d!      Z/dd"e#e!ejH                  f   d#e#e!ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&d)e0fd*Z1  ed+       ejP                  e1            Z2d"e#e!ejH                  f   d#e#e!ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&d)e0fd,Z3 ej\                  d-g d.      Z4dd"e#e!ejH                  f   d/e#e e!   ejJ                  f   d0e#e!ejj                  f   d1e#e!ejH                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&fd2Z6  ed3       ejP                  e6            Z7d"e#e!ejH                  f   d/e#e e!   ejJ                  f   d0e#e!ejj                  f   d1e#e!ejH                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&fd4Z8 ej\                  d5g d6      Z9dd"e#e!ejH                  f   d7e#e e!   ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   de&fd8Z:  ed9       ejP                  e:            Z;d"e#e!ejH                  f   d7e#e e!   ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   de&fd:Z<dd;e#e!ejz                  f   d<e#e!ejJ                  f   d=e#e!ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   de#e!ej|                  f   fd>Z?  ed?       ejP                  e?            Z@d;e#e!ejz                  f   d<e#e!ejJ                  f   d=e#e!ejJ                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   de#e!ej|                  f   fd@ZAdd;e#e!ejz                  f   dAe#e!ej                  f   dBe#e!ejj                  f   fdCZC  edD       ejP                  eC            ZDd;e#e!ejz                  f   dAe#e!ej                  f   dBe#e!ejj                  f   fdEZEddFe#e!ejz                  f   dGe#e!ejJ                  f   dHe#e!ej                  f   dIe&fdJZF  edK       ejP                  eF            ZGdFe#e!ejz                  f   dGe#e!ejJ                  f   dHe#e!ej                  f   dIe&fdLZHdd;e#e!ejz                  f   dAe#e!ej                  f   dBe#e!ejj                  f   fdMZI  edN       ejP                  eI            ZJd;e#e!ejz                  f   dAe#e!ej                  f   dBe#e!ejj                  f   fdOZKddPe0dQe0de#e!ejz                  f   fdRZL  edS       ejP                  eL            ZMdPe0dQe0de#e!ejz                  f   fdTZNdd;e#e!ejz                  f   dUe#e e!   ejH                  f   d(e&de#e!ejj                  f   fdVZO  edW       ejP                  eO            ZPd;e#e!ejz                  f   dUe#e e!   ejH                  f   d(e&de#e!ejj                  f   fdXZQddFe#e!ejz                  f   dYe&fdZZR  ed[       ejP                  eR            ZSdFe#e!ejz                  f   dYe&fd\ZT ej\                  d]g d^      ZUdd;e#e!ejz                  f   fd_ZV  ed`       ejP                  eV            ZWd;e#e!ejz                  f   fdaZXdde#e e!   ejJ                  f   dbe#e!ejJ                  f   dGe#e!ejJ                  f   fdcZY  edd       ejP                  eY            ZZde#e e!   ejJ                  f   dbe#e!ejJ                  f   dGe#e!ejJ                  f   fdeZ[dde#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   dfe#e e!   ejH                  f   de&de&de#e!ejJ                  f   fdgZ\  edh       ejP                  e\            Z]de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   dfe#e e!   ejH                  f   de&de&de#e!ejJ                  f   fdiZ^dd;e#e!ejz                  f   dUe#e e!   ejH                  f   d(e&de#e!ejJ                  f   fdjZ_  edk       ejP                  e_            Z`d;e#e!ejz                  f   dUe#e e!   ejH                  f   d(e&de#e!ejJ                  f   fdlZaddFe#e!ejz                  f   dme#e e!   ejJ                  f   fdnZb  edo       ejP                  eb            ZcdFe#e!ejz                  f   dme#e e!   ejJ                  f   fdpZdddFe#e!ejz                  f   de#e e!   ejJ                  f   fdqZe  edr       ejP                  ee            ZfdFe#e!ejz                  f   de#e e!   ejJ                  f   fdsZgddFe#e!ejz                  f   de#e!ej                  f   dtehfduZi  edv       ejP                  ei            ZjdFe#e!ejz                  f   de#e!ej                  f   dtehfdwZkddFe#e!ejz                  f   dYe&fdxZl  edy       ejP                  el            ZmdFe#e!ejz                  f   dYe&fdzZnddPe0dQe0de#e!ejz                  f   fd{Zo  ed|       ejP                  eo            ZpdPe0dQe0de#e!ejz                  f   fd}Zq ej\                  d~dAdBg      Zrdd;e#e!ejz                  f   fdZs  ed       ejP                  es            Ztd;e#e!ejz                  f   fdZu ej\                  dg d      Zvdde#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   de#e!ejH                  f   de#e!ejH                  f   de&de&fdZw  ed       ejP                  ew            Zxde#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   de#e!ejH                  f   de#e!ejH                  f   de&de&fdZy ej\                  dg d!      Zzdd"e#e!ejH                  f   de#e!ejH                  f   de#e!ejJ                  f   de#e!ejH                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&d)e0fdZ{  ed       ejP                  e{            Z|d"e#e!ejH                  f   de#e!ejH                  f   de#e!ejJ                  f   de#e!ejH                  f   d$e#e!ejJ                  f   d%e#e!ejJ                  f   d&e#e!ejJ                  f   d'e#e!ejJ                  f   d(e&d)e0fdZ} ej\                  dg d      Z~dd;e#e!ejz                  f   de#e!ejH                  f   de#e!ejH                  f   dUe#e e!   ejH                  f   d(e&f
dZ  ed       ejP                  e            Zd;e#e!ejz                  f   de#e!ejH                  f   de#e!ejH                  f   dUe#e e!   ejH                  f   d(e&f
dZdd;e#e!ejz                  f   de#e!ejH                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejJ                  f   de#e!ejH                  f   de#e!ejJ                  f   de&fdZ  ed       ejP                  e            Zd;e#e!ejz                  f   de#e!ejH                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejJ                  f   de#e!ejH                  f   de#e!ejJ                  f   de&fdZdd;e#e!ejz                  f   de#e e!   ejH                  f   de#e e!   ejH                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejJ                  f   d0e#e e!   ejj                  f   de#e!ejH                  f   de#e!ejJ                  f   de#e!ejH                  f   d(e&fdZ  ed       ejP                  e            Zd;e#e!ejz                  f   de#e e!   ejH                  f   de#e e!   ejH                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejH                  f   de#e e!   ejJ                  f   de#e e!   ejJ                  f   d0e#e e!   ejj                  f   de#e!ejH                  f   de#e!ejJ                  f   de#e!ejH                  f   d(e&fdZdd;e#e!ejz                  f   de#e!ej|                  f   fdZ  ed       ejP                  e            Zd;e#e!ejz                  f   de#e!ej|                  f   fdZddFe#e!ejz                  f   de#e!ej|                  f   fdZ  ed       ejP                  e            ZdFe#e!ejz                  f   de#e!ej|                  f   fdZy)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)	Annotatednode_ids	gradientshessiansfeature
max_splitsnum_bucketsreturnc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |||d|d|      }	|	S t        j                  |d      }t        j                  |d      }t        j                   d| ||||||      \  }}}}|dd }	t        j"                         rHd|j%                  d      d|j%                  d      f}|j&                  }t        j(                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y )w xY w)a
  Aggregates the summary of accumulated stats for the batch.

  The summary stats contains gradients and hessians accumulated for each node, feature dimension id and bucket.

  Args:
    node_ids: A `Tensor` of type `int32`.
      int32; Rank 1 Tensor containing node ids for each example, shape [batch_size].
    gradients: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example.
    hessians: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[batch_size, hessian_dimension]) with hessians for each example.
    feature: A `Tensor` of type `int32`.
      int32; Rank 2 feature Tensors (shape=[batch_size, feature_dimension]).
    max_splits: An `int` that is `>= 1`.
      int; the maximum number of splits possible in the whole tree.
    num_buckets: An `int` that is `>= 1`.
      int; equals to the maximum possible value of bucketized feature.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  BoostedTreesAggregateStatsr   r   Nr   r   namectx)r   r   r   r   r   r   r   )_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException,boosted_trees_aggregate_stats_eager_fallback_SymbolicException_executemake_int_op_def_library_apply_op_helpermust_record_gradient_get_attr_intinputsrecord_gradient)r   r   r   r   r   r   r   _ctxtld_resulte__op_outputs_attrs_inputs_flats                   [/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_boosted_trees_ops.pyboosted_trees_aggregate_statsr<      s   . 
			0h..0$#\\	11*D(I'<]g n   \:*!!+}=+'88$x9/71;2=D	J!QX
 QK'""$C--l;].0F::L$lFGE('	.5 && -
##At,,## 
9
IxZ!$8 8 ## 
s0     D E)EEE!E4 4F
Fz"raw_ops.BoostedTreesAggregateStatsc                 ,   t        j                  |d      }t        j                  |d      }t        j                  | t        j
                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j
                        }| |||g}d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )Nr   r   s   BoostedTreesAggregateStats   r0   attrsr   r   r   )
r*   r+   r%   convert_to_tensor_dtypesint32float32r   r.   r1   )r   r   r   r   r   r   r   r   r:   r9   r4   s              r;   r(   r(   X   s      \:*!!+}=+##Hgmm<($$Y@)##Hgoo>(""7GMM:'Ix9,*m[A&:A$0C"&(' ""$$lFGE('	.    float_valuesbucket_boundariesc                 r   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t'        j(                  d| ||      \  }}}	}
|
dd }t+        j,                         r7d|	j/                  d      f}|	j0                  }t+        j2                  d|||       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y Zw xY w)	a  Bucketize each feature based on bucket boundaries.

  An op that returns a list of float tensors, where each tensor represents the
  bucketized values for a single feature.

  Args:
    float_values: A list of `Tensor` objects with type `float32`.
      float; List of Rank 1 Tensor each containing float values for a single feature.
    bucket_boundaries: A list with the same length as `float_values` of `Tensor` objects with type `float32`.
      float; List of Rank 1 Tensors each containing the bucket boundaries for a single
      feature.
    name: A name for the operation (optional).

  Returns:
    A list with the same length as `float_values` of `Tensor` objects with type `int32`.
  BoostedTreesBucketizeNr   r   RExpected list for 'float_values' argument to 'boosted_trees_bucketize' Op, not %r.WExpected list for 'bucket_boundaries' argument to 'boosted_trees_bucketize' Op, not %r.List argument 'bucket_boundaries' to 'boosted_trees_bucketize' Op with length %d must match length %d of argument 'float_values'.)rF   rG   r   num_features)r   r   r    r!   r   r"   r#   r$   r%   r&   r'   &boosted_trees_bucketize_eager_fallbackr)   
isinstancelisttuple	TypeErrorlen
ValueErrorr,   r-   r*   r.   r/   r0   r1   )rF   rG   r   r2   r3   r4   r5   _attr_num_featuresr6   r7   r8   r9   r:   s                r;   boosted_trees_bucketizerW   k   s   " 
			0h..0$#\\11%t\;LNgn 
L4-	0
	02>	?@ @ <(	%e}	5
	02C	DE E 		11
	;		!34	56 6 (88l3D&*,!QX QK'""$c//?@F::Lvw@	.E && -
##At,,## 
3
)$@ @## 
s0    E FE33FFF F65F6zraw_ops.BoostedTreesBucketizec                 N   t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        j                  | t        j                        } t        j                  |t        j                        }t        |       t        |      z   }d|f}t        j                  d|||||      }t        j                         rt        j                  d|||       |S )NrK   rL   rM   rN   s   BoostedTreesBucketizer?   rI   )rP   rQ   rR   rS   rT   rU   r%   convert_n_to_tensorrB   rD   r*   r   r.   r1   )rF   rG   r   r   rV   r:   r9   r4   s           r;   rO   rO      s7   	L4-	0
	02>	?@ @ <(	%e}	5
	02C	DE E 		11
	;		!34	56 6 )),H,../@'//Rl#d+<&==,./&57I$0C"&(' ""$vw@	.rE   %BoostedTreesCalculateBestFeatureSplit)r   gainsfeature_dimensions
thresholdsleft_node_contribsright_node_contribssplit_with_default_directionsnode_id_rangestats_summaryl1l2tree_complexitymin_node_weightlogits_dimension
split_typec	                 |   t         j                   xs t        j                         }	|	j                  }
|
j                  r9	 t	        j
                  |	d|| |||||d|d|      }t        j                  |      }|S t        j                   |d      }|d}t        j"                  |d      }t%        j&                  d| ||||||||
      \  }}}}|dd }t        j(                         rHd|j+                  d      d|j-                  d      f}|j.                  }t        j0                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y Bw xY w)ar  Calculates gains for each feature and returns the best possible split information for the feature.

  The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature.

  It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split.

  In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features).

  The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature.

  Args:
    node_id_range: A `Tensor` of type `int32`.
      A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive).
    stats_summary: A `Tensor` of type `float32`.
      A Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature.
      The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used.
    l1: A `Tensor` of type `float32`.
      l1 regularization factor on leaf weights, per instance based.
    l2: A `Tensor` of type `float32`.
      l2 regularization factor on leaf weights, per instance based.
    tree_complexity: A `Tensor` of type `float32`.
      adjustment to the gain, per leaf based.
    min_node_weight: A `Tensor` of type `float32`.
      minimum avg of hessians in a node before required for the node to be considered for splitting.
    logits_dimension: An `int` that is `>= 1`.
      The dimension of logit, i.e., number of classes.
    split_type: An optional `string` from: `"inequality", "equality"`. Defaults to `"inequality"`.
      A string indicating if this Op should perform inequality split or equality split.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (node_ids, gains, feature_dimensions, thresholds, left_node_contribs, right_node_contribs, split_with_default_directions).

    node_ids: A `Tensor` of type `int32`.
    gains: A `Tensor` of type `float32`.
    feature_dimensions: A `Tensor` of type `int32`.
    thresholds: A `Tensor` of type `int32`.
    left_node_contribs: A `Tensor` of type `float32`.
    right_node_contribs: A `Tensor` of type `float32`.
    split_with_default_directions: A `Tensor` of type `string`.
  rZ   rg   rh   Nrg   rh   r   r   
inequality)	ra   rb   rc   rd   re   rf   rg   rh   r   )r   r   r    r!   r   r"   ,_BoostedTreesCalculateBestFeatureSplitOutput_maker#   r$   r%   r&   r'   9boosted_trees_calculate_best_feature_split_eager_fallbackr)   r*   r+   make_strr,   r-   r.   r/   get_attrr0   r1   )ra   rb   rc   rd   re   rf   rg   rh   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s                     r;   *boosted_trees_calculate_best_feature_splitrq      s   T 
			0h..0$#\\
115t]r2,lJHg =BB7Kgn &&'79KLJ  \:*'88/}?L462APAPBR<F6:<!QX QK'""$ #"3"34F"GCLL68F::L/vwP8>>wG'	.C && -
##At,,## 
F
B
,<d6 6 ## 
s0    7E FE22F
FF$ $F;:F;z-raw_ops.BoostedTreesCalculateBestFeatureSplitc
                    t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| |||||g}
d|d|f}t        j                  dd|
||	|      }t        j                         rt        j                  d|
||       t        j                  |      }|S )Nrg   rk   rh   s%   BoostedTreesCalculateBestFeatureSplit   r?   rZ   )r*   r+   ro   r%   rA   rB   rC   rD   r   r.   r1   rl   rm   )ra   rb   rc   rd   re   rf   rg   rh   r   r   r:   r9   r4   s                r;   rn   rn   $  s3   &&'79KLJ  \:*((F-((H-b'//2"b'//2"**?GOOL/**?GOOL/BY, 0,
K&Eq$0C"&(' ""$/vwP8>>wG'	.rE   'BoostedTreesCalculateBestFeatureSplitV2)r   r[   feature_idsr\   r]   r^   r_   r`   stats_summaries_listsplit_typescandidate_feature_idsc
                    t         j                   xs t        j                         }
|
j                  }|j                  r9	 t	        j
                  |
d|	| |||||||d|      }t        j                  |      }|S t        |t         t"        f      st%        d|z        t'        |      }t)        j*                  |d      }t-        j.                  d| |||||||||	      \  }}}}|dd }t)        j0                         rHd|j3                  d      d|j3                  d      f}|j4                  }t)        j6                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||	       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
      S # t        j                  $ r Y Yw xY w)a  Calculates gains for each feature and returns the best possible split information for each node. However, if no split is found, then no split information is returned for that node.

  The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature.

  It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split.

  In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features).

  The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature.

  Args:
    node_id_range: A `Tensor` of type `int32`.
      A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive).
    stats_summaries_list: A list of at least 1 `Tensor` objects with type `float32`.
      A list of Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature.
      The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used.
    split_types: A `Tensor` of type `string`.
      A Rank 1 tensor indicating if this Op should perform inequality split or equality split per feature.
    candidate_feature_ids: A `Tensor` of type `int32`.
      Rank 1 tensor with ids for each feature. This is the real id of the feature.
    l1: A `Tensor` of type `float32`.
      l1 regularization factor on leaf weights, per instance based.
    l2: A `Tensor` of type `float32`.
      l2 regularization factor on leaf weights, per instance based.
    tree_complexity: A `Tensor` of type `float32`.
      adjustment to the gain, per leaf based.
    min_node_weight: A `Tensor` of type `float32`.
      minimum avg of hessians in a node before required for the node to be considered for splitting.
    logits_dimension: An `int` that is `>= 1`.
      The dimension of logit, i.e., number of classes.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (node_ids, gains, feature_ids, feature_dimensions, thresholds, left_node_contribs, right_node_contribs, split_with_default_directions).

    node_ids: A `Tensor` of type `int32`.
    gains: A `Tensor` of type `float32`.
    feature_ids: A `Tensor` of type `int32`.
    feature_dimensions: A `Tensor` of type `int32`.
    thresholds: A `Tensor` of type `int32`.
    left_node_contribs: A `Tensor` of type `float32`.
    right_node_contribs: A `Tensor` of type `float32`.
    split_with_default_directions: A `Tensor` of type `string`.
  rt   rg   Nrg   r   r   pExpected list for 'stats_summaries_list' argument to 'boosted_trees_calculate_best_feature_split_v2' Op, not %r.)
ra   rv   rw   rx   rc   rd   re   rf   rg   r   rN   )r   r   r    r!   r   r"   ._BoostedTreesCalculateBestFeatureSplitV2Outputrm   r#   r$   r%   r&   r'   <boosted_trees_calculate_best_feature_split_v2_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   )ra   rv   rw   rx   rc   rd   re   rf   rg   r   r2   r3   r4   r5   rV   r6   r7   r8   r9   r:   s                       r;   -boosted_trees_calculate_best_feature_split_v2r~   ?  s   Z 
			0h..0$#\\117}k+@"b*<	g
 ?DDWMgn 
(4-	8
	FH\	]^ ^ /0&&'79KL'881H\?JI^68RCRCRDT8<	>!QX QK'""$c//? #"3"34F"GIF::L1<R:@@I'	.I && -
##At,,## 
I
-{
R/+$DB B ## 
s0    7E F!-FF! F!%F; ;GGz/raw_ops.BoostedTreesCalculateBestFeatureSplitV2c                    t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| gt        |      z   ||||||gz   }d|d|f}t        j                  dd|||
|	      }t        j                         rt        j                   d|||       t"        j%                  |      }|S )Nr{   rg   rN   s'   BoostedTreesCalculateBestFeatureSplitV2   r?   rt   )rP   rQ   rR   rS   rT   r*   r+   r%   rA   rB   rC   rY   rD   stringr   r.   r1   r|   rm   )ra   rv   rw   rx   rc   rd   re   rf   rg   r   r   rV   r:   r9   r4   s                  r;   r}   r}     s   	(4-	8
	FH\	]^ ^ /0&&'79KL((F-112FX&&{GNNC+001FVb'//2"b'//2"**?GOOL/**?GOOL/4(<#==Ncegikm|  N  AO  O,.0B&G$0C"&(' ""$1<R:@@I'	.rE   (BoostedTreesCalculateBestGainsPerFeature)node_ids_list
gains_listthresholds_listleft_node_contribs_listright_node_contribs_liststats_summary_listc                 ^   t         j                   xs t        j                         }|j                  }	|	j                  r7	 t	        j
                  |d|| |||||d|      }
t        j                  |
      }
|
S t        |t         t"        f      st%        d|z        t'        |      }t)        j*                  |d      }t-        j.                  d| |||||||	      \  }}}}|dd }
t)        j0                         rHd|j3                  d      d|j3                  d      f}|j4                  }t)        j6                  d|||
       |
d| g|
|d z   }
|
dd |
dd|z    gz   |
d|z   d z   }
|
dd	 |
d	d	|z    gz   |
d	|z   d z   }
|
dd
 |
d
d
|z    gz   |
d
|z   d z   }
|
dd |
dd gz   }
t        j                  |
      }
|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||||||	      S # t        j                  $ r Y w xY w)a  Calculates gains for each feature and returns the best possible split information for the feature.

  The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature.

  It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split.

  In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features).

  The length of output lists are all of the same length, `num_features`.
  The output shapes are compatible in a way that the first dimension of all tensors of all lists are the same and equal to the number of possible split nodes for each feature.

  Args:
    node_id_range: A `Tensor` of type `int32`.
      A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive).
    stats_summary_list: A list of at least 1 `Tensor` objects with type `float32`.
      A list of Rank 3 tensor (#shape=[max_splits, bucket, 2]) for accumulated stats summary (gradient/hessian) per node per buckets for each feature. The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used.
    l1: A `Tensor` of type `float32`.
      l1 regularization factor on leaf weights, per instance based.
    l2: A `Tensor` of type `float32`.
      l2 regularization factor on leaf weights, per instance based.
    tree_complexity: A `Tensor` of type `float32`.
      adjustment to the gain, per leaf based.
    min_node_weight: A `Tensor` of type `float32`.
      minimum avg of hessians in a node before required for the node to be considered for splitting.
    max_splits: An `int` that is `>= 1`.
      the number of nodes that can be split in the whole tree. Used as a dimension of output tensors.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (node_ids_list, gains_list, thresholds_list, left_node_contribs_list, right_node_contribs_list).

    node_ids_list: A list with the same length as `stats_summary_list` of `Tensor` objects with type `int32`.
    gains_list: A list with the same length as `stats_summary_list` of `Tensor` objects with type `float32`.
    thresholds_list: A list with the same length as `stats_summary_list` of `Tensor` objects with type `int32`.
    left_node_contribs_list: A list with the same length as `stats_summary_list` of `Tensor` objects with type `float32`.
    right_node_contribs_list: A list with the same length as `stats_summary_list` of `Tensor` objects with type `float32`.
  r   r   N)r   r   r   oExpected list for 'stats_summary_list' argument to 'boosted_trees_calculate_best_gains_per_feature' Op, not %r.)ra   r   rc   rd   re   rf   r   r   rN   r>            )r   r   r    r!   r   r"   /_BoostedTreesCalculateBestGainsPerFeatureOutputrm   r#   r$   r%   r&   r'   =boosted_trees_calculate_best_gains_per_feature_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   )ra   r   rc   rd   re   rf   r   r   r2   r3   r4   r5   rV   r6   r7   r8   r9   r:   s                     r;   .boosted_trees_calculate_best_gains_per_featurer     s   L 
			0h..0$#\\
118$BO_j"g @EEgNgn 
&u	6
	GI[	\] ] -.  \:*'882-GY79bDSDS?I9=?!QX QK'""$C--l;^/1F::L2L&'S(()*W5G5H-II'BQK71Q);%;<==L^H^H_@``'BQK71Q);%;<==L^H^H_@``'BQK71Q);%;<==L^H^H_@``'BQK712;-'';AA'J'	.M && -
##At,,## 
J
+R_
jtG G ## 
s0    5F6 6G=	G$$G=<G=H H,+H,z0raw_ops.BoostedTreesCalculateBestGainsPerFeaturec	                    t        |t        t        f      st        d|z        t	        |      }	t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| gt        |      z   ||||gz   }
d|d|	f}t        j                  d|	|	z   |	z   |	z   |	z   |
|||      }t        j                         rt        j                  d|
||       |d |	 g||	d  z   }|d d |dd|	z    gz   |d|	z   d  z   }|d d |dd|	z    gz   |d|	z   d  z   }|d d	 |d	d	|	z    gz   |d	|	z   d  z   }|d d
 |d
d  gz   }t         j#                  |      }|S )Nr   r   rN   s(   BoostedTreesCalculateBestGainsPerFeaturer?   r   r>   r   r   r   )rP   rQ   rR   rS   rT   r*   r+   r%   rA   rB   rC   rY   rD   r   r.   r1   r   rm   )ra   r   rc   rd   re   rf   r   r   r   rV   r:   r9   r4   s                r;   r   r     sO   	&u	6
	GI[	\] ] -.  \:*((F-//0BGOOTb'//2"b'//2"**?GOOL/**?GOOL/4(:#;;r2Xg>hh,*n6HI&H/2DD/02DE/08D#)s	?'
 ""$2L&'S(()*W5G5H-II'BQK71Q);%;<==L^H^H_@``'BQK71Q);%;<==L^H^H_@``'BQK71Q);%;<==L^H^H_@``'BQK712;-'';AA'J'	.rE   tree_ensemble_handlemean_gradientsmean_hessiansc           
      t   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||||      }|S t        j                  d| |||||      \  }
}
}}|dd }t        j                          r&d}|j"                  }t        j$                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y w xY w)aE  Calculates the prior from the training data (the bias) and fills in the first node with the logits' prior. Returns a boolean indicating whether to continue centering.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble.
    mean_gradients: A `Tensor` of type `float32`.
      A tensor with shape=[logits_dimension] with mean of gradients for a first node.
    mean_hessians: A `Tensor` of type `float32`.
      A tensor with shape=[logits_dimension] mean of hessians for a first node.
    l1: A `Tensor` of type `float32`.
      l1 regularization factor on leaf weights, per instance based.
    l2: A `Tensor` of type `float32`.
      l2 regularization factor on leaf weights, per instance based.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  BoostedTreesCenterBiasNrJ   )r   r   r   rc   rd   r    )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   (boosted_trees_center_bias_eager_fallbackr)   r,   r-   r*   r.   r0   r1   )r   r   r   rc   rd   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s                  r;   boosted_trees_center_biasr   ;  sN   & 
			0h..0$#\\11&.Br2/g n (88 7K1?0="'+	-!QX
 QK'""$F::L ,A('	./ && -
##At,,## 
5
r2  ## 
s0    C DC22D
DD! !D76D7zraw_ops.BoostedTreesCenterBiasc                    t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| ||||g}d }t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Ns   BoostedTreesCenterBiasr>   r?   r   )	r%   rA   rB   resourcerD   r*   r   r.   r1   )
r   r   r   rc   rd   r   r   r:   r9   r4   s
             r;   r   r   r  s    //0DgFVFVW)).'//J.((H-b'//2"b'//2"&r2N,&6$0C"&(' ""$ ,A('	.rE   stamp_tokentree_ensemble_serializedc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        j                  d| |||      \  }}}	}
|	S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Creates a tree ensemble model and returns a handle to it.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble resource to be created.
    stamp_token: A `Tensor` of type `int64`.
      Token to use as the initial value of the resource stamp.
    tree_ensemble_serialized: A `Tensor` of type `string`.
      Serialized proto of the tree ensemble.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  BoostedTreesCreateEnsembleNrJ   r   r   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   ,boosted_trees_create_ensemble_eager_fallbackr)   r,   r-   r   r   r   r   r2   r3   r4   r5   r6   r7   r8   s              r;   boosted_trees_create_ensembler     s    
			0h..0$#\\11*D2F-/g n (88$;O2=?W+/	1!QX
 
*! && -
##At,,## 
9
-E  ## 
0    A= =CB++CCC C.-C.z"raw_ops.BoostedTreesCreateEnsemblec                 &   t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j
                        }| ||g}d }t        j                  dd||||      }d }|S )Ns   BoostedTreesCreateEnsembler   r?   r%   rA   rB   r   int64r   r*   r   r   r   r   r   r   r:   r9   r4   s           r;   r   r     s    //0DgFVFVW&&{GMMB+!334Lgnn]&5MN,&:A$0C"&(' '	.rE   quantile_stream_resource_handleepsilonnum_streamsmax_elementsc           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||d|      }|S |d}t        j                  |d      }t        j                   d| ||||      \  }	}	}
}|
S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||      S # t        j                  $ r Y w xY w)a  Create the Resource for Quantile Streams.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource; Handle to quantile stream resource.
    epsilon: A `Tensor` of type `float32`.
      float; The required approximation error of the stream resource.
    num_streams: A `Tensor` of type `int64`.
      int; The number of streams managed by the resource that shares the same epsilon.
    max_elements: An optional `int`. Defaults to `1099511627776`.
      int; The maximum number of data points that can be fed to the stream.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  (BoostedTreesCreateQuantileStreamResourcer   N)r   r   r           )r   r   r   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   <boosted_trees_create_quantile_stream_resource_eager_fallbackr)   r*   r+   r,   r-   )r   r   r   r   r   r2   r3   r4   r5   r6   r7   r8   s               r;   -boosted_trees_create_quantile_stream_resourcer     s&   " 
			0h..0$#\\	118$'+~g n  L""<@,'882Ts<C@KAM9=?!QX 
*) && -
##At,,## 
I
)7K#$D: : ## 
s0    B C!-CC! C!%C6 6DDz0raw_ops.BoostedTreesCreateQuantileStreamResourcec                 ^   |d}t        j                  |d      }t        j                  | t        j
                        } t        j                  |t        j                        }t        j                  |t        j                        }| ||g}d|f}t        j                  dd||||      }d }|S )Nr   r   s(   BoostedTreesCreateQuantileStreamResourcer   r?   )	r*   r+   r%   rA   rB   r   rD   r   r   )	r   r   r   r   r   r   r:   r9   r4   s	            r;   r   r     s     L""<@,$($:$:;Z\c\l\l$m!""7GOO<'&&{GMMB+17KH,L)&H!$0C"&(' '	.rE   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        j                  d| |||      \  }}}	}
|	S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Deserializes a serialized tree ensemble config and replaces current tree

  ensemble.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble.
    stamp_token: A `Tensor` of type `int64`.
      Token to use as the new value of the resource stamp.
    tree_ensemble_serialized: A `Tensor` of type `string`.
      Serialized proto of the ensemble.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  BoostedTreesDeserializeEnsembleNrJ   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   1boosted_trees_deserialize_ensemble_eager_fallbackr)   r,   r-   r   s              r;   "boosted_trees_deserialize_ensembler     s   " 
			0h..0$#\\11/7K-/g n (88)@T7BD\04	6!QX
 
*! && -
##At,,## 
>
-E  ## 
r   z'raw_ops.BoostedTreesDeserializeEnsemblec                 &   t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j
                        }| ||g}d }t        j                  dd||||      }d }|S )Ns   BoostedTreesDeserializeEnsembler   r?   r   r   s           r;   r   r   +  s    //0DgFVFVW&&{GMMB+!334Lgnn]&5MN,&?$0C"&(' '	.rE   	containershared_namec           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d| d|      }|S | d} t        j                  | d      } |d}t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }t        j"                         rHd|j%                  d      d|j%                  d      f}
|j&                  }t        j(                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y )w xY w)a  Creates a handle to a BoostedTreesEnsembleResource

  Args:
    container: An optional `string`. Defaults to `""`.
    shared_name: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `resource`.
  $BoostedTreesEnsembleResourceHandleOpr   r   Nr   r   r   r    r   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   8boosted_trees_ensemble_resource_handle_op_eager_fallbackr)   r*   ro   r,   r-   r.   rp   r0   r1   r   r   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s               r;   )boosted_trees_ensemble_resource_handle_opr   8  s    
			0h..0$#\\114dK=+/g n I	;7)K!!+}=+'88.)<G59;!QX QK'""$3<<4mll=)+F::L.fgO('	.9 && -
##At,,## 
E;TtM M## 
0    D E)EEE!E0 0FFz,raw_ops.BoostedTreesEnsembleResourceHandleOpc                    | d} t        j                  | d      } |d}t        j                  |d      }g }d| d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   r   r   s$   BoostedTreesEnsembleResourceHandleOpr>   r?   r   r*   ro   r   r.   r1   r   r   r   r   r:   r9   r4   s          r;   r   r   l  s    I	;7)K!!+}=+,M;?&Da$0C"&(' ""$.fgO('	.rE   bucketized_featuresc           	      :   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S t        |t        t        f      st!        d|z        t#        |      }t%        j&                  |d      }t)        j*                  d| |||      \  }	}	}
}|dd }t%        j,                         rHd|
j/                  d      d|
j/                  d      f}|
j0                  }t%        j2                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y <w xY w)a  Debugging/model interpretability outputs for each example.

  It traverses all the trees and computes debug metrics for individual examples,
  such as getting split feature ids and logits after each split along the decision
  path used to compute directional feature contributions.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
    bucketized_features: A list of at least 1 `Tensor` objects with type `int32`.
      A list of rank 1 Tensors containing bucket id for each
      feature.
    logits_dimension: An `int`.
      scalar, dimension of the logits, to be used for constructing the protos in
      examples_debug_outputs_serialized.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `string`.
  BoostedTreesExampleDebugOutputsrg   Nrz   eExpected list for 'bucketized_features' argument to 'boosted_trees_example_debug_outputs' Op, not %r.r   r   rg   r   num_bucketized_features)r   r   r    r!   r   r"   r#   r$   r%   r&   r'   2boosted_trees_example_debug_outputs_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   r   r   rg   r   r2   r3   r4   r5   _attr_num_bucketized_featuresr6   r7   r8   r9   r:   s                 r;   #boosted_trees_example_debug_outputsr     s   ( 
			0h..0$#\\11/7K/1ACg n 
'$	7
	<>Q	RS S #&&9":&&'79KL'88)@T?R<L04	6!QX
 QK'""$' 9: #"3"34F"GIF ::L)<J('	.? && -
##At,,## 
?
 3+$DB B ## 
0    D( (E/;EE/.E/3F FFz'raw_ops.BoostedTreesExampleDebugOutputsc                    t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }| gt        |      z   }d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   rg   r   s   BoostedTreesExampleDebugOutputsr>   r?   r   rP   rQ   rR   rS   rT   r*   r+   r%   rA   rB   r   rY   rC   r   r.   r1   	r   r   rg   r   r   r   r:   r9   r4   s	            r;   r   r     s    	'$	7
	<>Q	RS S #&&9":&&'79KL//0DgFVFVW001DgmmT&'$/B*CC,%'D&(&?$0C"&(' ""$)<J('	.rE   rN   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }|s|S t        j"                         r7d|j%                  d      f}
|j&                  }t        j(                  d||
|       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)a:  Flush the quantile summaries from each quantile stream resource.

  An op that outputs a list of quantile summaries of a quantile stream resource.
  Each summary Tensor is rank 2, containing summaries (value, weight, min_rank,
  max_rank) for a single feature.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource handle referring to a QuantileStreamResource.
    num_features: An `int` that is `>= 0`.
    name: A name for the operation (optional).

  Returns:
    A list of `num_features` `Tensor` objects with type `float32`.
  "BoostedTreesFlushQuantileSummariesrN   NrN   r   r   r   rN   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   5boosted_trees_flush_quantile_summaries_eager_fallbackr)   r*   r+   r,   r-   r.   r/   r0   r1   r   rN   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s               r;   &boosted_trees_flush_quantile_summariesr     s`     
			0h..0$#\\112D'Gg n ""<@,'88,Nm;G379!QX QK'	J""$c//?@F::L,lFGM	.1 && -
##At,,## 
B
)  ## 
0    C& &D-9DD-,D-1E   EEz*raw_ops.BoostedTreesFlushQuantileSummariesc                    t        j                  |d      }t        j                  | t        j
                        } | g}d|f}t        j                  d|||||      }t        j                         rt        j                  d|||       |S )NrN   s"   BoostedTreesFlushQuantileSummariesr?   r   	r*   r+   r%   rA   rB   r   r   r.   r1   r   rN   r   r   r:   r9   r4   s          r;   r   r   
  s    ""<@,$($:$:;Z\c\l\l$m!12,L)&B),f!$41' ""$,lFGM	.rE   BoostedTreesGetEnsembleStates)r   	num_treesnum_finalized_treesnum_attempted_layerslast_layer_nodes_rangec                    t         j                   xs t        j                         }|j                  }|j                  r0	 t	        j
                  |d||       }t        j                  |      }|S t        j                   d| |      \  }}}}|dd }t#        j$                         r&d}	|j&                  }
t#        j(                  d|
|	|       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)au  Retrieves the tree ensemble resource stamp token, number of trees and growing statistics.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (stamp_token, num_trees, num_finalized_trees, num_attempted_layers, last_layer_nodes_range).

    stamp_token: A `Tensor` of type `int64`.
    num_trees: A `Tensor` of type `int32`.
    num_finalized_trees: A `Tensor` of type `int32`.
    num_attempted_layers: A `Tensor` of type `int32`.
    last_layer_nodes_range: A `Tensor` of type `int32`.
  r   NrJ   r   r   r   )r   r   r    r!   r   r"   $_BoostedTreesGetEnsembleStatesOutputrm   r#   r$   r%   r&   r'   0boosted_trees_get_ensemble_states_eager_fallbackr)   r,   r-   r*   r.   r0   r1   r   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s              r;   !boosted_trees_get_ensemble_statesr     sH   " 
			0h..0$#\\11-t5IKg4::7Cgn (88'>R.24!QX QK'""$F::L'vwH066w?'	.) && -
##At,,## 
=
Tt5 5## 
0    .C" "D)5DD)(D)-D; ;EEz%raw_ops.BoostedTreesGetEnsembleStatesc                    t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       t        j                  |      }|S )Ns   BoostedTreesGetEnsembleStates   r?   r   )
r%   rA   rB   r   r*   r   r.   r1   r   rm   r   r   r   r:   r9   r4   s         r;   r   r   N      //0DgFVFVW&',&=q$0C"&(' ""$'vwH066w?'	.rE   example_weightsc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        | t        t        f      st!        d| z        t#        |       }t%        j&                  d| |||      \  }	}	}
}|dd }t)        j*                         r7d|
j-                  d      f}|
j.                  }t)        j0                  d|||       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Makes the summary of quantiles for the batch.

  An op that takes a list of tensors (one tensor per feature) and outputs the
  quantile summaries for each tensor.

  Args:
    float_values: A list of `Tensor` objects with type `float32`.
      float; List of Rank 1 Tensors each containing values for a single feature.
    example_weights: A `Tensor` of type `float32`.
      float; Rank 1 Tensor with weights per instance.
    epsilon: A `Tensor` of type `float32`.
      float; The required maximum approximation error.
    name: A name for the operation (optional).

  Returns:
    A list with the same length as `float_values` of `Tensor` objects with type `float32`.
  !BoostedTreesMakeQuantileSummariesNrJ   `Expected list for 'float_values' argument to 'boosted_trees_make_quantile_summaries' Op, not %r.)rF   r   r   r   rN   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   4boosted_trees_make_quantile_summaries_eager_fallbackr)   rP   rQ   rR   rS   rT   r,   r-   r*   r.   r/   r0   r1   )rF   r   r   r   r2   r3   r4   r5   rV   r6   r7   r8   r9   r:   s                 r;   %boosted_trees_make_quantile_summariesr   \  s   $ 
			0h..0$#\\1114"g n 
L4-	0
	>@L	MN N <('88+,=L5<4I!QX QK'""$c//?@F::L+\67L	.3 && -
##At,,## 
A
tG G## 
s0    C< <ED**EEE E.-E.z)raw_ops.BoostedTreesMakeQuantileSummariesc                    t        | t        t        f      st        d| z        t	        |       }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        |       ||gz   }d|f}t        j                  d|||||      }t        j                         rt        j                  d|||       |S )Nr   rN   s!   BoostedTreesMakeQuantileSummariesr?   r   )rP   rQ   rR   rS   rT   r%   rY   rB   rD   rA   r*   r   r.   r1   )	rF   r   r   r   r   rV   r:   r9   r4   s	            r;   r   r     s    	L4-	0
	>@L	MN N <()),H,**?GOOL/""7GOO<'l#&@@,./&A/#)s?' ""$+\67L	.rE   bucketized_features_listc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |||d|d|      }	|	S t        |t        t        f      st!        d|z        t#        |      }t%        j&                  |d      }t%        j&                  |d      }t)        j*                  d| ||||||      \  }}}}|dd }	t%        j,                         rYd|j/                  d      d|j/                  d      d|j/                  d      f}|j0                  }t%        j2                  d|||	       |	\  }	|	S # t        j                  $ r }
t        j                  |
|       Y d}
~
nd}
~
wt        j                  $ r Y nw xY w	 t        | |||||||      S # t        j                  $ r Y iw xY w)	a!  Makes the summary of accumulated stats for the batch.

  The summary stats contains gradients and hessians accumulated into the corresponding node and bucket for each example.

  Args:
    node_ids: A `Tensor` of type `int32`.
      int32 Rank 1 Tensor containing node ids, which each example falls into for the requested layer.
    gradients: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[#examples, 1]) for gradients.
    hessians: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[#examples, 1]) for hessians.
    bucketized_features_list: A list of at least 1 `Tensor` objects with type `int32`.
      int32 list of Rank 1 Tensors, each containing the bucketized feature (for each feature column).
    max_splits: An `int` that is `>= 1`.
      int; the maximum number of splits possible in the whole tree.
    num_buckets: An `int` that is `>= 1`.
      int; equals to the maximum possible value of bucketized feature.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  BoostedTreesMakeStatsSummaryr   r   Nr   gExpected list for 'bucketized_features_list' argument to 'boosted_trees_make_stats_summary' Op, not %r.)r   r   r   r   r   r   r   rN   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   /boosted_trees_make_stats_summary_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   )r   r   r   r   r   r   r   r2   r3   r4   r5   rV   r6   r7   r8   r9   r:   s                    r;    boosted_trees_make_stats_summaryr     s   . 
			0h..0$#\\	11,dHi*L*{$g n 
,tUm	<
	9;S	TU U 34  \:*!!+}=+'88&2;19AY3=4?dL!QX QK'""$C--l;]./1F ::L&fgG('	.E && -
##At,,## 
<
Ix)A[tO O ## 
s0     E F)FFF!F4 4G
Gz$raw_ops.BoostedTreesMakeStatsSummaryc                    t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| ||gt        |      z   }	d|d|d|f}
t        j                  dd|	|
||      }t        j                         rt        j                  d|	|
|       |\  }|S )	Nr   r   r   rN   s   BoostedTreesMakeStatsSummaryr>   r?   r   )rP   rQ   rR   rS   rT   r*   r+   r%   rA   rB   rC   rD   rY   r   r.   r1   )r   r   r   r   r   r   r   r   rV   r:   r9   r4   s               r;   r   r     s;   	,tUm	<
	9;S	TU U 34  \:*!!+}=+##Hgmm<($$Y@)##Hgoo>(!556NPWP]P]^Ix048P3QQ,*m[$&&<a$0C"&(' ""$&fgG('	.rE   c           	      :   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S t        |t        t        f      st!        d|z        t#        |      }t%        j&                  |d      }t)        j*                  d| |||      \  }	}	}
}|dd }t%        j,                         rHd|
j/                  d      d|
j/                  d      f}|
j0                  }t%        j2                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y <w xY w)a  Runs multiple additive regression ensemble predictors on input instances and

  computes the logits. It is designed to be used during prediction.
  It traverses all the trees and calculates the final score for each instance.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
    bucketized_features: A list of at least 1 `Tensor` objects with type `int32`.
      A list of rank 1 Tensors containing bucket id for each
      feature.
    logits_dimension: An `int`.
      scalar, dimension of the logits, to be used for partial logits
      shape.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  BoostedTreesPredictrg   Nrz   WExpected list for 'bucketized_features' argument to 'boosted_trees_predict' Op, not %r.r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   $boosted_trees_predict_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   r   s                 r;   boosted_trees_predictr    s   & 
			0h..0$#\\11#T+?/1ACg n 
'$	7
	.0C	DE E #&&9":&&'79KL'884H3F0@tM!QX QK'""$' 9: #"3"34F"GIF ::L|VW>('	.= && -
##At,,## 
1
 3+$DB B ## 
r   zraw_ops.BoostedTreesPredictc                    t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }| gt        |      z   }d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   rg   r   s   BoostedTreesPredictr>   r?   r   r   r   s	            r;   r   r   F  s    	'$	7
	.0C	DE E #&&9":&&'79KL//0DgFVFVW001DgmmT&'$/B*CC,%'D&(&3Q|#)s?'""$|VW>('	.rE   	summariesc                 :   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        |t        t        f      st!        d|z        t#        |      }t%        j&                  d| ||      \  }}}	}
|	S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)aw  Add the quantile summaries to each quantile stream resource.

  An op that adds a list of quantile summaries to a quantile stream resource. Each
  summary Tensor is rank 2, containing summaries (value, weight, min_rank, max_rank)
  for a single feature.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource handle referring to a QuantileStreamResource.
    summaries: A list of `Tensor` objects with type `float32`.
      string; List of Rank 2 Tensor each containing the summaries for a single feature.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  .BoostedTreesQuantileStreamResourceAddSummariesNrJ   lExpected list for 'summaries' argument to 'boosted_trees_quantile_stream_resource_add_summaries' Op, not %r.)r   r  r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   Cboosted_trees_quantile_stream_resource_add_summaries_eager_fallbackr)   rP   rQ   rR   rS   rT   r,   r-   )r   r  r   r2   r3   r4   r5   rV   r6   r7   r8   s              r;   4boosted_trees_quantile_stream_resource_add_summariesr  [  s0   " 
			0h..0$#\\11>'4g n 
Ie}	-
	MOX	YZ Z 9~'888ZyDM?CE!QX 
*' && -
##At,,## 
P
)94TK K## 
0    B* *C1=CC10C15D DDz6raw_ops.BoostedTreesQuantileStreamResourceAddSummariesc                 T   t        |t        t        f      st        d|z        t	        |      }t        j                  | t        j                        } t        j                  |t        j                        }| gt        |      z   }d|f}t        j                  dd||||      }d }|S )Nr  rN   s.   BoostedTreesQuantileStreamResourceAddSummariesr   r?   rP   rQ   rR   rS   rT   r%   rA   rB   r   rY   rD   r*   r   )r   r  r   r   rV   r:   r9   r4   s           r;   r  r    s    	Ie}	-
	MOX	YZ Z 9~$($:$:;Z\c\l\l$m!&&y'//B)12T)_D,./&N|6s"&(' '	.rE   c                 :   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        |t        t        f      st!        d|z        t#        |      }t%        j&                  d| ||      \  }}}	}
|	S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)aI  Deserialize bucket boundaries and ready flag into current QuantileAccumulator.

  An op that deserializes bucket boundaries and are boundaries ready flag into current QuantileAccumulator.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource handle referring to a QuantileStreamResource.
    bucket_boundaries: A list of at least 1 `Tensor` objects with type `float32`.
      float; List of Rank 1 Tensors each containing the bucket boundaries for a feature.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  -BoostedTreesQuantileStreamResourceDeserializeNrJ   rExpected list for 'bucket_boundaries' argument to 'boosted_trees_quantile_stream_resource_deserialize' Op, not %r.)r   rG   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   Aboosted_trees_quantile_stream_resource_deserialize_eager_fallbackr)   rP   rQ   rR   rS   rT   r,   r-   )r   rG   r   r2   r3   r4   r5   _attr_num_streamsr6   r7   r8   s              r;   2boosted_trees_quantile_stream_resource_deserializer    s6    
			0h..0$#\\11=t'):<g n 
%e}	5
	KM^	_` ` +,'887YxK\>BD!QX 
*) && -
##At,,## 
N
)+<4  ## 
r	  z5raw_ops.BoostedTreesQuantileStreamResourceDeserializec                 T   t        |t        t        f      st        d|z        t	        |      }t        j                  | t        j                        } t        j                  |t        j                        }| gt        |      z   }d|f}t        j                  dd||||      }d }|S )Nr  r   s-   BoostedTreesQuantileStreamResourceDeserializer   r?   r  )r   rG   r   r   r  r:   r9   r4   s           r;   r  r    s    	%e}	5
	KM^	_` ` +,$($:$:;Z\c\l\l$m!../@'//R12T:K5LL,,-&M|6s"&(' '	.rE   generate_quantilesc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |d}t        j                  |d      }t        j                   d| |||      \  }}}	}
|	S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Flush the summaries for a quantile stream resource.

  An op that flushes the summaries for a quantile stream resource.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource handle referring to a QuantileStreamResource.
    num_buckets: A `Tensor` of type `int64`.
      int; approximate number of buckets unless using generate_quantiles.
    generate_quantiles: An optional `bool`. Defaults to `False`.
      bool; If True, the output will be the num_quantiles for each stream where the ith
      entry is the ith quantile of the input with an approximation error of epsilon.
      Duplicate values may be present.
      If False, the output will be the points in the histogram that we got which roughly
      translates to 1/epsilon boundaries and without any duplicates.
      Default to False.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  'BoostedTreesQuantileStreamResourceFlushr  N)r  r   r   F)r   r   r  r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   ;boosted_trees_quantile_stream_resource_flush_eager_fallbackr)   r*   	make_boolr,   r-   )r   r   r  r   r2   r3   r4   r5   r6   r7   r8   s              r;   ,boosted_trees_quantile_stream_resource_flushr    s&   , 
			0h..0$#\\	117'6Jg n ))*<>RS'881Sr?JFX8<	>!QX
 
*' && -
##At,,## 
H
);/dF F ## 
s0    B C+CCC#C3 3D	D	z/raw_ops.BoostedTreesQuantileStreamResourceFlushc                    |d}t        j                  |d      }t        j                  | t        j
                        } t        j                  |t        j                        }| |g}d|f}t        j                  dd||||      }d }|S )NFr  s'   BoostedTreesQuantileStreamResourceFlushr   r?   )r*   r  r%   rA   rB   r   r   r   )r   r   r  r   r   r:   r9   r4   s           r;   r  r    s    ))*<>RS$($:$:;Z\c\l\l$m!&&{GMMB+1;?, "45&G$0C"&(' '	.rE   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }|s|S t        j"                         r7d|j%                  d      f}
|j&                  }t        j(                  d||
|       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y w xY w)ac  Generate the bucket boundaries for each feature based on accumulated summaries.

  An op that returns a list of float tensors for a quantile stream resource. Each
  tensor is Rank 1 containing bucket boundaries for a single feature.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource handle referring to a QuantileStreamResource.
    num_features: An `int` that is `>= 0`.
      inferred int; number of features to get bucket boundaries for.
    name: A name for the operation (optional).

  Returns:
    A list of `num_features` `Tensor` objects with type `float32`.
  5BoostedTreesQuantileStreamResourceGetBucketBoundariesrN   Nr   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   Kboosted_trees_quantile_stream_resource_get_bucket_boundaries_eager_fallbackr)   r*   r+   r,   r-   r.   r/   r0   r1   r   s               r;   <boosted_trees_quantile_stream_resource_get_bucket_boundariesr  !  sf     
			0h..0$#\\11Et'Gg n ""<@,'88?  bANZFJL!QX QK'	J""$c//?@F::L?vW^`	.1 && -
##At,,## 
X
)  ## 
r   z=raw_ops.BoostedTreesQuantileStreamResourceGetBucketBoundariesc                    t        j                  |d      }t        j                  | t        j
                        } | g}d|f}t        j                  d|||||      }t        j                         rt        j                  d|||       |S )NrN   s5   BoostedTreesQuantileStreamResourceGetBucketBoundariesr?   r  r   r   s          r;   r  r  V  s    ""<@,$($:$:;Z\c\l\l$m!12,L)&U),f!$41' ""$?vW^`	.rE   c           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d| d|      }|S | d} t        j                  | d      } |d}t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }t        j"                         rHd|j%                  d      d|j%                  d      f}
|j&                  }t        j(                  d||
|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||      S # t        j                  $ r Y )w xY w)a  Creates a handle to a BoostedTreesQuantileStreamResource.

  Args:
    container: An optional `string`. Defaults to `""`.
    shared_name: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `resource`.
  *BoostedTreesQuantileStreamResourceHandleOpr   r   Nr   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   ?boosted_trees_quantile_stream_resource_handle_op_eager_fallbackr)   r*   ro   r,   r-   r.   rp   r0   r1   r   s               r;   0boosted_trees_quantile_stream_resource_handle_opr"  d  s    
			0h..0$#\\11:D+=+/g n I	;7)K!!+}=+'884	BM;?A!QX QK'""$3<<4mll=)+F::L4lFGU('	.9 && -
##At,,## 
L;TtM M## 
r   z2raw_ops.BoostedTreesQuantileStreamResourceHandleOpc                    | d} t        j                  | d      } |d}t        j                  |d      }g }d| d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   r   r   s*   BoostedTreesQuantileStreamResourceHandleOpr>   r?   r   r   r   s          r;   r!  r!    s    I	;7)K!!+}=+,M;?&JA$0C"&(' ""$4lFGU('	.rE   BoostedTreesSerializeEnsemblec                    t         j                   xs t        j                         }|j                  }|j                  r0	 t	        j
                  |d||       }t        j                  |      }|S t        j                   d| |      \  }}}}|dd }t#        j$                         r&d}	|j&                  }
t#        j(                  d|
|	|       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)a}  Serializes the tree ensemble to a proto.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (stamp_token, tree_ensemble_serialized).

    stamp_token: A `Tensor` of type `int64`.
    tree_ensemble_serialized: A `Tensor` of type `string`.
  r$  NrJ   r   r   )r   r   r    r!   r   r"   $_BoostedTreesSerializeEnsembleOutputrm   r#   r$   r%   r&   r'   /boosted_trees_serialize_ensemble_eager_fallbackr)   r,   r-   r*   r.   r0   r1   r   s              r;    boosted_trees_serialize_ensembler(    sH    
			0h..0$#\\11-t5IKg4::7Cgn (88'>R.24!QX QK'""$F::L'vwH066w?'	.) && -
##At,,## 
<
Tt5 5## 
r   z%raw_ops.BoostedTreesSerializeEnsemblec                    t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       t        j                  |      }|S )Ns   BoostedTreesSerializeEnsembler   r?   r$  )
r%   rA   rB   r   r*   r   r.   r1   r&  rm   r   s         r;   r'  r'    r   rE    BoostedTreesSparseAggregateStats)stats_summary_indicesstats_summary_valuesstats_summary_shapefeature_indicesfeature_valuesfeature_shapec	                 t   t         j                   xs t        j                         }	|	j                  }
|
j                  r9	 t	        j
                  |	d|| |||||d|d|      }t        j                  |      }|S t        j                   |d      }t        j                   |d      }t#        j$                  d| ||||||||
      \  }}}}|dd }t        j&                         rHd|j)                  d      d|j)                  d      f}|j*                  }t        j,                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	
      S # t        j                  $ r Y >w xY w)a  Aggregates the summary of accumulated stats for the batch.

  The summary stats contains gradients and hessians accumulated for each node, bucket and dimension id.

  Args:
    node_ids: A `Tensor` of type `int32`.
      int32; Rank 1 Tensor containing node ids for each example, shape [batch_size].
    gradients: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example.
    hessians: A `Tensor` of type `float32`.
      float32; Rank 2 Tensor (shape=[batch_size, hessian_dimension]) with hessians for each example.
    feature_indices: A `Tensor` of type `int32`.
      int32; Rank 2 indices of feature sparse Tensors (shape=[number of sparse entries, 2]).
      Number of sparse entries across all instances from the batch. The first value is
      the index of the instance, the second is dimension of the feature. The second axis
      can only have 2 values, i.e., the input dense version of Tensor can only be matrix.
    feature_values: A `Tensor` of type `int32`.
      int32; Rank 1 values of feature sparse Tensors (shape=[number of sparse entries]).
      Number of sparse entries across all instances from the batch. The first value is
      the index of the instance, the second is dimension of the feature.
    feature_shape: A `Tensor` of type `int32`.
      int32; Rank 1 dense shape of feature sparse Tensors (shape=[2]).
      The first axis can only have 2 values, [batch_size, feature_dimension].
    max_splits: An `int` that is `>= 1`.
      int; the maximum number of splits possible in the whole tree.
    num_buckets: An `int` that is `>= 1`.
      int; equals to the maximum possible value of bucketized feature + 1.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (stats_summary_indices, stats_summary_values, stats_summary_shape).

    stats_summary_indices: A `Tensor` of type `int32`.
    stats_summary_values: A `Tensor` of type `float32`.
    stats_summary_shape: A `Tensor` of type `int32`.
  r*  r   r   Nr   )	r   r   r   r.  r/  r0  r   r   r   )r   r   r    r!   r   r"   '_BoostedTreesSparseAggregateStatsOutputrm   r#   r$   r%   r&   r'   3boosted_trees_sparse_aggregate_stats_eager_fallbackr)   r*   r+   r,   r-   r.   r/   r0   r1   )r   r   r   r.  r/  r0  r   r   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s                     r;   $boosted_trees_sparse_aggregate_statsr4    s   J 
			0h..0$#\\
110$)/>=j->g 8==gFgn   \:*!!+}=+'88*X6?5=<K;I:G7A8C15	7!QX QK'""$C--l;].0F::L*L&'K399'B'	.A && -
##At,,## 
@
Ix.
JK  ## 
s0    7E   FE..FFF   F76F7z(raw_ops.BoostedTreesSparseAggregateStatsc
                    t        j                  |d      }t        j                  |d      }t        j                  | t        j
                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j
                        }t        j                  |t        j
                        }t        j                  |t        j
                        }| |||||g}
d|d|f}t        j                  dd|
||	|      }t        j                         rt        j                  d|
||       t        j                  |      }|S )Nr   r   s    BoostedTreesSparseAggregateStatsr   r?   r*  )r*   r+   r%   rA   rB   rC   rD   r   r.   r1   r2  rm   )r   r   r   r.  r/  r0  r   r   r   r   r:   r9   r4   s                r;   r3  r3  D  s%     \:*!!+}=+##Hgmm<($$Y@)##Hgoo>(**?GMMJ/)).'--H.((F-Ix.R_`,*m[A&@!$0C"&(' ""$*L&'K399'B'	.rE   +BoostedTreesSparseCalculateBestFeatureSplitr+  r,  r-  c                    t         j                   xs t        j                         }|j                  }|j                  r;	 t	        j
                  |d|
| |||||||d|d|	      }t        j                  |      }|S t        j                   |d      }|	d}	t        j"                  |	d      }	t%        j&                  d| |||||||||	|
      \  }}}}|dd }t        j(                         rHd|j+                  d      d|j-                  d      f}|j.                  }t        j0                  d|||       t        j                  |      }|S # t        j                  $ r }t        j                  ||
       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|      S # t        j                  $ r Y Fw xY w)a  Calculates gains for each feature and returns the best possible split information for the feature.

  The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature.

  It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split.

  In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features).

  The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature.

  Args:
    node_id_range: A `Tensor` of type `int32`.
      A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive).
    stats_summary_indices: A `Tensor` of type `int32`.
      A Rank 2 int64 tensor of dense shape [N, 4] (N specifies the number of non-zero values) for accumulated stats summary (gradient/hessian) per node per bucket for each feature. The second dimension contains node id, feature dimension, bucket id, and stats dim.
      stats dim is the sum of logits dimension and hessian dimension, hessian dimension can either be logits dimension if diagonal hessian is used, or logits dimension^2 if full hessian is used.
    stats_summary_values: A `Tensor` of type `float32`.
      A Rank 1 float tensor of dense shape [N] (N specifies the number of non-zero values), which supplies the values for each element in summary_indices.
    stats_summary_shape: A `Tensor` of type `int32`.
      A Rank 1 float tensor of dense shape [4], which specifies the dense shape of the sparse tensor, which is [num tree nodes, feature dimensions, num buckets, stats dim].
    l1: A `Tensor` of type `float32`.
      l1 regularization factor on leaf weights, per instance based.
    l2: A `Tensor` of type `float32`.
      l2 regularization factor on leaf weights, per instance based.
    tree_complexity: A `Tensor` of type `float32`.
      adjustment to the gain, per leaf based.
    min_node_weight: A `Tensor` of type `float32`.
      minimum avg of hessians in a node before required for the node to be considered for splitting.
    logits_dimension: An `int` that is `>= 1`.
      The dimension of logit, i.e., number of classes.
    split_type: An optional `string` from: `"inequality"`. Defaults to `"inequality"`.
      A string indicating if this Op should perform inequality split or equality split.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (node_ids, gains, feature_dimensions, thresholds, left_node_contribs, right_node_contribs, split_with_default_directions).

    node_ids: A `Tensor` of type `int32`.
    gains: A `Tensor` of type `float32`.
    feature_dimensions: A `Tensor` of type `int32`.
    thresholds: A `Tensor` of type `int32`.
    left_node_contribs: A `Tensor` of type `float32`.
    right_node_contribs: A `Tensor` of type `float32`.
    split_with_default_directions: A `Tensor` of type `string`.
  r6  rg   rh   Nrj   rk   )ra   r+  r,  r-  rc   rd   re   rf   rg   rh   r   )r   r   r    r!   r   r"   2_BoostedTreesSparseCalculateBestFeatureSplitOutputrm   r#   r$   r%   r&   r'   @boosted_trees_sparse_calculate_best_feature_split_eager_fallbackr)   r*   r+   ro   r,   r-   r.   r/   rp   r0   r1   )ra   r+  r,  r-  rc   rd   re   rf   rg   rh   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s                       r;   1boosted_trees_sparse_calculate_best_feature_splitr:  ]  s   \ 
			0h..0$#\\11;T,.BR_o,lJ	Hg
 CHHQgn &&'79KLJ  \:*'885]MbL`K^:<GVGVHXBL<@
B!QX QK'""$ #"3"34F"GCLL68F::L5|VWV>DDWM'	.I && -
##At,,## 
M
.0D
r2+
	 
 ## 
s0    9E FE66FFF* *G Gz3raw_ops.BoostedTreesSparseCalculateBestFeatureSplitc                 ~   t        j                  |d      }|	d}	t        j                  |	d      }	t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| |||||||g}d|d|	f}t        j                  dd||||
      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nrg   rk   rh   s+   BoostedTreesSparseCalculateBestFeatureSplitrs   r?   r6  )r*   r+   ro   r%   rA   rB   rC   rD   r   r.   r1   r8  rm   )ra   r+  r,  r-  rc   rd   re   rf   rg   rh   r   r   r:   r9   r4   s                  r;   r9  r9    sw   &&'79KLJ  \:*((F-001FV//0DgooV../BGMMRb'//2"b'//2"**?GOOL/**?GOOL/!68LNacegikz  }L  M, 0,
K&K|6s"&(' ""$5|VWV>DDWM'	.rE   BoostedTreesTrainingPredict)partial_logitstree_idsr   cached_tree_idscached_node_idsc                    t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||d|	      }t        j                  |      }|S t        |t         t"        f      st%        d|z        t'        |      }
t)        j*                  |d      }t-        j.                  d| |||||      \  }}}}|dd }t)        j0                         rHd|j3                  d      d|j3                  d      f}|j4                  }t)        j6                  d|||       t        j                  |      }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y Qw xY w)a  Runs multiple additive regression ensemble predictors on input instances and

  computes the update to cached logits. It is designed to be used during training.
  It traverses the trees starting from cached tree id and cached node id and
  calculates the updates to be pushed to the cache.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
    cached_tree_ids: A `Tensor` of type `int32`.
      Rank 1 Tensor containing cached tree ids which is the starting
      tree of prediction.
    cached_node_ids: A `Tensor` of type `int32`.
      Rank 1 Tensor containing cached node id which is the starting
      node of prediction.
    bucketized_features: A list of at least 1 `Tensor` objects with type `int32`.
      A list of rank 1 Tensors containing bucket id for each
      feature.
    logits_dimension: An `int`.
      scalar, dimension of the logits, to be used for partial logits
      shape.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (partial_logits, tree_ids, node_ids).

    partial_logits: A `Tensor` of type `float32`.
    tree_ids: A `Tensor` of type `int32`.
    node_ids: A `Tensor` of type `int32`.
  r<  rg   Nrz   `Expected list for 'bucketized_features' argument to 'boosted_trees_training_predict' Op, not %r.)r   r?  r@  r   rg   r   r   )r   r   r    r!   r   r"   "_BoostedTreesTrainingPredictOutputrm   r#   r$   r%   r&   r'   -boosted_trees_training_predict_eager_fallbackr)   rP   rQ   rR   rS   rT   r*   r+   r,   r-   r.   r/   r0   r1   )r   r?  r@  r   rg   r   r2   r3   r4   r5   r   r6   r7   r8   r9   r:   s                   r;   boosted_trees_training_predictrE    s   < 
			0h..0$#\\
11+T3G*=,.g 388Agn 
'$	7
	79L	MN N #&&9":&&'79KL'88%<P7F7F;N8H,02!QX QK'""$' 9: #"3"34F"GIF ::L%|VWF.44W='	.E && -
##At,,## 
:

0@t  ## 
s0    3E F%F  FFF/ /GGz#raw_ops.BoostedTreesTrainingPredictc                    t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| ||gt        |      z   }d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       t         j#                  |
      }
|
S )NrB  rg   r   s   BoostedTreesTrainingPredictr   r?   r<  )rP   rQ   rR   rS   rT   r*   r+   r%   rA   rB   r   rC   rY   r   r.   r1   rC  rm   )r   r?  r@  r   rg   r   r   r   r:   r9   r4   s              r;   rD  rD  +  s3   	'$	7
	79L	MN N #&&9":&&'79KL//0DgFVFVW**?GMMJ/**?GMMJ/001DgmmT&IDQdLee,%'D&(&;Q$0C"&(' ""$%|VWF.44W='	.rE   ru   r[   r]   r^   r_   	max_depthlearning_ratepruning_modec                    t         j                   xs t        j                         }|j                  }|j                  r%	 t	        j
                  |d|
| ||||||||d|	      }|S t        |t        t        f      st!        d|z        t#        |      }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        d	t#        |      |fz        t        |t        t        f      st!        d
|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t'        j(                  |	d      }	t+        j,                  d| |||||||||	|
      \  }}}}|S # t        j                  $ r }t        j                  ||
       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
|      S # t        j                  $ r Y w xY w)a5  Updates the tree ensemble by either adding a layer to the last tree being grown

  or by starting a new tree.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the ensemble variable.
    feature_ids: A `Tensor` of type `int32`.
      Rank 1 tensor with ids for each feature. This is the real id of
      the feature that will be used in the split.
    node_ids: A list of `Tensor` objects with type `int32`.
      List of rank 1 tensors representing the nodes for which this feature
      has a split.
    gains: A list with the same length as `node_ids` of `Tensor` objects with type `float32`.
      List of rank 1 tensors representing the gains for each of the feature's
      split.
    thresholds: A list with the same length as `node_ids` of `Tensor` objects with type `int32`.
      List of rank 1 tensors representing the thesholds for each of the
      feature's split.
    left_node_contribs: A list with the same length as `node_ids` of `Tensor` objects with type `float32`.
      List of rank 2 tensors with left leaf contribs for each of
      the feature's splits. Will be added to the previous node values to constitute
      the values of the left nodes.
    right_node_contribs: A list with the same length as `node_ids` of `Tensor` objects with type `float32`.
      List of rank 2 tensors with right leaf contribs for each
      of the feature's splits. Will be added to the previous node values to constitute
      the values of the right nodes.
    max_depth: A `Tensor` of type `int32`. Max depth of the tree to build.
    learning_rate: A `Tensor` of type `float32`.
      shrinkage const for each new tree.
    pruning_mode: An `int` that is `>= 0`.
      0-No pruning, 1-Pre-pruning, 2-Post-pruning.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  BoostedTreesUpdateEnsemblerI  N)rI  r   r   TExpected list for 'node_ids' argument to 'boosted_trees_update_ensemble' Op, not %r.QExpected list for 'gains' argument to 'boosted_trees_update_ensemble' Op, not %r.wList argument 'gains' to 'boosted_trees_update_ensemble' Op with length %d must match length %d of argument 'node_ids'.VExpected list for 'thresholds' argument to 'boosted_trees_update_ensemble' Op, not %r.|List argument 'thresholds' to 'boosted_trees_update_ensemble' Op with length %d must match length %d of argument 'node_ids'.^Expected list for 'left_node_contribs' argument to 'boosted_trees_update_ensemble' Op, not %r.List argument 'left_node_contribs' to 'boosted_trees_update_ensemble' Op with length %d must match length %d of argument 'node_ids'._Expected list for 'right_node_contribs' argument to 'boosted_trees_update_ensemble' Op, not %r.List argument 'right_node_contribs' to 'boosted_trees_update_ensemble' Op with length %d must match length %d of argument 'node_ids'.)r   ru   r   r[   r]   r^   r_   rG  rH  rI  r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   ,boosted_trees_update_ensemble_eager_fallbackr)   rP   rQ   rR   rS   rT   rU   r*   r+   r,   r-   )r   ru   r   r[   r]   r^   r_   rG  rH  rI  r   r2   r3   r4   r5   rV   r6   r7   r8   s                      r;   boosted_trees_update_ensemblerV  C  s	   L 
			0h..0$#\\
11*D2FXuj2DY~	g
 n 
HtUm	,
	68@	AB B 8}	ED%=	)
	68=	>? ? 	Z%%
	7	U'(	)* * 
Ju	.
	68B	CD D 	_**
	7	Z,-	./ / 
&u	6
	68J	KL L 		 22
	7		 "45	67 7 
'$	7
	68K	LM M 		!33
	7	 	!#56	78 8 ""<@,'88$;O2=/7u1;9K:M094A3?d	L!QX 
*A && -
##At,,## 
9
Xuj
19m#$D: : ## 
s0    #G= =IH++III I65I6z"raw_ops.BoostedTreesUpdateEnsemblec                 @   t        |t        t        f      st        d|z        t	        |      }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        d	t	        |      |fz        t        j                  |	d
      }	t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }| |gt        |      z   t        |      z   t        |      z   t        |      z   t        |      z   ||gz   }d
|	d|f}t        j                  dd||||
      }d }|S )NrL  rM  rN  rO  rP  rQ  rR  rS  rT  rI  rN   s   BoostedTreesUpdateEnsembler   r?   )rP   rQ   rR   rS   rT   rU   r*   r+   r%   rA   rB   r   rC   rY   rD   r   )r   ru   r   r[   r]   r^   r_   rG  rH  rI  r   r   rV   r:   r9   r4   s                   r;   rU  rU    sO   	HtUm	,
	68@	AB B 8}	ED%=	)
	68=	>? ? 	Z%%
	7	U'(	)* * 
Ju	.
	68B	CD D 	_**
	7	Z,-	./ / 
&u	6
	68J	KL L 		 22
	7		 "45	67 7 
'$	7
	68K	LM M 		!33
	7	 	!#56	78 8 ""<@,//0DgFVFVW&&{GMMB+%%h>(

"
"5'//
:%''
GMMB*//0BGOOT001DgooV$$Y>)((H-&4tH~EUSVZ[eVffim  oA  jB  B  EI  J]  E^  ^  bk  mz  a{  {,L.:LM&:A$0C"&(' '	.rE   dimension_idsc                    t         j                   xs t        j                         }|j                  }|j                  r(	 t	        j
                  |d|| |||||||||	|
|d|      }|S t        |t        t        f      st!        d|z        t#        |      }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        d	t#        |      |fz        t        |t        t        f      st!        d
|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      }|d}t'        j(                  |d      }t+        j,                  d| |||||||||	|
|||      \  }}}}|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||||||	|
||||      S # t        j                  $ r Y w xY w)a'	  Updates the tree ensemble by adding a layer to the last tree being grown

  or by starting a new tree.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the ensemble variable.
    feature_ids: A list of at least 1 `Tensor` objects with type `int32`.
      Rank 1 tensor with ids for each feature. This is the real id of
      the feature that will be used in the split.
    dimension_ids: A list of `Tensor` objects with type `int32`.
      List of rank 1 tensors representing the dimension in each feature.
    node_ids: A list with the same length as `dimension_ids` of `Tensor` objects with type `int32`.
      List of rank 1 tensors representing the nodes for which this feature
      has a split.
    gains: A list with the same length as `dimension_ids` of `Tensor` objects with type `float32`.
      List of rank 1 tensors representing the gains for each of the feature's
      split.
    thresholds: A list with the same length as `dimension_ids` of `Tensor` objects with type `int32`.
      List of rank 1 tensors representing the thesholds for each of the
      feature's split.
    left_node_contribs: A list with the same length as `dimension_ids` of `Tensor` objects with type `float32`.
      List of rank 2 tensors with left leaf contribs for each of
      the feature's splits. Will be added to the previous node values to constitute
      the values of the left nodes.
    right_node_contribs: A list with the same length as `dimension_ids` of `Tensor` objects with type `float32`.
      List of rank 2 tensors with right leaf contribs for each
      of the feature's splits. Will be added to the previous node values to constitute
      the values of the right nodes.
    split_types: A list with the same length as `dimension_ids` of `Tensor` objects with type `string`.
      List of rank 1 tensors representing the split type for each feature.
    max_depth: A `Tensor` of type `int32`. Max depth of the tree to build.
    learning_rate: A `Tensor` of type `float32`.
      shrinkage const for each new tree.
    pruning_mode: A `Tensor` of type `int32`.
      0-No pruning, 1-Pre-pruning, 2-Post-pruning.
    logits_dimension: An optional `int`. Defaults to `1`.
      scalar, dimension of the logits
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  BoostedTreesUpdateEnsembleV2rg   Nrz   \Expected list for 'dimension_ids' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.WExpected list for 'node_ids' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'node_ids' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.TExpected list for 'gains' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'gains' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.YExpected list for 'thresholds' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'thresholds' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.aExpected list for 'left_node_contribs' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'left_node_contribs' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.bExpected list for 'right_node_contribs' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'right_node_contribs' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.ZExpected list for 'split_types' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.List argument 'split_types' to 'boosted_trees_update_ensemble_v2' Op with length %d must match length %d of argument 'dimension_ids'.ZExpected list for 'feature_ids' argument to 'boosted_trees_update_ensemble_v2' Op, not %r.r>   )r   ru   rX  r   r[   r]   r^   r_   rw   rG  rH  rI  rg   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   /boosted_trees_update_ensemble_v2_eager_fallbackr)   rP   rQ   rR   rS   rT   rU   r*   r+   r,   r-   )r   ru   rX  r   r[   r]   r^   r_   rw   rG  rH  rI  rg   r   r2   r3   r4   r5   rV   _attr_num_groupsr6   r7   r8   s                          r;    boosted_trees_update_ensemble_v2rk    s2   X 
			0h..0$#\\
11,d4H]HeZ/i|%79I	Kg
 n 
MD%=	1
	9;H	IJ J =)	HtUm	,
	9;C	DE E 	]((
	<	X*+	,- - 
ED%=	)
	9;@	AB B 	Z%%
	<	U'(	)* * 
Ju	.
	9;E	FG G 	_**
	<	Z,-	./ / 
&u	6
	9;M	NO O 		 22
	<		 "45	67 7 
'$	7
	9;N	OP P 		!33
	<	 	!#56	78 8 
K$	/
	9;F	GH H 	++
	<	[	-.	/0 0 
K$	/
	9;F	GH H %&&'79KL'88&=Q4?6C193=;M<O4?2;6C5A9I-13!QX 
*} && -
##At,,## 
<
]He
(*={
]L+$D	B B
 ## 
s0    &K LK::LLL1 1MMz$raw_ops.BoostedTreesUpdateEnsembleV2c                    t        |t        t        f      st        d|z        t	        |      }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        d	t	        |      |fz        t        |t        t        f      st        d
|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      }|d}t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |	t        j                        }	t        j                  |
t        j                        }
t        j                  |t        j                        }| gt        |      z   t        |      z   t        |      z   t        |      z   t        |      z   t        |      z   t        |      z   t        |      z   |	|
|gz   }d|d|d|f}t        j                   dd||||      }d }|S )Nr[  r\  r]  r^  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  r>   rg   rN   
num_groupss   BoostedTreesUpdateEnsembleV2r   r?   )rP   rQ   rR   rS   rT   rU   r*   r+   r%   rA   rB   r   rY   rC   rD   r   r   )r   ru   rX  r   r[   r]   r^   r_   rw   rG  rH  rI  rg   r   r   rV   rj  r:   r9   r4   s                       r;   ri  ri  	  s   	MD%=	1
	9;H	IJ J =)	HtUm	,
	9;C	DE E 	]((
	<	X*+	,- - 
ED%=	)
	9;@	AB B 	Z%%
	<	U'(	)* * 
Ju	.
	9;E	FG G 	_**
	<	Z,-	./ / 
&u	6
	9;M	NO O 		 22
	<		 "45	67 7 
'$	7
	9;N	OP P 		!33
	<	 	!#56	78 8 
K$	/
	9;F	GH H 	++
	<	[	-.	/0 0 
K$	/
	9;F	GH H %&&'79KL//0DgFVFVW((gmmD+**='--H-%%h>(

"
"5'//
:%''
GMMB*//0BGOOT001DgooV((gnnE+$$Y>)((H-''gmmD,&'${*;;d=>QQTXYaTbbeijoeppsw  yC  tD  D  GK  L^  G_  _  bf  gz  b{  {  ~B  CN  ~O  O  S\  ^k  my  Rz  z,.0BL"24&<a$0C"&(' '	.rE   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)zChecks whether a tree ensemble has been initialized.

  Args:
    tree_ensemble_handle: A `Tensor` of type `resource`.
      Handle to the tree ensemble resource.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  !IsBoostedTreesEnsembleInitializedNrJ   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   4is_boosted_trees_ensemble_initialized_eager_fallbackr)   r,   r-   r*   r.   r0   r1   r   s              r;   %is_boosted_trees_ensemble_initializedrq  	  s/    
			0h..0$#\\11149MOgn (88+BV268!QX QK'""$F::L+\67L('	.) && -
##At,,## 
A
Tt5 5## 
0    B< <DC**DDD D+*D+z)raw_ops.IsBoostedTreesEnsembleInitializedc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns!   IsBoostedTreesEnsembleInitializedr>   r?   ro  r%   rA   rB   r   r*   r   r.   r1   r   s         r;   rp  rp  
  sz    //0DgFVFVW&',&A1$0C"&(' ""$+\67L('	.rE   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)ac  Checks whether a quantile stream has been initialized.

  An Op that checks if quantile stream resource is initialized.

  Args:
    quantile_stream_resource_handle: A `Tensor` of type `resource`.
      resource; The reference to quantile stream resource handle.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  /IsBoostedTreesQuantileStreamResourceInitializedNrJ   )r   r   r   )r   r   r    r!   r   r"   r#   r$   r%   r&   r'   Dis_boosted_trees_quantile_stream_resource_initialized_eager_fallbackr)   r,   r-   r*   r.   r0   r1   )r   r   r2   r3   r4   r5   r6   r7   r8   r9   r:   s              r;   5is_boosted_trees_quantile_stream_resource_initializedrx  
  s4    
			0h..0$#\\11?')g n (889[z@DF!QX QK'""$F::L9<QXZ('	.) && -
##At,,## 
Q
)$@ @## 
rr  z7raw_ops.IsBoostedTreesQuantileStreamResourceInitializedc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns/   IsBoostedTreesQuantileStreamResourceInitializedr>   r?   rv  rt  )r   r   r   r:   r9   r4   s         r;   rw  rw  M
  s|    $($:$:;Z\c\l\l$m!12,&O|6s"&(' ""$9<QXZ('	.rE   )N)rk   N)r   N)r   r   N)FN)r>   N)__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r   r   r#   r   r*   tensorflow.python.frameworkr   rB   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r%   r   r,   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   Int32Float32intr<   	to_raw_opr   r(   rW   rI   rO   
namedtuplerl   strrq   rZ   rn   r|   Stringr~   rt   r}   r   r   r   r   ResourceBoolr   r   r   Int64r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r  r  r  r  r  r  boolr  r  r  r  r  r  r"  r   r!  r&  r(  r$  r'  r2  r4  r*  r3  r8  r:  r6  r9  rC  rE  r<  rD  rV  rK  rU  rk  rZ  ri  rq  ro  rp  rx  rv  rw  r   rE   r;   <module>r     s4  
  6 7 1 7 9 F K 3 I C 8 6 % % ':Ic7==6H,I :V_`celetet`tVu :  BK  LO  QX  Q`  Q`  L`  Ba :  lu  vy  {B  {H  {H  vH  lI :  WZ :  il :  |E  FI  KR  KZ  KZ  FZ  |[ :x MY'KL^T^^\yMz{ 9S'--EW;X enort{  uD  uD  pD  fE   QZ  [^  `g  `o  `o  [o  Qp   {D  EH  JQ  JW  JW  EW  {X   fi   x{   KT  UX  Za  Zi  Zi  Ui  Kj &:)DIw4N*O :dmnrsvnw  zA  zI  zI  oI  eJ :x C	"AB>4>>RiCjk 49gooC]9^ s|  ~B  CF  ~G  IP  IX  IX  ~X  tY 6 0F{/E/E+ L0M ,
UiW]]HZ>[ Uluvy  |C  |K  |K  wK  mL U  R[  \_  ah  ap  ap  \p  Rq U  w@  AD  FM  FU  FU  AU  wV U  ir  sv  x  xG  xG  sG  iH U  [d  eh  jq  jy  jy  ey  [z U  NQ U  ^a Un )c	2a(bcqcgcqcq  s]  d^  )_ %YWZ\c\i\iWiMj   |E  FI  KR  KZ  KZ  FZ  |[   aj  kn  pw  p  p  k  a@   FO  PS  U\  Ud  Ud  Pd  Fe   xA  BE  GN  GV  GV  BV  xW   js  tw  y@  yH  yH  tH  jI   ]`   nq , 2H1G1G- [2\ .
\3PWP]P]K]A^ \v  AE  FI  AJ  LS  L[  L[  A[  w\ \  kt  ux  zA  zH  zH  uH  kI \  bk  lo  qx  q~  q~  l~  b \  EN  OR  T[  Tc  Tc  Oc  Ed \  js  tw  y@  yH  yH  tH  jI \  \e  fi  kr  kz  kz  fz  \{ \  NW  X[  ]d  ]l  ]l  Xl  Nm \  AD \| +g)4e*fgugkgugu  wd  he  +f 'PYZ]_f_l_lZlPm   FO  PT  UX  PY  [b  [j  [j  Pj  Fk   zC  DG  IP  IW  IW  DW  zX   qz  {~  @G  @M  @M  {M  qN   T]  ^a  cj  cr  cr  ^r  Ts   yB  CF  HO  HW  HW  CW  yX   kt  ux  zA  zI  zI  uI  kJ   ]f  gj  ls  l{  l{  g{  ]|   PS 6 3I+2H2H.m3o /
V)CQXQ^Q^L^B_ Vu~  @D  EH  @I  KR  KZ  KZ  @Z  v[ V  aj  kn  pw  p  p  k  a@ V  FO  PS  U\  Ud  Ud  Pd  Fe V  xA  BE  GN  GV  GV  BV  xW V  js  tw  y@  yH  yH  tH  jI V  WZ Vp ,i95g+hiwimiwiw  yg  jh  ,i (QZ[^`g`m`m[mQn   EN  OS  TW  OX  Za  Zi  Zi  Oi  Ej   py  z}  F  N  N  zN  pO   U^  _b  dk  ds  ds  _s  Ut   GP  QT  V]  Ve  Ve  Qe  Gf   yB  CF  HO  HW  HW  CW  yX   fi @2Ic7CSCS>S4T 2fopsu|  vE  vE  qE  gF 2  W`  ad  fm  fu  fu  au  Wv 2  |E  FI  KR  KZ  KZ  FZ  |[ 2  aj  kn  pw  p  p  k  a@ 2  PY  Z]  _f  _k  _k  Zk  Pl 2h E#CD^T^^TmEno 9SRYRbRbMbCc u~  @C  EL  ET  ET  @T  vU   fo  ps  u|  uD  uD  pD  fE   KT  UX  Za  Zi  Zi  Ui  Kj   py  z}  F  N  N  zN  pO   _h  il  nu  nz  nz  iz  _{ $'	#wGWGWBW8X 'gpqtv}  wD  wD  rD  hE '  aj  kn  pw  p~  p~  k~  a 'P MY'KL^T^^\yMz{ 
yQTV]VfVfQfGg 
v  AD  FM  FS  FS  AS  wT 
  py  z}  F  M  M  zM  pN 
.S\]`bibrbr]rSs .  H  IL  NU  N]  N]  I]  ^ .  mv  wz  |C  |I  |I  wI  mJ .  Y\ .^ ,i95g+hiwimiwiw  yf  jg  ,h (bkloqx  rB  rB  mB  cC   NW  X[  ]d  ]l  ]l  Xl  Nm   |E  FI  KR  KX  KX  FX  |Y   il  )YsGL\L\G\=] )luvy  |C  |I  |I  wI  mJ )  fo  ps  u|  uC  uC  pC  fD )T #W),U"VWeW[WeWe  gI  XJ  #K 
IVY[b[k[kVkLl 
  |E  FI  KR  KX  KX  FX  |Y 
  u~  B  DK  DR  DR  R  uS 
/ /C /bkloqx  rB  rB  mB  cC /b (ay1_'`aoaeaoao  qZ  b[  (\ $ Z] mvwz  }D  }M  }M  xM  nN &;iWM]M]H]>^ ;u~  @D  EH  @I  KR  KX  KX  @X  vY ;  mp ;  @I  JM  OV  O]  O]  J]  @^ ;z #W),U"VWeW[WeWe  gJ  XK  #L YWZ\c\l\lWlMm   EN  OS  TW  OX  Za  Zg  Zg  Og  Eh   |   OX  Y\  ^e  ^l  ^l  Yl  Om ,0IVY[b[k[kVkLl 0| 0d &]Y/[%\]k]a]k]k  mS  ^T  &U "[dehjqjzjzez[{   LO  (>{'='=#i(k $
-Ic7K[K[F[<\ -^ !S	*Q RSaSWSaSa  cD  TE  !F 9UXZaZjZjUjKk 3	$s)W__B\8] 3pyz}  @G  @O  @O  {O  qP 3  [d  eh  jq  jy  jy  ey  [z 3j %[I.Y$Z[i[_[i[i  kP  \Q  %R !yQUVYQZ\c\k\kQkGl   @I  JM  OV  O^  O^  J^  @_   js  tw  y@  yH  yH  tH  jI (Bygmm9K/L BYbcfhohwhwcwYx B  EN  OR  T[  Tc  Tc  Oc  Ed B  @I  JN  OR  JS  U\  Ub  Ub  Jb  @c B  qt B  CF B  V_  `c  el  et  et  `t  Vu BH  Qy)OPQ_QUQ_Q_  aA  RB   C iW]]HZ>[ hqruw~  xG  xG  sG  iH   T]  ^a  cj  cr  cr  ^r  Ts   OX  Y]  ^a  Yb  dk  dq  dq  Yq  Or   @C   RU   en  or  t{  tC  tC  oC  eD 29	#w?O?O:O0P 9gpquvyqz  }D  }J  }J  rJ  hK 9  _b 9  r{  |  AH  AP  AP  |P  rQ 9v ?i =>~t~~Nc?de ygN^N^I^?_ v  AE  FI  AJ  LS  LY  LY  AY  wZ   nq   AJ  KN  PW  P_  P_  K_  A` *,ZcdgipiyiydyZz ,  HQ  RV  WZ  R[  ]d  ]l  ]l  Rl  Hm ,Z 2u;s1t  vDuy  vD  vD  Ey  vz  2{ .irsvx  yI  yI  tI  jJ   W`  ae  fi  aj  ls  l{  l{  a{  W| "+XabegngwgwbwXx +  NW  X\  ]`  Xa  cj  cr  cr  Xr  Ns +X 1s	:q0r  tBsw  tB  tB  Cu  tv  1w -gpqtv}  wG  wG  rG  hH   ]f  gk  lo  gp  ry  rA  rA  gA  ]B "2R[\_ahaqaq\qRr 2  BK  LO  QX  Q^  Q^  L^  B_ 2  tx 2f +g)4e*fgugkgugu  wc  hd  +e 'ajknpw  qA  qA  lA  bB   QZ  [^  `g  `m  `m  [m  Qn   DH 0bkloqx  rB  rB  mB  cC 0  SV 0d 9C	  CB  9C  DR  DH  DR  DR  SO  DP  9Q 5qz{~  AH  AQ  AQ  |Q  rR   be /s /SV /irsvx  yI  yI  tI  jJ /b .mY7k-lm{mqm{m{  }m  nn  .o *s ad t}  B  DK  DT  DT  T  uU $ (>{'='=#./(1 $
*9S'JZJZEZ;[ *X !S	*Q RSaSWSaSa  cC  TD  !E )TWY`YiYiTiJj  +A+*@*@&L+N '
O9S'--=O3P O]fgjlsl{l{g{]| O  IR  SV  X_  Xg  Xg  Sg  Ih O  {D  EH  JQ  JW  JW  EW  {X O  js  tw  y@  yF  yF  tF  jG O  Xa  be  gn  gt  gt  bt  Xu O  CF O  UX Ob $Y9-W#XYgY]YgYg  iM  ZN  $O  )CQXQ^Q^L^B_ luvy  |C  |K  |K  wK  mL   Xa  be  gn  gv  gv  bv  Xw   JS  TW  Y`  Yf  Yf  Tf  Jg   yB  CF  HO  HU  HU  CU  yV   gp  qt  v}  vC  vC  qC  gD   RU   dg ( 6L[5K5K1 L6M 2
]YsT[TaTaOaEb ]  |E  FI  KR  KX  KX  FX  |Y ]  qz  {~  @G  @O  @O  {O  qP ]  gp  qt  v}  vC  vC  qC  gD ]  JS  TW  Y`  Yh  Yh  Th  Ji ]  ox  y|  ~E  ~M  ~M  yM  oN ]  aj  kn  pw  p  p  k  a@ ]  S\  ]`  bi  bq  bq  ]q  Sr ]  FI ]  VY ]~ /oi8m.no}oso}o}  p  pq  /r +T]^acjcpcp^pTq   KT  UX  Za  Zg  Zg  Ug  Kh   @I  JM  OV  O^  O^  J^  @_   v  @C  EL  ER  ER  @R  vS   Yb  cf  ho  hw  hw  cw  Yx   ~G  HK  MT  M\  M\  H\  ~]   py  z}  F  N  N  zN  pO   bk  lo  qx  q@  q@  l@  bA   UX   fi 0 &<[%;%;!.&0 "
J3HXHXCX9Y Jluvy  |C  |I  |I  wI  mJ J  ]f  gj  ls  ly  ly  gy  ]z J  QZ  [_  `c  [d  fm  fs  fs  [s  Qt J  HK JX Oi(MN~t~~^|O}~ 	RUW^WgWgRgHh   |E  FI  KR  KX  KX  FX  |Y   lu  vy  {B  {H  {H  vH  lI   `i  jn  or  js  u|  uB  uB  jB  `C   WZ 0p	#wGWGWBW8X pgpqtv}  wD  wD  rD  hE p  QZ  [_  `c  [d  fm  fs  fs  [s  Qt p  }F  GK  LO  GP  RY  Ra  Ra  Ga  }b p  py  z~  B  zC  EL  ER  ER  zR  pS p  ir  sw  x{  s|  ~E  ~M  ~M  sM  iN p  en  os  tw  ox  zA  zI  zI  oI  eJ p  W`  ad  fm  fs  fs  as  Wt p  EN  OR  T[  Tc  Tc  Oc  Ed p  tw pb MY'KL^T^^\yMz{ :yQTV]VfVfQfGg :v  AD  FM  FS  FS  AS  wT :  `i  jn  or  js  u|  uB  uB  jB  `C :  LU  VZ  [^  V_  ah  ap  ap  Vp  Lq :  H  IM  NQ  IR  T[  Ta  Ta  Ia  b :  xA  BF  GJ  BK  MT  M\  M\  B\  x] :  t}  ~B  CF  ~G  IP  IX  IX  ~X  tY :  fo  ps  u|  uB  uB  pB  fC :  T]  ^a  cj  cr  cr  ^r  Ts :  CF :zT9S'JZJZEZ;[ Tjstxy|t}  @G  @M  @M  uM  kN T  _h  im  nq  ir  t{  tA  tA  iA  _B T  NW  X\  ]`  Xa  cj  cp  cp  Xp  Nq T  zC  DH  IL  DM  OV  O^  O^  D^  z_ T  mv  w{  |  w@  BI  BO  BO  wO  mP T  fo  pt  ux  py  {B  {J  {J  pJ  fK T  bk  lp  qt  lu  w~  wF  wF  lF  bG T  V_  `d  eh  `i  kr  ky  ky  `y  Vz T  GP  QT  V]  Vc  Vc  Qc  Gd T  u~  B	  D	K	  D	S	  D	S	  S	  uT	 T  d	m	  n	q	  s	z	  s	@
  s	@
  n	@
  d	A
 T  T
W
 Tj  Qy)OPQ_QUQ_Q_  aA  RB   C W)TWY`YiYiTiJj W  zC  DH  IL  DM  OV  O\  O\  D\  z] W  nw  x|  }@  xA  CJ  CP  CP  xP  nQ W  ]f  gk  lo  gp  ry  r  r  g  ]@ W  IR  SW  X[  S\  ^e  ^m  ^m  Sm  In W  |E  FJ  KN  FO  QX  Q^  Q^  F^  |_ W  u~  C  DG  H  JQ  JY  JY  Y  uZ W  qz  {  @C  {D  FM  FU  FU  {U  qV W  en  os  tw  ox  zA  zH  zH  oH  eI W  V_  `c  el  er  er  `r  Vs W  D	M	  N	Q	  S	Z	  S	b	  S	b	  N	b	  D	c	 W  s	|	  }	@
  B
I
  B
O
  B
O
  }	O
  s	P
 W  d
g
 Wt&	#wO_O_J_@` &pyz}  @G  @L  @L  {L  qM &P %[I.Y$Z[i[_[i[i  kP  \Q  %R !yY\^e^n^nYnOo   @I  JM  OV  O[  O[  J[  @\ )[dehjqjzjzez[{ )  LU  VY  [b  [g  [g  Vg  Lh )V 3w)<u2v  xFw{  xF  xF  G|  x}  3~ /jstw  zA  zJ  zJ  uJ  kK   [d  eh  jq  jv  jv  ev  [w rE   