112
112
113
113
def _apply_cacheable_combiner (
114
114
combiner : analyzer_nodes .Combiner ,
115
- * tensor_inputs : common_types .InputTensorType ) -> Tuple [tf .Tensor , ...]:
115
+ * tensor_inputs : common_types .TensorType ) -> Tuple [tf .Tensor , ...]:
116
116
"""Applies the combiner over the whole dataset possibly utilizing cache."""
117
117
input_values_node = analyzer_nodes .get_input_tensors_value_nodes (
118
118
tensor_inputs )
@@ -137,7 +137,7 @@ def _apply_cacheable_combiner(
137
137
138
138
def _apply_cacheable_combiner_per_key (
139
139
combiner : analyzer_nodes .Combiner ,
140
- * tensor_inputs : common_types .InputTensorType ) -> Tuple [tf .Tensor , ...]:
140
+ * tensor_inputs : common_types .TensorType ) -> Tuple [tf .Tensor , ...]:
141
141
"""Similar to _apply_cacheable_combiner but this is computed per key."""
142
142
input_values_node = analyzer_nodes .get_input_tensors_value_nodes (
143
143
tensor_inputs )
@@ -162,7 +162,7 @@ def _apply_cacheable_combiner_per_key(
162
162
163
163
def _apply_cacheable_combiner_per_key_large (
164
164
combiner : analyzer_nodes .Combiner , key_vocabulary_filename : str ,
165
- * tensor_inputs : common_types .InputTensorType
165
+ * tensor_inputs : common_types .TensorType
166
166
) -> Union [tf .Tensor , common_types .Asset ]:
167
167
"""Similar to above but saves the combined result to a file."""
168
168
input_values_node = analyzer_nodes .get_input_tensors_value_nodes (
@@ -382,7 +382,7 @@ def _numeric_combine(inputs: List[tf.Tensor],
382
382
383
383
@common .log_api_use (common .ANALYZER_COLLECTION )
384
384
def min ( # pylint: disable=redefined-builtin
385
- x : common_types .InputTensorType ,
385
+ x : common_types .TensorType ,
386
386
reduce_instance_dims : bool = True ,
387
387
name : Optional [str ] = None ) -> tf .Tensor :
388
388
"""Computes the minimum of the values of a `Tensor` over the whole dataset.
@@ -409,7 +409,7 @@ def min( # pylint: disable=redefined-builtin
409
409
410
410
@common .log_api_use (common .ANALYZER_COLLECTION )
411
411
def max ( # pylint: disable=redefined-builtin
412
- x : common_types .InputTensorType ,
412
+ x : common_types .TensorType ,
413
413
reduce_instance_dims : bool = True ,
414
414
name : Optional [str ] = None ) -> tf .Tensor :
415
415
"""Computes the maximum of the values of a `Tensor` over the whole dataset.
@@ -433,7 +433,7 @@ def max( # pylint: disable=redefined-builtin
433
433
return _min_and_max (x , reduce_instance_dims , name )[1 ]
434
434
435
435
436
- def _min_and_max (x : common_types .InputTensorType ,
436
+ def _min_and_max (x : common_types .TensorType ,
437
437
reduce_instance_dims : bool = True ,
438
438
name : Optional [str ] = None ) -> Tuple [tf .Tensor , tf .Tensor ]:
439
439
"""Computes the min and max of the values of a `Tensor` or `CompositeTensor`.
@@ -482,8 +482,8 @@ def _min_and_max(x: common_types.InputTensorType,
482
482
483
483
484
484
def _min_and_max_per_key (
485
- x : common_types .InputTensorType ,
486
- key : common_types .InputTensorType ,
485
+ x : common_types .TensorType ,
486
+ key : common_types .TensorType ,
487
487
reduce_instance_dims : bool = True ,
488
488
key_vocabulary_filename : Optional [str ] = None ,
489
489
name : Optional [str ] = None
@@ -577,7 +577,7 @@ def _sum_combine_fn_and_dtype(
577
577
578
578
@common .log_api_use (common .ANALYZER_COLLECTION )
579
579
def sum ( # pylint: disable=redefined-builtin
580
- x : common_types .InputTensorType ,
580
+ x : common_types .TensorType ,
581
581
reduce_instance_dims : bool = True ,
582
582
name : Optional [str ] = None ) -> tf .Tensor :
583
583
"""Computes the sum of the values of a `Tensor` over the whole dataset.
@@ -629,7 +629,7 @@ def sum( # pylint: disable=redefined-builtin
629
629
630
630
631
631
@common .log_api_use (common .ANALYZER_COLLECTION )
632
- def histogram (x : common_types .InputTensorType ,
632
+ def histogram (x : common_types .TensorType ,
633
633
boundaries : Optional [Union [tf .Tensor , int ]] = None ,
634
634
categorical : Optional [bool ] = False ,
635
635
name : Optional [str ] = None ) -> Tuple [tf .Tensor , tf .Tensor ]:
@@ -702,7 +702,7 @@ def histogram(x: common_types.InputTensorType,
702
702
703
703
704
704
@common .log_api_use (common .ANALYZER_COLLECTION )
705
- def size (x : common_types .InputTensorType ,
705
+ def size (x : common_types .TensorType ,
706
706
reduce_instance_dims : bool = True ,
707
707
name : Optional [str ] = None ) -> tf .Tensor :
708
708
"""Computes the total size of instances in a `Tensor` over the whole dataset.
@@ -730,7 +730,7 @@ def size(x: common_types.InputTensorType,
730
730
731
731
732
732
@common .log_api_use (common .ANALYZER_COLLECTION )
733
- def count_per_key (key : common_types .InputTensorType ,
733
+ def count_per_key (key : common_types .TensorType ,
734
734
key_vocabulary_filename : Optional [str ] = None ,
735
735
name : Optional [str ] = None ):
736
736
"""Computes the count of each element of a `Tensor`.
@@ -779,7 +779,7 @@ def count_per_key(key: common_types.InputTensorType,
779
779
780
780
781
781
@common .log_api_use (common .ANALYZER_COLLECTION )
782
- def mean (x : common_types .InputTensorType ,
782
+ def mean (x : common_types .TensorType ,
783
783
reduce_instance_dims : bool = True ,
784
784
name : Optional [str ] = None ,
785
785
output_dtype : Optional [tf .DType ] = None ) -> tf .Tensor :
@@ -807,7 +807,7 @@ def mean(x: common_types.InputTensorType,
807
807
808
808
809
809
@common .log_api_use (common .ANALYZER_COLLECTION )
810
- def var (x : common_types .InputTensorType ,
810
+ def var (x : common_types .TensorType ,
811
811
reduce_instance_dims : bool = True ,
812
812
name : Optional [str ] = None ,
813
813
output_dtype : Optional [tf .DType ] = None ) -> tf .Tensor :
@@ -837,7 +837,7 @@ def var(x: common_types.InputTensorType,
837
837
return _mean_and_var (x , reduce_instance_dims , output_dtype )[1 ]
838
838
839
839
840
- def _mean_and_var (x : common_types .InputTensorType ,
840
+ def _mean_and_var (x : common_types .TensorType ,
841
841
reduce_instance_dims : bool = True ,
842
842
output_dtype : Optional [tf .DType ] = None ):
843
843
"""More efficient combined `mean` and `var`. See `var`."""
@@ -876,7 +876,7 @@ def _mean_and_var(x: common_types.InputTensorType,
876
876
877
877
878
878
@common .log_api_use (common .ANALYZER_COLLECTION )
879
- def tukey_location (x : common_types .InputTensorType ,
879
+ def tukey_location (x : common_types .TensorType ,
880
880
reduce_instance_dims : Optional [bool ] = True ,
881
881
output_dtype : Optional [tf .DType ] = None ,
882
882
name : Optional [str ] = None ) -> tf .Tensor :
@@ -913,7 +913,7 @@ def tukey_location(x: common_types.InputTensorType,
913
913
914
914
915
915
@common .log_api_use (common .ANALYZER_COLLECTION )
916
- def tukey_scale (x : common_types .InputTensorType ,
916
+ def tukey_scale (x : common_types .TensorType ,
917
917
reduce_instance_dims : Optional [bool ] = True ,
918
918
output_dtype : Optional [tf .DType ] = None ,
919
919
name : Optional [str ] = None ) -> tf .Tensor :
@@ -951,7 +951,7 @@ def tukey_scale(x: common_types.InputTensorType,
951
951
952
952
953
953
@common .log_api_use (common .ANALYZER_COLLECTION )
954
- def tukey_h_params (x : common_types .InputTensorType ,
954
+ def tukey_h_params (x : common_types .TensorType ,
955
955
reduce_instance_dims : bool = True ,
956
956
output_dtype : Optional [tf .DType ] = None ,
957
957
name : Optional [str ] = None ) -> Tuple [tf .Tensor , tf .Tensor ]:
@@ -988,7 +988,7 @@ def tukey_h_params(x: common_types.InputTensorType,
988
988
989
989
990
990
def _tukey_parameters (
991
- x : common_types .InputTensorType ,
991
+ x : common_types .TensorType ,
992
992
reduce_instance_dims : bool = True ,
993
993
output_dtype : Optional [tf .DType ] = None
994
994
) -> Tuple [tf .Tensor , tf .Tensor , tf .Tensor , tf .Tensor ]:
@@ -1027,8 +1027,8 @@ def _tukey_parameters(
1027
1027
1028
1028
1029
1029
def _mean_and_var_per_key (
1030
- x : common_types .InputTensorType ,
1031
- key : common_types .InputTensorType ,
1030
+ x : common_types .TensorType ,
1031
+ key : common_types .TensorType ,
1032
1032
reduce_instance_dims : bool = True ,
1033
1033
output_dtype : Optional [tf .DType ] = None ,
1034
1034
key_vocabulary_filename : Optional [str ] = None
@@ -1652,7 +1652,7 @@ def _register_vocab(sanitized_filename: str,
1652
1652
# https://github.com/tensorflow/community/blob/master/rfcs/20190116-embedding-partitioned-variable.md#goals
1653
1653
@common .log_api_use (common .ANALYZER_COLLECTION )
1654
1654
def vocabulary (
1655
- x : common_types .InputTensorType ,
1655
+ x : common_types .TensorType ,
1656
1656
top_k : Optional [int ] = None ,
1657
1657
frequency_threshold : Optional [int ] = None ,
1658
1658
vocab_filename : Optional [str ] = None ,
0 commit comments