From d964c138a609252460ac2fae152ea75e7f67c07f Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Wed, 11 Oct 2023 13:59:07 +0200 Subject: [PATCH] wip part 2 --- data.csv | 59121 +++++++++++++++++++++++++++------------------- extract-data.py | 55 +- search-data.py | 23 + 3 files changed, 34380 insertions(+), 24819 deletions(-) create mode 100644 search-data.py diff --git a/data.csv b/data.csv index 61530648..3f7637e5 100644 --- a/data.csv +++ b/data.csv @@ -190,9 +190,8 @@ Returns: 44,set_host_c_compiler,tensorflow/configure.py,1100,function,Set HOST_C_COMPILER. 45,set_computecpp_toolkit_path,tensorflow/configure.py,1117,function,Set COMPUTECPP_TOOLKIT_PATH. 46,set_trisycl_include_dir,tensorflow/configure.py,1149,function,Set TRISYCL_INCLUDE_DIR. -47,system_specific_test_config,tensorflow/configure.py,1173,function,Add default build and test flags required for TF tests to bazelrc. -48,set_system_libs_flag,tensorflow/configure.py,1216,function, -49,is_reduced_optimize_huge_functions_available,tensorflow/configure.py,1233,function,"Check to see if the system supports /d2ReducedOptimizeHugeFunctions. +47,set_system_libs_flag,tensorflow/configure.py,1216,function, +48,is_reduced_optimize_huge_functions_available,tensorflow/configure.py,1233,function,"Check to see if the system supports /d2ReducedOptimizeHugeFunctions. The above compiler flag is a new compiler flag introduced to the Visual Studio compiler in version 16.4 (available in Visual Studio 2019, Preview edition @@ -216,223 +215,74 @@ Arguments: Returns: boolean, whether or not /d2ReducedOptimizeHugeFunctions is available on this machine." -50,set_windows_build_flags,tensorflow/configure.py,1262,function,Set Windows specific build options. -51,config_info_line,tensorflow/configure.py,1283,function,Helper function to print formatted help text for Bazel config options. -52,configure_ios,tensorflow/configure.py,1288,function,"Configures TensorFlow for iOS builds. +49,set_windows_build_flags,tensorflow/configure.py,1262,function,Set Windows specific build options. +50,config_info_line,tensorflow/configure.py,1283,function,Helper function to print formatted help text for Bazel config options. +51,configure_ios,tensorflow/configure.py,1288,function,"Configures TensorFlow for iOS builds. This function will only be executed if `is_macos()` is true." -53,validate_cuda_config,tensorflow/configure.py,1305,function,"Run find_cuda_config.py and return cuda_toolkit_path, or None." -54,main,tensorflow/configure.py,1365,function, -55,_running_from_pip_package,tensorflow/tensorflow/api_template.__init__.py,132,function, -56,_running_from_pip_package,tensorflow/tensorflow/api_template_v1.__init__.py,142,function, -57,_LazyLoader,tensorflow/tensorflow/virtual_root_template_v1.__init__.py,33,class,Lazily import a module so that we can forward it. -58,_forward_module,tensorflow/tensorflow/virtual_root_template_v1.__init__.py,63,function, -59,_LazyLoader,tensorflow/tensorflow/virtual_root_template_v2.__init__.py,33,class,Lazily import a module so that we can forward it. -60,_forward_module,tensorflow/tensorflow/virtual_root_template_v2.__init__.py,63,function, -61,VarsAndArithmeticObjectGraph,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,37,class,Three vars (one in a sub-module) and compute method. -62,ReferencesParent,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,55,class, -63,CyclicModule,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,64,class, -64,main,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,77,function, -65,tfadd,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,48,function, -66,tfadd_with_ckpt,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,54,function, -67,tfadd_with_ckpt_saver,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,69,function, -68,tfassert_eq,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,88,function, -69,tfcond,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,96,function, -70,tfgather,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,104,function, -71,tfmatmul,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,110,function, -72,tfmatmulandadd,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,116,function, -73,tffunction,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,124,function, -74,tfsplits,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,135,function,"A more complex graph, including splits." -75,tftop_k,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,152,function, -76,tfvariable_readonly,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,158,function, -77,tfvariable,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,169,function, -78,tfvariable_sequential_updates,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,177,function, -79,export_debug_info,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,189,function,"Exports debug information from a graph. +52,validate_cuda_config,tensorflow/configure.py,1305,function,"Run find_cuda_config.py and return cuda_toolkit_path, or None." +53,VarsAndArithmeticObjectGraph,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,37,class,Three vars (one in a sub-module) and compute method. +54,compute,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,51,method, +55,ReferencesParent,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,55,class, +56,CyclicModule,tensorflow/tensorflow/cc/saved_model/testdata/generate_saved_models.py,64,class, +57,tfadd,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,48,function, +58,tfadd_with_ckpt,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,54,function, +59,tfadd_with_ckpt_saver,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,69,function, +60,tfassert_eq,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,88,function, +61,tfcond,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,96,function, +62,tfgather,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,104,function, +63,tfmatmul,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,110,function, +64,tfmatmulandadd,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,116,function, +65,tffunction,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,124,function, +66,tfsplits,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,135,function,"A more complex graph, including splits." +67,tftop_k,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,152,function, +68,tfvariable_readonly,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,158,function, +69,tfvariable,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,169,function, +70,tfvariable_sequential_updates,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,177,function, +71,export_debug_info,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,189,function,"Exports debug information from a graph. Args: exported_graph: A Graph that has been created by tracing a saveable view. Returns: Corresponding GraphDebugInfo with traces for all ops in exported_graph." -80,write_graph,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,204,function,Build a graph using build_graph and write it out. -81,main,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,223,function, -82,_XlaClusterOutputGrad,tensorflow/tensorflow/compiler/jit/ops/xla_ops_grad.py,25,function, -83,TestGraphDebugInfo,tensorflow/tensorflow/compiler/mlir/lite/tests/debuginfo/concrete_function_error.py,32,class,Test stack trace can be displayed. -84,main,tensorflow/tensorflow/compiler/mlir/lite/tests/debuginfo/concrete_function_error.py,64,function, -85,TestModule,tensorflow/tensorflow/compiler/mlir/lite/tests/debuginfo/saved_model_error.py,32,class,The test model has unsupported op. -86,TestGraphDebugInfo,tensorflow/tensorflow/compiler/mlir/lite/tests/debuginfo/saved_model_error.py,41,class,Test stack trace can be displayed. -87,main,tensorflow/tensorflow/compiler/mlir/lite/tests/debuginfo/saved_model_error.py,73,function,test driver method writes the error message to stdout. -88,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/basic.py,38,class, -89,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/basic_v1.py,49,function, -90,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/call_to_exported.py,27,class, -91,do_test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/common.py,43,function,"Runs test. - -1. Performs absl and tf ""main""-like initialization that must run before almost - anything else. -2. Converts `tf.Module` to SavedModel -3. Converts SavedModel to MLIR -4. Prints the textual MLIR to stdout (it is expected that the caller will have - FileCheck checks in its file to check this output). - -This is only for use by the MLIR SavedModel importer tests. - -Args: - create_module_fn: A callable taking no arguments, which returns the - `tf.Module` to be converted and printed. - exported_names: A set of exported names for the MLIR converter (default is - ""export all""). - show_debug_info: If true, shows debug locations in the resulting MLIR." -92,set_tf_options,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/common_v1.py,38,function, -93,do_test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/common_v1.py,49,function,"Runs test. - -1. Performs absl and tf ""main""-like initialization that must run before almost - anything else. -2. Converts signature_def_map to SavedModel V1 -3. Converts SavedModel V1 to MLIR -4. Prints the textual MLIR to stdout (it is expected that the caller will have - FileCheck checks in its file to check this output). - -This is only for use by the MLIR SavedModel importer tests. - -Args: - create_signature: A functor that return signature_def_map, init_op and - assets_collection. signature_def_map is a map from string key to - signature_def. The key will be used as function name in the resulting - MLIR. - canonicalize: If true, canonicalizer will be run on the resulting MLIR. - show_debug_info: If true, shows debug locations in the resulting MLIR." -94,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/control_flow_duplicate_v1.py,42,function, -95,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/control_flow_upgrade_legacy_v1.py,34,function, -96,ReferencesParent,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/cyclic_object_graph.py,27,class, -97,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/cyclic_object_graph.py,38,class, -98,Child,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/dag_object_graph.py,27,class, -99,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/dag_object_graph.py,37,class, -100,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py,27,class, -101,plus,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/defun_export.py,29,function, -102,test_defun,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/defun_export.py,33,function, -103,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/duplicate_method_names_v1.py,37,function, -104,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/exported_python_args.py,27,class, -105,write_vocabulary_file,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/hash_table_asset_v1.py,39,function,Write temporary vocab file for module construction. -106,test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/hash_table_asset_v1.py,49,function, -107,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/hash_table_v1.py,60,function, -108,mnist_model,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/keras.py,27,function,Creates a MNIST model. -109,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/keras.py,36,class, -110,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/multi_arguments_results_v1.py,52,function, -111,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/multi_variables_v1.py,39,function, -112,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/partially_shaped_variables.py,27,class, -113,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/remove_init_variable_v1.py,50,function, -114,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/shapes_for_arguments.py,27,class, -115,Test,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/shared_variable_v1.py,41,function, -116,TestModule,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/structured_input.py,27,class, -117,AdadeltaOptimizerTest,tensorflow/tensorflow/compiler/tests/adadelta_test.py,31,class, -118,AdagradDAOptimizerTest,tensorflow/tensorflow/compiler/tests/adagrad_da_test.py,32,class, -119,AdagradOptimizerTest,tensorflow/tensorflow/compiler/tests/adagrad_test.py,31,class, -120,adam_update_numpy,tensorflow/tensorflow/compiler/tests/adam_test.py,34,function, -121,AdamOptimizerTest,tensorflow/tensorflow/compiler/tests/adam_test.py,52,class, -122,XlaAddNTest,tensorflow/tensorflow/compiler/tests/add_n_test.py,30,class, -123,ArgMinMaxTest,tensorflow/tensorflow/compiler/tests/argminmax_test.py,30,class, -124,BinaryOpsTest,tensorflow/tensorflow/compiler/tests/binary_ops_test.py,39,class,Test cases for binary operators. -125,BucketizationOpTest,tensorflow/tensorflow/compiler/tests/bucketize_op_test.py,30,class, -126,CaseTest,tensorflow/tensorflow/compiler/tests/case_test.py,31,class, -127,CategoricalTest,tensorflow/tensorflow/compiler/tests/categorical_op_test.py,36,class,Test cases for random-number generating operators. -128,CholeskyOpTest,tensorflow/tensorflow/compiler/tests/cholesky_op_test.py,35,class, -129,ClusteringTest,tensorflow/tensorflow/compiler/tests/clustering_test.py,35,class, -130,ComplexNumbersDivisionTest,tensorflow/tensorflow/compiler/tests/complex_div_test.py,35,class,Test cases for complex numbers division operators. -131,ConcatTest,tensorflow/tensorflow/compiler/tests/concat_ops_test.py,34,class, -132,ConcatOffsetTest,tensorflow/tensorflow/compiler/tests/concat_ops_test.py,335,class, -133,PackTest,tensorflow/tensorflow/compiler/tests/concat_ops_test.py,349,class, -134,CondTest,tensorflow/tensorflow/compiler/tests/cond_test.py,39,class, -135,Conv2DTest,tensorflow/tensorflow/compiler/tests/conv2d_test.py,42,class, -136,Conv2DBackpropInputTest,tensorflow/tensorflow/compiler/tests/conv2d_test.py,236,class, -137,Conv2DBackpropFilterTest,tensorflow/tensorflow/compiler/tests/conv2d_test.py,534,class, -138,Conv3DBackpropFilterV2GradTest,tensorflow/tensorflow/compiler/tests/conv3d_test.py,36,class, -139,Conv3DTransposeTest,tensorflow/tensorflow/compiler/tests/conv3d_test.py,69,class, -140,ConvolutionNodeNameTest,tensorflow/tensorflow/compiler/tests/conv_node_name_test.py,35,class,"Verify convolution node name match. - -Verify convolution node names on TPU and CPU match with dilation > 1." -141,XlaDataFormatDimMapTest,tensorflow/tensorflow/compiler/tests/data_format_ops_test.py,30,class, -142,XlaPermuteOpTest,tensorflow/tensorflow/compiler/tests/data_format_ops_test.py,67,class, -143,GetRunMetadataLabels,tensorflow/tensorflow/compiler/tests/dense_layer_test.py,36,function,Returns all labels in run_metadata. -144,InLabels,tensorflow/tensorflow/compiler/tests/dense_layer_test.py,45,function,Returns true iff one of the labels contains substr. -145,DenseLayerTest,tensorflow/tensorflow/compiler/tests/dense_layer_test.py,50,class, -146,ReferenceDepthwiseConv2D,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,35,function, -147,ConfigsToTest,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,64,function,"Iterator for different convolution shapes, strides and paddings. - -Yields: - Tuple (input_size, filter_size, out_size, stride, padding), the depthwise - convolution parameters." -148,ConfigsWithDilationsToTest,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,91,function,"Iterator for different convolution shapes, strides and paddings. - -Yields: - Tuple (input_size, filter_size, out_size, stride, dilation, padding), the - depthwise - convolution parameters." -149,CheckGradConfigsToTest,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,117,function,"Iterator for different convolution shapes, strides and paddings. - -compute_gradient_error() is very expensive. So the configs should be -relatively small. - -Yields: - Tuple (input_size, filter_size, out_size, stride, padding), the depthwise - convolution parameters." -150,DepthwiseConv2DTest,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,144,class, -151,DynamicUpdateSliceOpsTest,tensorflow/tensorflow/compiler/tests/dynamic_slice_ops_test.py,30,class, -152,DynamicStitchTest,tensorflow/tensorflow/compiler/tests/dynamic_stitch_test.py,30,class, -153,EagerTest,tensorflow/tensorflow/compiler/tests/eager_test.py,47,class, -154,EagerFunctionTest,tensorflow/tensorflow/compiler/tests/eager_test.py,301,class, -155,ExcessivePaddingTest,tensorflow/tensorflow/compiler/tests/eager_test.py,721,class,"Test that eager execution works with TPU flattened tensors. - -Tensors that would normally be excessively padded when written -to TPU memory are reshaped to 1-D flat tensors. - -This test case verifies that such tensors work with eager execution. - -The flattening currently only happens on TPU, but tests should work -fine with all backends as flattening is transparent." -156,multiple_tpus,tensorflow/tensorflow/compiler/tests/eager_test.py,772,function, -157,MultiDeviceTest,tensorflow/tensorflow/compiler/tests/eager_test.py,777,class,Test running TPU computation on more than one core. -158,EinsumOpTest,tensorflow/tensorflow/compiler/tests/einsum_op_test.py,30,class,Test cases for einsum op. -159,EnsureShapeOpTest,tensorflow/tensorflow/compiler/tests/ensure_shape_op_test.py,29,class, -160,ExtractImagePatches,tensorflow/tensorflow/compiler/tests/extract_image_patches_op_test.py,29,class,Functional tests for ExtractImagePatches op. -161,FakeQuantWithMinMaxArgsTest,tensorflow/tensorflow/compiler/tests/fake_quant_ops_test.py,27,class,Test cases for FakeQuantWithMinMaxArgs operation. -162,FakeQuantWithMinMaxArgsGradientTest,tensorflow/tensorflow/compiler/tests/fake_quant_ops_test.py,125,class,Test cases for FakeQuantWithMinMaxArgsGradient operation. -163,FakeQuantWithMinMaxVarsTest,tensorflow/tensorflow/compiler/tests/fake_quant_ops_test.py,226,class,Test cases for FakeQuantWithMinMaxVars operation. -164,FakeQuantWithMinMaxVarsGradientTest,tensorflow/tensorflow/compiler/tests/fake_quant_ops_test.py,331,class,Test cases for FakeQuantWithMinMaxVarsGradient operation. -165,pick_10,tensorflow/tensorflow/compiler/tests/fft_test.py,38,function, -166,to_32bit,tensorflow/tensorflow/compiler/tests/fft_test.py,45,function, -167,FFTTest,tensorflow/tensorflow/compiler/tests/fft_test.py,60,class, -168,FIFOQueueTest,tensorflow/tensorflow/compiler/tests/fifo_queue_test.py,31,class, -169,FtrlOptimizerTest,tensorflow/tensorflow/compiler/tests/ftrl_test.py,32,class, -170,FunctionTest,tensorflow/tensorflow/compiler/tests/function_test.py,31,class, -171,FusedBatchNormTest,tensorflow/tensorflow/compiler/tests/fused_batchnorm_test.py,45,class, -172,GatherNdTest,tensorflow/tensorflow/compiler/tests/gather_nd_op_test.py,30,class, -173,GatherTest,tensorflow/tensorflow/compiler/tests/gather_test.py,34,class, -174,GatherBenchmark,tensorflow/tensorflow/compiler/tests/gather_test.py,158,class,Microbenchmarks for the gather op. -175,_generate_numpy_random_rgb,tensorflow/tensorflow/compiler/tests/image_ops_test.py,40,function, -176,RGBToHSVTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,47,class, -177,AdjustContrastTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,110,class, -178,AdjustHueTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,174,class, -179,AdjustSaturationTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,309,class, -180,ResizeNearestNeighborTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,409,class, -181,ResizeBilinearTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,548,class, -182,ResizeBilinearGradTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,631,class, -183,ResizeBilinearNonAlignCornersTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,713,class, -184,NonMaxSuppressionTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,776,class, -185,BatchedNonMaxSuppressionCorrectnessTest,tensorflow/tensorflow/compiler/tests/image_ops_test.py,985,class, -186,NoRewriteSessionConfig,tensorflow/tensorflow/compiler/tests/jit_test.py,46,function, -187,CompiledKernel,tensorflow/tensorflow/compiler/tests/jit_test.py,56,function,"Execute 'fn' as a compiled XLA kernel, with 'inputs'." -188,RunMetadataLabels,tensorflow/tensorflow/compiler/tests/jit_test.py,68,function,Returns all labels in run_metadata. -189,InLabels,tensorflow/tensorflow/compiler/tests/jit_test.py,77,function,Returns true iff one of the labels contains substr. -190,MetadataHasXlaRunOp,tensorflow/tensorflow/compiler/tests/jit_test.py,82,function,Returns true if there are XlaRun kernels in run_metadata's timeline. -191,JitLaunchTest,tensorflow/tensorflow/compiler/tests/jit_test.py,89,class, -192,XlaCompilationTest,tensorflow/tensorflow/compiler/tests/jit_test.py,279,class,Tests for auto-compilation on CPU/GPU devices. -193,ElementWiseFusionTest,tensorflow/tensorflow/compiler/tests/jit_test.py,480,class, -194,LazyCompilationTest,tensorflow/tensorflow/compiler/tests/jit_test.py,520,class, -195,ListDiffTest,tensorflow/tensorflow/compiler/tests/listdiff_op_test.py,31,class, -196,LRNTest,tensorflow/tensorflow/compiler/tests/lrn_ops_test.py,39,class, -197,Clip,tensorflow/tensorflow/compiler/tests/lstm.py,38,function,"Clips x to the range [-1., 1.]." -198,LSTMCellWeightsShape,tensorflow/tensorflow/compiler/tests/lstm.py,43,function,Returns the shape of the weights for a single LSTM cell. -199,LSTMCell,tensorflow/tensorflow/compiler/tests/lstm.py,50,function,"Unrolls a single LSTM cell with clipped activations forward by one step. +72,write_graph,tensorflow/tensorflow/compiler/aot/tests/make_test_graphs.py,204,function,Build a graph using build_graph and write it out. +73,set_tf_options,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/common_v1.py,38,function, +74,ReferencesParent,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/cyclic_object_graph.py,27,class, +75,Child,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/dag_object_graph.py,27,class, +76,plus,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/defun_export.py,29,function, +77,write_vocabulary_file,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/hash_table_asset_v1.py,39,function,Write temporary vocab file for module construction. +78,mnist_model,tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/keras.py,27,function,Creates a MNIST model. +79,adam_update_numpy,tensorflow/tensorflow/compiler/tests/adam_test.py,34,function, +80,GetRunMetadataLabels,tensorflow/tensorflow/compiler/tests/dense_layer_test.py,36,function,Returns all labels in run_metadata. +81,InLabels,tensorflow/tensorflow/compiler/tests/dense_layer_test.py,45,function,Returns true iff one of the labels contains substr. +82,ReferenceDepthwiseConv2D,tensorflow/tensorflow/compiler/tests/depthwise_conv_op_test.py,35,function, +83,multiple_tpus,tensorflow/tensorflow/compiler/tests/eager_test.py,772,function, +84,ExtractImagePatches,tensorflow/tensorflow/compiler/tests/extract_image_patches_op_test.py,29,class,Functional tests for ExtractImagePatches op. +85,pick_10,tensorflow/tensorflow/compiler/tests/fft_test.py,38,function, +86,to_32bit,tensorflow/tensorflow/compiler/tests/fft_test.py,45,function, +87,GatherBenchmark,tensorflow/tensorflow/compiler/tests/gather_test.py,158,class,Microbenchmarks for the gather op. +88,benchmarkSliceGatherAxis0,tensorflow/tensorflow/compiler/tests/gather_test.py,183,method, +89,benchmarkSliceGatherAxis0XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,186,method, +90,benchmarkSliceGatherAxis1,tensorflow/tensorflow/compiler/tests/gather_test.py,189,method, +91,benchmarkSliceGatherAxis1XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,192,method, +92,benchmarkSliceGatherAxis4,tensorflow/tensorflow/compiler/tests/gather_test.py,195,method, +93,benchmarkSliceGatherAxis4XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,198,method, +94,benchmarkNontrivialGatherAxis0,tensorflow/tensorflow/compiler/tests/gather_test.py,201,method, +95,benchmarkNontrivialGatherAxis0XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,204,method, +96,benchmarkNontrivialGatherAxis1,tensorflow/tensorflow/compiler/tests/gather_test.py,207,method, +97,benchmarkNontrivialGatherAxis1XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,210,method, +98,benchmarkNontrivialGatherAxis4,tensorflow/tensorflow/compiler/tests/gather_test.py,213,method, +99,benchmarkNontrivialGatherAxis4XLA,tensorflow/tensorflow/compiler/tests/gather_test.py,216,method, +100,BuilderFn,tensorflow/tensorflow/compiler/tests/gather_test.py,163,method, +101,NoRewriteSessionConfig,tensorflow/tensorflow/compiler/tests/jit_test.py,46,function, +102,CompiledKernel,tensorflow/tensorflow/compiler/tests/jit_test.py,56,function,"Execute 'fn' as a compiled XLA kernel, with 'inputs'." +103,RunMetadataLabels,tensorflow/tensorflow/compiler/tests/jit_test.py,68,function,Returns all labels in run_metadata. +104,InLabels,tensorflow/tensorflow/compiler/tests/jit_test.py,77,function,Returns true iff one of the labels contains substr. +105,MetadataHasXlaRunOp,tensorflow/tensorflow/compiler/tests/jit_test.py,82,function,Returns true if there are XlaRun kernels in run_metadata's timeline. +106,Clip,tensorflow/tensorflow/compiler/tests/lstm.py,38,function,"Clips x to the range [-1., 1.]." +107,LSTMCellWeightsShape,tensorflow/tensorflow/compiler/tests/lstm.py,43,function,Returns the shape of the weights for a single LSTM cell. +108,LSTMCell,tensorflow/tensorflow/compiler/tests/lstm.py,50,function,"Unrolls a single LSTM cell with clipped activations forward by one step. Args: weights: Weight matrix with shape LSTMCellWeightsShape. @@ -445,7 +295,7 @@ Args: from the previous states. Returns: The next (m, c) states, each with shape [batch_size, num_nodes]." -200,LSTMLayer,tensorflow/tensorflow/compiler/tests/lstm.py,88,function,"Unrolls a layer of LSTM cells forward by the sequence length. +109,LSTMLayer,tensorflow/tensorflow/compiler/tests/lstm.py,88,function,"Unrolls a layer of LSTM cells forward by the sequence length. The sequence length is determined by the length of x_seq and pad_seq, which must be the same. @@ -465,9 +315,9 @@ Returns: List of per-sequence-step outputs, each with shape [batch_size, num_nodes]. Raises: ValueError: If len(x_seq) != len(pad_seq)." -201,RandomVar,tensorflow/tensorflow/compiler/tests/lstm.py,121,function,Returns a variable of the given shape initialized to random values. -202,RandomInputs,tensorflow/tensorflow/compiler/tests/lstm.py,127,function,"Returns randomly initialized (x_seq, pad_seq) sequences." -203,BuildLSTMLayer,tensorflow/tensorflow/compiler/tests/lstm.py,140,function,"Builds a single LSTM layer with random weights and inputs. +110,RandomVar,tensorflow/tensorflow/compiler/tests/lstm.py,121,function,Returns a variable of the given shape initialized to random values. +111,RandomInputs,tensorflow/tensorflow/compiler/tests/lstm.py,127,function,"Returns randomly initialized (x_seq, pad_seq) sequences." +112,BuildLSTMLayer,tensorflow/tensorflow/compiler/tests/lstm.py,140,function,"Builds a single LSTM layer with random weights and inputs. Args: batch_size: Inputs are fed in batches of this size. @@ -479,84 +329,34 @@ Returns: (out_seq, weights) pair. The out_seq is a list of per-sequence-step outputs, each with shape [batch_size, num_nodes]. The weights are a list of weight variables that may be trained." -204,_DumpGraph,tensorflow/tensorflow/compiler/tests/lstm_test.py,40,function, -205,_Sigmoid,tensorflow/tensorflow/compiler/tests/lstm_test.py,47,function, -206,_Clip,tensorflow/tensorflow/compiler/tests/lstm_test.py,51,function, -207,LSTMTest,tensorflow/tensorflow/compiler/tests/lstm_test.py,55,class, -208,LSTMBenchmark,tensorflow/tensorflow/compiler/tests/lstm_test.py,238,class,Mcro-benchmarks for a single layer of LSTM cells. -209,ManipOpsTest,tensorflow/tensorflow/compiler/tests/manip_ops_test.py,30,class,Test cases for manip ops. -210,MatrixBandPartTest,tensorflow/tensorflow/compiler/tests/matrix_band_part_test.py,30,class, -211,zip_to_first_list_length,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,32,function, -212,repack_diagonals,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,40,function, -213,repack_diagonals_in_tests,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,77,function, -214,square_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,95,function, -215,tall_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,173,function, -216,fat_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,261,function, -217,all_tests,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,329,function, -218,MatrixDiagTest,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,333,class, -219,MatrixSetDiagTest,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,519,class, -220,MatrixDiagPartTest,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,652,class, -221,InverseOpTest,tensorflow/tensorflow/compiler/tests/matrix_inverse_op_test.py,31,class, -222,MatrixSolveOpTest,tensorflow/tensorflow/compiler/tests/matrix_solve_op_test.py,30,class, -223,MakePlaceholder,tensorflow/tensorflow/compiler/tests/matrix_triangular_solve_op_test.py,36,function, -224,MatrixTriangularSolveOpTest,tensorflow/tensorflow/compiler/tests/matrix_triangular_solve_op_test.py,40,class, -225,MomentumOptimizerTest,tensorflow/tensorflow/compiler/tests/momentum_test.py,33,class, -226,NAryOpsTest,tensorflow/tensorflow/compiler/tests/nary_ops_test.py,32,class, -227,NullaryOpsTest,tensorflow/tensorflow/compiler/tests/nullary_ops_test.py,29,class, -228,PlaceholderTest,tensorflow/tensorflow/compiler/tests/placeholder_test.py,28,class, -229,_AvgPoolGrad,tensorflow/tensorflow/compiler/tests/pooling_ops_3d_test.py,35,function, -230,Pooling3DTest,tensorflow/tensorflow/compiler/tests/pooling_ops_3d_test.py,45,class, -231,NHWCToNCHW,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,33,function,"Convert the input from NHWC format to NCHW. +113,LSTMBenchmark,tensorflow/tensorflow/compiler/tests/lstm_test.py,238,class,Mcro-benchmarks for a single layer of LSTM cells. +114,benchmarkLayerInference,tensorflow/tensorflow/compiler/tests/lstm_test.py,256,method, +115,benchmarkLayerInferenceXLA,tensorflow/tensorflow/compiler/tests/lstm_test.py,260,method, +116,benchmarkLayerTraining,tensorflow/tensorflow/compiler/tests/lstm_test.py,264,method, +117,benchmarkLayerTrainingXLA,tensorflow/tensorflow/compiler/tests/lstm_test.py,268,method, +118,zip_to_first_list_length,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,32,function, +119,repack_diagonals,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,40,function, +120,square_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,95,function, +121,tall_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,173,function, +122,fat_cases,tensorflow/tensorflow/compiler/tests/matrix_diag_ops_test.py,261,function, +123,MakePlaceholder,tensorflow/tensorflow/compiler/tests/matrix_triangular_solve_op_test.py,36,function, +124,NHWCToNCHW,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,33,function,"Convert the input from NHWC format to NCHW. Args: input_tensor: a 4-D tensor, or a 4-element array representing the same. Returns: the converted tensor or a shape array" -232,NCHWToNHWC,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,48,function,"Convert the input from NCHW format to NHWC. +125,NCHWToNHWC,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,48,function,"Convert the input from NCHW format to NHWC. Args: input_tensor: a 4-D tensor, or a 4-element array representing the same. Returns: the converted tensor or a shape array" -233,GetTestConfigs,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,63,function,"Get all the valid tests configs to run. - -Returns: - all the valid test configs" -234,PoolingTest,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,73,class, -235,PoolGradTest,tensorflow/tensorflow/compiler/tests/pooling_ops_test.py,292,class, -236,ProximalAdagradOptimizerTest,tensorflow/tensorflow/compiler/tests/proximal_adagrad_test.py,32,class, -237,ProximalGradientDescentOptimizerTest,tensorflow/tensorflow/compiler/tests/proximal_gradient_descent_test.py,32,class, -238,QrOpTest,tensorflow/tensorflow/compiler/tests/qr_op_test.py,33,class, -239,QuantizedOpsTest,tensorflow/tensorflow/compiler/tests/quantized_ops_test.py,36,class, -240,DequantizedOpsTest,tensorflow/tensorflow/compiler/tests/quantized_ops_test.py,53,class, -241,RandomOpsTest,tensorflow/tensorflow/compiler/tests/random_ops_test.py,34,class,Test cases for random-number generating operators. -242,ReduceOpsTest,tensorflow/tensorflow/compiler/tests/reduce_ops_test.py,37,class, -243,ReduceOpPrecisionTest,tensorflow/tensorflow/compiler/tests/reduce_ops_test.py,183,class, -244,ReduceWindowTest,tensorflow/tensorflow/compiler/tests/reduce_window_test.py,31,class,Test cases for xla.reduce_window. -245,ReshapeTest,tensorflow/tensorflow/compiler/tests/reshape_op_test.py,30,class, -246,ReverseOpsTest,tensorflow/tensorflow/compiler/tests/reverse_ops_test.py,32,class, -247,ReverseSequenceTest,tensorflow/tensorflow/compiler/tests/reverse_sequence_op_test.py,29,class, -248,RmspropTest,tensorflow/tensorflow/compiler/tests/rmsprop_test.py,31,class, -249,numpy_reverse,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,32,function, -250,handle_options,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,43,function,Adds tf options to numpy scan ops. -251,CumsumTest,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,72,class, -252,CumprodTest,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,150,class, -253,_AsType,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,31,function, -254,_FlatInnerDims,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,35,function, -255,_FlatOuterDims,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,42,function, -256,_NumpyScatterNd,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,49,function, -257,_NumpyUpdate,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,66,function, -258,ScatterNdTest,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,71,class, -259,ScatterNdTensorTest,tensorflow/tensorflow/compiler/tests/scatter_nd_op_test.py,193,class, -260,SearchSorteddOpTest,tensorflow/tensorflow/compiler/tests/searchsorted_op_test.py,28,class, -261,SegmentReductionOpsTest,tensorflow/tensorflow/compiler/tests/segment_reduction_ops_test.py,32,class,Test cases for segment reduction ops. -262,SelfAdjointEigOpTest,tensorflow/tensorflow/compiler/tests/self_adjoint_eig_op_test.py,32,class, -263,SliceTest,tensorflow/tensorflow/compiler/tests/slice_ops_test.py,29,class, -264,StridedSliceTest,tensorflow/tensorflow/compiler/tests/slice_ops_test.py,127,class, -265,XlaSortOpTest,tensorflow/tensorflow/compiler/tests/sort_ops_test.py,32,class, -266,space_to_batch_direct,tensorflow/tensorflow/compiler/tests/spacetobatch_op_test.py,30,function,"Direct Python implementation of space-to-batch conversion. +126,numpy_reverse,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,32,function, +127,handle_options,tensorflow/tensorflow/compiler/tests/scan_ops_test.py,43,function,Adds tf options to numpy scan ops. +128,space_to_batch_direct,tensorflow/tensorflow/compiler/tests/spacetobatch_op_test.py,30,function,"Direct Python implementation of space-to-batch conversion. This is used for tests only. @@ -567,49 +367,23 @@ Args: Returns: Converted tensor." -267,SpaceToBatchTest,tensorflow/tensorflow/compiler/tests/spacetobatch_op_test.py,71,class,Tests input-output pairs for the SpaceToBatch and BatchToSpace ops. -268,SpaceToBatchNDTest,tensorflow/tensorflow/compiler/tests/spacetobatch_op_test.py,152,class,Tests input-output pairs for the SpaceToBatchND and BatchToSpaceND ops. -269,_SparseToDense,tensorflow/tensorflow/compiler/tests/sparse_to_dense_op_test.py,31,function, -270,SparseToDenseTest,tensorflow/tensorflow/compiler/tests/sparse_to_dense_op_test.py,46,class, -271,_igamma,tensorflow/tensorflow/compiler/tests/special_math_test.py,48,function, -272,_igammac,tensorflow/tensorflow/compiler/tests/special_math_test.py,53,function, -273,implicit_reparameterization_grad,tensorflow/tensorflow/compiler/tests/special_math_test.py,58,function, -274,_log1p,tensorflow/tensorflow/compiler/tests/special_math_test.py,65,function, -275,Log1pTest,tensorflow/tensorflow/compiler/tests/special_math_test.py,69,class, -276,IgammaTest,tensorflow/tensorflow/compiler/tests/special_math_test.py,139,class, -277,IgammacTest,tensorflow/tensorflow/compiler/tests/special_math_test.py,324,class, -278,StackOpTest,tensorflow/tensorflow/compiler/tests/stack_ops_test.py,32,class, -279,xla_device,tensorflow/tensorflow/compiler/tests/stateful_random_ops_test.py,41,function, -280,xla_device_name,tensorflow/tensorflow/compiler/tests/stateful_random_ops_test.py,55,function, -281,StatefulRandomOpsTest,tensorflow/tensorflow/compiler/tests/stateful_random_ops_test.py,64,class,Test cases for stateful random-number generator operators. -282,StatelessRandomOpsTest,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,33,class,Test cases for stateless random-number generator operators. -283,StatelessRandomOpsBenchmark,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,136,class,Microbenchmarks for the stateless random ops. -284,SvdOpTest,tensorflow/tensorflow/compiler/tests/svd_op_test.py,33,class, -285,_make_converter,tensorflow/tensorflow/compiler/tests/tensor_array_ops_test.py,42,function, -286,TensorArrayTest,tensorflow/tensorflow/compiler/tests/tensor_array_ops_test.py,53,class, -287,ListOpsTest,tensorflow/tensorflow/compiler/tests/tensor_list_ops_test.py,34,class, -288,TernaryOpsTest,tensorflow/tensorflow/compiler/tests/ternary_ops_test.py,34,class, -289,ConvertBetweenDataFormats,tensorflow/tensorflow/compiler/tests/test_utils.py,26,function,Converts 4D tensor between data formats. -290,PermuteDimsBetweenDataFormats,tensorflow/tensorflow/compiler/tests/test_utils.py,47,function,Get new shape for converting between data formats. -291,RunWithWarmup,tensorflow/tensorflow/compiler/tests/test_utils.py,71,function,Runs a graph a few times to ensure that its clusters are compiled. -292,_tfconst,tensorflow/tensorflow/compiler/tests/tridiagonal_solve_ops_test.py,39,function, -293,_tf_ones,tensorflow/tensorflow/compiler/tests/tridiagonal_solve_ops_test.py,43,function, -294,TridiagonalSolveOpsTest,tensorflow/tensorflow/compiler/tests/tridiagonal_solve_ops_test.py,47,class,Test for tri-diagonal matrix related ops. -295,nhwc_to_format,tensorflow/tensorflow/compiler/tests/unary_ops_test.py,37,function,Converts a numpy array from NHWC format to `data_format`. -296,UnaryOpsTest,tensorflow/tensorflow/compiler/tests/unary_ops_test.py,48,class,Test cases for unary operators. -297,UnstackOpTest,tensorflow/tensorflow/compiler/tests/unstack_test.py,29,class, -298,VariableOpsTest,tensorflow/tensorflow/compiler/tests/variable_ops_test.py,40,class,Test cases for resource variable operators. -299,StridedSliceAssignChecker,tensorflow/tensorflow/compiler/tests/variable_ops_test.py,422,class,Compares the results of a slice assignment using Tensorflow and numpy. -300,SliceAssignTest,tensorflow/tensorflow/compiler/tests/variable_ops_test.py,451,class, -301,WhileTest,tensorflow/tensorflow/compiler/tests/while_test.py,39,class, -302,is_compile_on_demand,tensorflow/tensorflow/compiler/tests/while_test.py,260,function, -303,XlaDeviceGpuTest,tensorflow/tensorflow/compiler/tests/xla_device_gpu_test.py,28,class, -304,XlaDeviceTest,tensorflow/tensorflow/compiler/tests/xla_device_test.py,32,class, -305,XlaOpsNumericalTest,tensorflow/tensorflow/compiler/tests/xla_ops_test.py,37,class, -306,XlaOpsShapeInferenceTest,tensorflow/tensorflow/compiler/tests/xla_ops_test.py,366,class, -307,parse_disabled_manifest,tensorflow/tensorflow/compiler/tests/xla_test.py,55,function, -308,XLATestCase,tensorflow/tensorflow/compiler/tests/xla_test.py,81,class,XLA test cases are parameterized test cases. -309,Benchmark,tensorflow/tensorflow/compiler/tests/xla_test.py,250,function,"Build a graph and run benchmarks against it, with or without XLA. +129,implicit_reparameterization_grad,tensorflow/tensorflow/compiler/tests/special_math_test.py,58,function, +130,xla_device,tensorflow/tensorflow/compiler/tests/stateful_random_ops_test.py,41,function, +131,xla_device_name,tensorflow/tensorflow/compiler/tests/stateful_random_ops_test.py,55,function, +132,StatelessRandomOpsBenchmark,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,136,class,Microbenchmarks for the stateless random ops. +133,benchmarkUniformF32,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,152,method, +134,benchmarkUniformF64,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,156,method, +135,benchmarkUniformF32XLA,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,160,method, +136,benchmarkUniformF64XLA,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,164,method, +137,BuilderFn,tensorflow/tensorflow/compiler/tests/stateless_random_ops_test.py,141,method, +138,ConvertBetweenDataFormats,tensorflow/tensorflow/compiler/tests/test_utils.py,26,function,Converts 4D tensor between data formats. +139,PermuteDimsBetweenDataFormats,tensorflow/tensorflow/compiler/tests/test_utils.py,47,function,Get new shape for converting between data formats. +140,RunWithWarmup,tensorflow/tensorflow/compiler/tests/test_utils.py,71,function,Runs a graph a few times to ensure that its clusters are compiled. +141,nhwc_to_format,tensorflow/tensorflow/compiler/tests/unary_ops_test.py,37,function,Converts a numpy array from NHWC format to `data_format`. +142,StridedSliceAssignChecker,tensorflow/tensorflow/compiler/tests/variable_ops_test.py,422,class,Compares the results of a slice assignment using Tensorflow and numpy. +143,is_compile_on_demand,tensorflow/tensorflow/compiler/tests/while_test.py,260,function, +144,parse_disabled_manifest,tensorflow/tensorflow/compiler/tests/xla_test.py,55,function, +145,Benchmark,tensorflow/tensorflow/compiler/tests/xla_test.py,250,function,"Build a graph and run benchmarks against it, with or without XLA. Args: tf_bench: An instance of tf.test.Benchmark, used to run the benchmark. @@ -626,15 +400,9 @@ Args: as the name of the gradients. As a result, the gradients will be compiled in a scope that is separate from both the forward computation, and from other gradients." -310,XlaTestCaseTestCase,tensorflow/tensorflow/compiler/tests/xla_test_test.py,25,class, -311,_unary_op,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,70,function,Wrapper that restricts `fn` to have the correct signature. -312,_broadcasting_binary_op,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,119,function,Wraps a binary Tensorflow operator and performs XLA-style broadcasting. -313,_shift_right_logical_helper,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,152,function,Performs an integer right logical shift irrespective of input type. -314,_shift_right_arithmetic_helper,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,167,function,Performs an integer right arithmetic shift irrespective of input type. -315,_binary_op,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,211,function,Wrapper that restricts `fn` to have the correct signature. -316,broadcast,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,226,function, -317,clamp,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,234,function, -318,conv,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,241,function,"Wraps the XLA ConvGeneralDilated operator. +146,broadcast,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,226,function, +147,clamp,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,234,function, +148,conv,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,241,function,"Wraps the XLA ConvGeneralDilated operator. ConvGeneralDilated is the most general form of XLA convolution and is documented at @@ -654,13 +422,13 @@ Args: Returns: A tensor representing the output of the convolution." -319,dot,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,291,function, -320,dot_general,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,295,function, -321,self_adjoint_eig,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,307,function, -322,svd,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,311,function, -323,random_normal,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,327,function, -324,random_uniform,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,333,function, -325,reduce_window,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,343,function,"Wraps the XLA ReduceWindow operator. +149,dot,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,291,function, +150,dot_general,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,295,function, +151,self_adjoint_eig,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,307,function, +152,svd,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,311,function, +153,random_normal,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,327,function, +154,random_uniform,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,333,function, +155,reduce_window,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,343,function,"Wraps the XLA ReduceWindow operator. ReduceWindow is documented at https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow . @@ -679,21 +447,63 @@ Args: Returns: A tensor that represents the output of the reduce_window operator." -326,reshape,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,391,function, -327,select,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,398,function, -328,slice,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,406,function, -329,_sharding_grad,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,418,function, -330,_spmd_full_to_shard_shape_grad,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,431,function, -331,_spmd_shard_to_full_shape_grad,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,440,function, -332,gather,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,452,function, -333,scatter,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,463,function, -334,Sharding,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,28,class,"A class to support adding sharding attributes to Ops. +156,reshape,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,391,function, +157,select,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,398,function, +158,slice,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,406,function, +159,gather,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,452,function, +160,scatter,tensorflow/tensorflow/compiler/tf2xla/python/xla.py,463,function, +161,Sharding,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,28,class,"A class to support adding sharding attributes to Ops. Use the factory constructors and then call apply_to_tensor: Sharding.replicate().apply_to_tensor(tensor)" -335,replicate,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,179,function, -336,assign_device,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,188,function,Returns a tensor that has AssignDevice sharding attribute. -337,tile,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,202,function,"Returns a tensor that has tiled sharding. +162,replicate,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,40,method,"Returns a replicated sharding attribute. + +This causes an op to be computed in its entirety independently on all +cores in the XLA device." +163,assign_device,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,50,method,"Returns an AssignDevice sharding attribute. + +This causes an op to be computed in its entirety only on one core in +the XLA device. +Args: + core: The core to assign this Op to." +164,tile,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,65,method,"Returns a Tiled sharding attribute. + +This causes an op to be partially computed on multiple cores in the +XLA device. + +Args: + tile_assignment: An np.ndarray describing the topology of the tiling and + which device will compute which part of the topology. + +Raises: + TypeError: tile_assignment was not of np.array type. + +TODO(jmolloy): This concept is nefarious and is not +something we really want to expose to users (especially as the +contract for tile_assignment is very strict)." +165,split,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,93,method,"Returns a Sharding that splits a tensor across a dimension. + +This creates a Tiled attribute, similar to tile(), but easier to use for the +common case of tiling a tensor N ways in one dimension. + +Args: + tensor: A tf.Tensor to split. + split_dimension: The dimension number to split. + num_devices: The number of cores to split `tensor` over. + input_shape: The shape of the original tensor. + +Raises: + ValueError: The tensor to split was smaller in the split dimension than + the number of devices to split over." +166,apply_to_tensor,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,128,method,"Applies this Sharding attribute to `tensor`. + +Args: + tensor: A tf.Tensor to split. + assign_tuple_sharding: If the sharding type should be a tuple." +167,proto,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,152,method,Return the sharding protobuf of type xla_data_pb2.OpSharding. +168,replicate,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,179,function, +169,assign_device,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,188,function,Returns a tensor that has AssignDevice sharding attribute. +170,tile,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,202,function,"Returns a tensor that has tiled sharding. Args: tensor: A tf.Tensor to shard. @@ -701,7 +511,7 @@ Args: which device will compute which part of the topology. assign_tuple_sharding: If the sharding type should be a tuple. use_sharding_op: If true, adds a sharding op to set the sharding." -338,split,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,224,function,"Returns a tensor that is split along the given dimension. +171,split,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,224,function,"Returns a tensor that is split along the given dimension. Args: tensor: A tf.Tensor to split. @@ -710,14 +520,14 @@ Args: assign_tuple_sharding: If the sharding type should be a tuple. use_sharding_op: If true, adds a sharding op to set the sharding. input_shape: The full shape of the input tensor." -339,get_op_sharding,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,248,function,"Returns sharding attribute of an op. +172,get_op_sharding,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,248,function,"Returns sharding attribute of an op. Args: op: a TensorFlow op. Returns: The attribute representing XLA sharding on this op." -340,auto_to_manual_spmd_partition,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,260,function,"Switches from automatic SPMD partitioning to manual partitioning. +173,auto_to_manual_spmd_partition,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,260,function,"Switches from automatic SPMD partitioning to manual partitioning. Converts a full-shaped tensor (to be automatically partitioned by SPMD partitioner) to a shard-shaped tensor to be consumed by manually partitioned @@ -730,7 +540,7 @@ Args: Returns: A shard-shaped tensor to be consumed by manually partitioned ops." -341,manual_to_auto_spmd_partition,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,279,function,"Switches from manual partitioning to automatic SPMD partitioning. +174,manual_to_auto_spmd_partition,tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/xla_sharding.py,279,function,"Switches from manual partitioning to automatic SPMD partitioning. Converts a shard-shaped tensor (manually partitioned in SPMD-style) to a full-shaped tensor to be partitioned automatically by the SPMD partitioner. @@ -744,15 +554,9 @@ Args: Returns: A full-shaped tensor to be partitioned automatically by the SPMD partitioner." -342,numpy_assert_allclose,tensorflow/tensorflow/compiler/xla/python/bfloat16_test.py,35,function, -343,Bfloat16Test,tensorflow/tensorflow/compiler/xla/python/bfloat16_test.py,53,class,Tests the non-numpy Python methods of the bfloat16 type. -344,Bfloat16NumPyTest,tensorflow/tensorflow/compiler/xla/python/bfloat16_test.py,251,class,Tests the NumPy integration of the bfloat16 type. -345,_interpreter_backend_factory,tensorflow/tensorflow/compiler/xla/python/xla_client.py,58,function, -346,_cpu_backend_factory,tensorflow/tensorflow/compiler/xla/python/xla_client.py,62,function, -347,_gpu_backend_factory,tensorflow/tensorflow/compiler/xla/python/xla_client.py,66,function,Returns a GPU backend. BFC allocator is used by default. -348,register_local_backend_factory,tensorflow/tensorflow/compiler/xla/python/xla_client.py,101,function, -349,_get_local_backends,tensorflow/tensorflow/compiler/xla/python/xla_client.py,108,function,Instantiates all known local backends. -350,get_local_backend,tensorflow/tensorflow/compiler/xla/python/xla_client.py,131,function,"Returns a local backend. +175,numpy_assert_allclose,tensorflow/tensorflow/compiler/xla/python/bfloat16_test.py,35,function, +176,register_local_backend_factory,tensorflow/tensorflow/compiler/xla/python/xla_client.py,101,function, +177,get_local_backend,tensorflow/tensorflow/compiler/xla/python/xla_client.py,131,function,"Returns a local backend. Args: name: the backend name. If `None`, a default local backend is returned, @@ -761,12 +565,12 @@ Args: Returns: A LocalBackend object." -351,OpMetadata,tensorflow/tensorflow/compiler/xla/python/xla_client.py,152,class,Python representation of a xla.OpMetadata protobuf. -352,CurrentSourceInfoMetadata,tensorflow/tensorflow/compiler/xla/python/xla_client.py,163,function,Helper for use in source mapping that returns an OpMetadata object. -353,dtype_to_etype,tensorflow/tensorflow/compiler/xla/python/xla_client.py,206,function,Convenience function for reading DTYPE_TO_XLA_ELEMENT_TYPE. -354,shape_from_pyval,tensorflow/tensorflow/compiler/xla/python/xla_client.py,272,function,Returns a Shape that describes a tuple-tree of Numpy arrays. -355,execute_with_python_values,tensorflow/tensorflow/compiler/xla/python/xla_client.py,334,function,Execute on one replica with Python values as arguments and output. -356,execute_with_python_values_replicated,tensorflow/tensorflow/compiler/xla/python/xla_client.py,345,function,"Execute on many replicas with Python values as arguments and output. +178,OpMetadata,tensorflow/tensorflow/compiler/xla/python/xla_client.py,152,class,Python representation of a xla.OpMetadata protobuf. +179,CurrentSourceInfoMetadata,tensorflow/tensorflow/compiler/xla/python/xla_client.py,163,function,Helper for use in source mapping that returns an OpMetadata object. +180,dtype_to_etype,tensorflow/tensorflow/compiler/xla/python/xla_client.py,206,function,Convenience function for reading DTYPE_TO_XLA_ELEMENT_TYPE. +181,shape_from_pyval,tensorflow/tensorflow/compiler/xla/python/xla_client.py,272,function,Returns a Shape that describes a tuple-tree of Numpy arrays. +182,execute_with_python_values,tensorflow/tensorflow/compiler/xla/python/xla_client.py,334,function,Execute on one replica with Python values as arguments and output. +183,execute_with_python_values_replicated,tensorflow/tensorflow/compiler/xla/python/xla_client.py,345,function,"Execute on many replicas with Python values as arguments and output. Arguments: executable: the program to run. @@ -776,17 +580,17 @@ Arguments: Returns: A list of python values, one per replica." -357,PaddingType,tensorflow/tensorflow/compiler/xla/python/xla_client.py,374,class, -358,window_padding_type_to_pad_values,tensorflow/tensorflow/compiler/xla/python/xla_client.py,379,function,Maps PaddingType or string to pad values (list of pairs of ints). -359,register_custom_call_target,tensorflow/tensorflow/compiler/xla/python/xla_client.py,418,function,"Registers a custom call target. +184,PaddingType,tensorflow/tensorflow/compiler/xla/python/xla_client.py,374,class, +185,window_padding_type_to_pad_values,tensorflow/tensorflow/compiler/xla/python/xla_client.py,379,function,Maps PaddingType or string to pad values (list of pairs of ints). +186,register_custom_call_target,tensorflow/tensorflow/compiler/xla/python/xla_client.py,418,function,"Registers a custom call target. Args: name: bytes containing the name of the function. fn: a PyCapsule object containing the function pointer. platform: the target platform." -360,PaddingConfigDimension,tensorflow/tensorflow/compiler/xla/python/xla_client.py,433,class,Python representation of a xla.PaddingConfigDimension protobuf. -361,PaddingConfig,tensorflow/tensorflow/compiler/xla/python/xla_client.py,443,class,Python representation of a xla.PaddingConfig protobuf. -362,make_padding_config,tensorflow/tensorflow/compiler/xla/python/xla_client.py,451,function,"Create PaddingConfig proto from list of triples of integers. +187,PaddingConfigDimension,tensorflow/tensorflow/compiler/xla/python/xla_client.py,433,class,Python representation of a xla.PaddingConfigDimension protobuf. +188,PaddingConfig,tensorflow/tensorflow/compiler/xla/python/xla_client.py,443,class,Python representation of a xla.PaddingConfig protobuf. +189,make_padding_config,tensorflow/tensorflow/compiler/xla/python/xla_client.py,451,function,"Create PaddingConfig proto from list of triples of integers. Args: padding_config: either a PaddingConfig or a list of integer triples @@ -795,8 +599,8 @@ Args: Returns: A `PaddingConfig` object." -363,DotDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,476,class,Python representation of a xla.DotDimensionNumbers protobuf. -364,make_dot_dimension_numbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,488,function,"Builds a DotDimensionNumbers object from a specification. +190,DotDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,476,class,Python representation of a xla.DotDimensionNumbers protobuf. +191,make_dot_dimension_numbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,488,function,"Builds a DotDimensionNumbers object from a specification. Args: dimension_numbers: either a `DotDimensionNumbers` or a nested tuple @@ -806,8 +610,8 @@ Args: Returns: A `DotDimensionNumbers` object." -365,ConvolutionDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,516,class,Python representation of a xla.ConvolutionDimensionNumbers protobuf. -366,make_convolution_dimension_numbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,536,function,"Builds a ConvolutionDimensionNumbers object from a specification. +192,ConvolutionDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,516,class,Python representation of a xla.ConvolutionDimensionNumbers protobuf. +193,make_convolution_dimension_numbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,536,function,"Builds a ConvolutionDimensionNumbers object from a specification. Args: dimension_numbers: optional, either a ConvolutionDimensionNumbers object or @@ -832,22 +636,19 @@ Args: Returns: A `ConvolutionDimensionNumbers` object." -367,OpSharding,tensorflow/tensorflow/compiler/xla/python/xla_client.py,600,class,Python representation of a xla.OpSharding protobuf. -368,PrecisionConfig,tensorflow/tensorflow/compiler/xla/python/xla_client.py,614,class,Python representation of a xla.PrecisionConfig protobuf. -369,GatherDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,624,class,Python representation of a xla.GatherDimensionNumbers protobuf. -370,ScatterDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,636,class,Python representation of a xla.ScatterDimensionNumbers protobuf. -371,ReplicaGroup,tensorflow/tensorflow/compiler/xla/python/xla_client.py,648,class,Python representation of a xla.ReplicaGroup protobuf. -372,_make_replica_group_proto,tensorflow/tensorflow/compiler/xla/python/xla_client.py,656,function, -373,make_replica_groups,tensorflow/tensorflow/compiler/xla/python/xla_client.py,662,function, -374,tracebacks,tensorflow/tensorflow/compiler/xla/python/xla_client.py,677,function,Context manager that enables or disables traceback collection. -375,heap_profile,tensorflow/tensorflow/compiler/xla/python/xla_client.py,687,function,Returns a gzipped pprof protocol buffer containing a heap profile. -376,TestFactory,tensorflow/tensorflow/compiler/xla/python/xla_client_test.py,56,function, -377,InstantiateTests,tensorflow/tensorflow/compiler/xla/python/xla_client_test.py,2103,function, -378,TpuBackend,tensorflow/tensorflow/compiler/xla/python/tpu_driver/client/tpu_client.py,29,class,XLA backend implemented using the Tpu driver API. -379,ConvertLiteralToNumpyArray,tensorflow/tensorflow/compiler/xla/python_api/xla_literal.py,28,function,Converts a XLA literal to a Numpy array. -380,_ConvertNumpyArrayToLiteral,tensorflow/tensorflow/compiler/xla/python_api/xla_literal.py,64,function,Converts a Numpy array to a XLA literal. -381,ConvertNumpyArrayToLiteral,tensorflow/tensorflow/compiler/xla/python_api/xla_literal.py,85,function,Converts a Numpy array or a nested tuple thereof to an XLA literal. -382,Shape,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,29,class,"Wraps a xla_data_pb2.ShapeProto message with a convenient Python type. +194,OpSharding,tensorflow/tensorflow/compiler/xla/python/xla_client.py,600,class,Python representation of a xla.OpSharding protobuf. +195,PrecisionConfig,tensorflow/tensorflow/compiler/xla/python/xla_client.py,614,class,Python representation of a xla.PrecisionConfig protobuf. +196,GatherDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,624,class,Python representation of a xla.GatherDimensionNumbers protobuf. +197,ScatterDimensionNumbers,tensorflow/tensorflow/compiler/xla/python/xla_client.py,636,class,Python representation of a xla.ScatterDimensionNumbers protobuf. +198,ReplicaGroup,tensorflow/tensorflow/compiler/xla/python/xla_client.py,648,class,Python representation of a xla.ReplicaGroup protobuf. +199,make_replica_groups,tensorflow/tensorflow/compiler/xla/python/xla_client.py,662,function, +200,tracebacks,tensorflow/tensorflow/compiler/xla/python/xla_client.py,677,function,Context manager that enables or disables traceback collection. +201,heap_profile,tensorflow/tensorflow/compiler/xla/python/xla_client.py,687,function,Returns a gzipped pprof protocol buffer containing a heap profile. +202,TpuBackend,tensorflow/tensorflow/compiler/xla/python/tpu_driver/client/tpu_client.py,29,class,XLA backend implemented using the Tpu driver API. +203,create,tensorflow/tensorflow/compiler/xla/python/tpu_driver/client/tpu_client.py,36,method,Constructs a Cloud TPU backend. +204,ConvertLiteralToNumpyArray,tensorflow/tensorflow/compiler/xla/python_api/xla_literal.py,28,function,Converts a XLA literal to a Numpy array. +205,ConvertNumpyArrayToLiteral,tensorflow/tensorflow/compiler/xla/python_api/xla_literal.py,85,function,Converts a Numpy array or a nested tuple thereof to an XLA literal. +206,Shape,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,29,class,"Wraps a xla_data_pb2.ShapeProto message with a convenient Python type. Provides direct access to the underlying xla_data_pb2.ShapeProto message in the @@ -855,14 +656,19 @@ message attribute, along with accessor wrappers to the message's fields. Avoid direct access to .message unless interacting directly with protobuf APIs like CopyFrom. In other words, prefer hauling the shape around in a Shape, and only access .message when strictly required by the protobuf API." -383,_CreateShapeFromNumpy,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,103,function,"Create a Shape from a given Numpy array. - -Args: - ndarray: Numpy array. +207,element_type,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,71,method, +208,is_tuple,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,74,method, +209,dimensions,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,77,method, +210,tuple_shapes,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,82,method,"If this is a tuple, returns its sequence of constituent Shape objects. Returns: - A Shape object." -384,CreateShapeFromNumpy,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,129,function,"Create a Shape from a Numpy array or a nested tuple structure thereof. + Tuple sub-shapes. + +Raises: + ValueError: if this is not a tuple." +211,layout,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,95,method, +212,from_pyval,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,99,method, +213,CreateShapeFromNumpy,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,129,function,"Create a Shape from a Numpy array or a nested tuple structure thereof. Args: value: Numpy array or (possibly nested) tuple structure that bottoms out in @@ -870,7 +676,7 @@ Args: Returns: A Shape object." -385,CreateShapeFromDtypeAndTuple,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,147,function,"Create a shape from a Numpy dtype and a sequence of nonnegative integers. +214,CreateShapeFromDtypeAndTuple,tensorflow/tensorflow/compiler/xla/python_api/xla_shape.py,147,function,"Create a shape from a Numpy dtype and a sequence of nonnegative integers. Args: dtype: a numpy dtype, e.g. np.dtype('int32'). @@ -878,72 +684,33 @@ Args: Returns: A Shape object." -386,RamFilesystemTest,tensorflow/tensorflow/core/platform/ram_file_system_test.py,38,class, -387,AddOneTest,tensorflow/tensorflow/examples/adding_an_op/cuda_op_test.py,25,class, -388,FactTest,tensorflow/tensorflow/examples/adding_an_op/fact_test.py,25,class, -389,ZeroOut1Test,tensorflow/tensorflow/examples/adding_an_op/zero_out_1_test.py,29,class, -390,ZeroOut2Test,tensorflow/tensorflow/examples/adding_an_op/zero_out_2_test.py,30,class, -391,ZeroOut3Test,tensorflow/tensorflow/examples/adding_an_op/zero_out_3_test.py,27,class, -392,_zero_out_grad,tensorflow/tensorflow/examples/adding_an_op/zero_out_grad_2.py,28,function,"The gradients for `zero_out`. - -Args: - op: The `zero_out` `Operation` that we are differentiating, which we can use - to find the inputs and outputs of the original op. - grad: Gradient with respect to the output of the `zero_out` op. - -Returns: - Gradients with respect to the input of `zero_out`." -393,load_graph,tensorflow/tensorflow/examples/label_image/label_image.py,26,function, -394,read_tensor_from_image_file,tensorflow/tensorflow/examples/label_image/label_image.py,38,function, -395,load_labels,tensorflow/tensorflow/examples/label_image/label_image.py,65,function, -396,main,tensorflow/tensorflow/examples/saved_model/integration_tests/deploy_mnist_cnn.py,47,function, -397,MaybeDistributionScope,tensorflow/tensorflow/examples/saved_model/integration_tests/distribution_strategy_utils.py,48,class,Provides a context allowing no distribution strategy. -398,make_feature_extractor,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,56,function,Returns a Keras Model to compute a feature vector from MNIST images. -399,set_feature_extractor_hparams,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,72,function, -400,make_classifier,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,76,function,Returns a Keras Model to classify MNIST using feature_extractor. -401,wrap_keras_model_for_export,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,87,function,Wraps `model` for saving and loading as SavedModel. -402,_get_traced_loss,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,144,function,"Returns tf.function for model.losses[i] with a trace for zero args. - -The intended usage is - [_get_traced_loss(model, i) for i in range(len(model.losses))] -This is better than - [tf.function(lambda: model.losses[i], input_signature=[]) for i ...] -because it avoids capturing a loop index in a lambda, and removes any -chance of deferring the trace. - -Args: - model: a Keras Model. - i: an integer between from 0 up to but to len(model.losses)." -403,main,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,163,function, -404,main,tensorflow/tensorflow/examples/saved_model/integration_tests/export_rnn_cell.py,32,function, -405,write_vocabulary_file,tensorflow/tensorflow/examples/saved_model/integration_tests/export_simple_text_embedding.py,34,function,Write temporary vocab file for module construction. -406,TextEmbeddingModel,tensorflow/tensorflow/examples/saved_model/integration_tests/export_simple_text_embedding.py,44,class,"Text embedding model. +215,load_graph,tensorflow/tensorflow/examples/label_image/label_image.py,26,function, +216,read_tensor_from_image_file,tensorflow/tensorflow/examples/label_image/label_image.py,38,function, +217,load_labels,tensorflow/tensorflow/examples/label_image/label_image.py,65,function, +218,MaybeDistributionScope,tensorflow/tensorflow/examples/saved_model/integration_tests/distribution_strategy_utils.py,48,class,Provides a context allowing no distribution strategy. +219,from_name,tensorflow/tensorflow/examples/saved_model/integration_tests/distribution_strategy_utils.py,52,method, +220,make_feature_extractor,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,56,function,Returns a Keras Model to compute a feature vector from MNIST images. +221,set_feature_extractor_hparams,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,72,function, +222,make_classifier,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,76,function,Returns a Keras Model to classify MNIST using feature_extractor. +223,wrap_keras_model_for_export,tensorflow/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py,87,function,Wraps `model` for saving and loading as SavedModel. +224,write_vocabulary_file,tensorflow/tensorflow/examples/saved_model/integration_tests/export_simple_text_embedding.py,34,function,Write temporary vocab file for module construction. +225,TextEmbeddingModel,tensorflow/tensorflow/examples/saved_model/integration_tests/export_simple_text_embedding.py,44,class,"Text embedding model. A text embeddings model that takes a sentences on input and outputs the sentence embedding." -407,main,tensorflow/tensorflow/examples/saved_model/integration_tests/export_simple_text_embedding.py,96,function, -408,TextRnnModel,tensorflow/tensorflow/examples/saved_model/integration_tests/export_text_rnn_model.py,31,class,"Text RNN model. +226,TextRnnModel,tensorflow/tensorflow/examples/saved_model/integration_tests/export_text_rnn_model.py,31,class,"Text RNN model. A full generative text RNN model that can train and decode sentences from a starting word." -409,main,tensorflow/tensorflow/examples/saved_model/integration_tests/export_text_rnn_model.py,170,function, -410,TestCase,tensorflow/tensorflow/examples/saved_model/integration_tests/integration_scripts.py,42,class,Base class to write SavedModel integration tests. -411,MaybeRunScriptInstead,tensorflow/tensorflow/examples/saved_model/integration_tests/integration_scripts.py,62,function, -412,_load_random_data,tensorflow/tensorflow/examples/saved_model/integration_tests/mnist_util.py,28,function, -413,load_reshaped_data,tensorflow/tensorflow/examples/saved_model/integration_tests/mnist_util.py,34,function,Returns MNIST or Fashion MNIST or fake train and test data. -414,_prepare_image,tensorflow/tensorflow/examples/saved_model/integration_tests/mnist_util.py,44,function,"Converts images to [n,h,w,c] format in range [0,1]." -415,_prepare_label,tensorflow/tensorflow/examples/saved_model/integration_tests/mnist_util.py,49,function,Conerts labels to one-hot encoding. -416,SavedModelTest,tensorflow/tensorflow/examples/saved_model/integration_tests/saved_model_test.py,32,class, -417,make_feature_extractor,tensorflow/tensorflow/examples/saved_model/integration_tests/use_mnist_cnn.py,72,function,Load a pre-trained feature extractor and wrap it for use in Keras. -418,make_classifier,tensorflow/tensorflow/examples/saved_model/integration_tests/use_mnist_cnn.py,100,function,Returns a Keras Model to classify MNIST using feature_extractor. -419,main,tensorflow/tensorflow/examples/saved_model/integration_tests/use_mnist_cnn.py,112,function, -420,train,tensorflow/tensorflow/examples/saved_model/integration_tests/use_model_in_sequential_keras.py,35,function,Build a Keras model and train with mock data. -421,main,tensorflow/tensorflow/examples/saved_model/integration_tests/use_model_in_sequential_keras.py,67,function, -422,main,tensorflow/tensorflow/examples/saved_model/integration_tests/use_rnn_cell.py,33,function, -423,train,tensorflow/tensorflow/examples/saved_model/integration_tests/use_text_embedding_in_dataset.py,34,function,Build a Keras model and train with mock data. -424,main,tensorflow/tensorflow/examples/saved_model/integration_tests/use_text_embedding_in_dataset.py,65,function, -425,main,tensorflow/tensorflow/examples/saved_model/integration_tests/use_text_rnn_model.py,32,function, -426,StreamingAccuracyStats,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,24,class,"Get streaming accuracy statistics every time a new command is founded. +227,train,tensorflow/tensorflow/examples/saved_model/integration_tests/export_text_rnn_model.py,81,method, +228,decode_greedy,tensorflow/tensorflow/examples/saved_model/integration_tests/export_text_rnn_model.py,143,method, +229,MaybeRunScriptInstead,tensorflow/tensorflow/examples/saved_model/integration_tests/integration_scripts.py,62,function, +230,load_reshaped_data,tensorflow/tensorflow/examples/saved_model/integration_tests/mnist_util.py,34,function,Returns MNIST or Fashion MNIST or fake train and test data. +231,make_feature_extractor,tensorflow/tensorflow/examples/saved_model/integration_tests/use_mnist_cnn.py,72,function,Load a pre-trained feature extractor and wrap it for use in Keras. +232,make_classifier,tensorflow/tensorflow/examples/saved_model/integration_tests/use_mnist_cnn.py,100,function,Returns a Keras Model to classify MNIST using feature_extractor. +233,train,tensorflow/tensorflow/examples/saved_model/integration_tests/use_model_in_sequential_keras.py,35,function,Build a Keras model and train with mock data. +234,train,tensorflow/tensorflow/examples/saved_model/integration_tests/use_text_embedding_in_dataset.py,34,function,Build a Keras model and train with mock data. +235,StreamingAccuracyStats,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,24,class,"Get streaming accuracy statistics every time a new command is founded. Attributes: _how_many_gt: How many ground truths. @@ -956,7 +723,21 @@ Attributes: _previous_c: A variable to record the last status of _how_many_c. _previous_w: A variable to record the last status of _how_many_w. _previous_fp: A variable to record the last status of _how_many_fp." -427,create_inference_graph,tensorflow/tensorflow/examples/speech_commands/freeze.py,63,function,"Creates an audio model with the nodes needed for inference. +236,read_ground_truth_file,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,52,method,Load ground truth and timestamp pairs and store it in time order. +237,delta,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,64,method,Compute delta of StreamingAccuracyStats against last status. +238,calculate_accuracy_stats,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,83,method,"Calculate accuracy statistics when a new commands is founded. + +Given ground truth and corresponding predictions founded by +model, figure out how many were correct. Take a tolerance time, so that only +predictions up to a point in time are considered. + +Args: + found_words: A list of all founded commands up to now. + up_to_time_ms: End timestamp of this audio piece. + time_tolerance_ms: The tolerance milliseconds before and after + up_to_time_ms to match a ground truth." +239,print_accuracy_stats,tensorflow/tensorflow/examples/speech_commands/accuracy_utils.py,137,method,Write a human-readable description of the statistics to stdout. +240,create_inference_graph,tensorflow/tensorflow/examples/speech_commands/freeze.py,63,function,"Creates an audio model with the nodes needed for inference. Uses the supplied arguments to create a model, and inserts the input and output nodes that are needed to use the graph for inference. @@ -978,21 +759,19 @@ Returns: Raises: Exception: If the preprocessing mode isn't recognized." -428,save_graph_def,tensorflow/tensorflow/examples/speech_commands/freeze.py,161,function,"Writes a graph def file out to disk. +241,save_graph_def,tensorflow/tensorflow/examples/speech_commands/freeze.py,161,function,"Writes a graph def file out to disk. Args: file_name: Where to save the file. frozen_graph_def: GraphDef proto object to save." -429,save_saved_model,tensorflow/tensorflow/examples/speech_commands/freeze.py,176,function,"Writes a SavedModel out to disk. +242,save_saved_model,tensorflow/tensorflow/examples/speech_commands/freeze.py,176,function,"Writes a SavedModel out to disk. Args: file_name: Where to save the file. sess: TensorFlow session containing the graph. input_tensor: Tensor object defining the input's properties. output_tensor: Tensor object defining the output's properties." -430,main,tensorflow/tensorflow/examples/speech_commands/freeze.py,211,function, -431,FreezeTest,tensorflow/tensorflow/examples/speech_commands/freeze_test.py,30,class, -432,mix_in_audio_sample,tensorflow/tensorflow/examples/speech_commands/generate_streaming_test_wav.py,55,function,"Mixes the sample data into the main track at the specified offset. +243,mix_in_audio_sample,tensorflow/tensorflow/examples/speech_commands/generate_streaming_test_wav.py,55,function,"Mixes the sample data into the main track at the specified offset. Args: track_data: Numpy array holding main audio data. Modified in-place. @@ -1003,16 +782,14 @@ Args: sample_volume: Loudness to mix the sample in at. ramp_in: Length in samples of volume increase stage. ramp_out: Length in samples of volume decrease stage." -433,main,tensorflow/tensorflow/examples/speech_commands/generate_streaming_test_wav.py,86,function, -434,GenerateStreamingTestWavTest,tensorflow/tensorflow/examples/speech_commands/generate_streaming_test_wav_test.py,27,class, -435,prepare_words_list,tensorflow/tensorflow/examples/speech_commands/input_data.py,58,function,"Prepends common tokens to the custom word list. +244,prepare_words_list,tensorflow/tensorflow/examples/speech_commands/input_data.py,58,function,"Prepends common tokens to the custom word list. Args: wanted_words: List of strings containing the custom words. Returns: List with the standard silence and unknown tokens added." -436,which_set,tensorflow/tensorflow/examples/speech_commands/input_data.py,70,function,"Determines which data partition the file should belong to. +245,which_set,tensorflow/tensorflow/examples/speech_commands/input_data.py,70,function,"Determines which data partition the file should belong to. We want to keep files in the same training, validation, or testing sets even if new ones are added over time. This makes it less likely that testing @@ -1033,20 +810,20 @@ Args: Returns: String, one of 'training', 'validation', or 'testing'." -437,load_wav_file,tensorflow/tensorflow/examples/speech_commands/input_data.py,118,function,"Loads an audio file and returns a float PCM-encoded array of samples. +246,load_wav_file,tensorflow/tensorflow/examples/speech_commands/input_data.py,118,function,"Loads an audio file and returns a float PCM-encoded array of samples. Args: filename: Path to the .wav file to load. Returns: Numpy array holding the sample data as floats between -1.0 and 1.0." -438,save_wav_file,tensorflow/tensorflow/examples/speech_commands/input_data.py,136,function,"Saves audio sample data to a .wav audio file. +247,save_wav_file,tensorflow/tensorflow/examples/speech_commands/input_data.py,136,function,"Saves audio sample data to a .wav audio file. Args: filename: Path to save the file to. wav_data: 2D array of float PCM-encoded audio data. sample_rate: Samples per second to encode in the file." -439,get_features_range,tensorflow/tensorflow/examples/speech_commands/input_data.py,160,function,"Returns the expected min/max for generated features. +248,get_features_range,tensorflow/tensorflow/examples/speech_commands/input_data.py,160,function,"Returns the expected min/max for generated features. Args: model_settings: Information about the current model being trained. @@ -1056,27 +833,144 @@ Returns: Raises: Exception: If preprocessing mode isn't recognized." -440,AudioProcessor,tensorflow/tensorflow/examples/speech_commands/input_data.py,190,class,"Handles loading, partitioning, and preparing audio training data." -441,InputDataTest,tensorflow/tensorflow/examples/speech_commands/input_data_test.py,33,class, -442,load_graph,tensorflow/tensorflow/examples/speech_commands/label_wav.py,43,function,Unpersists graph from file as default graph. -443,load_labels,tensorflow/tensorflow/examples/speech_commands/label_wav.py,51,function,"Read in labels, one label per line." -444,run_graph,tensorflow/tensorflow/examples/speech_commands/label_wav.py,56,function,Runs the audio data through the graph and prints predictions. -445,label_wav,tensorflow/tensorflow/examples/speech_commands/label_wav.py,77,function,"Loads the model and labels, and runs the inference to print predictions." -446,main,tensorflow/tensorflow/examples/speech_commands/label_wav.py,98,function,"Entry point for script, converts flags to arguments." -447,load_graph,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,44,function,Unpersists graph from file as default graph. -448,load_labels,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,52,function,"Read in labels, one label per line." -449,run_graph,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,57,function,Runs the audio data through the graph and prints predictions. -450,label_wav,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,85,function,"Loads the model and labels, and runs the inference to print predictions." -451,main,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,101,function,"Entry point for script, converts flags to arguments." -452,LabelWavTest,tensorflow/tensorflow/examples/speech_commands/label_wav_test.py,29,class, -453,_next_power_of_two,tensorflow/tensorflow/examples/speech_commands/models.py,27,function,"Calculates the smallest enclosing power of two for an input. +249,AudioProcessor,tensorflow/tensorflow/examples/speech_commands/input_data.py,190,class,"Handles loading, partitioning, and preparing audio training data." +250,maybe_download_and_extract_dataset,tensorflow/tensorflow/examples/speech_commands/input_data.py,205,method,"Download and extract data set tar file. + +If the data set we're using doesn't already exist, this function +downloads it from the TensorFlow.org website and unpacks it into a +directory. +If the data_url is none, don't download anything and expect the data +directory to contain the correct files already. Args: - x: Positive float or integer number. + data_url: Web location of the tar file containing the data set. + dest_directory: File path to extract data to." +251,prepare_data_index,tensorflow/tensorflow/examples/speech_commands/input_data.py,247,method,"Prepares a list of the samples organized by set and label. + +The training loop needs a list of all the available data, organized by +which partition it should belong to, and with ground truth labels attached. +This function analyzes the folders below the `data_dir`, figures out the +right +labels for each file based on the name of the subdirectory it belongs to, +and uses a stable hash to assign it to a data set partition. + +Args: + silence_percentage: How much of the resulting data should be background. + unknown_percentage: How much should be audio outside the wanted classes. + wanted_words: Labels of the classes we want to be able to recognize. + validation_percentage: How much of the data set to use for validation. + testing_percentage: How much of the data set to use for testing. Returns: - Next largest power of two integer." -454,prepare_model_settings,tensorflow/tensorflow/examples/speech_commands/models.py,39,function,"Calculates common settings needed for all models. + Dictionary containing a list of file information for each set partition, + and a lookup map for each class to determine its numeric index. + +Raises: + Exception: If expected files are not found." +252,prepare_background_data,tensorflow/tensorflow/examples/speech_commands/input_data.py,333,method,"Searches a folder for background noise audio, and loads it into memory. + +It's expected that the background audio samples will be in a subdirectory +named '_background_noise_' inside the 'data_dir' folder, as .wavs that match +the sample rate of the training data, but can be much longer in duration. + +If the '_background_noise_' folder doesn't exist at all, this isn't an +error, it's just taken to mean that no background noise augmentation should +be used. If the folder does exist, but it's empty, that's treated as an +error. + +Returns: + List of raw PCM-encoded audio samples of background noise. + +Raises: + Exception: If files aren't found in the folder." +253,prepare_processing_graph,tensorflow/tensorflow/examples/speech_commands/input_data.py,369,method,"Builds a TensorFlow graph to apply the input distortions. + +Creates a graph that loads a WAVE file, decodes it, scales the volume, +shifts it in time, adds in background noise, calculates a spectrogram, and +then builds an MFCC fingerprint from that. + +This must be called with an active TensorFlow session running, and it +creates multiple placeholder inputs, and one output: + + - wav_filename_placeholder_: Filename of the WAV to load. + - foreground_volume_placeholder_: How loud the main clip should be. + - time_shift_padding_placeholder_: Where to pad the clip. + - time_shift_offset_placeholder_: How much to move the clip in time. + - background_data_placeholder_: PCM sample data for background noise. + - background_volume_placeholder_: Loudness of mixed-in background. + - output_: Output 2D fingerprint of processed audio. + +Args: + model_settings: Information about the current model being trained. + summaries_dir: Path to save training summary information to. + +Raises: + ValueError: If the preprocessing mode isn't recognized. + Exception: If the preprocessor wasn't compiled in." +254,set_size,tensorflow/tensorflow/examples/speech_commands/input_data.py,498,method,"Calculates the number of samples in the dataset partition. + +Args: + mode: Which partition, must be 'training', 'validation', or 'testing'. + +Returns: + Number of samples in the partition." +255,get_data,tensorflow/tensorflow/examples/speech_commands/input_data.py,509,method,"Gather samples from the data set, applying transformations as needed. + +When the mode is 'training', a random selection of samples will be returned, +otherwise the first N clips in the partition will be used. This ensures that +validation always uses the same samples, reducing noise in the metrics. + +Args: + how_many: Desired number of samples to return. -1 means the entire + contents of this partition. + offset: Where to start when fetching deterministically. + model_settings: Information about the current model being trained. + background_frequency: How many clips will have background noise, 0.0 to + 1.0. + background_volume_range: How loud the background noise will be. + time_shift: How much to randomly shift the clips by in time. + mode: Which partition to use, must be 'training', 'validation', or + 'testing'. + sess: TensorFlow session that was active when processor was created. + +Returns: + List of sample data for the transformed samples, and list of label indexes + +Raises: + ValueError: If background samples are too short." +256,get_features_for_wav,tensorflow/tensorflow/examples/speech_commands/input_data.py,612,method,"Applies the feature transformation process to the input_wav. + +Runs the feature generation process (generally producing a spectrogram from +the input samples) on the WAV file. This can be useful for testing and +verifying implementations being run on other platforms. + +Args: + wav_filename: The path to the input audio file. + model_settings: Information about the current model being trained. + sess: TensorFlow session that was active when processor was created. + +Returns: + Numpy data array containing the generated features." +257,get_unprocessed_data,tensorflow/tensorflow/examples/speech_commands/input_data.py,640,method,"Retrieve sample data for the given partition, with no transformations. + +Args: + how_many: Desired number of samples to return. -1 means the entire + contents of this partition. + model_settings: Information about the current model being trained. + mode: Which partition to use, must be 'training', 'validation', or + 'testing'. + +Returns: + List of sample data for the samples, and list of labels in one-hot form." +258,load_graph,tensorflow/tensorflow/examples/speech_commands/label_wav.py,43,function,Unpersists graph from file as default graph. +259,load_labels,tensorflow/tensorflow/examples/speech_commands/label_wav.py,51,function,"Read in labels, one label per line." +260,run_graph,tensorflow/tensorflow/examples/speech_commands/label_wav.py,56,function,Runs the audio data through the graph and prints predictions. +261,label_wav,tensorflow/tensorflow/examples/speech_commands/label_wav.py,77,function,"Loads the model and labels, and runs the inference to print predictions." +262,load_graph,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,44,function,Unpersists graph from file as default graph. +263,load_labels,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,52,function,"Read in labels, one label per line." +264,run_graph,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,57,function,Runs the audio data through the graph and prints predictions. +265,label_wav,tensorflow/tensorflow/examples/speech_commands/label_wav_dir.py,85,function,"Loads the model and labels, and runs the inference to print predictions." +266,prepare_model_settings,tensorflow/tensorflow/examples/speech_commands/models.py,39,function,"Calculates common settings needed for all models. Args: label_count: How many classes are to be recognized. @@ -1092,7 +986,7 @@ Returns: Raises: ValueError: If the preprocessing mode isn't recognized." -455,create_model,tensorflow/tensorflow/examples/speech_commands/models.py,95,function,"Builds a model of the requested architecture compatible with the settings. +267,create_model,tensorflow/tensorflow/examples/speech_commands/models.py,95,function,"Builds a model of the requested architecture compatible with the settings. There are many possible ways of deriving predictions from a spectrogram input, so this function provides an abstract interface for creating different @@ -1123,12 +1017,12 @@ Returns: Raises: Exception: If the architecture type isn't recognized." -456,load_variables_from_checkpoint,tensorflow/tensorflow/examples/speech_commands/models.py,153,function,"Utility function to centralize checkpoint restoration. +268,load_variables_from_checkpoint,tensorflow/tensorflow/examples/speech_commands/models.py,153,function,"Utility function to centralize checkpoint restoration. Args: sess: TensorFlow session. start_checkpoint: Path to saved checkpoint on disk." -457,create_single_fc_model,tensorflow/tensorflow/examples/speech_commands/models.py,164,function,"Builds a model with a single hidden fully-connected layer. +269,create_single_fc_model,tensorflow/tensorflow/examples/speech_commands/models.py,164,function,"Builds a model with a single hidden fully-connected layer. This is a very simple model with just one matmul and bias layer. As you'd expect, it doesn't produce very accurate results, but it is very fast and @@ -1151,7 +1045,7 @@ Args: Returns: TensorFlow node outputting logits results, and optionally a dropout placeholder." -458,create_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,207,function,"Builds a standard convolutional model. +270,create_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,207,function,"Builds a standard convolutional model. This is roughly the network labeled as 'cnn-trad-fpool3' in the 'Convolutional Neural Networks for Small-footprint Keyword Spotting' paper: @@ -1197,7 +1091,7 @@ Args: Returns: TensorFlow node outputting logits results, and optionally a dropout placeholder." -459,create_low_latency_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,333,function,"Builds a convolutional model with low compute requirements. +271,create_low_latency_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,333,function,"Builds a convolutional model with low compute requirements. This is roughly the network labeled as 'cnn-one-fstride4' in the 'Convolutional Neural Networks for Small-footprint Keyword Spotting' paper: @@ -1240,7 +1134,7 @@ Args: Returns: TensorFlow node outputting logits results, and optionally a dropout placeholder." -460,create_low_latency_svdf_model,tensorflow/tensorflow/examples/speech_commands/models.py,462,function,"Builds an SVDF model with low compute requirements. +272,create_low_latency_svdf_model,tensorflow/tensorflow/examples/speech_commands/models.py,462,function,"Builds an SVDF model with low compute requirements. This is based in the topology presented in the 'Compressing Deep Neural Networks using a Rank-Constrained Topology' paper: @@ -1292,7 +1186,7 @@ Returns: Raises: ValueError: If the inputs tensor is incorrectly shaped." -461,create_tiny_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,673,function,"Builds a convolutional model aimed at microcontrollers. +273,create_tiny_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,673,function,"Builds a convolutional model aimed at microcontrollers. Devices like DSPs and microcontrollers can have very small amounts of memory and limited processing power. This model is designed to use less @@ -1329,7 +1223,7 @@ Args: Returns: TensorFlow node outputting logits results, and optionally a dropout placeholder." -462,create_tiny_embedding_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,765,function,"Builds a convolutional model aimed at microcontrollers. +274,create_tiny_embedding_conv_model,tensorflow/tensorflow/examples/speech_commands/models.py,765,function,"Builds a convolutional model aimed at microcontrollers. Devices like DSPs and microcontrollers can have very small amounts of memory and limited processing power. This model is designed to use less @@ -1378,8 +1272,7 @@ Args: Returns: TensorFlow node outputting logits results, and optionally a dropout placeholder." -463,ModelsTest,tensorflow/tensorflow/examples/speech_commands/models_test.py,28,class, -464,RecognizeResult,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,25,class,"Save recognition result temporarily. +275,RecognizeResult,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,25,class,"Save recognition result temporarily. Attributes: founded_command: A string indicating the word just founded. Default value @@ -1388,7 +1281,13 @@ Attributes: value is zero. is_new_command: A boolean indicating if the founded command is a new one against the last one. Default value is False." -465,RecognizeCommands,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,67,class,"Smooth the inference results by using average window. +276,founded_command,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,43,method, +277,founded_command,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,47,method, +278,score,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,51,method, +279,score,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,55,method, +280,is_new_command,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,59,method, +281,is_new_command,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,63,method, +282,RecognizeCommands,tensorflow/tensorflow/examples/speech_commands/recognize_commands.py,67,class,"Smooth the inference results by using average window. Maintain a slide window over the audio stream, which adds new result(a pair of the 1.confidences of all classes and 2.the start timestamp of input audio @@ -1409,21 +1308,18 @@ Attributes: _label_count: The length of label list. _previous_top_label: Last founded command. Initial value is '_silence_'. _previous_top_time: The timestamp of _previous results. Default is -np.inf." -466,load_graph,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,80,function,"Read a tensorflow model, and creates a default graph object." -467,read_label_file,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,92,function,Load a list of label. -468,read_wav_file,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,101,function,Load a wav file and return sample_rate and numpy data of float64 type. -469,main,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,111,function, -470,main,tensorflow/tensorflow/examples/speech_commands/train.py,88,function, -471,verbosity_arg,tensorflow/tensorflow/examples/speech_commands/train.py,480,function,"Parses verbosity argument. +283,load_graph,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,80,function,"Read a tensorflow model, and creates a default graph object." +284,read_label_file,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,92,function,Load a list of label. +285,read_wav_file,tensorflow/tensorflow/examples/speech_commands/test_streaming_accuracy.py,101,function,Load a wav file and return sample_rate and numpy data of float64 type. +286,verbosity_arg,tensorflow/tensorflow/examples/speech_commands/train.py,480,function,"Parses verbosity argument. Args: value: A member of tf.logging. Raises: ArgumentTypeError: Not an expected value." -472,requires_contrib,tensorflow/tensorflow/examples/speech_commands/train_test.py,32,function, -473,DictStruct,tensorflow/tensorflow/examples/speech_commands/train_test.py,44,class, -474,TrainTest,tensorflow/tensorflow/examples/speech_commands/train_test.py,50,class, -475,wav_to_features,tensorflow/tensorflow/examples/speech_commands/wav_to_features.py,47,function,"Converts an audio file into its corresponding feature map. +287,requires_contrib,tensorflow/tensorflow/examples/speech_commands/train_test.py,32,function, +288,DictStruct,tensorflow/tensorflow/examples/speech_commands/train_test.py,44,class, +289,wav_to_features,tensorflow/tensorflow/examples/speech_commands/wav_to_features.py,47,function,"Converts an audio file into its corresponding feature map. Args: sample_rate: Expected sample rate of the wavs. @@ -1435,9 +1331,7 @@ Args: preprocess: Spectrogram processing mode; ""mfcc"", ""average"" or ""micro"". input_wav: Path to the audio WAV file to read. output_c_file: Where to save the generated C source file." -476,main,tensorflow/tensorflow/examples/speech_commands/wav_to_features.py,125,function, -477,WavToFeaturesTest,tensorflow/tensorflow/examples/speech_commands/wav_to_features_test.py,30,class, -478,create_model,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,69,function,"Model to recognize digits in the MNIST dataset. +290,create_model,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,69,function,"Model to recognize digits in the MNIST dataset. Network structure is equivalent to: https://github.com/tensorflow/tensorflow/blob/r1.5/tensorflow/examples/tutorials/mnist/mnist_deep.py @@ -1446,19 +1340,17 @@ https://github.com/tensorflow/models/blob/master/tutorials/image/mnist/convoluti But uses the tf.keras API. Returns: A tf.keras.Model." -479,mnist_datasets,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,115,function, -480,loss,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,125,function, -481,compute_accuracy,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,131,function, -482,train,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,140,function,Trains model on `dataset` using `optimizer`. -483,test,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,166,function,Perform an evaluation of `model` on the examples from `dataset`. -484,train_and_export,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,184,function,"Run MNIST training and eval loop in eager mode. +291,mnist_datasets,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,115,function, +292,loss,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,125,function, +293,compute_accuracy,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,131,function, +294,train,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,140,function,Trains model on `dataset` using `optimizer`. +295,train_and_export,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,184,function,"Run MNIST training and eval loop in eager mode. Args: flags_obj: An object containing parsed flag values." -485,import_and_eval,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,237,function, -486,apply_clean,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,247,function, -487,main,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,254,function, -488,placeholder_inputs,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,37,function,"Generate placeholder variables to represent the input tensors. +296,import_and_eval,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,237,function, +297,apply_clean,tensorflow/tensorflow/examples/tf2_showcase/mnist.py,247,function, +298,placeholder_inputs,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,37,function,"Generate placeholder variables to represent the input tensors. These placeholders are used as inputs by the rest of the model building code and will be fed from the downloaded data in the .run() loop, below. @@ -1469,7 +1361,7 @@ Args: Returns: images_placeholder: Images placeholder. labels_placeholder: Labels placeholder." -489,fill_feed_dict,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,59,function,"Fills the feed_dict for training the given step. +299,fill_feed_dict,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,59,function,"Fills the feed_dict for training the given step. A feed_dict takes the form of: feed_dict = { @@ -1484,7 +1376,7 @@ Args: Returns: feed_dict: The feed dictionary mapping from placeholders to values." -490,do_eval,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,87,function,"Runs one evaluation against the full epoch of data. +300,do_eval,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,87,function,"Runs one evaluation against the full epoch of data. Args: sess: The session in which the model has been trained. @@ -1493,46 +1385,9 @@ Args: labels_placeholder: The labels placeholder. data_set: The set of images and labels to evaluate, from input_data.read_data_sets()." -491,run_training,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,116,function,Train MNIST for a number of steps. -492,main,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,218,function, -493,_read32,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,43,function, -494,_extract_images,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,49,function,"Extract the images into a 4D uint8 numpy array [index, y, x, depth]. - -Args: - f: A file object that can be passed into a gzip reader. - -Returns: - data: A 4D uint8 numpy array [index, y, x, depth]. - -Raises: - ValueError: If the bytestream does not start with 2051." -495,_dense_to_one_hot,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,78,function,Convert class labels from scalars to one-hot vectors. -496,_extract_labels,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,88,function,"Extract the labels into a 1D uint8 numpy array [index]. - -Args: - f: A file object that can be passed into a gzip reader. - one_hot: Does one hot encoding for the result. - num_classes: Number of classes for the one hot encoding. - -Returns: - labels: a 1D uint8 numpy array. - -Raises: - ValueError: If the bystream doesn't start with 2049." -497,_DataSet,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,116,class,"Container class for a _DataSet (deprecated). - -THIS CLASS IS DEPRECATED." -498,_maybe_download,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,242,function,"Download the data from source url, unless it's already here. - -Args: - filename: string, name of the file in the directory. - work_directory: string, path to working directory. - source_url: url to download from if file doesn't exist. - -Returns: - Path to resulting file." -499,read_data_sets,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,266,function, -500,inference,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,45,function,"Build the MNIST model up to where it may be used for inference. +301,run_training,tensorflow/tensorflow/examples/tutorials/mnist/fully_connected_feed.py,116,function,Train MNIST for a number of steps. +302,read_data_sets,tensorflow/tensorflow/examples/tutorials/mnist/input_data.py,266,function, +303,inference,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,45,function,"Build the MNIST model up to where it may be used for inference. Args: images: Images placeholder, from inputs(). @@ -1541,7 +1396,7 @@ Args: Returns: softmax_linear: Output tensor with the computed logits." -501,loss,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,86,function,"Calculates the loss from the logits and the labels. +304,loss,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,86,function,"Calculates the loss from the logits and the labels. Args: logits: Logits tensor, float - [batch_size, NUM_CLASSES]. @@ -1549,7 +1404,7 @@ Args: Returns: loss: Loss tensor of type float." -502,training,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,101,function,"Sets up the training Ops. +305,training,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,101,function,"Sets up the training Ops. Creates a summarizer to track the loss over time in TensorBoard. @@ -1564,7 +1419,7 @@ Args: Returns: train_op: The Op for training." -503,evaluation,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,130,function,"Evaluate the quality of the logits at predicting the label. +306,evaluation,tensorflow/tensorflow/examples/tutorials/mnist/mnist.py,130,function,"Evaluate the quality of the logits at predicting the label. Args: logits: Logits tensor, float - [batch_size, NUM_CLASSES]. @@ -1574,37 +1429,11 @@ Args: Returns: A scalar int32 tensor with the number of examples (out of batch_size) that were predicted correctly." -504,main,tensorflow/tensorflow/examples/tutorials/mnist/mnist_softmax_xla.py,34,function, -505,train,tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py,38,function, -506,main,tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py,185,function, -507,_hash_file,tensorflow/tensorflow/examples/tutorials/word2vec/word2vec_basic.py,41,function, -508,word2vec_basic,tensorflow/tensorflow/examples/tutorials/word2vec/word2vec_basic.py,49,function,"Example of building, training and visualizing a word2vec model." -509,main,tensorflow/tensorflow/examples/tutorials/word2vec/word2vec_basic.py,360,function, -510,suppress_exception,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,37,function, -511,TestModule,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,46,class,The test model has unsupported op. -512,test_from_saved_model,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,57,function,displaying stack trace when converting saved model. -513,test_from_concrete_function,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,71,function,displaying stack trace when converting concrete function. -514,main,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,83,function, -515,load_labels,tensorflow/tensorflow/lite/examples/python/label_image.py,29,function, -516,_convert_bytes_to_cc_source,tensorflow/tensorflow/lite/experimental/acceleration/compatibility/convert_binary_to_cc_source.py,35,function,"Returns strings representing a C++ constant array containing `data`. - -Args: - data: Byte array that will be converted into a C++ constant. - array_name: String to use as the variable name for the constant array. - max_line_width: The longest line length, for formatting purposes. - include_guard: Name to use for the include guard macro definition. - include_path: Optional path to include in the source file. - use_tensorflow_license: Whether to include the standard TensorFlow Apache2 - license in the generated files. - -Returns: - Text that can be compiled as a C++ source file to link in the data as a - literal array of values. - Text that can be used as a C++ header file to reference the literal array." -517,main,tensorflow/tensorflow/lite/experimental/acceleration/compatibility/convert_binary_to_cc_source.py,155,function, -518,BidirectionalSequenceLstmTest,tensorflow/tensorflow/lite/experimental/examples/lstm/bidirectional_sequence_lstm_test.py,36,class, -519,BidirectionalSequenceRnnTest,tensorflow/tensorflow/lite/experimental/examples/lstm/bidirectional_sequence_rnn_test.py,38,class, -520,dynamic_rnn,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn.py,42,function,"Creates a recurrent neural network specified by RNNCell `cell`. +307,train,tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py,38,function, +308,word2vec_basic,tensorflow/tensorflow/examples/tutorials/word2vec/word2vec_basic.py,49,function,"Example of building, training and visualizing a word2vec model." +309,suppress_exception,tensorflow/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py,37,function, +310,load_labels,tensorflow/tensorflow/lite/examples/python/label_image.py,29,function, +311,dynamic_rnn,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn.py,42,function,"Creates a recurrent neural network specified by RNNCell `cell`. Performs fully dynamic unrolling of `inputs`. @@ -1711,7 +1540,7 @@ Raises: TypeError: If `cell` is not an instance of RNNCell. ValueError: If inputs is None or an empty list. RuntimeError: If not using control flow v2." -521,bidirectional_dynamic_rnn,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn.py,279,function,"Creates a dynamic version of bidirectional recurrent neural network. +312,bidirectional_dynamic_rnn,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn.py,279,function,"Creates a dynamic version of bidirectional recurrent neural network. Takes input and builds independent forward and backward RNNs. The input_size of forward and backward cell must match. The initial state for both directions @@ -1784,11 +1613,23 @@ Returns: Raises: TypeError: If `cell_fw` or `cell_bw` is not an instance of `RNNCell`." -522,TfLiteRNNCell,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,39,class,"The most basic RNN cell. +313,TfLiteRNNCell,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,39,class,"The most basic RNN cell. This is used only for TfLite, it provides hints and it also makes the variables in the desired for the tflite ops." -523,TFLiteLSTMCell,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,162,class,"Long short-term memory unit (LSTM) recurrent network cell. +314,state_size,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,88,method, +315,output_size,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,92,method, +316,build,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,95,method,"Builds the RNN cell. + +Args: + inputs_shape: Rnn input tensor shape. + +Raises: + ValueError: If last dimension of the input shape is not known." +317,call,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,127,method,Most basic RNN: output = new_state = act(W * input + U * state + B). +318,get_config,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,150,method, +319,add_variable_wrapped,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,110,method, +320,TFLiteLSTMCell,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,162,class,"Long short-term memory unit (LSTM) recurrent network cell. This is used only for TfLite, it provides hints and it also makes the variables in the desired for the tflite ops (transposed and separated). @@ -1815,10 +1656,41 @@ Note that this cell is not optimized for performance. Please use `tf.contrib.cudnn_rnn.CudnnLSTM` for better performance on GPU, or `tf.contrib.rnn.LSTMBlockCell` and `tf.contrib.rnn.LSTMBlockFusedCell` for better performance on CPU." -524,UnidirectionalSequenceLstmTest,tensorflow/tensorflow/lite/experimental/examples/lstm/unidirectional_sequence_lstm_test.py,36,class, -525,UnidirectionalSequenceRnnTest,tensorflow/tensorflow/lite/experimental/examples/lstm/unidirectional_sequence_rnn_test.py,37,class, -526,AudioFeatureGenerationTest,tensorflow/tensorflow/lite/experimental/microfrontend/python/kernel_tests/audio_microfrontend_op_test.py,35,class, -527,audio_microfrontend,tensorflow/tensorflow/lite/experimental/microfrontend/python/ops/audio_microfrontend_op.py,34,function,"Audio Microfrontend Op. +321,state_size,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,284,method, +322,output_size,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,288,method, +323,build,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,291,method,"Build TfLite LSTM cell graph. + +Args: + inputs_shape: The inputs_shape must be known, and is [batch_size, + input_size] shape. + +Raises: + ValueError: if the inputs_shape is invalid." +324,call,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,392,method,"Run one step of LSTM. + +Args: + inputs: input Tensor, 2D, `[batch, num_units]`. + state: if `state_is_tuple` is False, this must be a state Tensor, `2-D, + [batch, state_size]`. If `state_is_tuple` is True, this must be a tuple + of state Tensors, both `2-D`, with column sizes `c_state` and `m_state`. + +Returns: + A tuple containing: + + - A `2-D, [batch, output_dim]`, Tensor representing the output of the + LSTM after reading `inputs` when previous state was `state`. + Here output_dim is: + num_proj if num_proj was set, + num_units otherwise. + - Tensor(s) representing the new state of LSTM after reading `inputs` when + the previous state was `state`. Same type and shape(s) as `state`. + +Raises: + ValueError: If input size cannot be inferred from inputs via + static shape inference." +325,get_config,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,519,method, +326,add_variable_wrapped,tensorflow/tensorflow/lite/experimental/examples/lstm/rnn_cell.py,317,method, +327,audio_microfrontend,tensorflow/tensorflow/lite/experimental/microfrontend/python/ops/audio_microfrontend_op.py,34,function,"Audio Microfrontend Op. This Op converts a sequence of audio data into one or more feature vectors containing filterbanks of the input. The @@ -1862,11 +1734,11 @@ Returns: Raises: ValueError: If the audio tensor is not explicitly a vector." -528,SupportedOp,tensorflow/tensorflow/lite/experimental/tensorboard/ops_util.py,26,class,"Spec of supported ops. +328,SupportedOp,tensorflow/tensorflow/lite/experimental/tensorboard/ops_util.py,26,class,"Spec of supported ops. Args: op: string of op name." -529,get_potentially_supported_ops,tensorflow/tensorflow/lite/experimental/tensorboard/ops_util.py,35,function,"Returns operations potentially supported by TensorFlow Lite. +329,get_potentially_supported_ops,tensorflow/tensorflow/lite/experimental/tensorboard/ops_util.py,35,function,"Returns operations potentially supported by TensorFlow Lite. The potentially support list contains a list of ops that are partially or fully supported, which is derived by simply scanning op names to check whether @@ -1878,44 +1750,39 @@ Lite converter. Returns: A list of SupportedOp." -530,OpsUtilTest,tensorflow/tensorflow/lite/experimental/tensorboard/ops_util_test.py,24,class, -531,main,tensorflow/tensorflow/lite/g3doc/tools/build_java_api_docs.py,53,function, -532,main,tensorflow/tensorflow/lite/g3doc/tools/build_py_api_docs.py,55,function, -533,time_wrapping,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_augmentation.py,29,function,Generate (molecule/denominator)x speed data. -534,augment_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_augmentation.py,43,function,Perform data augmentation. -535,TestAugmentation,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_augmentation_test.py,32,class, -536,DataLoader,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,35,class,Loads data and prepares for training. -537,TestLoad,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load_test.py,30,class, -538,prepare_original_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,46,function,Read collected data from files. -539,generate_negative_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,86,function,Generate negative data labeled as 'negative6~8'. -540,write_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,143,function, -541,TestPrepare,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare_test.py,32,class, -542,read_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split.py,40,function, -543,split_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split.py,51,function,"Splits data into train, validation and test according to ratio." -544,person_split,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split_person.py,41,function,Split data by person. -545,TestSplitPerson,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split_person_test.py,28,class, -546,TestSplit,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split_test.py,29,class, -547,reshape_function,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,37,function, -548,calculate_model_size,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,42,function, -549,build_cnn,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,51,function,Builds a convolutional neural network in Keras. -550,build_lstm,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,78,function,Builds an LSTM in Keras. -551,load_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,93,function, -552,build_net,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,101,function, -553,train_net,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,111,function,Trains the model. -554,TestTrain,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train_test.py,33,class, -555,to_cc,tensorflow/tensorflow/lite/micro/examples/micro_speech/CMSIS/create_constants.py,26,function,Writes table values to a C++ source file. -556,to_h,tensorflow/tensorflow/lite/micro/examples/micro_speech/CMSIS/create_constants.py,44,function,Writes a header file for the table values. -557,new_data_to_array,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/captured_data_to_wav.py,28,function, -558,new_data_to_array,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py,29,function,Converts file information to an in-memory array. -559,to_float,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py,63,function, -560,check_file_existence,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,52,function, -561,show_and_save_bitmaps,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,60,function,"Display and save a list of bitmaps. +330,time_wrapping,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_augmentation.py,29,function,Generate (molecule/denominator)x speed data. +331,augment_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_augmentation.py,43,function,Perform data augmentation. +332,DataLoader,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,35,class,Loads data and prepares for training. +333,get_data_file,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,50,method,"Get train, valid and test data from files." +334,pad,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,66,method,Get neighbour padding. +335,format_support_func,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,81,method,"Support function for format.(Helps format train, valid and test.)" +336,format,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_load.py,98,method,"Format data(including padding, etc.) and get the dataset for the model." +337,prepare_original_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,46,function,Read collected data from files. +338,generate_negative_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,86,function,Generate negative data labeled as 'negative6~8'. +339,write_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_prepare.py,143,function, +340,read_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split.py,40,function, +341,split_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split.py,51,function,"Splits data into train, validation and test according to ratio." +342,person_split,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/data_split_person.py,41,function,Split data by person. +343,reshape_function,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,37,function, +344,calculate_model_size,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,42,function, +345,build_cnn,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,51,function,Builds a convolutional neural network in Keras. +346,build_lstm,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,78,function,Builds an LSTM in Keras. +347,load_data,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,93,function, +348,build_net,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,101,function, +349,train_net,tensorflow/tensorflow/lite/micro/examples/magic_wand/train/train.py,111,function,Trains the model. +350,to_cc,tensorflow/tensorflow/lite/micro/examples/micro_speech/CMSIS/create_constants.py,26,function,Writes table values to a C++ source file. +351,to_h,tensorflow/tensorflow/lite/micro/examples/micro_speech/CMSIS/create_constants.py,44,function,Writes a header file for the table values. +352,new_data_to_array,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/captured_data_to_wav.py,28,function, +353,new_data_to_array,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py,29,function,Converts file information to an in-memory array. +354,to_float,tensorflow/tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py,63,function, +355,check_file_existence,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,52,function, +356,show_and_save_bitmaps,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,60,function,"Display and save a list of bitmaps. Args: input_file: input file name bitmap_list: list of numpy arrays to represent bitmap images channels: color channel count" -562,reshape_bitmaps,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,87,function,"Reshape flat integer arrays. +357,reshape_bitmaps,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,87,function,"Reshape flat integer arrays. Args: frame_list: list of 1-D arrays to represent raw image data @@ -1925,7 +1792,7 @@ Args: Returns: list of numpy arrays to represent bitmap images" -563,parse_file,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,109,function,"Convert log file to array of pixels. +358,parse_file,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,109,function,"Convert log file to array of pixels. Args: inputfile: log file to parse @@ -1935,39 +1802,29 @@ Args: Returns: list 1-D arrays to represent raw image data." -564,main,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap.py,159,function, -565,RawToBitmapTest,tensorflow/tensorflow/lite/micro/examples/person_detection/utils/raw_to_bitmap_test.py,94,class, -566,generate_conv_model,tensorflow/tensorflow/lite/micro/testing/generate_test_models.py,34,function,"Creates a basic Keras model and converts to tflite. +359,generate_conv_model,tensorflow/tensorflow/lite/micro/testing/generate_test_models.py,34,function,"Creates a basic Keras model and converts to tflite. This model does not make any relevant classifications. It only exists to generate a model that is designed to run on embedded devices." -567,main,tensorflow/tensorflow/lite/micro/testing/generate_test_models.py,74,function, -568,rename_example_subfolder_files,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,29,function,Moves source files in example subfolders to equivalents at root. -569,move_person_data,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,41,function,Moves the downloaded person model into the examples folder. -570,move_person_data_experimental,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,61,function,Moves the downloaded person model into the examples folder. -571,move_image_data_experimental,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,83,function,Moves the downloaded image detection model into the examples folder. -572,rename_example_main_inos,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,104,function,Makes sure the .ino sketch files match the example name. -573,main,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,114,function,Control the rewriting of source files. -574,parse_args,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,124,function,Converts the raw arguments into accessible flags. -575,sanitize_xml,tensorflow/tensorflow/lite/micro/tools/make/generate_keil_project.py,29,function,Uses a allowlist to avoid generating bad XML. -576,main,tensorflow/tensorflow/lite/micro/tools/make/generate_keil_project.py,34,function,Generates a Keil project file from a template source. -577,parse_args,tensorflow/tensorflow/lite/micro/tools/make/generate_keil_project.py,82,function,Converts the raw arguments into accessible flags. -578,main,tensorflow/tensorflow/lite/micro/tools/make/merge_arduino_zips.py,27,function,Merges multiple Arduino zipfiles into a single result. -579,parse_args,tensorflow/tensorflow/lite/micro/tools/make/merge_arduino_zips.py,39,function,Converts the raw arguments into accessible flags. -580,replace_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,29,function,Updates any includes to reference the new Arduino library paths. -581,replace_main,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,43,function,Updates any occurrences of a bare main definition to the Arduino equivalent. -582,check_ino_functions,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,51,function,Ensures the required functions exist. -583,add_example_ino_library_include,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,65,function,Makes sure the example includes the header that loads the library. -584,replace_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,71,function,Updates any includes for local example files. -585,main,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,85,function,Transforms the input source file to work when exported to Arduino. -586,parse_args,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,108,function,Converts the raw arguments into accessible flags. -587,replace_arduino_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,36,function,Updates any includes to reference the new Arduino library paths. -588,replace_arduino_main,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,50,function,Updates any occurrences of a bare main definition to the Arduino equivalent. -589,check_ino_functions,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,58,function,Ensures the required functions exist. -590,add_example_ino_library_include,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,72,function,Makes sure the example includes the header that loads the library. -591,replace_arduino_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,78,function,Updates any includes for local example files. -592,replace_esp_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,92,function,Updates any includes for local example files. -593,transform_arduino_sources,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,109,function,"Transform sources for the Arduino platform. +360,rename_example_subfolder_files,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,29,function,Moves source files in example subfolders to equivalents at root. +361,move_person_data,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,41,function,Moves the downloaded person model into the examples folder. +362,move_person_data_experimental,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,61,function,Moves the downloaded person model into the examples folder. +363,move_image_data_experimental,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,83,function,Moves the downloaded image detection model into the examples folder. +364,parse_args,tensorflow/tensorflow/lite/micro/tools/make/fix_arduino_subfolders.py,124,function,Converts the raw arguments into accessible flags. +365,sanitize_xml,tensorflow/tensorflow/lite/micro/tools/make/generate_keil_project.py,29,function,Uses a allowlist to avoid generating bad XML. +366,parse_args,tensorflow/tensorflow/lite/micro/tools/make/generate_keil_project.py,82,function,Converts the raw arguments into accessible flags. +367,parse_args,tensorflow/tensorflow/lite/micro/tools/make/merge_arduino_zips.py,39,function,Converts the raw arguments into accessible flags. +368,replace_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,29,function,Updates any includes to reference the new Arduino library paths. +369,check_ino_functions,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,51,function,Ensures the required functions exist. +370,add_example_ino_library_include,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,65,function,Makes sure the example includes the header that loads the library. +371,replace_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,71,function,Updates any includes for local example files. +372,parse_args,tensorflow/tensorflow/lite/micro/tools/make/transform_arduino_source.py,108,function,Converts the raw arguments into accessible flags. +373,replace_arduino_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,36,function,Updates any includes to reference the new Arduino library paths. +374,check_ino_functions,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,58,function,Ensures the required functions exist. +375,add_example_ino_library_include,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,72,function,Makes sure the example includes the header that loads the library. +376,replace_arduino_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,78,function,Updates any includes for local example files. +377,replace_esp_example_includes,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,92,function,Updates any includes for local example files. +378,transform_arduino_sources,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,109,function,"Transform sources for the Arduino platform. Args: input_lines: A sequence of lines from the input file to process. @@ -1975,7 +1832,7 @@ Args: Returns: The transformed output as a string." -594,transform_esp_sources,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,138,function,"Transform sources for the ESP-IDF platform. +379,transform_esp_sources,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,138,function,"Transform sources for the ESP-IDF platform. Args: input_lines: A sequence of lines from the input file to process. @@ -1983,15 +1840,13 @@ Args: Returns: The transformed output as a string." -595,main,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,158,function,Transforms the input source file to work when exported as example. -596,parse_args,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,171,function,Converts the raw arguments into accessible flags. -597,_requires_input_stats,tensorflow/tensorflow/lite/python/convert.py,49,function, -598,_try_convert_to_unicode,tensorflow/tensorflow/lite/python/convert.py,67,function, -599,OpsSet,tensorflow/tensorflow/lite/python/convert.py,80,class,"Enum class defining the sets of ops available to generate TFLite models. +380,parse_args,tensorflow/tensorflow/lite/micro/tools/make/transform_source.py,171,function,Converts the raw arguments into accessible flags. +381,OpsSet,tensorflow/tensorflow/lite/python/convert.py,80,class,"Enum class defining the sets of ops available to generate TFLite models. WARNING: Experimental interface, subject to change." -600,ConverterError,tensorflow/tensorflow/lite/python/convert.py,120,class,Raised when an error occurs during model conversion. -601,mlir_quantize,tensorflow/tensorflow/lite/python/convert.py,125,function,"Quantize `input_data_str` with calibration results. +382,get_options,tensorflow/tensorflow/lite/python/convert.py,115,method,Returns a list of OpsSet options as a list of strings. +383,ConverterError,tensorflow/tensorflow/lite/python/convert.py,120,class,Raised when an error occurs during model conversion. +384,mlir_quantize,tensorflow/tensorflow/lite/python/convert.py,125,function,"Quantize `input_data_str` with calibration results. Args: input_data_str: Input data in serialized form (e.g. a TFLITE model with @@ -2005,14 +1860,14 @@ Args: Returns: Quantized model in serialized form (e.g. a TFLITE model) with floating-point inputs and outputs." -602,mlir_sparsify,tensorflow/tensorflow/lite/python/convert.py,150,function,"Sparsify `input_data_str` to encode sparse tensor with proper format. +385,mlir_sparsify,tensorflow/tensorflow/lite/python/convert.py,150,function,"Sparsify `input_data_str` to encode sparse tensor with proper format. Args: input_data_str: Input data in serialized form (e.g. a TFLITE model). Returns: Sparsified model in serialized form (e.g. a TFLITE model)." -603,toco_convert_protos,tensorflow/tensorflow/lite/python/convert.py,162,function,"Convert `input_data_str` according to model and toco parameters. +386,toco_convert_protos,tensorflow/tensorflow/lite/python/convert.py,162,function,"Convert `input_data_str` according to model and toco parameters. Unless you know what you are doing consider using the more friendly `tf.compat.v1.lite.toco_convert`. @@ -2035,7 +1890,7 @@ Raises: ops not being supported. RuntimeError: When conversion fails, an exception is raised with the error message embedded." -604,build_toco_convert_protos,tensorflow/tensorflow/lite/python/convert.py,291,function,"Builds protocol buffers describing a conversion of a model using TOCO. +387,build_toco_convert_protos,tensorflow/tensorflow/lite/python/convert.py,291,function,"Builds protocol buffers describing a conversion of a model using TOCO. Typically this is to convert from TensorFlow GraphDef to TFLite, in which case the default `input_format` and `output_format` are sufficient. @@ -2123,7 +1978,7 @@ Raises: Missing mean_values or std_dev_values RuntimeError: If TOCO fails to convert (in which case the runtime error's error text will contain the TOCO error log)" -605,toco_convert_graph_def,tensorflow/tensorflow/lite/python/convert.py,485,function,"""Convert a model using TOCO. +388,toco_convert_graph_def,tensorflow/tensorflow/lite/python/convert.py,485,function,"""Convert a model using TOCO. This function is used to convert GraphDefs that cannot be loaded into TensorFlow to TFLite. Conversion can be customized by providing arguments @@ -2150,7 +2005,7 @@ Returns: Raises: Defined in `build_toco_convert_protos`." -606,toco_convert_impl,tensorflow/tensorflow/lite/python/convert.py,541,function,"""Convert a model using TOCO. +389,toco_convert_impl,tensorflow/tensorflow/lite/python/convert.py,541,function,"""Convert a model using TOCO. Typically this function is used to convert from TensorFlow GraphDef to TFLite. Conversion can be customized by providing arguments that are forwarded to @@ -2172,7 +2027,7 @@ Returns: Raises: Defined in `build_toco_convert_protos`." -607,toco_convert,tensorflow/tensorflow/lite/python/convert.py,580,function,"Convert a model using TOCO. +390,toco_convert,tensorflow/tensorflow/lite/python/convert.py,580,function,"Convert a model using TOCO. Typically this function is used to convert from TensorFlow GraphDef to TFLite. Conversion can be customized by providing arguments that are forwarded to @@ -2193,10 +2048,7 @@ Returns: Raises: Defined in `build_toco_convert_protos`." -608,run_main,tensorflow/tensorflow/lite/python/convert_file_to_c_source.py,29,function,Main in convert_file_to_c_source.py. -609,main,tensorflow/tensorflow/lite/python/convert_file_to_c_source.py,101,function, -610,_log_tensor_details,tensorflow/tensorflow/lite/python/convert_saved_model.py,30,function,"Log tensor details: name, shape, and type." -611,get_meta_graph_def,tensorflow/tensorflow/lite/python/convert_saved_model.py,46,function,"Validate saved_model and extract MetaGraphDef. +391,get_meta_graph_def,tensorflow/tensorflow/lite/python/convert_saved_model.py,46,function,"Validate saved_model and extract MetaGraphDef. Args: saved_model_dir: saved_model path to convert. @@ -2207,7 +2059,7 @@ Returns: Raises: ValueError: No valid MetaGraphDef for given tag_set." -612,get_signature_def,tensorflow/tensorflow/lite/python/convert_saved_model.py,63,function,"Get the signature def from meta_graph with given signature_key. +392,get_signature_def,tensorflow/tensorflow/lite/python/convert_saved_model.py,63,function,"Get the signature def from meta_graph with given signature_key. Args: meta_graph: meta_graph_def. @@ -2218,34 +2070,14 @@ Returns: Raises: ValueError: Given signature_key is not valid for this meta_graph." -613,get_inputs_outputs,tensorflow/tensorflow/lite/python/convert_saved_model.py,88,function,"Get inputs and outputs from SignatureDef. +393,get_inputs_outputs,tensorflow/tensorflow/lite/python/convert_saved_model.py,88,function,"Get inputs and outputs from SignatureDef. Args: signature_def: SignatureDef in the meta_graph_def for conversion. Returns: The inputs and outputs in the graph for conversion." -614,_get_tensors,tensorflow/tensorflow/lite/python/convert_saved_model.py,112,function,"Gets the tensors associated with the tensor names. - -Either signature_def_tensor_names or user_tensor_names should be provided. If -the user provides tensors, the tensors associated with the user provided -tensor names are provided. Otherwise, the tensors associated with the names in -the SignatureDef are provided. - -Args: - graph: GraphDef representing graph. - signature_def_tensor_names: Tensor names stored in either the inputs or - outputs of a SignatureDef. (default None) - user_tensor_names: Tensor names provided by the user. (default None) - -Returns: - List of tensors. - -Raises: - ValueError: - signature_def_tensors and user_tensor_names are undefined or empty. - user_tensor_names are not valid." -615,freeze_saved_model,tensorflow/tensorflow/lite/python/convert_saved_model.py,155,function,"Converts a SavedModel to a frozen graph. +394,freeze_saved_model,tensorflow/tensorflow/lite/python/convert_saved_model.py,155,function,"Converts a SavedModel to a frozen graph. Args: saved_model_dir: SavedModel directory to convert. @@ -2273,11 +2105,7 @@ Raises: assets/ directory is in the MetaGraphDef. input_shapes does not match the length of input_arrays. input_arrays or output_arrays are not valid." -616,FreezeSavedModelTest,tensorflow/tensorflow/lite/python/convert_saved_model_test.py,40,class, -617,ConvertTest,tensorflow/tensorflow/lite/python/convert_test.py,38,class, -618,ConvertTestOpHint,tensorflow/tensorflow/lite/python/convert_test.py,168,class,Test the hint to stub functionality. -619,_tf_export,tensorflow/tensorflow/lite/python/interpreter.py,37,function, -620,Delegate,tensorflow/tensorflow/lite/python/interpreter.py,42,class,"Python wrapper class to manage TfLiteDelegate objects. +395,Delegate,tensorflow/tensorflow/lite/python/interpreter.py,42,class,"Python wrapper class to manage TfLiteDelegate objects. The shared library is expected to have two functions: TfLiteDelegate* tflite_plugin_create_delegate( @@ -2292,7 +2120,8 @@ created delegate object. Passing NULL as argument value is allowed, i.e. tflite_plugin_destroy_delegate(tflite_plugin_create_delegate(...)) always works." -621,load_delegate,tensorflow/tensorflow/lite/python/interpreter.py,132,function,"Returns loaded Delegate object. +396,report,tensorflow/tensorflow/lite/python/interpreter.py,101,method, +397,load_delegate,tensorflow/tensorflow/lite/python/interpreter.py,132,function,"Returns loaded Delegate object. Args: library: Name of shared library containing the @@ -2308,7 +2137,7 @@ Returns: Raises: ValueError: Delegate failed to load. RuntimeError: If delegate loading is used on unsupported platform." -622,Interpreter,tensorflow/tensorflow/lite/python/interpreter.py,159,class,"Interpreter interface for TensorFlow Lite Models. +398,Interpreter,tensorflow/tensorflow/lite/python/interpreter.py,159,class,"Interpreter interface for TensorFlow Lite Models. This makes the TensorFlow Lite interpreter accessible in Python. It is possible to use this interpreter in a multithreaded Python environment, @@ -2319,7 +2148,124 @@ data. Similarly, if you are calling invoke() in one thread on a single interpreter but you want to use tensor() on another thread once it is done, you must use a synchronization primitive between the threads to ensure invoke has returned before calling tensor()." -623,InterpreterWithCustomOps,tensorflow/tensorflow/lite/python/interpreter.py,552,class,"Interpreter interface for TensorFlow Lite Models that accepts custom ops. +399,allocate_tensors,tensorflow/tensorflow/lite/python/interpreter.py,242,method, +400,get_tensor_details,tensorflow/tensorflow/lite/python/interpreter.py,365,method,"Gets tensor details for every tensor with valid tensor details. + +Tensors where required information about the tensor is not found are not +added to the list. This includes temporary tensors without a name. + +Returns: + A list of dictionaries containing tensor information." +401,get_input_details,tensorflow/tensorflow/lite/python/interpreter.py,382,method,"Gets model input details. + +Returns: + A list of input details." +402,set_tensor,tensorflow/tensorflow/lite/python/interpreter.py,392,method,"Sets the value of the input tensor. + +Note this copies data in `value`. + +If you want to avoid copying, you can use the `tensor()` function to get a +numpy buffer pointing to the input buffer in the tflite interpreter. + +Args: + tensor_index: Tensor index of tensor to set. This value can be gotten from + the 'index' field in get_input_details. + value: Value of tensor to set. + +Raises: + ValueError: If the interpreter could not set the tensor." +403,resize_tensor_input,tensorflow/tensorflow/lite/python/interpreter.py,410,method,"Resizes an input tensor. + +``` +interpreter = Interpreter(model_content=tflite_model) +interpreter.resize_tensor_input(0, [1, 224, 224, 3], strict=True) +interpreter.allocate_tensors() +interpreter.invoke() +``` + +Args: + input_index: Tensor index of input to set. This value can be gotten from + the 'index' field in get_input_details. + tensor_size: The tensor_shape to resize the input to. + strict: Only unknown dimensions can be resized when `strict` is True. + Unknown dimensions are indicated as `-1` in the `shape_signature` + attribute of a given tensor. (default False) + +Raises: + ValueError: If the interpreter could not resize the input tensor." +404,get_output_details,tensorflow/tensorflow/lite/python/interpreter.py,437,method,"Gets model output details. + +Returns: + A list of output details." +405,get_tensor,tensorflow/tensorflow/lite/python/interpreter.py,447,method,"Gets the value of the input tensor (get a copy). + +If you wish to avoid the copy, use `tensor()`. This function cannot be used +to read intermediate results. + +Args: + tensor_index: Tensor index of tensor to get. This value can be gotten from + the 'index' field in get_output_details. + +Returns: + a numpy array." +406,tensor,tensorflow/tensorflow/lite/python/interpreter.py,462,method,"Returns function that gives a numpy view of the current tensor buffer. + +This allows reading and writing to this tensors w/o copies. This more +closely mirrors the C++ Interpreter class interface's tensor() member, hence +the name. Be careful to not hold these output references through calls +to `allocate_tensors()` and `invoke()`. This function cannot be used to read +intermediate results. + +Usage: + +``` +interpreter.allocate_tensors() +input = interpreter.tensor(interpreter.get_input_details()[0][""index""]) +output = interpreter.tensor(interpreter.get_output_details()[0][""index""]) +for i in range(10): + input().fill(3.) + interpreter.invoke() + print(""inference %s"" % output()) +``` + +Notice how this function avoids making a numpy array directly. This is +because it is important to not hold actual numpy views to the data longer +than necessary. If you do, then the interpreter can no longer be invoked, +because it is possible the interpreter would resize and invalidate the +referenced tensors. The NumPy API doesn't allow any mutability of the +the underlying buffers. + +WRONG: + +``` +input = interpreter.tensor(interpreter.get_input_details()[0][""index""])() +output = interpreter.tensor(interpreter.get_output_details()[0][""index""])() +interpreter.allocate_tensors() # This will throw RuntimeError +for i in range(10): + input.fill(3.) + interpreter.invoke() # this will throw RuntimeError since input,output +``` + +Args: + tensor_index: Tensor index of tensor to get. This value can be gotten from + the 'index' field in get_output_details. + +Returns: + A function that can return a new numpy array pointing to the internal + TFLite tensor state at any point. It is safe to hold the function forever, + but it is not safe to hold the numpy array forever." +407,invoke,tensorflow/tensorflow/lite/python/interpreter.py,512,method,"Invoke the interpreter. + +Be sure to set the input sizes, allocate tensors and fill values before +calling this. Also, note that this function releases the GIL so heavy +computation can be done in the background while the Python interpreter +continues. No other function on this object should be called while the +invoke() call has not finished. + +Raises: + ValueError: When the underlying interpreter fails raise ValueError." +408,reset_all_variables,tensorflow/tensorflow/lite/python/interpreter.py,527,method, +409,InterpreterWithCustomOps,tensorflow/tensorflow/lite/python/interpreter.py,552,class,"Interpreter interface for TensorFlow Lite Models that accepts custom ops. The interface provided by this class is experimental and therefore not exposed as part of the public API. @@ -2327,12 +2273,7 @@ as part of the public API. Wraps the tf.lite.Interpreter class and adds the ability to load custom ops by providing the names of functions that take a pointer to a BuiltinOpResolver and add a custom op." -624,InterpreterCustomOpsTest,tensorflow/tensorflow/lite/python/interpreter_test.py,43,class, -625,InterpreterTest,tensorflow/tensorflow/lite/python/interpreter_test.py,63,class, -626,InterpreterTestErrorPropagation,tensorflow/tensorflow/lite/python/interpreter_test.py,260,class, -627,InterpreterTensorAccessorTest,tensorflow/tensorflow/lite/python/interpreter_test.py,298,class, -628,InterpreterDelegateTest,tensorflow/tensorflow/lite/python/interpreter_test.py,353,class, -629,Optimize,tensorflow/tensorflow/lite/python/lite.py,88,class,"Enum defining the optimizations to apply when generating tflite graphs. +410,Optimize,tensorflow/tensorflow/lite/python/lite.py,88,class,"Enum defining the optimizations to apply when generating tflite graphs. Some optimizations may come at the cost of accuracy. @@ -2351,13 +2292,13 @@ OPTIMIZE_FOR_SIZE OPTIMIZE_FOR_LATENCY Deprecated. Does the same as DEFAULT." -630,RepresentativeDataset,tensorflow/tensorflow/lite/python/lite.py,131,class,"Representative dataset to evaluate optimizations. +411,RepresentativeDataset,tensorflow/tensorflow/lite/python/lite.py,131,class,"Representative dataset to evaluate optimizations. A representative dataset that can be used to evaluate optimizations by the converter. E.g. converter can use these examples to estimate (min, max) ranges by calibrating the model on inputs. This can allow converter to quantize a converted floating point model." -631,TargetSpec,tensorflow/tensorflow/lite/python/lite.py,153,class,"Specification of target device. +412,TargetSpec,tensorflow/tensorflow/lite/python/lite.py,153,class,"Specification of target device. Details about target device. Converter optimizes the generated model for specific device. @@ -2369,9 +2310,22 @@ Attributes: Supported values are types exported by lite.constants. Frequently, an optimization choice is driven by the most compact (i.e. smallest) type in this list (default [constants.FLOAT])" -632,QuantizationMode,tensorflow/tensorflow/lite/python/lite.py,177,class,QuantizationMode determines the quantized conversion from user options. -633,TFLiteConverterBase,tensorflow/tensorflow/lite/python/lite.py,384,class,Converter subclass to share functionality between V1 and V2 converters. -634,TFLiteConverterBaseV2,tensorflow/tensorflow/lite/python/lite.py,522,class,"Converter subclass to share functionality between V2 converters. +413,QuantizationMode,tensorflow/tensorflow/lite/python/lite.py,177,class,QuantizationMode determines the quantized conversion from user options. +414,post_training_int8_no_float,tensorflow/tensorflow/lite/python/lite.py,189,method,"Post training int8 quantize, disallow float fallback." +415,post_training_int8_allow_float,tensorflow/tensorflow/lite/python/lite.py,195,method,"Post training int8 quantize, allow float fallback." +416,is_post_training_integer_quantize,tensorflow/tensorflow/lite/python/lite.py,202,method,Post training integer quantization. +417,training_time_int8_allow_float,tensorflow/tensorflow/lite/python/lite.py,207,method,"Training-time int8 quantize, allow float fallback." +418,post_training_int16x8_no_float,tensorflow/tensorflow/lite/python/lite.py,213,method,"Post training int16x8 quantize, disallow float fallback." +419,post_training_int16x8_allow_float,tensorflow/tensorflow/lite/python/lite.py,220,method,"Post training int16x8 quantize, allow float fallback." +420,post_training_dynamic_range_int8,tensorflow/tensorflow/lite/python/lite.py,224,method,"Post training int8 const, on-the-fly int8 quantize of dynamic tensors." +421,post_training_fp16,tensorflow/tensorflow/lite/python/lite.py,233,method,Post training fp16 quantize. +422,fp32_execution,tensorflow/tensorflow/lite/python/lite.py,238,method,If none of the above are true. +423,activations_type,tensorflow/tensorflow/lite/python/lite.py,248,method, +424,converter_flags,tensorflow/tensorflow/lite/python/lite.py,252,method,Flags to the converter. +425,quantizer_flags,tensorflow/tensorflow/lite/python/lite.py,292,method,Default flags to the TFMOT quantizer. +426,contains_training_quant_op,tensorflow/tensorflow/lite/python/lite.py,371,method,Checks if the graph contains any training-time quantization ops. +427,TFLiteConverterBase,tensorflow/tensorflow/lite/python/lite.py,384,class,Converter subclass to share functionality between V1 and V2 converters. +428,TFLiteConverterBaseV2,tensorflow/tensorflow/lite/python/lite.py,522,class,"Converter subclass to share functionality between V2 converters. Attributes: allow_custom_ops: Boolean indicating whether to allow custom operations. @@ -2397,13 +2351,62 @@ Attributes: {tf.float32, tf.int8, tf.uint8}) experimental_new_converter: Experimental flag, subject to change. Enables MLIR-based conversion instead of TOCO conversion. (default True)" -635,TFLiteSavedModelConverterV2,tensorflow/tensorflow/lite/python/lite.py,652,class,"Converts the given SavedModel into TensorFlow Lite model. +429,convert,tensorflow/tensorflow/lite/python/lite.py,574,method,"Converts a TensorFlow GraphDef based on instance variables. + +Args: + graph_def: Frozen TensorFlow GraphDef. + input_tensors: List of input tensors. Type and shape are computed using + `foo.shape` and `foo.dtype`. + output_tensors: List of output tensors (only .name is used from this). + +Returns: + The converted data in serialized format. + +Raises: + ValueError: + No concrete functions is specified. + Multiple concrete functions are specified. + Input shape is not specified. + Invalid quantization parameters." +430,TFLiteSavedModelConverterV2,tensorflow/tensorflow/lite/python/lite.py,652,class,"Converts the given SavedModel into TensorFlow Lite model. Attributes: saved_model_dir: Directory of the SavedModel." -636,TFLiteKerasModelConverterV2,tensorflow/tensorflow/lite/python/lite.py,719,class,Converts the given Keras model into TensorFlow Lite model. -637,TFLiteFrozenGraphConverterV2,tensorflow/tensorflow/lite/python/lite.py,840,class,Converts the given frozen graph into TensorFlow Lite model. -638,TFLiteConverterV2,tensorflow/tensorflow/lite/python/lite.py,910,class,"Converts a TensorFlow model into TensorFlow Lite model. +431,convert,tensorflow/tensorflow/lite/python/lite.py,686,method,"Converts a TensorFlow GraphDef based on instance variables. + +Returns: + The converted data in serialized format. + +Raises: + ValueError: + No concrete functions is specified. + Multiple concrete functions are specified. + Input shape is not specified. + Invalid quantization parameters." +432,TFLiteKerasModelConverterV2,tensorflow/tensorflow/lite/python/lite.py,719,class,Converts the given Keras model into TensorFlow Lite model. +433,convert,tensorflow/tensorflow/lite/python/lite.py,781,method,"Converts a keras model based on instance variables. + +Returns: + The converted data in serialized format. + +Raises: + ValueError: + Multiple concrete functions are specified. + Input shape is not specified. + Invalid quantization parameters." +434,TFLiteFrozenGraphConverterV2,tensorflow/tensorflow/lite/python/lite.py,840,class,Converts the given frozen graph into TensorFlow Lite model. +435,convert,tensorflow/tensorflow/lite/python/lite.py,859,method,"Converts a TensorFlow GraphDef based on instance variables. + +Returns: + The converted data in serialized format. + +Raises: + ValueError: + No concrete functions is specified. + Multiple concrete functions are specified. + Input shape is not specified. + Invalid quantization parameters." +436,TFLiteConverterV2,tensorflow/tensorflow/lite/python/lite.py,910,class,"Converts a TensorFlow model into TensorFlow Lite model. Attributes: allow_custom_ops: Boolean indicating whether to allow custom operations. @@ -2445,7 +2448,53 @@ Example usage: converter = tf.lite.TFLiteConverter.from_concrete_functions([func]) tflite_model = converter.convert() ```" -639,TFLiteConverterBaseV1,tensorflow/tensorflow/lite/python/lite.py,1085,class,"Converter subclass to share functionality between V1 converters. +437,from_concrete_functions,tensorflow/tensorflow/lite/python/lite.py,971,method,"Creates a TFLiteConverter object from ConcreteFunctions. + +Args: + funcs: List of TensorFlow ConcreteFunctions. The list should not contain + duplicate elements. Currently converter can only convert a single + ConcreteFunction. Converting multiple functions is under development. + +Returns: + TFLiteConverter object. + +Raises: + Invalid input type." +438,from_saved_model,tensorflow/tensorflow/lite/python/lite.py,995,method,"Creates a TFLiteConverter object from a SavedModel directory. + +Args: + saved_model_dir: SavedModel directory to convert. + signature_keys: List of keys identifying SignatureDef containing inputs + and outputs. Elements should not be duplicated. By default the + `signatures` attribute of the MetaGraphdef is used. (default + saved_model.signatures) + tags: Set of tags identifying the MetaGraphDef within the SavedModel to + analyze. All tags in the tag set must be present. (default set(SERVING)) + +Returns: + TFLiteConverter object. + +Raises: + Invalid signature keys." +439,from_keras_model,tensorflow/tensorflow/lite/python/lite.py,1057,method,"Creates a TFLiteConverter object from a Keras model. + +Args: + model: tf.Keras.Model + +Returns: + TFLiteConverter object." +440,convert,tensorflow/tensorflow/lite/python/lite.py,1069,method,"Converts a TensorFlow GraphDef based on instance variables. + +Returns: + The converted data in serialized format. + +Raises: + ValueError: + No concrete functions is specified. + Multiple concrete functions are specified. + Input shape is not specified. + Invalid quantization parameters." +441,TFLiteConverterBaseV1,tensorflow/tensorflow/lite/python/lite.py,1085,class,"Converter subclass to share functionality between V1 converters. Attributes: inference_type: Target data type of real-number arrays in the output file. @@ -2516,13 +2565,37 @@ Attributes: dataset to evaluate different optimizations. experimental_new_converter: Experimental flag, subject to change. Enables MLIR-based conversion instead of TOCO conversion. (default True)" -640,TFLiteSavedModelConverter,tensorflow/tensorflow/lite/python/lite.py,1410,class,"Converts the given SavedModel into TensorFlow Lite model. +442,convert,tensorflow/tensorflow/lite/python/lite.py,1226,method,"Converts a TensorFlow GraphDef based on instance variables. + +Returns: + The converted data in serialized format. Either a TFLite Flatbuffer or a + Graphviz graph depending on value in `output_format`. + +Raises: + ValueError: + Input shape is not specified. + None value for dimension in input_tensor." +443,get_input_arrays,tensorflow/tensorflow/lite/python/lite.py,1352,method,"Returns a list of the names of the input tensors. + +Returns: + List of strings." +444,TFLiteSavedModelConverter,tensorflow/tensorflow/lite/python/lite.py,1410,class,"Converts the given SavedModel into TensorFlow Lite model. Attributes: saved_model_dir: Directory of the SavedModel." -641,TFLiteKerasModelConverter,tensorflow/tensorflow/lite/python/lite.py,1458,class,Converts the given SavedModel into TensorFlow Lite model. -642,TFLiteFrozenGraphConverter,tensorflow/tensorflow/lite/python/lite.py,1586,class,Converts the given frozen graph def into TensorFlow Lite model. -643,TFLiteConverter,tensorflow/tensorflow/lite/python/lite.py,1634,class,"Convert a TensorFlow model into `output_format`. +445,TFLiteKerasModelConverter,tensorflow/tensorflow/lite/python/lite.py,1458,class,Converts the given SavedModel into TensorFlow Lite model. +446,convert,tensorflow/tensorflow/lite/python/lite.py,1567,method,"Converts a Keras model based on instance variables. + +Returns: + The converted data in serialized format. Either a TFLite Flatbuffer or a + Graphviz graph depending on value in `output_format`. + +Raises: + ValueError: + Input shape is not specified. + None value for dimension in input_tensor." +447,TFLiteFrozenGraphConverter,tensorflow/tensorflow/lite/python/lite.py,1586,class,Converts the given frozen graph def into TensorFlow Lite model. +448,TFLiteConverter,tensorflow/tensorflow/lite/python/lite.py,1634,class,"Convert a TensorFlow model into `output_format`. This is used to convert from a TensorFlow GraphDef, SavedModel or tf.keras model into either a TFLite FlatBuffer or graph visualization. @@ -2626,31 +2699,107 @@ Example usage: tflite_model = converter.convert() open(""converted_model.tflite"", ""wb"").write(tflite_model) ```" -644,TocoConverter,tensorflow/tensorflow/lite/python/lite.py,1979,class,"Convert a TensorFlow model into `output_format` using TOCO. +449,from_session,tensorflow/tensorflow/lite/python/lite.py,1776,method,"Creates a TFLiteConverter class from a TensorFlow Session. + +Args: + sess: TensorFlow Session. + input_tensors: List of input tensors. Type and shape are computed using + `foo.shape` and `foo.dtype`. + output_tensors: List of output tensors (only .name is used from this). + +Returns: + TFLiteConverter class." +450,from_frozen_graph,tensorflow/tensorflow/lite/python/lite.py,1796,method,"Creates a TFLiteConverter class from a file containing a frozen GraphDef. + +Args: + graph_def_file: Full filepath of file containing frozen GraphDef. + input_arrays: List of input tensors to freeze graph with. + output_arrays: List of output tensors to freeze graph with. + input_shapes: Dict of strings representing input tensor names to list of + integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). + Automatically determined when input shapes is None (e.g., {""foo"" : + None}). (default None) + +Returns: + TFLiteConverter class. + +Raises: + IOError: + File not found. + Unable to parse input file. + ValueError: + The graph is not frozen. + input_arrays or output_arrays contains an invalid tensor name. + input_shapes is not correctly defined when required" +451,from_saved_model,tensorflow/tensorflow/lite/python/lite.py,1889,method,"Creates a TFLiteConverter class from a SavedModel. + +Args: + saved_model_dir: SavedModel directory to convert. + input_arrays: List of input tensors to freeze graph with. Uses input + arrays from SignatureDef when none are provided. (default None) + input_shapes: Dict of strings representing input tensor names to list of + integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). + Automatically determined when input shapes is None (e.g., {""foo"" : + None}). (default None) + output_arrays: List of output tensors to freeze graph with. Uses output + arrays from SignatureDef when none are provided. (default None) + tag_set: Set of tags identifying the MetaGraphDef within the SavedModel to + analyze. All tags in the tag set must be present. (default set(""serve"")) + signature_key: Key identifying SignatureDef containing inputs and outputs. + (default DEFAULT_SERVING_SIGNATURE_DEF_KEY) + +Returns: + TFLiteConverter class." +452,from_keras_model_file,tensorflow/tensorflow/lite/python/lite.py,1936,method,"Creates a TFLiteConverter class from a tf.keras model file. + +Args: + model_file: Full filepath of HDF5 file containing the tf.keras model. + input_arrays: List of input tensors to freeze graph with. Uses input + arrays from SignatureDef when none are provided. (default None) + input_shapes: Dict of strings representing input tensor names to list of + integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). + Automatically determined when input shapes is None (e.g., {""foo"" : + None}). (default None) + output_arrays: List of output tensors to freeze graph with. Uses output + arrays from SignatureDef when none are provided. (default None) + custom_objects: Dict mapping names (strings) to custom classes or + functions to be considered during model deserialization. (default None) + +Returns: + TFLiteConverter class." +453,convert,tensorflow/tensorflow/lite/python/lite.py,1964,method,"Converts a TensorFlow GraphDef based on instance variables. + +Returns: + The converted data in serialized format. Either a TFLite Flatbuffer or a + Graphviz graph depending on value in `output_format`. + +Raises: + ValueError: + Input shape is not specified. + None value for dimension in input_tensor." +454,TocoConverter,tensorflow/tensorflow/lite/python/lite.py,1979,class,"Convert a TensorFlow model into `output_format` using TOCO. This class has been deprecated. Please use `lite.TFLiteConverter` instead." -645,FromSessionTest,tensorflow/tensorflow/lite/python/lite_flex_test.py,38,class, -646,FromConcreteFunctionTest,tensorflow/tensorflow/lite/python/lite_flex_test.py,103,class, -647,LiteTest,tensorflow/tensorflow/lite/python/lite_test.py,59,class,Base class of all the tests in this module. -648,TestModels,tensorflow/tensorflow/lite/python/lite_test.py,63,class, -649,FromConstructor,tensorflow/tensorflow/lite/python/lite_test.py,76,class, -650,FromSessionTest,tensorflow/tensorflow/lite/python/lite_test.py,115,class, -651,FromFrozenGraphFile,tensorflow/tensorflow/lite/python/lite_test.py,1464,class, -652,FromFrozenGraphObjectDetection,tensorflow/tensorflow/lite/python/lite_test.py,1650,class, -653,FromSavedModelTest,tensorflow/tensorflow/lite/python/lite_test.py,1713,class, -654,MyAddLayer,tensorflow/tensorflow/lite/python/lite_test.py,1897,class, -655,FromKerasFile,tensorflow/tensorflow/lite/python/lite_test.py,1912,class, -656,GrapplerTest,tensorflow/tensorflow/lite/python/lite_test.py,2292,class, -657,ImportOpsUtilTest,tensorflow/tensorflow/lite/python/lite_test.py,2384,class, -658,DefaultConverterAttrsTest,tensorflow/tensorflow/lite/python/lite_test.py,2390,class, -659,FromConcreteFunctionTest,tensorflow/tensorflow/lite/python/lite_v2_test.py,48,class, -660,FromSavedModelTest,tensorflow/tensorflow/lite/python/lite_v2_test.py,498,class, -661,FromKerasModelTest,tensorflow/tensorflow/lite/python/lite_v2_test.py,709,class, -662,ControlFlowTest,tensorflow/tensorflow/lite/python/lite_v2_test.py,825,class, -663,GrapplerTest,tensorflow/tensorflow/lite/python/lite_v2_test.py,1013,class, -664,UnknownShapes,tensorflow/tensorflow/lite/python/lite_v2_test.py,1047,class, -665,ModelTest,tensorflow/tensorflow/lite/python/lite_v2_test_util.py,34,class,Base test class for TensorFlow Lite 2.x model tests. -666,OpHint,tensorflow/tensorflow/lite/python/op_hint.py,97,class,"A class that helps build tflite function invocations. +455,from_session,tensorflow/tensorflow/lite/python/lite.py,1988,method,Creates a TocoConverter class from a TensorFlow Session. +456,from_frozen_graph,tensorflow/tensorflow/lite/python/lite.py,1995,method,Creates a TocoConverter class from a file containing a frozen graph. +457,from_saved_model,tensorflow/tensorflow/lite/python/lite.py,2007,method,Creates a TocoConverter class from a SavedModel. +458,from_keras_model_file,tensorflow/tensorflow/lite/python/lite.py,2022,method,Creates a TocoConverter class from a tf.keras model file. +459,FromConstructor,tensorflow/tensorflow/lite/python/lite_test.py,76,class, +460,FromFrozenGraphFile,tensorflow/tensorflow/lite/python/lite_test.py,1464,class, +461,FromFrozenGraphObjectDetection,tensorflow/tensorflow/lite/python/lite_test.py,1650,class, +462,MyAddLayer,tensorflow/tensorflow/lite/python/lite_test.py,1897,class, +463,call,tensorflow/tensorflow/lite/python/lite_test.py,1903,method, +464,get_config,tensorflow/tensorflow/lite/python/lite_test.py,1906,method, +465,FromKerasFile,tensorflow/tensorflow/lite/python/lite_test.py,1912,class, +466,setUp,tensorflow/tensorflow/lite/python/lite_test.py,1914,method, +467,tearDown,tensorflow/tensorflow/lite/python/lite_test.py,1921,method, +468,UnknownShapes,tensorflow/tensorflow/lite/python/lite_v2_test.py,1047,class, +469,model,tensorflow/tensorflow/lite/python/lite_v2_test.py,1056,method, +470,model,tensorflow/tensorflow/lite/python/lite_v2_test.py,1077,method, +471,calibration_gen,tensorflow/tensorflow/lite/python/lite_v2_test.py,1093,method, +472,model,tensorflow/tensorflow/lite/python/lite_v2_test.py,1157,method, +473,model,tensorflow/tensorflow/lite/python/lite_v2_test.py,1178,method, +474,OpHint,tensorflow/tensorflow/lite/python/op_hint.py,97,class,"A class that helps build tflite function invocations. It allows you to take a bunch of TensorFlow ops and annotate the construction such that toco knows how to convert it to tflite. This embeds a pseudo @@ -2662,124 +2811,82 @@ Essentially, any ""input"" into this pseudo op is fed into an identity, and attributes are added to that input before being used by the constituent ops that make up the pseudo op. A similar process is done to any output that is to be exported from the current op." -667,_LiteOperand,tensorflow/tensorflow/lite/python/op_hint.py,471,class,"Abstract operand for a tflite hint function._dynamic_rnn_loop. - -This is a base class that handles representing arguments to an OpHint. -It also is able to serialize operands to the stubbed graph_def. -Child classes are responsible for being able to -store information about the hint identity operators. They are also responsible -for knowing how to serialize to output graphdefs. - -Typically this will be implemented by holding one or more identity nodes -that were previously discovered as hints." -668,_LiteSingleOperand,tensorflow/tensorflow/lite/python/op_hint.py,518,class,A simple operand that is non-aggregated (i.e. most hints). -669,_LiteAggregateOperand,tensorflow/tensorflow/lite/python/op_hint.py,544,class,"An operand for a tflite hint function that is aggregated from many. - -For example, an LSTM is a grid of operators that are all related. Inputs -going into them may need to be fused, so they should all be tracked as -related arguments." -670,_LiteFuncCall,tensorflow/tensorflow/lite/python/op_hint.py,670,class,"Represent a TensorFlow Lite custom function. - -This is uses to accumulate found hints in the graphdef into a single -conceptual unit. - -Attributes: - inputs: inputs to the op (hash from index # to argument) - outputs: outputs to the op (hash from index # to argument) - function_name: the tflite custom op name to use - uuid: a unique call id for this particular call (i.e. multiple function - calls would have the same function_name but different uuids. - params: A param name to key value for op constant data. I.e. for axis on a - reduction, strides on a convolution, etc. - level: Level of the OpHint. - children_inputs_mappings: If the Ophint has children, children inputs - mappings indicate how their inputs & outputs are mapped." -671,_find_all_hints_in_nodes,tensorflow/tensorflow/lite/python/op_hint.py,730,function,"Look at the all the input nodes and return a list of LiteFuncCall objs. +475,add_input,tensorflow/tensorflow/lite/python/op_hint.py,388,method,"Add a wrapped input argument to the hint. Args: - nodes: A TensorFlow graph_def to look for LiteFuncCalls. + *args: The input tensor. + **kwargs: + ""name"" label + ""tag"" a tag to group multiple arguments that will be aggregated. I.e. + a string like 'cool_input'. Basically multiple inputs can be added + to the same hint for parallel operations that will eventually be + combined. An example would be static_rnn which creates multiple copies + of state or inputs. + ""aggregate"" aggregation strategy that is valid only for tag non None. + Acceptable values are OpHint.AGGREGATE_FIRST, OpHint.AGGREGATE_LAST, + and OpHint.AGGREGATE_STACK. + ""index_override"" The global index to use. This corresponds to the + argument order in the final stub that will be generated. +Returns: + The wrapped input tensor." +476,add_output,tensorflow/tensorflow/lite/python/op_hint.py,410,method,"Add a wrapped output argument to the hint. + +Args: + *args: The output tensor. + **kwargs: + ""name"" label + ""tag"" a tag to group multiple arguments that will be aggregated. I.e. + a string like 'cool_input'. Basically multiple inputs can be added + to the same hint for parallel operations that will eventually be + combined. An example would be static_rnn which creates multiple copies + of state or inputs. + ""aggregate"" aggregation strategy that is valid only for tag non None. + Acceptable values are OpHint.AGGREGATE_FIRST, OpHint.AGGREGATE_LAST, + and OpHint.AGGREGATE_STACK. + ""index_override"" The global index to use. This corresponds to the + argument order in the final stub that will be generated. +Returns: + The wrapped output tensor." +477,add_inputs,tensorflow/tensorflow/lite/python/op_hint.py,432,method,"Add a sequence of inputs to the function invocation. + +Args: + *args: List of inputs to be converted (should be Tf.Tensor). + **kwargs: This allows 'names' which should be a list of names. Returns: - a list of `LifeFuncCall` objects in the form" -672,_extract_topology_sequence_mapping,tensorflow/tensorflow/lite/python/op_hint.py,795,function, -673,_find_children_hints_in_while_loop,tensorflow/tensorflow/lite/python/op_hint.py,800,function,"Find children hints and all nodes inside the while loop. + Wrapped inputs (identity standins that have additional metadata). These + are also are also tf.Tensor's." +478,add_outputs,tensorflow/tensorflow/lite/python/op_hint.py,451,method,"Add a sequence of outputs to the function invocation. Args: - function_def: Function def of the while loop. - nodes_mapping: While loop input_arg : real node name. + *args: List of outputs to be converted (should be tf.Tensor). + **kwargs: See Returns: - Ordered children hints and all re-mapped nodes inside the while loop." -674,_find_children_hints,tensorflow/tensorflow/lite/python/op_hint.py,833,function,"Find all children hints. - -For a given OpHint, we find all children hints inside it, we also copy all the -nodes inside function defs (if applicable) to the original graph_def, they are -returned in a list as well. + Wrapped outputs (identity standins that have additional metadata). These + are also tf.Tensor's." +479,add,tensorflow/tensorflow/lite/python/op_hint.py,229,method,"Return a wrapped tensor of an input tensor as an argument. Args: - call: Parent OpHint that contains children ophints. - graph_def: Original graph def. + arg: A TensorFlow tensor that should be considered an argument. + tag: String tag to identify arguments that should be packed. + name: Name of argument. This is included in the Identity hint op names. + aggregate: Strategy to aggregate. + Acceptable values are OpHint.AGGREGATE_FIRST, OpHint.AGGREGATE_LAST, + and OpHint.AGGREGATE_STACK. + Note, aggregate is only valid if tag is specified. + index_override: Specify what input/output index should this be in the + final stub. i.e. add(arg0, index=1); add(arg1, index=0) will make the + final stub be as stub_func(inputs[arg1, arg0], outputs=[]) rather than + the default call order based ordering. Returns: - Ordered children hints inside the parent ophint; new graph def that contains - nodes inside function defs (if applicable); nodes inside function defs." -675,_tensor_name_base,tensorflow/tensorflow/lite/python/op_hint.py,887,function,"Removes the device assignment code from a tensor. - -e.g. _tensor_name_base(""foo:3"") => ""foo"" - -Args: - full_tensor_name: A tensor name that is annotated with a device placement - (this is what tensor flow introspection gives). - -Returns: - A name without any device assignment." -676,_tensorflow_output_name,tensorflow/tensorflow/lite/python/op_hint.py,904,function, -677,_check_subgraph_closed,tensorflow/tensorflow/lite/python/op_hint.py,910,function,"Checks to make sure node only connects to predecessor graph through inputs. - -Args: - n: Node to check - reachable_by_input: Nodes that are reachable by all inputs of subgraph - input_nodes_set: The set of nodes that are ""inputs"". - name_to_input_name: Maps from name to the list of inputs. + A tensor representing the wrapped argument. Raises: - TypeError: If the given node uses items past inputs directly." -678,_convert_single_op_hint_to_stub,tensorflow/tensorflow/lite/python/op_hint.py,940,function,"Given a graph_def, converts `call` into a stub and returns a new graph_def. - -Args: - call: A single function call to be converted. - graph_def: A graph_def to use as input (that has call obviously). - function_def_nodes: Nodes inside the function def those are not connected to - the graph. - is_last_run: Whether it is the last run for a given pass (for OpHint has - children). - -Returns: - A new transformed graph-def that has call as a stub (single op). - -Note: after this process, the graph_def can no longer be loaded into - the tensorflow runtime, so all future manipulations are done in graph_def - level." -679,_remove_one_redundant_stack_unstack,tensorflow/tensorflow/lite/python/op_hint.py,1070,function,"Removes a stack->unstack pattern from in_graph_def in a returned graph. - -Args: - in_graph_def: Graph def to use as input. - -Returns: - Simplified tuple (graph_def, changed_something) where changed_something - is true if anything was done." -680,_remove_redundant_stack_unstack,tensorflow/tensorflow/lite/python/op_hint.py,1161,function, -681,_get_correct_mapping,tensorflow/tensorflow/lite/python/op_hint.py,1170,function, -682,_convert_op_hints_to_stubs_helper,tensorflow/tensorflow/lite/python/op_hint.py,1180,function,"Converts a graph_def to a new graph_def where all op hints are stubbed. - -Args: - graph_def: A graph def that we should convert. - write_callback: A function pointer that can be used to write intermediate - steps of graph transformation (optional). - -Returns: - A new stubbed graph_def." -683,find_all_hinted_output_nodes,tensorflow/tensorflow/lite/python/op_hint.py,1257,function,"Find all Ophints output nodes in the graph. + ValueError: When indices are not consistent." +480,assert_dictlist_has_keys,tensorflow/tensorflow/lite/python/op_hint.py,365,method, +481,find_all_hinted_output_nodes,tensorflow/tensorflow/lite/python/op_hint.py,1257,function,"Find all Ophints output nodes in the graph. This is used to get all the output nodes those are ophinted, it is important for operation like convert_variables_to_constants keep all ophints structure. @@ -2799,8 +2906,8 @@ Returns: A list of OpHints output nodes. Raises: ValueError: If both session and graph_def are provided." -684,is_ophint_converted,tensorflow/tensorflow/lite/python/op_hint.py,1292,function, -685,convert_op_hints_to_stubs,tensorflow/tensorflow/lite/python/op_hint.py,1305,function,"Converts a graphdef with LiteOp hints into stub operations. +482,is_ophint_converted,tensorflow/tensorflow/lite/python/op_hint.py,1292,function, +483,convert_op_hints_to_stubs,tensorflow/tensorflow/lite/python/op_hint.py,1305,function,"Converts a graphdef with LiteOp hints into stub operations. This is used to prepare for toco conversion of complex intrinsic usages. Note: only one of session or graph_def should be used, not both. @@ -2816,82 +2923,7 @@ Returns: a single op call with the right parameters. Raises: ValueError: If both session and graph_def are provided." -686,_parse_array,tensorflow/tensorflow/lite/python/tflite_convert.py,39,function, -687,_parse_set,tensorflow/tensorflow/lite/python/tflite_convert.py,45,function, -688,_parse_inference_type,tensorflow/tensorflow/lite/python/tflite_convert.py,51,function,"Converts the inference type to the value of the constant. - -Args: - value: str representing the inference type. - flag: str representing the flag name. - -Returns: - tf.dtype. - -Raises: - ValueError: Unsupported value." -689,_get_tflite_converter,tensorflow/tensorflow/lite/python/tflite_convert.py,74,function,"Makes a TFLiteConverter object based on the flags provided. - -Args: - flags: argparse.Namespace object containing TFLite flags. - -Returns: - TFLiteConverter object. - -Raises: - ValueError: Invalid flags." -690,_convert_tf1_model,tensorflow/tensorflow/lite/python/tflite_convert.py,122,function,"Calls function to convert the TensorFlow 1.X model into a TFLite model. - -Args: - flags: argparse.Namespace object. - -Raises: - ValueError: Invalid flags." -691,_convert_tf2_model,tensorflow/tensorflow/lite/python/tflite_convert.py,219,function,"Calls function to convert the TensorFlow 2.0 model into a TFLite model. - -Args: - flags: argparse.Namespace object. - -Raises: - ValueError: Unsupported file format." -692,_check_tf1_flags,tensorflow/tensorflow/lite/python/tflite_convert.py,244,function,"Checks the parsed and unparsed flags to ensure they are valid in 1.X. - -Raises an error if previously support unparsed flags are found. Raises an -error for parsed flags that don't meet the required conditions. - -Args: - flags: argparse.Namespace object containing TFLite flags. - unparsed: List of unparsed flags. - -Raises: - ValueError: Invalid flags." -693,_check_tf2_flags,tensorflow/tensorflow/lite/python/tflite_convert.py,313,function,"Checks the parsed and unparsed flags to ensure they are valid in 2.X. - -Args: - flags: argparse.Namespace object containing TFLite flags. - -Raises: - ValueError: Invalid flags." -694,_get_tf1_flags,tensorflow/tensorflow/lite/python/tflite_convert.py,327,function,"Returns ArgumentParser for tflite_convert for TensorFlow 1.X. - -Args: - parser: ArgumentParser" -695,_get_tf2_flags,tensorflow/tensorflow/lite/python/tflite_convert.py,511,function,"Returns ArgumentParser for tflite_convert for TensorFlow 2.0. - -Args: - parser: ArgumentParser" -696,_ParseExperimentalNewConverter,tensorflow/tensorflow/lite/python/tflite_convert.py,535,class,Helper class to parse --experimental_new_converter argument. -697,_get_parser,tensorflow/tensorflow/lite/python/tflite_convert.py,565,function,"Returns an ArgumentParser for tflite_convert. - -Args: - use_v2_converter: Indicates which converter to return. -Return: ArgumentParser." -698,run_main,tensorflow/tensorflow/lite/python/tflite_convert.py,596,function,Main in tflite_convert.py. -699,main,tensorflow/tensorflow/lite/python/tflite_convert.py,639,function, -700,TestModels,tensorflow/tensorflow/lite/python/tflite_convert_test.py,45,class, -701,TfLiteConvertV1Test,tensorflow/tensorflow/lite/python/tflite_convert_test.py,81,class, -702,TfLiteConvertV2Test,tensorflow/tensorflow/lite/python/tflite_convert_test.py,298,class, -703,ArgParserTest,tensorflow/tensorflow/lite/python/tflite_convert_test.py,339,class, -704,convert_dtype_to_tflite_type,tensorflow/tensorflow/lite/python/util.py,59,function,"Converts tf.dtype to TFLite proto type. +484,convert_dtype_to_tflite_type,tensorflow/tensorflow/lite/python/util.py,59,function,"Converts tf.dtype to TFLite proto type. Args: tf_dtype: tf.dtype @@ -2901,14 +2933,14 @@ Raises: Returns: types_flag_pb2." -705,get_tensor_name,tensorflow/tensorflow/lite/python/util.py,77,function,"Returns name of the input tensor. +485,get_tensor_name,tensorflow/tensorflow/lite/python/util.py,77,function,"Returns name of the input tensor. Args: tensor: tf.Tensor Returns: str" -706,get_tensors_from_tensor_names,tensorflow/tensorflow/lite/python/util.py,98,function,"Gets the Tensors associated with the `tensor_names` in the provided graph. +486,get_tensors_from_tensor_names,tensorflow/tensorflow/lite/python/util.py,98,function,"Gets the Tensors associated with the `tensor_names` in the provided graph. Args: graph: TensorFlow Graph. @@ -2920,7 +2952,7 @@ Returns: Raises: ValueError: tensor_names contains an invalid tensor name." -707,set_tensor_shapes,tensorflow/tensorflow/lite/python/util.py,141,function,"Sets Tensor shape for each tensor if the shape is defined. +487,set_tensor_shapes,tensorflow/tensorflow/lite/python/util.py,141,function,"Sets Tensor shape for each tensor if the shape is defined. Args: tensors: TensorFlow ops.Tensor. @@ -2931,14 +2963,14 @@ Raises: ValueError: `shapes` contains an invalid tensor. `shapes` contains an invalid shape for a valid tensor." -708,get_grappler_config,tensorflow/tensorflow/lite/python/util.py,172,function,"Creates a tf.compat.v1.ConfigProto for configuring Grappler. +488,get_grappler_config,tensorflow/tensorflow/lite/python/util.py,172,function,"Creates a tf.compat.v1.ConfigProto for configuring Grappler. Args: optimizers_list: List of strings that represents the list of optimizers. Returns: tf.ConfigProto." -709,run_graph_optimizations,tensorflow/tensorflow/lite/python/util.py,188,function,"Apply standard TensorFlow optimizations to the graph_def. +489,run_graph_optimizations,tensorflow/tensorflow/lite/python/util.py,188,function,"Apply standard TensorFlow optimizations to the graph_def. Args: graph_def: Frozen GraphDef to be optimized. @@ -2949,8 +2981,7 @@ Args: Returns: A new, optimized GraphDef." -710,_convert_op_hints_if_present,tensorflow/tensorflow/lite/python/util.py,230,function, -711,freeze_graph,tensorflow/tensorflow/lite/python/util.py,241,function,"Returns a frozen GraphDef. +490,freeze_graph,tensorflow/tensorflow/lite/python/util.py,241,function,"Returns a frozen GraphDef. Runs a Grappler pass and freezes a graph with Variables in it. Otherwise the existing GraphDef is returned. The Grappler pass is only run on models that @@ -2964,7 +2995,7 @@ Args: Returns: Frozen GraphDef." -712,is_frozen_graph,tensorflow/tensorflow/lite/python/util.py,281,function,"Determines if the graph is frozen. +491,is_frozen_graph,tensorflow/tensorflow/lite/python/util.py,281,function,"Determines if the graph is frozen. Determines if a graph has previously been frozen by checking for any operations of type Variable*. If variables are found, the graph is not frozen. @@ -2974,7 +3005,7 @@ Args: Returns: Bool." -713,build_debug_info_func,tensorflow/tensorflow/lite/python/util.py,300,function,"Returns a method to retrieve the `GraphDebugInfo` from the original graph. +492,build_debug_info_func,tensorflow/tensorflow/lite/python/util.py,300,function,"Returns a method to retrieve the `GraphDebugInfo` from the original graph. Args: original_graph: The original `Graph` containing all the op stack traces. @@ -2982,7 +3013,7 @@ Args: Returns: A function which retrieves the stack traces from the original graph and converts them to a `GraphDebugInfo` for a given set of nodes." -714,convert_debug_info_func,tensorflow/tensorflow/lite/python/util.py,339,function,"Returns a method to retrieve the `GraphDebugInfo` from the original graph. +493,convert_debug_info_func,tensorflow/tensorflow/lite/python/util.py,339,function,"Returns a method to retrieve the `GraphDebugInfo` from the original graph. Args: saved_debug_info: The `GraphDebugInfo` containing all the debug info. @@ -2990,7 +3021,7 @@ Args: Returns: A function which retrieves the stack traces from the original graph and converts them to a `GraphDebugInfo` for a given set of nodes." -715,get_debug_info,tensorflow/tensorflow/lite/python/util.py,368,function,"Returns the debug info for the original nodes in the `converted_graph`. +494,get_debug_info,tensorflow/tensorflow/lite/python/util.py,368,function,"Returns the debug info for the original nodes in the `converted_graph`. Args: nodes_to_debug_info_func: The method to collect the op debug info for the @@ -2999,7 +3030,7 @@ Args: Returns: `GraphDebugInfo` for all the original nodes in `converted_graph`." -716,convert_bytes_to_c_source,tensorflow/tensorflow/lite/python/util.py,399,function,"Returns strings representing a C constant array containing `data`. +495,convert_bytes_to_c_source,tensorflow/tensorflow/lite/python/util.py,399,function,"Returns strings representing a C constant array containing `data`. Args: data: Byte array that will be converted into a C constant. @@ -3014,18 +3045,61 @@ Returns: Text that can be compiled as a C source file to link in the data as a literal array of values. Text that can be used as a C header file to reference the literal array." -717,UtilTest,tensorflow/tensorflow/lite/python/util_test.py,39,class, -718,TensorFunctionsTest,tensorflow/tensorflow/lite/python/util_test.py,124,class, -719,wrapped_toco_convert,tensorflow/tensorflow/lite/python/wrap_toco.py,29,function,Wraps TocoConvert with lazy loader. -720,wrapped_get_potentially_supported_ops,tensorflow/tensorflow/lite/python/wrap_toco.py,41,function,Wraps TocoGetPotentiallySupportedOps with lazy loader. -721,wrapped_experimental_mlir_quantize,tensorflow/tensorflow/lite/python/wrap_toco.py,46,function,Wraps experimental mlir quantize model. -722,wrapped_experimental_mlir_sparsify,tensorflow/tensorflow/lite/python/wrap_toco.py,55,function,Wraps experimental mlir sparsify model. -723,Calibrator,tensorflow/tensorflow/lite/python/optimize/calibrator.py,33,class,"Calibrates a floating point model and then quantizes it. +496,wrapped_toco_convert,tensorflow/tensorflow/lite/python/wrap_toco.py,29,function,Wraps TocoConvert with lazy loader. +497,wrapped_get_potentially_supported_ops,tensorflow/tensorflow/lite/python/wrap_toco.py,41,function,Wraps TocoGetPotentiallySupportedOps with lazy loader. +498,wrapped_experimental_mlir_quantize,tensorflow/tensorflow/lite/python/wrap_toco.py,46,function,Wraps experimental mlir quantize model. +499,wrapped_experimental_mlir_sparsify,tensorflow/tensorflow/lite/python/wrap_toco.py,55,function,Wraps experimental mlir sparsify model. +500,Calibrator,tensorflow/tensorflow/lite/python/optimize/calibrator.py,33,class,"Calibrates a floating point model and then quantizes it. This is an internal class, not a public interface." -724,CalibratorTest,tensorflow/tensorflow/lite/python/optimize/calibrator_test.py,33,class, -725,TemporaryDirectoryResource,tensorflow/tensorflow/lite/schema/upgrade_schema.py,57,function, -726,Converter,tensorflow/tensorflow/lite/schema/upgrade_schema.py,65,class,"Converts TensorFlow flatbuffer models from old to new version of schema. +501,calibrate_and_quantize,tensorflow/tensorflow/lite/python/optimize/calibrator.py,58,method,"Calibrates the model with specified generator and then quantizes it. + +The input shapes of the calibrator are resized with the calibration data if +`resize_input` is set. + +Returns: + A quantized model. + +Args: + dataset_gen: A generator that generates calibration samples. + input_type: A tf.dtype representing the desired real-value input type. + output_type: A tf.dtype representing the desired real-value output type. + allow_float: A boolean. False if the resulting model cannot perform float + computation, useful when targeting an integer-only backend. + If False, an error will be thrown if an operation cannot be + quantized, otherwise the model will fallback to float ops. + activations_type: A tf.dtype representing the desired type for + activations. + resize_input: A boolean. True if the shape of the sample data is different + from the input." +502,calibrate_and_quantize_single,tensorflow/tensorflow/lite/python/optimize/calibrator.py,100,method,"Calibrates the model with specified generator and then quantizes it. + +Only the single op with output op_output_name will be quantized. +The input shapes of the calibrator are resized with the calibration data. + +Returns: + A quantized model. + +Args: + dataset_gen: A generator that generates calibration samples. + input_type: A tf.dtype representing the desired real-value input type. + output_type: A tf.dtype representing the desired real-value output type. + allow_float: A boolean. False if the resulting model cannot perform float + computation, useful when targeting an integer-only backend. If False, an + error will be thrown if an operation cannot be quantized, otherwise the + model will fallback to float ops. + op_output_name: A string, only this op will be quantized. + resize_input: A boolean. True if the shape of the sample data is different + from the input." +503,calibrate,tensorflow/tensorflow/lite/python/optimize/calibrator.py,140,method,"Calibrates the model with specified generator. + +Returns: + A model with min and max calibration stats. + +Args: + dataset_gen: A generator that generates calibration samples." +504,TemporaryDirectoryResource,tensorflow/tensorflow/lite/schema/upgrade_schema.py,57,function, +505,Converter,tensorflow/tensorflow/lite/schema/upgrade_schema.py,65,class,"Converts TensorFlow flatbuffer models from old to new version of schema. This can convert between any version to the latest version. It uses an incremental upgrade strategy to go from version to version. @@ -3034,35 +3108,60 @@ Usage: converter = Converter() converter.Convert(""a.tflite"", ""a.json"") converter.Convert(""b.json"", ""b.tflite"")" -727,main,tensorflow/tensorflow/lite/schema/upgrade_schema.py,344,function, -728,JsonDumpAndFlush,tensorflow/tensorflow/lite/schema/upgrade_schema_test.py,242,function,"Write the dictionary `data` to a JSON file `fp` (and flush). +506,Convert,tensorflow/tensorflow/lite/schema/upgrade_schema.py,309,method,"Perform schema conversion from input_file to output_file. + +Args: + input_file: Filename of TensorFlow Lite data to convert from. Must + be `.json` or `.bin` extension files for JSON or Binary forms of + the TensorFlow FlatBuffer schema. + output_file: Filename to write to. Extension also must be `.json` + or `.bin`. + +Raises: + RuntimeError: Generated when none of the upgrader supported schemas + matche the `input_file` data." +507,FindSchema,tensorflow/tensorflow/lite/schema/upgrade_schema.py,88,method, +508,RemapOperator,tensorflow/tensorflow/lite/schema/upgrade_schema.py,209,method,"Go from old schema op name to new schema op name. + +Args: + opcode_name: String representing the ops (see :schema.fbs). +Returns: + Converted opcode_name from V1 to V2." +509,RemapOperatorType,tensorflow/tensorflow/lite/schema/upgrade_schema.py,232,method,"Remap operator structs from old names to new names. + +Args: + operator_type: String representing the builtin operator data type + string. + (see :schema.fbs). +Raises: + ValueError: When the model has consistency problems. +Returns: + Upgraded builtin operator data type as a string." +510,JsonDumpAndFlush,tensorflow/tensorflow/lite/schema/upgrade_schema_test.py,242,function,"Write the dictionary `data` to a JSON file `fp` (and flush). Args: data: in a dictionary that is JSON serializable. fp: File-like object" -729,TestSchemaUpgrade,tensorflow/tensorflow/lite/schema/upgrade_schema_test.py,253,class, -730,main,tensorflow/tensorflow/lite/testing/generate_examples.py,100,function, -731,MultiGenState,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,176,class,"State of multiple set generation process. +511,MultiGenState,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,176,class,"State of multiple set generation process. This state class stores the information needed when generating the examples for multiple test set. The stored informations are open archive object to be shared, information on test target for current iteration of generation, accumulated generation results." -732,Options,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,203,class,All options for example generation. -733,_prepare_dir,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,244,function, -734,generate_examples,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,256,function,"Generate examples for a test set. +512,Options,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,203,class,All options for example generation. +513,generate_examples,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,256,function,"Generate examples for a test set. Args: options: Options containing information to generate examples. Raises: RuntimeError: if the test function cannot be found." -735,generate_multi_set_examples,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,294,function,"Generate examples for test sets. +514,generate_multi_set_examples,tensorflow/tensorflow/lite/testing/generate_examples_lib.py,294,function,"Generate examples for test sets. Args: options: Options containing information to generate examples. test_sets: List of the name of test sets to generate examples." -736,make_report_table,tensorflow/tensorflow/lite/testing/generate_examples_report.py,32,function,"Make an HTML report of the success/failure reports. +515,make_report_table,tensorflow/tensorflow/lite/testing/generate_examples_report.py,32,function,"Make an HTML report of the success/failure reports. Args: fp: File-like object in which to put the html. @@ -3071,7 +3170,7 @@ Args: ({""shape"": [1,2,3], ""type"": ""tf.float32""}, {""tf"": ""SUCCESS"", ""toco"": ""FAILURE"", ""toco_log"": ""Unsupported type."", ""tf_log"": """"})" -737,toco_options,tensorflow/tensorflow/lite/testing/toco_convert.py,31,function,"Create TOCO options to process a model. +516,toco_options,tensorflow/tensorflow/lite/testing/toco_convert.py,31,function,"Create TOCO options to process a model. Args: data_types: input and inference types used by TOCO. @@ -3082,7 +3181,7 @@ Args: Returns: the options in a string." -738,toco_convert,tensorflow/tensorflow/lite/testing/toco_convert.py,78,function,"Convert a model's graph def into a tflite model. +517,toco_convert,tensorflow/tensorflow/lite/testing/toco_convert.py,78,function,"Convert a model's graph def into a tflite model. NOTE: this currently shells out to the toco binary, but we would like convert to Python API tooling in the future. @@ -3097,12 +3196,10 @@ Args: Returns: output tflite model, log_txt from conversion or None, log_txt if it did not convert properly." -739,register_make_test_function,tensorflow/tensorflow/lite/testing/zip_test_utils.py,55,function, -740,get_test_function,tensorflow/tensorflow/lite/testing/zip_test_utils.py,65,function,Get the test function according to the test function name. -741,ExtraTocoOptions,tensorflow/tensorflow/lite/testing/zip_test_utils.py,88,class,"Additional toco options besides input, output, shape." -742,create_tensor_data,tensorflow/tensorflow/lite/testing/zip_test_utils.py,106,function,"Build tensor data spreading the range [min_value, max_value)." -743,create_scalar_data,tensorflow/tensorflow/lite/testing/zip_test_utils.py,126,function,Build scalar tensor data range from min_value to max_value exclusively. -744,freeze_graph,tensorflow/tensorflow/lite/testing/zip_test_utils.py,144,function,"Freeze the current graph. +518,ExtraTocoOptions,tensorflow/tensorflow/lite/testing/zip_test_utils.py,88,class,"Additional toco options besides input, output, shape." +519,create_tensor_data,tensorflow/tensorflow/lite/testing/zip_test_utils.py,106,function,"Build tensor data spreading the range [min_value, max_value)." +520,create_scalar_data,tensorflow/tensorflow/lite/testing/zip_test_utils.py,126,function,Build scalar tensor data range from min_value to max_value exclusively. +521,freeze_graph,tensorflow/tensorflow/lite/testing/zip_test_utils.py,144,function,"Freeze the current graph. Args: session: Tensorflow sessions containing the graph @@ -3110,8 +3207,8 @@ Args: Returns: The frozen graph_def." -745,format_result,tensorflow/tensorflow/lite/testing/zip_test_utils.py,158,function,Convert a tensor to a format that can be used in test specs. -746,write_examples,tensorflow/tensorflow/lite/testing/zip_test_utils.py,168,function,"Given a list `examples`, write a text format representation. +522,format_result,tensorflow/tensorflow/lite/testing/zip_test_utils.py,158,function,Convert a tensor to a format that can be used in test specs. +523,write_examples,tensorflow/tensorflow/lite/testing/zip_test_utils.py,168,function,"Given a list `examples`, write a text format representation. The file format is csv like with a simple repeated pattern. We would ike to use proto here, but we can't yet due to interfacing with the Android @@ -3120,49 +3217,14 @@ team using this format. Args: fp: File-like object to write to. examples: Example dictionary consisting of keys ""inputs"" and ""outputs""" -747,write_test_cases,tensorflow/tensorflow/lite/testing/zip_test_utils.py,196,function,"Given a dictionary of `examples`, write a text format representation. - -The file format is protocol-buffer-like, even though we don't use proto due -to the needs of the Android team. - -Args: - fp: File-like object to write to. - model_name: Filename where the model was written to, relative to filename. - examples: Example dictionary consisting of keys ""inputs"" and ""outputs""" -748,get_input_shapes_map,tensorflow/tensorflow/lite/testing/zip_test_utils.py,225,function,"Gets a map of input names to shapes. +524,get_input_shapes_map,tensorflow/tensorflow/lite/testing/zip_test_utils.py,225,function,"Gets a map of input names to shapes. Args: input_tensors: List of input tensor tuples `(name, shape, type)`. Returns: {string : list of integers}." -749,_normalize_output_name,tensorflow/tensorflow/lite/testing/zip_test_utils.py,251,function,Remove :0 suffix from tensor names. -750,make_zip_of_tests,tensorflow/tensorflow/lite/testing/zip_test_utils.py,262,function,"Helper to make a zip file of a bunch of TensorFlow models. - -This does a cartesian product of the dictionary of test_parameters and -calls make_graph() for each item in the cartesian product set. -If the graph is built successfully, then make_test_inputs() is called to -build expected input/output value pairs. The model is then converted to tflite -with toco, and the examples are serialized with the tflite model into a zip -file (2 files per item in the cartesian product set). - -Args: - options: An Options instance. - test_parameters: Dictionary mapping to lists for each parameter. - e.g. `{""strides"": [[1,3,3,1], [1,2,2,1]], ""foo"": [1.2, 1.3]}` - make_graph: function that takes current parameters and returns tuple - `[input1, input2, ...], [output1, output2, ...]` - make_test_inputs: function taking `curr_params`, `session`, `input_tensors`, - `output_tensors` and returns tuple `(input_values, output_values)`. - extra_toco_options: Additional toco options. - use_frozen_graph: Whether or not freeze graph before toco converter. - expected_tf_failures: Number of times tensorflow is expected to fail in - executing the input graphs. In some cases it is OK for TensorFlow to fail - because the one or more combination of parameters is invalid. - -Raises: - RuntimeError: if there are converter errors that can't be ignored." -751,get_filepath,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,47,function,"Returns the full path of the filename. +525,get_filepath,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,47,function,"Returns the full path of the filename. Args: filename: Subdirectory and name of the model file. @@ -3170,71 +3232,14 @@ Args: Returns: str." -752,get_image,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,63,function,"Returns an image loaded into an np.ndarray with dims [1, size, size, 3]. +526,get_image,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,63,function,"Returns an image loaded into an np.ndarray with dims [1, size, size, 3]. Args: size: Size of image. Returns: np.ndarray." -753,_convert,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,80,function,"Converts the model. - -Args: - converter: TFLiteConverter object. - **kwargs: Additional arguments to be passed into the converter. Supported - flags are {""target_ops"", ""post_training_quantize"", ""quantize_to_float16""}. - -Returns: - The converted TFLite model in serialized format. - -Raises: - ValueError: Invalid version number." -754,_get_tflite_interpreter,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,103,function,"Creates a TFLite interpreter with resized input tensors. - -Args: - tflite_model: Serialized TensorFlow Lite model. - input_shapes_resize: A map where the key is the input tensor name and the - value is the shape of the input tensor. This resize happens after model - conversion, prior to calling allocate tensors. (default None) - -Returns: - lite.Interpreter" -755,_get_input_data_map,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,127,function,"Generates a map of input data based on the TFLite model. - -Args: - tflite_model: Serialized TensorFlow Lite model. - input_data: List of np.ndarray. - -Returns: - {str: [np.ndarray]}." -756,_generate_random_input_data,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,146,function,"Generates input data based on the input tensors in the TFLite model. - -Args: - tflite_model: Serialized TensorFlow Lite model. - seed: Integer seed for the random generator. (default None) - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - input_shapes_resize: A map where the key is the input tensor name and the - value is the shape of the input tensor. This resize happens after model - conversion, prior to calling allocate tensors. (default None) - -Returns: - ([np.ndarray], {str : [np.ndarray]})." -757,_evaluate_tflite_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,191,function,"Returns evaluation of input data on TFLite model. - -Args: - tflite_model: Serialized TensorFlow Lite model. - input_data: List of np.ndarray. - input_shapes_resize: A map where the key is the input tensor name and the - value is the shape of the input tensor. This resize happens after model - conversion, prior to calling allocate tensors. (default None) - -Returns: - List of np.ndarray." -758,evaluate_frozen_graph,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,222,function,"Returns a function that evaluates the frozen graph on input data. +527,evaluate_frozen_graph,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,222,function,"Returns a function that evaluates the frozen graph on input data. Args: filename: Full filepath of file containing frozen GraphDef. @@ -3243,7 +3248,7 @@ Args: Returns: Lambda function ([np.ndarray data] : [np.ndarray result])." -759,evaluate_saved_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,260,function,"Returns a function that evaluates the SavedModel on input data. +528,evaluate_saved_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,260,function,"Returns a function that evaluates the SavedModel on input data. Args: directory: SavedModel directory to convert. @@ -3253,14 +3258,14 @@ Args: Returns: Lambda function ([np.ndarray data] : [np.ndarray result])." -760,evaluate_keras_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,286,function,"Returns a function that evaluates the tf.keras model on input data. +529,evaluate_keras_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,286,function,"Returns a function that evaluates the tf.keras model on input data. Args: filename: Full filepath of HDF5 file containing the tf.keras model. Returns: Lambda function ([np.ndarray data] : [np.ndarray result])." -761,compare_models,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,299,function,"Compares TensorFlow and TFLite models. +530,compare_models,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,299,function,"Compares TensorFlow and TFLite models. Unless the input data is provided, the models are compared with random data. @@ -3278,7 +3283,7 @@ Args: generate a random value for tensor `input1` within range [1.0, 5.0) (half-inclusive). (default None) tolerance: Decimal place to check accuracy to. (default 5)." -762,compare_models_v2,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,336,function,"Compares TensorFlow and TFLite models for TensorFlow 2.0. +531,compare_models_v2,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,336,function,"Compares TensorFlow and TFLite models for TensorFlow 2.0. Unless the input data is provided, the models are compared with random data. Currently only 1 input and 1 output are supported by this function. @@ -3295,281 +3300,14 @@ Args: generate a random value for tensor `input1` within range [1.0, 5.0) (half-inclusive). (default None) tolerance: Decimal place to check accuracy to. (default 5)" -763,test_frozen_graph_quant,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,390,function,"Sanity check to validate post quantize flag alters the graph. - -This test does not check correctness of the converted model. It converts the -TensorFlow frozen graph to TFLite with and without the post_training_quantized -flag. It ensures some tensors have different types between the float and -quantized models in the case of an all TFLite model or mix-and-match model. -It ensures tensor types do not change in the case of an all Flex model. - -Args: - filename: Full filepath of file containing frozen GraphDef. - input_arrays: List of input tensors to freeze graph with. - output_arrays: List of output tensors to freeze graph with. - input_shapes: Dict of strings representing input tensor names to list of - integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). - Automatically determined when input shapes is None (e.g., {""foo"" : None}). - (default None) - **kwargs: Additional arguments to be passed into the converter. - -Raises: - ValueError: post_training_quantize flag doesn't act as intended." -764,test_frozen_graph,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,459,function,"Validates the TensorFlow frozen graph converts to a TFLite model. - -Converts the TensorFlow frozen graph to TFLite and checks the accuracy of the -model on random data. - -Args: - filename: Full filepath of file containing frozen GraphDef. - input_arrays: List of input tensors to freeze graph with. - output_arrays: List of output tensors to freeze graph with. - input_shapes: Dict of strings representing input tensor names to list of - integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). - Automatically determined when input shapes is None (e.g., {""foo"" : None}). - (default None) - input_shapes_resize: A map where the key is the input tensor name and the - value is the shape of the input tensor. This resize happens after model - conversion, prior to calling allocate tensors. (default None) - input_data: np.ndarray to pass into models during inference. (default None). - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - **kwargs: Additional arguments to be passed into the converter." -765,test_saved_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,504,function,"Validates the TensorFlow SavedModel converts to a TFLite model. - -Converts the TensorFlow SavedModel to TFLite and checks the accuracy of the -model on random data. - -Args: - directory: SavedModel directory to convert. - input_shapes: Dict of strings representing input tensor names to list of - integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). - Automatically determined when input shapes is None (e.g., {""foo"" : None}). - (default None) - tag_set: Set of tags identifying the MetaGraphDef within the SavedModel to - analyze. All tags in the tag set must be present. - signature_key: Key identifying SignatureDef containing inputs and outputs. - input_data: np.ndarray to pass into models during inference. (default None). - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - **kwargs: Additional arguments to be passed into the converter." -766,test_saved_model_v2,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,548,function,"Validates the TensorFlow SavedModel converts to a TFLite model. - -Converts the TensorFlow SavedModel to TFLite and checks the accuracy of the -model on random data. - -Args: - directory: SavedModel directory to convert. - tag_set: Set of tags identifying the MetaGraphDef within the SavedModel to - analyze. All tags in the tag set must be present. - signature_key: Key identifying SignatureDef containing inputs and outputs. - input_data: np.ndarray to pass into models during inference. (default None). - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - **kwargs: Additional arguments to be passed into the converter." -767,test_saved_model_v2_quant_float16,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,587,function,Validates the TensorFlow SavedModel converts to a TFLite model. -768,test_keras_model,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,623,function,"Validates the tf.keras model converts to a TFLite model. - -Converts the tf.keras model to TFLite and checks the accuracy of the model on -random data. - -Args: - filename: Full filepath of HDF5 file containing the tf.keras model. - input_arrays: List of input tensors to freeze graph with. - input_shapes: Dict of strings representing input tensor names to list of - integers representing input shapes (e.g., {""foo"" : [1, 16, 16, 3]}). - Automatically determined when input shapes is None (e.g., {""foo"" : None}). - (default None) - input_data: np.ndarray to pass into models during inference. (default None). - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - **kwargs: Additional arguments to be passed into the converter." -769,test_keras_model_v2,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib.py,661,function,"Validates the tf.keras model converts to a TFLite model. - -Converts the tf.keras model to TFLite and checks the accuracy of the model on -random data. - -Args: - filename: Full filepath of HDF5 file containing the tf.keras model. - input_shapes: List of list of integers representing input shapes in the - order of the tf.keras model's .input attribute (e.g., [[1, 16, 16, 3]]). - (default None) - input_data: np.ndarray to pass into models during inference. (default None). - input_data_range: A map where the key is the input tensor name and - the value is a tuple (min_val, max_val) which specifies the value range of - the corresponding input tensor. For example, '{'input1': (1, 5)}' means to - generate a random value for tensor `input1` within range [1.0, 5.0) - (half-inclusive). (default None) - **kwargs: Additional arguments to be passed into the converter." -770,EvaluateFrozenGraph,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,42,class, -771,EvaluateSavedModel,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,142,class, -772,EvaluateKerasModel,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,160,class, -773,make_abs_tests,tensorflow/tensorflow/lite/testing/op_tests/abs.py,28,function,Make a set of tests to do abs. -774,make_add_n_tests,tensorflow/tensorflow/lite/testing/op_tests/add_n.py,27,function,Make a set of tests for AddN op. -775,make_arg_min_max_tests,tensorflow/tensorflow/lite/testing/op_tests/arg_min_max.py,29,function,Make a set of tests to do arg_max. -776,make_batch_to_space_nd_tests,tensorflow/tensorflow/lite/testing/op_tests/batch_to_space_nd.py,28,function,Make a set of tests to do batch_to_space_nd. -777,make_binary_op_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,26,function,Make a set of tests to do binary ops with and without broadcast. -778,make_binary_op_tests_func,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,239,function,Return a function that does a test on a binary operator. -779,make_add_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,245,function, -780,make_div_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,250,function,Make zip tests for div op with 5D case. -781,make_sub_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,267,function,Make zip tests for sub op with additional cases. -782,make_mul_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,287,function, -783,make_pow_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,292,function, -784,make_floor_div_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,297,function, -785,make_floor_mod_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,302,function, -786,make_squared_difference_tests,tensorflow/tensorflow/lite/testing/op_tests/binary_op.py,307,function, -787,make_cast_tests,tensorflow/tensorflow/lite/testing/op_tests/cast.py,27,function,Generate examples for cast. -788,make_ceil_tests,tensorflow/tensorflow/lite/testing/op_tests/ceil.py,27,function,Make a set of tests to do ceil. -789,make_concat_tests,tensorflow/tensorflow/lite/testing/op_tests/concat.py,27,function,Make a set of tests to do concatenation. -790,make_constant_tests,tensorflow/tensorflow/lite/testing/op_tests/constant.py,31,function,Make a set of tests to do constant ops. -791,make_conv_tests,tensorflow/tensorflow/lite/testing/op_tests/conv.py,28,function,Make a set of tests to do convolution. -792,make_conv2d_transpose_tests,tensorflow/tensorflow/lite/testing/op_tests/conv2d_transpose.py,28,function,Make a set of tests to do transpose_conv. -793,make_conv_activation_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,27,function,Make a set of tests to do convolution with activation. -794,make_conv_relu6_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,132,function,Make a set of tests to do conv_relu6. -795,make_conv_relu_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,138,function,Make a set of tests to do conv_relu. -796,relu1,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,143,function, -797,make_conv_relu1_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,151,function,Make a set of tests to do conv_relu1. -798,make_conv_to_depthwiseconv_with_shared_weights_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_to_depthwiseconv_with_shared_weights.py,28,function,Make a test where 2 Conv ops shared the same constant weight tensor. -799,make_conv_with_shared_weights_tests,tensorflow/tensorflow/lite/testing/op_tests/conv_with_shared_weights.py,28,function,Make a test where 2 Conv ops shared the same constant weight tensor. -800,make_cos_tests,tensorflow/tensorflow/lite/testing/op_tests/cos.py,28,function,Make a set of tests to do cos. -801,make_depth_to_space_tests,tensorflow/tensorflow/lite/testing/op_tests/depth_to_space.py,27,function,Make a set of tests to do depth_to_space. -802,make_depthwiseconv_tests,tensorflow/tensorflow/lite/testing/op_tests/depthwiseconv.py,28,function,Make a set of tests to do convolution. -803,_make_elementwise_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,26,function,Make a set of tests to do element-wise operations. -804,make_sin_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,57,function,Make a set of tests to do sin. -805,make_log_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,63,function,Make a set of tests to do log. -806,make_sqrt_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,69,function,Make a set of tests to do sqrt. -807,make_rsqrt_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,75,function,Make a set of tests to do 1/sqrt. -808,make_square_tests,tensorflow/tensorflow/lite/testing/op_tests/elementwise.py,81,function,Make a set of tests to do square. -809,make_elu_tests,tensorflow/tensorflow/lite/testing/op_tests/elu.py,28,function,Make a set of tests to do (float) tf.nn.elu. -810,make_embedding_lookup_tests,tensorflow/tensorflow/lite/testing/op_tests/embedding_lookup.py,27,function,Make a set of tests to do gather. -811,make_equal_tests,tensorflow/tensorflow/lite/testing/op_tests/equal.py,27,function,Make a set of tests to do equal. -812,make_exp_tests,tensorflow/tensorflow/lite/testing/op_tests/exp.py,27,function,Make a set of tests to do exp. -813,make_expand_dims_tests,tensorflow/tensorflow/lite/testing/op_tests/expand_dims.py,28,function,Make a set of tests to do expand_dims. -814,make_eye_tests,tensorflow/tensorflow/lite/testing/op_tests/eye.py,28,function,Make a set of tests for tf.eye op. -815,make_fill_tests,tensorflow/tensorflow/lite/testing/op_tests/fill.py,28,function,Make a set of tests to do fill. -816,make_floor_tests,tensorflow/tensorflow/lite/testing/op_tests/floor.py,27,function,Make a set of tests to do floor. -817,make_fully_connected_tests,tensorflow/tensorflow/lite/testing/op_tests/fully_connected.py,28,function,Make a set of tests to do fully_connected. -818,make_fused_batch_norm_tests,tensorflow/tensorflow/lite/testing/op_tests/fused_batch_norm.py,27,function,Make a set of tests to do fused_batch_norm. -819,make_gather_tests,tensorflow/tensorflow/lite/testing/op_tests/gather.py,27,function,Make a set of tests to do gather. -820,make_gather_nd_tests,tensorflow/tensorflow/lite/testing/op_tests/gather_nd.py,27,function,Make a set of tests to do gather_nd. -821,make_gather_with_constant_tests,tensorflow/tensorflow/lite/testing/op_tests/gather_with_constant.py,28,function,Make a set of test which feed a constant to gather toco. -822,make_global_batch_norm_tests,tensorflow/tensorflow/lite/testing/op_tests/global_batch_norm.py,27,function,Make a set of tests to do batch_norm_with_global_normalization. -823,make_greater_tests,tensorflow/tensorflow/lite/testing/op_tests/greater.py,27,function,Make a set of tests to do greater. -824,make_greater_equal_tests,tensorflow/tensorflow/lite/testing/op_tests/greater_equal.py,27,function,Make a set of tests to do greater_equal. -825,_tflite_convert_verify_num_ops,tensorflow/tensorflow/lite/testing/op_tests/hardswish.py,29,function,Verifies that the result of the conversion is a single op. -826,make_hardswish_tests,tensorflow/tensorflow/lite/testing/op_tests/hardswish.py,47,function,Make a set of tests to do hardswish. -827,make_identity_tests,tensorflow/tensorflow/lite/testing/op_tests/identity.py,29,function,Make a set of tests to do identity. -828,make_l2norm_tests,tensorflow/tensorflow/lite/testing/op_tests/l2norm.py,28,function,Make a set of tests to do l2norm. -829,make_l2norm_shared_epsilon_tests,tensorflow/tensorflow/lite/testing/op_tests/l2norm_shared_epsilon.py,28,function,Regression test for a bug (b/122651451). -830,make_leaky_relu_tests,tensorflow/tensorflow/lite/testing/op_tests/leaky_relu.py,28,function,Make a set of tests to do LeakyRelu. -831,make_less_tests,tensorflow/tensorflow/lite/testing/op_tests/less.py,27,function,Make a set of tests to do less. -832,make_less_equal_tests,tensorflow/tensorflow/lite/testing/op_tests/less_equal.py,27,function,Make a set of tests to do less_equal. -833,make_local_response_norm_tests,tensorflow/tensorflow/lite/testing/op_tests/local_response_norm.py,28,function,Make a set of tests to do local_response_norm. -834,make_log_softmax_tests,tensorflow/tensorflow/lite/testing/op_tests/log_softmax.py,27,function,Make a set of tests to do log_softmax. -835,_make_logical_tests,tensorflow/tensorflow/lite/testing/op_tests/logic.py,26,function,Make a set of tests to do logical operations. -836,make_logical_or_tests,tensorflow/tensorflow/lite/testing/op_tests/logic.py,65,function,Make a set of tests to do logical_or. -837,make_logical_and_tests,tensorflow/tensorflow/lite/testing/op_tests/logic.py,71,function,Make a set of tests to do logical_and. -838,make_logical_xor_tests,tensorflow/tensorflow/lite/testing/op_tests/logic.py,77,function,"Make a set of tests to do logical_xor, test logical_not as well." -839,make_lstm_tests,tensorflow/tensorflow/lite/testing/op_tests/lstm.py,29,function,Make a set of tests to do basic Lstm cell. -840,make_matrix_diag_tests,tensorflow/tensorflow/lite/testing/op_tests/matrix_diag.py,27,function,Make a set of tests for tf.linalg.diag op. -841,make_matrix_set_diag_tests,tensorflow/tensorflow/lite/testing/op_tests/matrix_set_diag.py,27,function,Make a set of tests for tf.linalg.set_diag op. -842,make_maximum_tests,tensorflow/tensorflow/lite/testing/op_tests/maximum.py,27,function,Make a set of tests to do maximum. -843,make_minimum_tests,tensorflow/tensorflow/lite/testing/op_tests/minimum.py,27,function,Make a set of tests to do minimum. -844,make_mirror_pad_tests,tensorflow/tensorflow/lite/testing/op_tests/mirror_pad.py,28,function,Make a set of tests to do mirror_pad. -845,make_nearest_upsample_tests,tensorflow/tensorflow/lite/testing/op_tests/nearest_upsample.py,27,function,Make a set of tests to do nearest_upsample. -846,make_neg_tests,tensorflow/tensorflow/lite/testing/op_tests/neg.py,27,function,Make a set of tests to do neg. -847,make_not_equal_tests,tensorflow/tensorflow/lite/testing/op_tests/not_equal.py,27,function,Make a set of tests to do not equal. -848,make_one_hot_tests,tensorflow/tensorflow/lite/testing/op_tests/one_hot.py,27,function,Make a set of tests to do one_hot. -849,make_pack_tests,tensorflow/tensorflow/lite/testing/op_tests/pack.py,28,function,Make a set of tests to do stack. -850,make_pad_tests,tensorflow/tensorflow/lite/testing/op_tests/pad.py,28,function,Make a set of tests to do pad. -851,make_padv2_tests,tensorflow/tensorflow/lite/testing/op_tests/padv2.py,28,function,Make a set of tests to do padv2. -852,make_placeholder_with_default_tests,tensorflow/tensorflow/lite/testing/op_tests/placeholder_with_default.py,28,function,Make a set of tests to test placeholder_with_default. -853,make_pool_tests,tensorflow/tensorflow/lite/testing/op_tests/pool.py,26,function,"Make a set of tests to do average pooling. - -Args: - pool_op_in: TensorFlow pooling operation to test i.e. `tf.nn.avg_pool2d`. - allow_fully_quantize: bool, whether fully_quantize is allowed. - -Returns: - A function representing the true generator (after curried pool_op_in)." -854,make_l2_pool,tensorflow/tensorflow/lite/testing/op_tests/pool.py,119,function,Given an input perform a sequence of TensorFlow ops to produce l2pool. -855,make_l2_pool_tests,tensorflow/tensorflow/lite/testing/op_tests/pool.py,131,function, -856,make_avg_pool_tests,tensorflow/tensorflow/lite/testing/op_tests/pool.py,136,function, -857,make_max_pool_tests,tensorflow/tensorflow/lite/testing/op_tests/pool.py,143,function, -858,make_prelu_tests,tensorflow/tensorflow/lite/testing/op_tests/prelu.py,28,function,Make a set of tests to do PReLU. -859,make_range_tests,tensorflow/tensorflow/lite/testing/op_tests/range.py,27,function,Make a set of tests to do range. -860,make_rank_tests,tensorflow/tensorflow/lite/testing/op_tests/rank.py,27,function,Make a set of tests to do rank. -861,make_reduce_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,27,function,"Make a set of tests to do reduce operation. - -Args: - reduce_op: TensorFlow reduce operation to test, i.e. `tf.reduce_mean`. - min_value: min value for created tensor data. - max_value: max value for created tensor data. - boolean_tensor_only: If true, will only generate tensor with boolean value. - allow_fully_quantize: bool, whether fully_quantize is allowed. - -Returns: - a function representing the true generator with `reduce_op_in` curried." -862,make_mean_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,219,function,Make a set of tests to do mean. -863,make_sum_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,231,function,Make a set of tests to do sum. -864,make_reduce_prod_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,243,function,Make a set of tests to do prod. -865,make_reduce_max_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,250,function,Make a set of tests to do max. -866,make_reduce_min_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,258,function,Make a set of tests to do min. -867,make_reduce_any_tests,tensorflow/tensorflow/lite/testing/op_tests/reduce.py,266,function,Make a set of tests to do any. -868,make_relu_tests,tensorflow/tensorflow/lite/testing/op_tests/relu.py,28,function,Make a set of tests to do relu. -869,make_relu1_tests,tensorflow/tensorflow/lite/testing/op_tests/relu1.py,28,function,Make a set of tests to do relu1. -870,make_relu6_tests,tensorflow/tensorflow/lite/testing/op_tests/relu6.py,28,function,Make a set of tests to do relu6. -871,make_reshape_tests,tensorflow/tensorflow/lite/testing/op_tests/reshape.py,28,function,Make a set of tests to do reshape. -872,make_resize_bilinear_tests,tensorflow/tensorflow/lite/testing/op_tests/resize_bilinear.py,27,function,Make a set of tests to do resize_bilinear. -873,make_resize_nearest_neighbor_tests,tensorflow/tensorflow/lite/testing/op_tests/resize_nearest_neighbor.py,27,function,Make a set of tests to do resize_nearest_neighbor. -874,make_resolve_constant_strided_slice_tests,tensorflow/tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py,29,function,Make a set of tests to show strided_slice yields incorrect results. -875,make_reverse_sequence_tests,tensorflow/tensorflow/lite/testing/op_tests/reverse_sequence.py,27,function,Make a set of tests to do reverse_sequence. -876,make_reverse_v2_tests,tensorflow/tensorflow/lite/testing/op_tests/reverse_v2.py,27,function,Make a set of tests to do reverse_v2. -877,make_rfft2d_tests,tensorflow/tensorflow/lite/testing/op_tests/rfft2d.py,28,function,Make a set of tests to do rfft2d. -878,make_round_tests,tensorflow/tensorflow/lite/testing/op_tests/round.py,27,function,Build the round op testing graph. -879,make_scatter_nd_tests,tensorflow/tensorflow/lite/testing/op_tests/scatter_nd.py,28,function,Make a set of tests to do scatter_nd. -880,make_shape_tests,tensorflow/tensorflow/lite/testing/op_tests/shape.py,28,function,Make a set of tests to do shape. -881,make_sigmoid_tests,tensorflow/tensorflow/lite/testing/op_tests/sigmoid.py,27,function,Make a set of tests to do sigmoid. -882,make_slice_tests,tensorflow/tensorflow/lite/testing/op_tests/slice.py,29,function,Make a set of tests to do slice. -883,make_softmax_tests,tensorflow/tensorflow/lite/testing/op_tests/softmax.py,27,function,Make a set of tests to do softmax. -884,make_space_to_batch_nd_tests,tensorflow/tensorflow/lite/testing/op_tests/space_to_batch_nd.py,28,function,Make a set of tests to do space_to_batch_nd. -885,make_space_to_depth_tests,tensorflow/tensorflow/lite/testing/op_tests/space_to_depth.py,27,function,Make a set of tests to do space_to_depth. -886,make_sparse_to_dense_tests,tensorflow/tensorflow/lite/testing/op_tests/sparse_to_dense.py,29,function,Make a set of tests to do sparse to dense. -887,make_split_tests,tensorflow/tensorflow/lite/testing/op_tests/split.py,28,function,Make a set of tests to do tf.split. -888,make_splitv_tests,tensorflow/tensorflow/lite/testing/op_tests/splitv.py,28,function,Make a set of tests to do tf.split_v. -889,make_squeeze_tests,tensorflow/tensorflow/lite/testing/op_tests/squeeze.py,27,function,Make a set of tests to do squeeze. -890,make_squeeze_transpose_tests,tensorflow/tensorflow/lite/testing/op_tests/squeeze_transpose.py,27,function,Make a set of tests to do squeeze followed by transpose. -891,_make_strided_slice_tests,tensorflow/tensorflow/lite/testing/op_tests/strided_slice.py,28,function,Utility function to make strided_slice_tests based on parameters. -892,make_strided_slice_tests,tensorflow/tensorflow/lite/testing/op_tests/strided_slice.py,100,function,Make a set of tests to do strided_slice. -893,make_strided_slice_1d_exhaustive_tests,tensorflow/tensorflow/lite/testing/op_tests/strided_slice.py,208,function,Make a set of exhaustive tests for 1D strided_slice. -894,make_strided_slice_np_style_tests,tensorflow/tensorflow/lite/testing/op_tests/strided_slice_np_style.py,29,function,Make a set of tests to test strided_slice in np style. -895,make_tanh_tests,tensorflow/tensorflow/lite/testing/op_tests/tanh.py,28,function,Make a set of tests to do tanh. -896,make_tile_tests,tensorflow/tensorflow/lite/testing/op_tests/tile.py,27,function,Make a set of tests to do tile. -897,make_topk_tests,tensorflow/tensorflow/lite/testing/op_tests/topk.py,28,function,Make a set of tests to do topk. -898,make_transpose_tests,tensorflow/tensorflow/lite/testing/op_tests/transpose.py,28,function,Make a set of tests to do transpose. -899,make_transpose_conv_tests,tensorflow/tensorflow/lite/testing/op_tests/transpose_conv.py,33,function,Make a set of tests to do transpose_conv. -900,make_unfused_gru_tests,tensorflow/tensorflow/lite/testing/op_tests/unfused_gru.py,27,function,Make a set of tests for unfused gru op. -901,make_unidirectional_sequence_lstm_tests,tensorflow/tensorflow/lite/testing/op_tests/unidirectional_sequence_lstm.py,29,function,Make a set of tests to do unidirectional_sequence_lstm. -902,make_unidirectional_sequence_rnn_tests,tensorflow/tensorflow/lite/testing/op_tests/unidirectional_sequence_rnn.py,29,function,Make a set of tests to do unidirectional_sequence_rnn. -903,make_unique_tests,tensorflow/tensorflow/lite/testing/op_tests/unique.py,27,function,Make a set of tests for Unique op. -904,make_unpack_tests,tensorflow/tensorflow/lite/testing/op_tests/unpack.py,27,function,Make a set of tests to do unpack. -905,make_unroll_batch_matmul_tests,tensorflow/tensorflow/lite/testing/op_tests/unroll_batch_matmul.py,27,function,Make a set of tests to test unroll_batch_matmul. -906,make_where_tests,tensorflow/tensorflow/lite/testing/op_tests/where.py,27,function,Make a set of tests to do where. -907,make_zeros_like_tests,tensorflow/tensorflow/lite/testing/op_tests/zeros_like.py,27,function,Make a set of tests to do zeros_like. -908,html_escape,tensorflow/tensorflow/lite/toco/logging/gen_html.py,37,function, -909,get_input_type_from_signature,tensorflow/tensorflow/lite/toco/logging/gen_html.py,41,function,"Parses op_signature and returns a string denoting the input tensor type. +532,EvaluateFrozenGraph,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,42,class, +533,plus_placeholder,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,92,method, +534,EvaluateSavedModel,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,142,class, +535,EvaluateKerasModel,tensorflow/tensorflow/lite/testing/model_coverage/model_coverage_lib_test.py,160,class, +536,relu1,tensorflow/tensorflow/lite/testing/op_tests/conv_activation.py,143,function, +537,make_l2_pool,tensorflow/tensorflow/lite/testing/op_tests/pool.py,119,function,Given an input perform a sequence of TensorFlow ops to produce l2pool. +538,html_escape,tensorflow/tensorflow/lite/toco/logging/gen_html.py,37,function, +539,get_input_type_from_signature,tensorflow/tensorflow/lite/toco/logging/gen_html.py,41,function,"Parses op_signature and returns a string denoting the input tensor type. Args: op_signature: a string specifying the signature of a particular operator. @@ -3589,9 +3327,35 @@ Returns: by comma. For example: shape:[1,73,73,160],type:float,shape:[64,1,1,160],type:float,shape:[64], type:float" -910,get_operator_type,tensorflow/tensorflow/lite/toco/logging/gen_html.py,78,function, -911,HTMLGenerator,tensorflow/tensorflow/lite/toco/logging/gen_html.py,87,class,Utility class to generate an HTML report. -912,gen_conversion_log_html,tensorflow/tensorflow/lite/toco/logging/gen_html.py,208,function,"Generates an HTML report about the conversion process. +540,get_operator_type,tensorflow/tensorflow/lite/toco/logging/gen_html.py,78,function, +541,HTMLGenerator,tensorflow/tensorflow/lite/toco/logging/gen_html.py,87,class,Utility class to generate an HTML report. +542,generate,tensorflow/tensorflow/lite/toco/logging/gen_html.py,111,method,"Generates the HTML report and writes it to local directory. + +This function uses the fields in `toco_conversion_log_before` and +`toco_conversion_log_after` to populate the HTML content. Certain markers +(placeholders) in the HTML template are then substituted with the fields +from the protos. Once finished it will write the HTML file to the specified +local file path. + +Args: + toco_conversion_log_before: A `TocoConversionLog` protobuf generated + before the model is converted by TOCO. + toco_conversion_log_after: A `TocoConversionLog` protobuf generated after + the model is converted by TOCO. + post_training_quant_enabled: A boolean, whether post-training quantization + is enabled. + dot_before: A string, the dot representation of the model + before the conversion. + dot_after: A string, the dot representation of the model after + the conversion. + toco_err_log: A string, the logs emitted by TOCO during conversion. Caller + need to ensure that this string is properly anonymized (any kind of + user data should be eliminated). + tflite_graph_path: A string, the filepath to the converted TFLite model. + +Raises: + RuntimeError: When error occurs while generating the template." +543,gen_conversion_log_html,tensorflow/tensorflow/lite/toco/logging/gen_html.py,208,function,"Generates an HTML report about the conversion process. Args: conversion_log_dir: A string specifying the file directory of the conversion @@ -3606,12 +3370,9 @@ Args: Raises: IOError: When any of the required files doesn't exist." -913,GenHtmlTest,tensorflow/tensorflow/lite/toco/logging/gen_html_test.py,32,class, -914,execute,tensorflow/tensorflow/lite/toco/python/toco_from_protos.py,32,function,Runs the converter. -915,main,tensorflow/tensorflow/lite/toco/python/toco_from_protos.py,61,function, -916,TensorName,tensorflow/tensorflow/lite/toco/python/toco_from_protos_test.py,30,function,Get the canonical (non foo:0 name). -917,TocoFromProtosTest,tensorflow/tensorflow/lite/toco/python/toco_from_protos_test.py,35,class, -918,get_image,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,41,function,"Returns an image loaded into an np.ndarray with dims [height, width, (3 or 1)]. +544,execute,tensorflow/tensorflow/lite/toco/python/toco_from_protos.py,32,function,Runs the converter. +545,TensorName,tensorflow/tensorflow/lite/toco/python/toco_from_protos_test.py,30,function,Get the canonical (non foo:0 name). +546,get_image,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,41,function,"Returns an image loaded into an np.ndarray with dims [height, width, (3 or 1)]. Args: width: Width to rescale the image to. @@ -3622,18 +3383,15 @@ Args: Returns: np.ndarray of shape (height, width, channels) where channels is 1 if want_grayscale is true, otherwise 3." -919,array_to_int_csv,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,65,function,"Converts all elements in a numerical array to a comma-separated string. +547,array_to_int_csv,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,65,function,"Converts all elements in a numerical array to a comma-separated string. Args: array_data: Numerical array to convert. Returns: String containing array values as integers, separated by commas." -920,run_main,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,79,function,Application run loop. -921,main,tensorflow/tensorflow/lite/tools/convert_image_to_csv.py,110,function, -922,ConvertImageToCsvTest,tensorflow/tensorflow/lite/tools/convert_image_to_csv_test.py,34,class, -923,convert_bytearray_to_object,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,38,function,Converts a tflite model from a bytearray to an object for parsing. -924,read_model,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,44,function,"Reads a tflite model as a python object. +548,convert_bytearray_to_object,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,38,function,Converts a tflite model from a bytearray to an object for parsing. +549,read_model,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,44,function,"Reads a tflite model as a python object. Args: input_tflite_file: Full path name to the input tflite file @@ -3644,7 +3402,7 @@ Raises: Returns: A python object corresponding to the input tflite file." -925,read_model_with_mutable_tensors,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,64,function,"Reads a tflite model as a python object with mutable tensors. +550,read_model_with_mutable_tensors,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,64,function,"Reads a tflite model as a python object with mutable tensors. Similar to read_model() with the addition that the returned object has mutable tensors (read_model() returns an object with immutable tensors). @@ -3658,8 +3416,8 @@ Raises: Returns: A mutable python object corresponding to the input tflite file." -926,convert_object_to_bytearray,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,83,function,Converts a tflite model from an object to a bytearray. -927,write_model,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,93,function,"Writes the tflite model, a python object, into the output file. +551,convert_object_to_bytearray,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,83,function,Converts a tflite model from an object to a bytearray. +552,write_model,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,93,function,"Writes the tflite model, a python object, into the output file. Args: model_object: A tflite model as a python object @@ -3667,7 +3425,7 @@ Args: Raises: IOError: If output_tflite_file path is invalid or cannot be opened." -928,strip_strings,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,108,function,"Strips all nonessential strings from the model to reduce model size. +553,strip_strings,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,108,function,"Strips all nonessential strings from the model to reduce model size. We remove the following strings: (find strings by searching "":string"" in the tensorflow lite flatbuffer schema) @@ -3678,27 +3436,22 @@ We retain OperatorCode custom_code and Metadata name. Args: model: The model from which to remove nonessential strings." -929,randomize_weights,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,130,function,"Randomize weights in a model. +554,randomize_weights,tensorflow/tensorflow/lite/tools/flatbuffer_utils.py,130,function,"Randomize weights in a model. Args: model: The model in which to randomize weights. random_seed: The input to the random number generator (default value is 0)." -930,WriteReadModelTest,tensorflow/tensorflow/lite/tools/flatbuffer_utils_test.py,29,class, -931,StripStringsTest,tensorflow/tensorflow/lite/tools/flatbuffer_utils_test.py,74,class, -932,RandomizeWeightsTest,tensorflow/tensorflow/lite/tools/flatbuffer_utils_test.py,119,class, -933,main,tensorflow/tensorflow/lite/tools/randomize_weights.py,34,function, -934,main,tensorflow/tensorflow/lite/tools/strip_strings.py,34,function,Application run loop. -935,build_mock_flatbuffer_model,tensorflow/tensorflow/lite/tools/test_utils.py,30,function,Creates a flatbuffer containing an example model. -936,load_model_from_flatbuffer,tensorflow/tensorflow/lite/tools/test_utils.py,211,function,Loads a model as a python object from a flatbuffer model. -937,build_mock_model,tensorflow/tensorflow/lite/tools/test_utils.py,218,function,Creates an object containing an example model. -938,TensorTypeToName,tensorflow/tensorflow/lite/tools/visualize.py,202,function,Converts a numerical enum to a readable tensor type. -939,BuiltinCodeToName,tensorflow/tensorflow/lite/tools/visualize.py,210,function,Converts a builtin op code enum to a readable name. -940,NameListToString,tensorflow/tensorflow/lite/tools/visualize.py,218,function,Converts a list of integers to the equivalent ASCII string. -941,OpCodeMapper,tensorflow/tensorflow/lite/tools/visualize.py,229,class,Maps an opcode index to an op name. -942,DataSizeMapper,tensorflow/tensorflow/lite/tools/visualize.py,245,class,"For buffers, report the number of bytes." -943,TensorMapper,tensorflow/tensorflow/lite/tools/visualize.py,255,class,Maps a list of tensor indices to a tooltip hoverable indicator of more. -944,GenerateGraph,tensorflow/tensorflow/lite/tools/visualize.py,278,function,Produces the HTML required to have a d3 visualization of the dag. -945,GenerateTableHtml,tensorflow/tensorflow/lite/tools/visualize.py,337,function,"Given a list of object values and keys to print, make an HTML table. +555,build_mock_flatbuffer_model,tensorflow/tensorflow/lite/tools/test_utils.py,30,function,Creates a flatbuffer containing an example model. +556,load_model_from_flatbuffer,tensorflow/tensorflow/lite/tools/test_utils.py,211,function,Loads a model as a python object from a flatbuffer model. +557,build_mock_model,tensorflow/tensorflow/lite/tools/test_utils.py,218,function,Creates an object containing an example model. +558,TensorTypeToName,tensorflow/tensorflow/lite/tools/visualize.py,202,function,Converts a numerical enum to a readable tensor type. +559,BuiltinCodeToName,tensorflow/tensorflow/lite/tools/visualize.py,210,function,Converts a builtin op code enum to a readable name. +560,NameListToString,tensorflow/tensorflow/lite/tools/visualize.py,218,function,Converts a list of integers to the equivalent ASCII string. +561,OpCodeMapper,tensorflow/tensorflow/lite/tools/visualize.py,229,class,Maps an opcode index to an op name. +562,DataSizeMapper,tensorflow/tensorflow/lite/tools/visualize.py,245,class,"For buffers, report the number of bytes." +563,TensorMapper,tensorflow/tensorflow/lite/tools/visualize.py,255,class,Maps a list of tensor indices to a tooltip hoverable indicator of more. +564,GenerateGraph,tensorflow/tensorflow/lite/tools/visualize.py,278,function,Produces the HTML required to have a d3 visualization of the dag. +565,GenerateTableHtml,tensorflow/tensorflow/lite/tools/visualize.py,337,function,"Given a list of object values and keys to print, make an HTML table. Args: items: Items to print an array of dicts. @@ -3710,8 +3463,8 @@ Args: Returns: An html table." -946,CamelCaseToSnakeCase,tensorflow/tensorflow/lite/tools/visualize.py,375,function,Converts an identifier in CamelCase to snake_case. -947,FlatbufferToDict,tensorflow/tensorflow/lite/tools/visualize.py,381,function,"Converts a hierarchy of FB objects into a nested dict. +566,CamelCaseToSnakeCase,tensorflow/tensorflow/lite/tools/visualize.py,375,function,Converts an identifier in CamelCase to snake_case. +567,FlatbufferToDict,tensorflow/tensorflow/lite/tools/visualize.py,381,function,"Converts a hierarchy of FB objects into a nested dict. We avoid transforming big parts of the flat buffer into python arrays. This speeds conversion from ten minutes to a few seconds on big graphs. @@ -3722,66 +3475,9 @@ Args: false if all downstream np.array should become python arrays Returns: A dictionary representing the flatbuffer rather than a flatbuffer object." -948,CreateDictFromFlatbuffer,tensorflow/tensorflow/lite/tools/visualize.py,413,function, -949,CreateHtmlFile,tensorflow/tensorflow/lite/tools/visualize.py,419,function,"Given a tflite model in `tflite_input` file, produce html description." -950,main,tensorflow/tensorflow/lite/tools/visualize.py,506,function, -951,VisualizeTest,tensorflow/tensorflow/lite/tools/visualize_test.py,29,class, -952,main,tensorflow/tensorflow/lite/tools/zip_files.py,32,function, -953,_get_ground_truth_detections,tensorflow/tensorflow/lite/tools/evaluation/tasks/coco_object_detection/preprocess_coco_minival.py,44,function,"Processes the annotations JSON file and returns ground truth data corresponding to allowlisted image IDs. - -Args: - instances_file: COCO instances JSON file, usually named as - instances_val20xx.json. - allowlist_file: File containing COCO minival image IDs to allowlist for - evaluation, one per line. - num_images: Number of allowlisted images to pre-process. First num_images - are chosen based on sorted list of filenames. If None, all allowlisted - files are preprocessed. - -Returns: - A dict mapping image id (int) to a per-image dict that contains: - 'filename', 'image' & 'height' mapped to filename & image dimensions - respectively - AND - 'detections' to a list of detection dicts, with each mapping: - 'category_id' to COCO category id (starting with 1) & - 'bbox' to a list of dimension-normalized [top, left, bottom, right] - bounding-box values." -954,_dump_data,tensorflow/tensorflow/lite/tools/evaluation/tasks/coco_object_detection/preprocess_coco_minival.py,145,function,"Dumps images & data from ground-truth objects into output_folder_path. - -The following are created in output_folder_path: - images/: sub-folder for allowlisted validation images. - ground_truth.pb: A binary proto file containing all ground-truth - object-sets. - -Args: - ground_truth_detections: A dict mapping image id to ground truth data. - Output of _get_ground_truth_detections. - images_folder_path: Validation images folder - output_folder_path: folder to output files to." -955,_parse_args,tensorflow/tensorflow/lite/tools/evaluation/tasks/coco_object_detection/preprocess_coco_minival.py,190,function,"Creates a parser that parse the command line arguments. - -Returns: - A namespace parsed from command line arguments." -956,_synset_to_word,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,30,function,Returns synset to word dictionary by reading sysnset arrays. -957,_validation_file_path,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,50,function, -958,_synset_array_path,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,54,function, -959,_generate_validation_labels,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,58,function, -960,_check_arguments,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,67,function, -961,main,tensorflow/tensorflow/lite/tools/evaluation/tasks/imagenet_image_classification/generate_validation_labels.py,80,function, -962,main,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface.py,38,function,Application run loop. -963,_parse_type_to_int,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib.py,27,function,"Converts a tflite type to it's integer representation. - -Args: - dtype: tf.DType representing the inference type. - flag: str representing the flag name. - -Returns: - integer, a tflite TensorType enum value. - -Raises: - ValueError: Unsupported tflite type." -964,modify_model_interface,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib.py,52,function,"Modify a quantized model's interface (input/output) from float to integer. +568,CreateDictFromFlatbuffer,tensorflow/tensorflow/lite/tools/visualize.py,413,function, +569,CreateHtmlFile,tensorflow/tensorflow/lite/tools/visualize.py,419,function,"Given a tflite model in `tflite_input` file, produce html description." +570,modify_model_interface,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib.py,52,function,"Modify a quantized model's interface (input/output) from float to integer. Args: input_file: Full path name to the input tflite file. @@ -3792,26 +3488,27 @@ Args: Raises: RuntimeError: If the modification of the model interface was unsuccessful. ValueError: If the input_type or output_type is unsupported." -965,build_tflite_model_with_full_integer_quantization,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib_test.py,31,function, -966,ModifyModelInterfaceTest,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib_test.py,56,class, -967,FormatConverterTest,tensorflow/tensorflow/lite/tools/optimize/sparsity/python/format_converter_extension_test.py,28,class, -968,get_build_cpus,tensorflow/tensorflow/lite/tools/pip_package/setup.py,72,function, -969,make_args,tensorflow/tensorflow/lite/tools/pip_package/setup.py,80,function,Construct make command line. -970,make_output,tensorflow/tensorflow/lite/tools/pip_package/setup.py,94,function,Invoke make on the target and return output. -971,make,tensorflow/tensorflow/lite/tools/pip_package/setup.py,99,function,"Invoke make to build tflite C++ sources. +571,build_tflite_model_with_full_integer_quantization,tensorflow/tensorflow/lite/tools/optimize/python/modify_model_interface_lib_test.py,31,function, +572,get_build_cpus,tensorflow/tensorflow/lite/tools/pip_package/setup.py,72,function, +573,make_args,tensorflow/tensorflow/lite/tools/pip_package/setup.py,80,function,Construct make command line. +574,make_output,tensorflow/tensorflow/lite/tools/pip_package/setup.py,94,function,Invoke make on the target and return output. +575,make,tensorflow/tensorflow/lite/tools/pip_package/setup.py,99,function,"Invoke make to build tflite C++ sources. Build dependencies: apt-get install swig libjpeg-dev zlib1g-dev python3-dev python3-nump" -972,download_dependencies,tensorflow/tensorflow/lite/tools/pip_package/setup.py,108,function,Download build dependencies if haven't done yet. -973,CustomBuildExt,tensorflow/tensorflow/lite/tools/pip_package/setup.py,114,class,Customized build extension. -974,CustomBuildPy,tensorflow/tensorflow/lite/tools/pip_package/setup.py,130,class, -975,get_pybind_include,tensorflow/tensorflow/lite/tools/pip_package/setup.py,137,function,"pybind11 include directory is not correctly resolved. +576,download_dependencies,tensorflow/tensorflow/lite/tools/pip_package/setup.py,108,function,Download build dependencies if haven't done yet. +577,CustomBuildExt,tensorflow/tensorflow/lite/tools/pip_package/setup.py,114,class,Customized build extension. +578,get_ext_filename,tensorflow/tensorflow/lite/tools/pip_package/setup.py,117,method, +579,run,tensorflow/tensorflow/lite/tools/pip_package/setup.py,123,method, +580,CustomBuildPy,tensorflow/tensorflow/lite/tools/pip_package/setup.py,130,class, +581,run,tensorflow/tensorflow/lite/tools/pip_package/setup.py,132,method, +582,get_pybind_include,tensorflow/tensorflow/lite/tools/pip_package/setup.py,137,function,"pybind11 include directory is not correctly resolved. This fixes include directory to /usr/local/pythonX.X Returns: include directories to find pybind11" -976,set_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,25,function,"Sets SignatureDefs to the Metadata of a TfLite flatbuffer buffer. +583,set_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,25,function,"Sets SignatureDefs to the Metadata of a TfLite flatbuffer buffer. Args: tflite_model: Binary TFLite model (bytes or bytes-like object) to which to @@ -3825,7 +3522,7 @@ Raises: ValueError: tflite_model buffer does not contain a valid TFLite model. signature_def_map is empty or does not contain a SignatureDef." -977,get_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,51,function,"Get SignatureDef dict from the Metadata of a TfLite flatbuffer buffer. +584,get_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,51,function,"Get SignatureDef dict from the Metadata of a TfLite flatbuffer buffer. Args: tflite_model: TFLite model buffer to get the signature_def. @@ -3839,7 +3536,7 @@ Raises: tflite_model buffer does not contain a valid TFLite model. DecodeError: SignatureDef cannot be parsed from TfLite SignatureDef metadata." -978,clear_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,78,function,"Clears SignatureDefs from the Metadata of a TfLite flatbuffer buffer. +585,clear_signature_defs,tensorflow/tensorflow/lite/tools/signature/signature_def_utils.py,78,function,"Clears SignatureDefs from the Metadata of a TfLite flatbuffer buffer. Args: tflite_model: TFLite model buffer to remove signature_defs. @@ -3851,16 +3548,13 @@ Returns: Raises: ValueError: tflite_model buffer does not contain a valid TFLite model." -979,SignatureDefUtilsTest,tensorflow/tensorflow/lite/tools/signature/signature_def_utils_test.py,30,class, -980,read32,tensorflow/tensorflow/lite/tutorials/dataset.py,35,function,Read 4 bytes from bytestream as an unsigned 32-bit integer. -981,check_image_file_header,tensorflow/tensorflow/lite/tutorials/dataset.py,41,function,Validate that filename corresponds to images for the MNIST dataset. -982,check_labels_file_header,tensorflow/tensorflow/lite/tutorials/dataset.py,57,function,Validate that filename corresponds to labels for the MNIST dataset. -983,download,tensorflow/tensorflow/lite/tutorials/dataset.py,67,function,Download (and unzip) a file from the MNIST dataset if not already done. -984,dataset,tensorflow/tensorflow/lite/tutorials/dataset.py,86,function,Download and parse MNIST dataset. -985,train,tensorflow/tensorflow/lite/tutorials/dataset.py,114,function,tf.data.Dataset object for MNIST training data. -986,test,tensorflow/tensorflow/lite/tutorials/dataset.py,120,function,tf.data.Dataset object for MNIST test data. -987,test_image_generator,tensorflow/tensorflow/lite/tutorials/mnist_tflite.py,35,function, -988,run_eval,tensorflow/tensorflow/lite/tutorials/mnist_tflite.py,47,function,"Performs evaluation for input image over specified model. +586,read32,tensorflow/tensorflow/lite/tutorials/dataset.py,35,function,Read 4 bytes from bytestream as an unsigned 32-bit integer. +587,check_image_file_header,tensorflow/tensorflow/lite/tutorials/dataset.py,41,function,Validate that filename corresponds to images for the MNIST dataset. +588,check_labels_file_header,tensorflow/tensorflow/lite/tutorials/dataset.py,57,function,Validate that filename corresponds to labels for the MNIST dataset. +589,download,tensorflow/tensorflow/lite/tutorials/dataset.py,67,function,Download (and unzip) a file from the MNIST dataset if not already done. +590,dataset,tensorflow/tensorflow/lite/tutorials/dataset.py,86,function,Download and parse MNIST dataset. +591,train,tensorflow/tensorflow/lite/tutorials/dataset.py,114,function,tf.data.Dataset object for MNIST training data. +592,run_eval,tensorflow/tensorflow/lite/tutorials/mnist_tflite.py,47,function,"Performs evaluation for input image over specified model. Args: interpreter: TFLite interpreter initialized with model to execute. @@ -3868,31 +3562,29 @@ Args: Returns: output: output tensor of model being executed." -989,main,tensorflow/tensorflow/lite/tutorials/mnist_tflite.py,72,function, -990,set_dlopen_flags,tensorflow/tensorflow/python/pywrap_dlopen_global_flags.py,43,function, -991,reset_dlopen_flags,tensorflow/tensorflow/python/pywrap_dlopen_global_flags.py,48,function, -992,import_graphdef,tensorflow/tensorflow/python/pywrap_mlir.py,26,function, -993,experimental_convert_saved_model_to_mlir,tensorflow/tensorflow/python/pywrap_mlir.py,32,function, -994,experimental_convert_saved_model_v1_to_mlir,tensorflow/tensorflow/python/pywrap_mlir.py,39,function, -995,experimental_run_pass_pipeline,tensorflow/tensorflow/python/pywrap_mlir.py,48,function, -996,enable,tensorflow/tensorflow/python/tf2.py,30,function, -997,disable,tensorflow/tensorflow/python/tf2.py,36,function, -998,enabled,tensorflow/tensorflow/python/tf2.py,42,function, -999,AssertTransformer,tensorflow/tensorflow/python/autograph/converters/asserts.py,27,class,Transforms Assert nodes to Call so they can be handled as functions. -1000,transform,tensorflow/tensorflow/python/autograph/converters/asserts.py,50,function, -1001,AssertsTest,tensorflow/tensorflow/python/autograph/converters/asserts_test.py,30,class, -1002,_Break,tensorflow/tensorflow/python/autograph/converters/break_statements.py,29,class, -1003,BreakTransformer,tensorflow/tensorflow/python/autograph/converters/break_statements.py,39,class,Canonicalizes break statements into additional conditionals. -1004,transform,tensorflow/tensorflow/python/autograph/converters/break_statements.py,183,function, -1005,BreakCanonicalizationTest,tensorflow/tensorflow/python/autograph/converters/break_statements_test.py,27,class, -1006,_Function,tensorflow/tensorflow/python/autograph/converters/call_trees.py,40,class, -1007,_ArgTemplateBuilder,tensorflow/tensorflow/python/autograph/converters/call_trees.py,51,class,"Constructs a tuple representing the positional arguments in a call. - -Example (yes, it's legal Python 3): - - f(*args1, b, *args2, c, d) -> args1 + (b,) + args2 + (c, d)" -1008,CallTreeTransformer,tensorflow/tensorflow/python/autograph/converters/call_trees.py,96,class,Transforms the call tree by renaming transformed symbols. -1009,transform,tensorflow/tensorflow/python/autograph/converters/call_trees.py,211,function,"Transform function call to the compiled counterparts. +593,set_dlopen_flags,tensorflow/tensorflow/python/pywrap_dlopen_global_flags.py,43,function, +594,reset_dlopen_flags,tensorflow/tensorflow/python/pywrap_dlopen_global_flags.py,48,function, +595,import_graphdef,tensorflow/tensorflow/python/pywrap_mlir.py,26,function, +596,experimental_convert_saved_model_to_mlir,tensorflow/tensorflow/python/pywrap_mlir.py,32,function, +597,experimental_convert_saved_model_v1_to_mlir,tensorflow/tensorflow/python/pywrap_mlir.py,39,function, +598,experimental_run_pass_pipeline,tensorflow/tensorflow/python/pywrap_mlir.py,48,function, +599,enable,tensorflow/tensorflow/python/tf2.py,30,function, +600,disable,tensorflow/tensorflow/python/tf2.py,36,function, +601,enabled,tensorflow/tensorflow/python/tf2.py,42,function, +602,AssertTransformer,tensorflow/tensorflow/python/autograph/converters/asserts.py,27,class,Transforms Assert nodes to Call so they can be handled as functions. +603,visit_Assert,tensorflow/tensorflow/python/autograph/converters/asserts.py,30,method, +604,transform,tensorflow/tensorflow/python/autograph/converters/asserts.py,50,function, +605,BreakTransformer,tensorflow/tensorflow/python/autograph/converters/break_statements.py,39,class,Canonicalizes break statements into additional conditionals. +606,visit_Break,tensorflow/tensorflow/python/autograph/converters/break_statements.py,42,method, +607,visit_While,tensorflow/tensorflow/python/autograph/converters/break_statements.py,75,method, +608,visit_For,tensorflow/tensorflow/python/autograph/converters/break_statements.py,121,method, +609,transform,tensorflow/tensorflow/python/autograph/converters/break_statements.py,183,function, +610,CallTreeTransformer,tensorflow/tensorflow/python/autograph/converters/call_trees.py,96,class,Transforms the call tree by renaming transformed symbols. +611,visit_Lambda,tensorflow/tensorflow/python/autograph/converters/call_trees.py,99,method, +612,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/call_trees.py,108,method, +613,visit_With,tensorflow/tensorflow/python/autograph/converters/call_trees.py,126,method, +614,visit_Call,tensorflow/tensorflow/python/autograph/converters/call_trees.py,160,method, +615,transform,tensorflow/tensorflow/python/autograph/converters/call_trees.py,211,function,"Transform function call to the compiled counterparts. Args: node: AST @@ -3901,69 +3593,80 @@ Returns: A tuple (node, new_names): node: The transformed AST new_names: set(string), containing any newly-generated names" -1010,MockConvertedCall,tensorflow/tensorflow/python/autograph/converters/call_trees_test.py,30,class, -1011,CallTreesTest,tensorflow/tensorflow/python/autograph/converters/call_trees_test.py,42,class, -1012,ConditionalExpressionTransformer,tensorflow/tensorflow/python/autograph/converters/conditional_expressions.py,28,class,Converts conditional expressions to functional form. -1013,transform,tensorflow/tensorflow/python/autograph/converters/conditional_expressions.py,48,function, -1014,ConditionalExpressionsTest,tensorflow/tensorflow/python/autograph/converters/conditional_expressions_test.py,26,class, -1015,_Continue,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,29,class, -1016,_Block,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,40,class,"Tracks information about lexical blocks as they are visited in the AST. +616,MockConvertedCall,tensorflow/tensorflow/python/autograph/converters/call_trees_test.py,30,class, +617,ConditionalExpressionTransformer,tensorflow/tensorflow/python/autograph/converters/conditional_expressions.py,28,class,Converts conditional expressions to functional form. +618,visit_IfExp,tensorflow/tensorflow/python/autograph/converters/conditional_expressions.py,31,method, +619,transform,tensorflow/tensorflow/python/autograph/converters/conditional_expressions.py,48,function, +620,ContinueCanonicalizationTransformer,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,60,class,Canonicalizes continue statements into additional conditionals. +621,visit_Continue,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,63,method, +622,visit_While,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,125,method, +623,visit_For,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,132,method, +624,visit_If,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,140,method, +625,visit_With,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,145,method, +626,visit_Try,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,150,method, +627,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,158,method, +628,transform,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,163,function, +629,ControlFlowTransformer,tensorflow/tensorflow/python/autograph/converters/control_flow.py,46,class,Transforms control flow structures like loops an conditionals. +630,visit_Lambda,tensorflow/tensorflow/python/autograph/converters/control_flow.py,49,method, +631,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/control_flow.py,54,method, +632,visit_If,tensorflow/tensorflow/python/autograph/converters/control_flow.py,206,method, +633,visit_While,tensorflow/tensorflow/python/autograph/converters/control_flow.py,261,method, +634,visit_For,tensorflow/tensorflow/python/autograph/converters/control_flow.py,309,method, +635,AnnotatedDef,tensorflow/tensorflow/python/autograph/converters/control_flow.py,395,class, +636,transform,tensorflow/tensorflow/python/autograph/converters/control_flow.py,402,function, +637,ControlFlowTransformer,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,44,class,Transforms control flow structures like loops an conditionals. +638,visit_If,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,200,method, +639,visit_While,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,400,method, +640,visit_For,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,490,method, +641,AnnotatedDef,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,623,class, +642,transform,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,630,function, +643,DirectivesTransformer,tensorflow/tensorflow/python/autograph/converters/directives.py,90,class,Parses compiler directives and converts them into AST annotations. +644,visit_Name,tensorflow/tensorflow/python/autograph/converters/directives.py,117,method, +645,visit_Attribute,tensorflow/tensorflow/python/autograph/converters/directives.py,126,method, +646,visit_Assign,tensorflow/tensorflow/python/autograph/converters/directives.py,134,method, +647,visit_AugAssign,tensorflow/tensorflow/python/autograph/converters/directives.py,138,method, +648,visit_Expr,tensorflow/tensorflow/python/autograph/converters/directives.py,142,method, +649,visit_While,tensorflow/tensorflow/python/autograph/converters/directives.py,173,method, +650,visit_For,tensorflow/tensorflow/python/autograph/converters/directives.py,176,method, +651,transform,tensorflow/tensorflow/python/autograph/converters/directives.py,180,function, +652,FunctionTransformer,tensorflow/tensorflow/python/autograph/converters/functions.py,38,class,Wraps function bodies around autograph-specific boilerplate. +653,visit_Lambda,tensorflow/tensorflow/python/autograph/converters/functions.py,53,method, +654,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/functions.py,81,method, +655,transform,tensorflow/tensorflow/python/autograph/converters/functions.py,134,function, +656,FunctionTransformer,tensorflow/tensorflow/python/autograph/converters/functions_test.py,31,class, +657,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,35,method,Docstring. +658,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,49,method,"First sentence. -Mainly, this object tracks the creation of block guards that replace -`continue` statements (e.g. `if not continue_:`). +Second sentence. -Attributes: - create_guard_current: bool, whether to create a guard for the current - statement. - create_guard_next: bool, whether to create a guard for the next - statement. - is_loop_type: bool, whether this block is the body of a loop." -1017,ContinueCanonicalizationTransformer,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,60,class,Canonicalizes continue statements into additional conditionals. -1018,transform,tensorflow/tensorflow/python/autograph/converters/continue_statements.py,163,function, -1019,ContinueCanonicalizationTest,tensorflow/tensorflow/python/autograph/converters/continue_statements_test.py,27,class, -1020,_Function,tensorflow/tensorflow/python/autograph/converters/control_flow.py,41,class, -1021,ControlFlowTransformer,tensorflow/tensorflow/python/autograph/converters/control_flow.py,46,class,Transforms control flow structures like loops an conditionals. -1022,AnnotatedDef,tensorflow/tensorflow/python/autograph/converters/control_flow.py,395,class, -1023,transform,tensorflow/tensorflow/python/autograph/converters/control_flow.py,402,function, -1024,ControlFlowTransformer,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,44,class,Transforms control flow structures like loops an conditionals. -1025,AnnotatedDef,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,623,class, -1026,transform,tensorflow/tensorflow/python/autograph/converters/control_flow_deprecated_py2.py,630,function, -1027,ControlFlowTestBase,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,43,class, -1028,NestedControlFlowTest,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,59,class, -1029,WhileStatementTest,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,106,class, -1030,IfStatementTest,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,352,class, -1031,ForStatementTest,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,598,class, -1032,AdvancedControlFlowTest,tensorflow/tensorflow/python/autograph/converters/control_flow_test.py,688,class, -1033,_LoopScope,tensorflow/tensorflow/python/autograph/converters/directives.py,48,class, -1034,_map_args,tensorflow/tensorflow/python/autograph/converters/directives.py,55,function,"Maps AST call nodes to the actual function's arguments. - -Args: - call_node: ast.Call - function: Callable[..., Any], the actual function matching call_node Returns: - Dict[Text, ast.AST], mapping each of the function's argument names to - the respective AST node. -Raises: - ValueError: if the default arguments are not correctly set" -1035,DirectivesTransformer,tensorflow/tensorflow/python/autograph/converters/directives.py,90,class,Parses compiler directives and converts them into AST annotations. -1036,transform,tensorflow/tensorflow/python/autograph/converters/directives.py,180,function, -1037,DirectivesTest,tensorflow/tensorflow/python/autograph/converters/directives_test.py,28,class, -1038,_Function,tensorflow/tensorflow/python/autograph/converters/functions.py,32,class, -1039,FunctionTransformer,tensorflow/tensorflow/python/autograph/converters/functions.py,38,class,Wraps function bodies around autograph-specific boilerplate. -1040,transform,tensorflow/tensorflow/python/autograph/converters/functions.py,134,function, -1041,FunctionTransformer,tensorflow/tensorflow/python/autograph/converters/functions_test.py,31,class, -1042,ListCompTransformer,tensorflow/tensorflow/python/autograph/converters/list_comprehensions.py,42,class,Lowers list comprehensions into standard control flow. -1043,transform,tensorflow/tensorflow/python/autograph/converters/list_comprehensions.py,81,function, -1044,ListCompTest,tensorflow/tensorflow/python/autograph/converters/list_comprehensions_test.py,26,class, -1045,_Statement,tensorflow/tensorflow/python/autograph/converters/lists.py,45,class, -1046,ListTransformer,tensorflow/tensorflow/python/autograph/converters/lists.py,51,class,Converts lists and related operations to their TF counterpart. -1047,transform,tensorflow/tensorflow/python/autograph/converters/lists.py,239,function, -1048,ListTest,tensorflow/tensorflow/python/autograph/converters/lists_test.py,33,class, -1049,LogicalExpressionTransformer,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,49,class,Converts logical expressions to corresponding TF calls. -1050,transform,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,135,function, -1051,LogicalExpressionTest,tensorflow/tensorflow/python/autograph/converters/logical_expressions_test.py,28,class, -1052,_RewriteBlock,tensorflow/tensorflow/python/autograph/converters/return_statements.py,37,class, -1053,ConditionalReturnRewriter,tensorflow/tensorflow/python/autograph/converters/return_statements.py,43,class,"Rewrites a a pattern where it's unobvious that all paths return a value. + Something." +659,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,68,method, +660,inner_fn_callee,tensorflow/tensorflow/python/autograph/converters/functions_test.py,85,method, +661,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,89,method, +662,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,121,method, +663,inner_fn,tensorflow/tensorflow/python/autograph/converters/functions_test.py,70,method, +664,inner_fn,tensorflow/tensorflow/python/autograph/converters/functions_test.py,90,method, +665,f,tensorflow/tensorflow/python/autograph/converters/functions_test.py,104,method, +666,inner_fn,tensorflow/tensorflow/python/autograph/converters/functions_test.py,106,method, +667,ListCompTransformer,tensorflow/tensorflow/python/autograph/converters/list_comprehensions.py,42,class,Lowers list comprehensions into standard control flow. +668,visit_Assign,tensorflow/tensorflow/python/autograph/converters/list_comprehensions.py,45,method, +669,transform,tensorflow/tensorflow/python/autograph/converters/list_comprehensions.py,81,function, +670,ListTransformer,tensorflow/tensorflow/python/autograph/converters/lists.py,51,class,Converts lists and related operations to their TF counterpart. +671,visit_List,tensorflow/tensorflow/python/autograph/converters/lists.py,54,method, +672,visit_Call,tensorflow/tensorflow/python/autograph/converters/lists.py,131,method, +673,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/lists.py,209,method, +674,visit_For,tensorflow/tensorflow/python/autograph/converters/lists.py,215,method, +675,visit_While,tensorflow/tensorflow/python/autograph/converters/lists.py,221,method, +676,visit_If,tensorflow/tensorflow/python/autograph/converters/lists.py,227,method, +677,visit_With,tensorflow/tensorflow/python/autograph/converters/lists.py,233,method, +678,transform,tensorflow/tensorflow/python/autograph/converters/lists.py,239,function, +679,LogicalExpressionTransformer,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,49,class,Converts logical expressions to corresponding TF calls. +680,visit_Compare,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,83,method, +681,visit_UnaryOp,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,114,method, +682,visit_BoolOp,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,123,method, +683,transform,tensorflow/tensorflow/python/autograph/converters/logical_expressions.py,135,function, +684,ConditionalReturnRewriter,tensorflow/tensorflow/python/autograph/converters/return_statements.py,43,class,"Rewrites a a pattern where it's unobvious that all paths return a value. This rewrite allows avoiding intermediate None return values. @@ -3987,9 +3690,15 @@ is converted to: and vice-versa (if the else returns, subsequent statements are moved under the if branch)." -1054,_Block,tensorflow/tensorflow/python/autograph/converters/return_statements.py,159,class, -1055,_Function,tensorflow/tensorflow/python/autograph/converters/return_statements.py,172,class, -1056,ReturnStatementsTransformer,tensorflow/tensorflow/python/autograph/converters/return_statements.py,183,class,"Lowers return statements into variables and conditionals. +685,visit_Return,tensorflow/tensorflow/python/autograph/converters/return_statements.py,70,method, +686,visit_While,tensorflow/tensorflow/python/autograph/converters/return_statements.py,100,method, +687,visit_For,tensorflow/tensorflow/python/autograph/converters/return_statements.py,106,method, +688,visit_With,tensorflow/tensorflow/python/autograph/converters/return_statements.py,113,method, +689,visit_Try,tensorflow/tensorflow/python/autograph/converters/return_statements.py,120,method, +690,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/converters/return_statements.py,130,method, +691,visit_If,tensorflow/tensorflow/python/autograph/converters/return_statements.py,135,method, +692,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/return_statements.py,153,method, +693,ReturnStatementsTransformer,tensorflow/tensorflow/python/autograph/converters/return_statements.py,183,class,"Lowers return statements into variables and conditionals. Specifically, the following pattern: @@ -4026,16 +3735,24 @@ is converted to: do_return = True retval = val" -1057,transform,tensorflow/tensorflow/python/autograph/converters/return_statements.py,392,function,"Ensure a function has only a single return, at the end." -1058,SingleReturnTest,tensorflow/tensorflow/python/autograph/converters/return_statements_test.py,28,class, -1059,SliceTransformer,tensorflow/tensorflow/python/autograph/converters/slices.py,28,class,"Converts slicing operations to their TF counterpart. +694,visit_Return,tensorflow/tensorflow/python/autograph/converters/return_statements.py,227,method, +695,visit_While,tensorflow/tensorflow/python/autograph/converters/return_statements.py,283,method, +696,visit_For,tensorflow/tensorflow/python/autograph/converters/return_statements.py,297,method, +697,visit_With,tensorflow/tensorflow/python/autograph/converters/return_statements.py,319,method, +698,visit_Try,tensorflow/tensorflow/python/autograph/converters/return_statements.py,324,method, +699,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/converters/return_statements.py,331,method, +700,visit_If,tensorflow/tensorflow/python/autograph/converters/return_statements.py,335,method, +701,visit_FunctionDef,tensorflow/tensorflow/python/autograph/converters/return_statements.py,341,method, +702,transform,tensorflow/tensorflow/python/autograph/converters/return_statements.py,392,function,"Ensure a function has only a single return, at the end." +703,SliceTransformer,tensorflow/tensorflow/python/autograph/converters/slices.py,28,class,"Converts slicing operations to their TF counterpart. Currently, relying on the default slice operator that Tensor uses is insufficient, because TensorArray and tensor lists use dedicated index read and write functions." -1060,transform,tensorflow/tensorflow/python/autograph/converters/slices.py,84,function, -1061,SliceTest,tensorflow/tensorflow/python/autograph/converters/slices_test.py,31,class, -1062,VariableAccessTransformer,tensorflow/tensorflow/python/autograph/converters/variables.py,28,class,"Rewrites basic symbol reads. +704,visit_Assign,tensorflow/tensorflow/python/autograph/converters/slices.py,48,method, +705,visit_Subscript,tensorflow/tensorflow/python/autograph/converters/slices.py,58,method, +706,transform,tensorflow/tensorflow/python/autograph/converters/slices.py,84,function, +707,VariableAccessTransformer,tensorflow/tensorflow/python/autograph/converters/variables.py,28,class,"Rewrites basic symbol reads. This transformer rewrites variable reads with a ""read"" operator which allows tracking activity. @@ -4059,19 +3776,22 @@ read: a = ld(a) a += ld(b)" -1063,transform,tensorflow/tensorflow/python/autograph/converters/variables.py,100,function, -1064,VariablesTest,tensorflow/tensorflow/python/autograph/converters/variables_test.py,26,class, -1065,_control_ctx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,29,function, -1066,control_status_ctx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,35,function, -1067,Status,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,40,class, -1068,ControlStatusCtx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,46,class,A context that tracks whether autograph is enabled by the user. -1069,NullCtx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,66,class,Helper substitute for contextlib.nullcontext. -1070,_default_control_status_ctx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,76,function, -1071,Rule,tensorflow/tensorflow/python/autograph/core/config_lib.py,27,class,Base class for conversion rules. -1072,Action,tensorflow/tensorflow/python/autograph/core/config_lib.py,38,class, -1073,DoNotConvert,tensorflow/tensorflow/python/autograph/core/config_lib.py,44,class,Indicates that this module should be not converted. -1074,Convert,tensorflow/tensorflow/python/autograph/core/config_lib.py,56,class,Indicates that this module should be converted. -1075,Feature,tensorflow/tensorflow/python/autograph/core/converter.py,83,class,"This enumeration represents optional conversion options. +708,visit_Name,tensorflow/tensorflow/python/autograph/converters/variables.py,55,method, +709,visit_Delete,tensorflow/tensorflow/python/autograph/converters/variables.py,63,method, +710,visit_AugAssign,tensorflow/tensorflow/python/autograph/converters/variables.py,88,method, +711,transform,tensorflow/tensorflow/python/autograph/converters/variables.py,100,function, +712,control_status_ctx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,35,function, +713,Status,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,40,class, +714,ControlStatusCtx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,46,class,A context that tracks whether autograph is enabled by the user. +715,NullCtx,tensorflow/tensorflow/python/autograph/core/ag_ctx.py,66,class,Helper substitute for contextlib.nullcontext. +716,Rule,tensorflow/tensorflow/python/autograph/core/config_lib.py,27,class,Base class for conversion rules. +717,matches,tensorflow/tensorflow/python/autograph/core/config_lib.py,33,method, +718,Action,tensorflow/tensorflow/python/autograph/core/config_lib.py,38,class, +719,DoNotConvert,tensorflow/tensorflow/python/autograph/core/config_lib.py,44,class,Indicates that this module should be not converted. +720,get_action,tensorflow/tensorflow/python/autograph/core/config_lib.py,50,method, +721,Convert,tensorflow/tensorflow/python/autograph/core/config_lib.py,56,class,Indicates that this module should be converted. +722,get_action,tensorflow/tensorflow/python/autograph/core/config_lib.py,62,method, +723,Feature,tensorflow/tensorflow/python/autograph/core/converter.py,83,class,"This enumeration represents optional conversion options. These conversion options are experimental. They are subject to change without notice and offer no guarantees. @@ -4098,7 +3818,9 @@ Attributes: LISTS: Convert list idioms, like initializers, slices, append, etc. NAME_SCOPES: Insert name scopes that name ops according to context, like the function they were defined in." -1076,ConversionOptions,tensorflow/tensorflow/python/autograph/core/converter.py,138,class,"Immutable container for global conversion flags. +724,all,tensorflow/tensorflow/python/autograph/core/converter.py,123,method,Returns a tuple that enables all options. +725,all_but,tensorflow/tensorflow/python/autograph/core/converter.py,128,method,Returns a tuple that enables all but the excluded options. +726,ConversionOptions,tensorflow/tensorflow/python/autograph/core/converter.py,138,class,"Immutable container for global conversion flags. Attributes: recursive: bool, whether to recursively convert any user functions or @@ -4109,23 +3831,50 @@ Attributes: optional_features: Union[Feature, Set[Feature]], controls the use of optional features in the conversion process. See Feature for available options." -1077,ProgramContext,tensorflow/tensorflow/python/autograph/core/converter.py,236,class,"ProgramContext keeps track of converting function hierarchies. +727,as_tuple,tensorflow/tensorflow/python/autograph/core/converter.py,169,method, +728,uses,tensorflow/tensorflow/python/autograph/core/converter.py,183,method, +729,call_options,tensorflow/tensorflow/python/autograph/core/converter.py,187,method,Returns the corresponding options to be used for recursive conversion. +730,to_ast,tensorflow/tensorflow/python/autograph/core/converter.py,195,method,"Returns a representation of this object as an AST node. + +The AST node encodes a constructor that would create an object with the +same contents. + +Returns: + ast.Node" +731,list_of_features,tensorflow/tensorflow/python/autograph/core/converter.py,215,method, +732,ProgramContext,tensorflow/tensorflow/python/autograph/core/converter.py,236,class,"ProgramContext keeps track of converting function hierarchies. Attributes: options: ConversionOptions autograph_module: Deprecated. Do not use." -1078,Base,tensorflow/tensorflow/python/autograph/core/converter.py,249,class,"All converters should inherit from this class. +733,Base,tensorflow/tensorflow/python/autograph/core/converter.py,249,class,"All converters should inherit from this class. Attributes: ctx: EntityContext" -1079,TestConverter,tensorflow/tensorflow/python/autograph/core/converter_test.py,32,class, -1080,ConversionOptionsTest,tensorflow/tensorflow/python/autograph/core/converter_test.py,36,class, -1081,ConverterBaseTest,tensorflow/tensorflow/python/autograph/core/converter_test.py,64,class, -1082,allowlist,tensorflow/tensorflow/python/autograph/core/converter_testing.py,35,function,Helper that marks a callable as whtelitisted. -1083,is_inside_generated_code,tensorflow/tensorflow/python/autograph/core/converter_testing.py,47,function,Tests whether the caller is generated code. Implementation-specific. -1084,TestingTranspiler,tensorflow/tensorflow/python/autograph/core/converter_testing.py,66,class,Testing version that only applies given transformations. -1085,TestCase,tensorflow/tensorflow/python/autograph/core/converter_testing.py,98,class,Base class for unit tests in this module. Contains relevant utilities. -1086,FunctionScope,tensorflow/tensorflow/python/autograph/core/function_wrappers.py,33,class,"Context manager that wraps the body of a converted function. +734,get_definition_directive,tensorflow/tensorflow/python/autograph/core/converter.py,262,method,"Returns the unique directive argument for a symbol. + +See lang/directives.py for details on directives. + +Example: + # Given a directive in the code: + ag.foo_directive(bar, baz=1) + + # One can write for an AST node Name(id='bar'): + get_definition_directive(node, ag.foo_directive, 'baz') + +Args: + node: ast.AST, the node representing the symbol for which the directive + argument is needed. + directive: Callable[..., Any], the directive to search. + arg: str, the directive argument to return. + default: Any + +Raises: + ValueError: if conflicting annotations have been found" +735,visit,tensorflow/tensorflow/python/autograph/core/converter.py,311,method, +736,allowlist,tensorflow/tensorflow/python/autograph/core/converter_testing.py,35,function,Helper that marks a callable as whtelitisted. +737,is_inside_generated_code,tensorflow/tensorflow/python/autograph/core/converter_testing.py,47,function,Tests whether the caller is generated code. Implementation-specific. +738,FunctionScope,tensorflow/tensorflow/python/autograph/core/function_wrappers.py,33,class,"Context manager that wraps the body of a converted function. This context manager handles various operations related to the scope of a function: @@ -4136,24 +3885,32 @@ function: optionally enabled when using `tf.autograph.to_graph`; * tracking of autograph conversion state (whether it's enabled by the user, conversion options;" -1087,with_function_scope,tensorflow/tensorflow/python/autograph/core/function_wrappers.py,114,function,Inline version of the FunctionScope context manager. -1088,FunctionWrappersTest,tensorflow/tensorflow/python/autograph/core/function_wrappers_test.py,29,class, -1089,UnsupportedFeaturesChecker,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,26,class,"Quick check for Python features we know we don't support. +739,ret,tensorflow/tensorflow/python/autograph/core/function_wrappers.py,91,method,Marks a value as returned from the function guarded by the scope. +740,with_function_scope,tensorflow/tensorflow/python/autograph/core/function_wrappers.py,114,function,Inline version of the FunctionScope context manager. +741,UnsupportedFeaturesChecker,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,26,class,"Quick check for Python features we know we don't support. Any features detected will cause AutoGraph to not compile a function." -1090,verify,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,60,function, -1091,is_autograph_strict_conversion_mode,tensorflow/tensorflow/python/autograph/impl/api.py,72,function, -1092,AutoGraphError,tensorflow/tensorflow/python/autograph/impl/api.py,82,class,Base class for all AutoGraph exceptions. -1093,ConversionError,tensorflow/tensorflow/python/autograph/impl/api.py,87,class,Raised during the conversion process. -1094,StagingError,tensorflow/tensorflow/python/autograph/impl/api.py,92,class,Raised during the staging (i.e. Python execution) of converted code. -1095,_ErrorMetadata,tensorflow/tensorflow/python/autograph/impl/api.py,97,class,AutoGraph-specific error metadata. See base class. -1096,_attach_error_metadata,tensorflow/tensorflow/python/autograph/impl/api.py,146,function,Augments an error with the metadata necessary for rewrite. -1097,StackTraceMapper,tensorflow/tensorflow/python/autograph/impl/api.py,166,class,Remaps generated code to code it originated from. -1098,PyToTF,tensorflow/tensorflow/python/autograph/impl/api.py,203,class,The TensorFlow AutoGraph transformer. -1099,_convert_actual,tensorflow/tensorflow/python/autograph/impl/api.py,275,function,Applies AutoGraph to entity. -1100,autograph_artifact,tensorflow/tensorflow/python/autograph/impl/api.py,298,function, -1101,is_autograph_artifact,tensorflow/tensorflow/python/autograph/impl/api.py,303,function, -1102,converted_call,tensorflow/tensorflow/python/autograph/impl/api.py,307,function,"Converts a function call inline. +742,visit_Attribute,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,32,method, +743,visit_For,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,39,method, +744,visit_While,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,45,method, +745,visit_Yield,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,53,method, +746,visit_YieldFrom,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,56,method, +747,verify,tensorflow/tensorflow/python/autograph/core/unsupported_features_checker.py,60,function, +748,is_autograph_strict_conversion_mode,tensorflow/tensorflow/python/autograph/impl/api.py,72,function, +749,AutoGraphError,tensorflow/tensorflow/python/autograph/impl/api.py,82,class,Base class for all AutoGraph exceptions. +750,ConversionError,tensorflow/tensorflow/python/autograph/impl/api.py,87,class,Raised during the conversion process. +751,StagingError,tensorflow/tensorflow/python/autograph/impl/api.py,92,class,Raised during the staging (i.e. Python execution) of converted code. +752,StackTraceMapper,tensorflow/tensorflow/python/autograph/impl/api.py,166,class,Remaps generated code to code it originated from. +753,get_effective_source_map,tensorflow/tensorflow/python/autograph/impl/api.py,172,method, +754,PyToTF,tensorflow/tensorflow/python/autograph/impl/api.py,203,class,The TensorFlow AutoGraph transformer. +755,get_transformed_name,tensorflow/tensorflow/python/autograph/impl/api.py,228,method, +756,get_extra_locals,tensorflow/tensorflow/python/autograph/impl/api.py,231,method, +757,get_caching_key,tensorflow/tensorflow/python/autograph/impl/api.py,234,method, +758,initial_analysis,tensorflow/tensorflow/python/autograph/impl/api.py,237,method, +759,transform_ast,tensorflow/tensorflow/python/autograph/impl/api.py,250,method, +760,autograph_artifact,tensorflow/tensorflow/python/autograph/impl/api.py,298,function, +761,is_autograph_artifact,tensorflow/tensorflow/python/autograph/impl/api.py,303,function, +762,converted_call,tensorflow/tensorflow/python/autograph/impl/api.py,307,function,"Converts a function call inline. For internal use only. @@ -4177,9 +3934,7 @@ Args: Returns: Any, the result of executing a possibly-converted `f` with the given arguments." -1103,_call_unconverted,tensorflow/tensorflow/python/autograph/impl/api.py,466,function,Calls the original function without converting with AutoGraph. -1104,_fall_back_unconverted,tensorflow/tensorflow/python/autograph/impl/api.py,479,function,"Falls back to calling the function unconverted, in case of error." -1105,tf_convert,tensorflow/tensorflow/python/autograph/impl/api.py,506,function,"Decorator that applies AutoGraph to a function. +763,tf_convert,tensorflow/tensorflow/python/autograph/impl/api.py,506,function,"Decorator that applies AutoGraph to a function. Use in internal APIs. @@ -4200,9 +3955,8 @@ Args: Returns: Either `f or the converted version of `f`." -1106,call_with_unspecified_conversion_status,tensorflow/tensorflow/python/autograph/impl/api.py,565,function,Decorator that resets the conversion context to the unspecified status. -1107,_log_callargs,tensorflow/tensorflow/python/autograph/impl/api.py,577,function,Logging helper. -1108,do_not_convert,tensorflow/tensorflow/python/autograph/impl/api.py,599,function,"Decorator that suppresses the conversion of a function. +764,call_with_unspecified_conversion_status,tensorflow/tensorflow/python/autograph/impl/api.py,565,function,Decorator that resets the conversion context to the unspecified status. +765,do_not_convert,tensorflow/tensorflow/python/autograph/impl/api.py,599,function,"Decorator that suppresses the conversion of a function. Args: func: function to decorate. @@ -4213,7 +3967,7 @@ Returns: If `func` is None, returns a decorator that, when invoked with a single `func` argument, returns a `Callable` equivalent to the above case." -1109,convert,tensorflow/tensorflow/python/autograph/impl/api.py,626,function,"Decorator that compiles a function to use TensorFlow ops. +766,convert,tensorflow/tensorflow/python/autograph/impl/api.py,626,function,"Decorator that compiles a function to use TensorFlow ops. The decorator is dynamic - it recompiles the target whenever the decorated function is called. This means the parameter values are known at conversion. @@ -4234,7 +3988,7 @@ Args: Returns: Callable, a decorator that converts the given function into an equivalent function that uses TensorFlow ops." -1110,to_graph,tensorflow/tensorflow/python/autograph/impl/api.py,682,function,"Converts a Python entity into a TensorFlow graph. +767,to_graph,tensorflow/tensorflow/python/autograph/impl/api.py,682,function,"Converts a Python entity into a TensorFlow graph. Also see: `tf.autograph.to_code`, `tf.function`. @@ -4290,7 +4044,7 @@ Returns: Raises: ValueError: If the entity could not be converted." -1111,to_graph_v1,tensorflow/tensorflow/python/autograph/impl/api.py,754,function,"Converts a Python entity into a TensorFlow graph. +768,to_graph_v1,tensorflow/tensorflow/python/autograph/impl/api.py,754,function,"Converts a Python entity into a TensorFlow graph. Also see: `tf.autograph.to_code`, `tf.function`. @@ -4346,7 +4100,7 @@ Returns: Raises: ValueError: If the entity could not be converted." -1112,to_code_v1,tensorflow/tensorflow/python/autograph/impl/api.py,825,function,"Returns the source code generated by AutoGraph, as a string. +769,to_code_v1,tensorflow/tensorflow/python/autograph/impl/api.py,825,function,"Returns the source code generated by AutoGraph, as a string. Example usage: @@ -4383,7 +4137,7 @@ Args: Returns: The converted code as string." -1113,to_code,tensorflow/tensorflow/python/autograph/impl/api.py,879,function,"Returns the source code generated by AutoGraph, as a string. +770,to_code,tensorflow/tensorflow/python/autograph/impl/api.py,879,function,"Returns the source code generated by AutoGraph, as a string. Example usage: @@ -4417,12 +4171,8 @@ Args: Returns: The converted code as string." -1114,TestResource,tensorflow/tensorflow/python/autograph/impl/api_test.py,64,class, -1115,ApiTest,tensorflow/tensorflow/python/autograph/impl/api_test.py,70,class, -1116,_is_of_known_loaded_module,tensorflow/tensorflow/python/autograph/impl/conversion.py,37,function, -1117,_is_known_loaded_type,tensorflow/tensorflow/python/autograph/impl/conversion.py,46,function,Tests whether the function or method is an instance of a known type. -1118,is_unsupported,tensorflow/tensorflow/python/autograph/impl/conversion.py,73,function,Checks whether an entity is supported by AutoGraph at all. -1119,is_allowlisted,tensorflow/tensorflow/python/autograph/impl/conversion.py,116,function,"Checks whether an entity is allowed for use in graph mode. +771,is_unsupported,tensorflow/tensorflow/python/autograph/impl/conversion.py,73,function,Checks whether an entity is supported by AutoGraph at all. +772,is_allowlisted,tensorflow/tensorflow/python/autograph/impl/conversion.py,116,function,"Checks whether an entity is allowed for use in graph mode. Examples of allowed entities include all members of the tensorflow package. @@ -4437,10 +4187,9 @@ Args: Returns: Boolean" -1120,is_in_allowlist_cache,tensorflow/tensorflow/python/autograph/impl/conversion.py,221,function, -1121,cache_allowlisted,tensorflow/tensorflow/python/autograph/impl/conversion.py,229,function, -1122,ConversionTest,tensorflow/tensorflow/python/autograph/impl/conversion_test.py,39,class, -1123,set_element_type,tensorflow/tensorflow/python/autograph/lang/directives.py,33,function,"Indicates that the entity is expected hold items of specified type/shape. +773,is_in_allowlist_cache,tensorflow/tensorflow/python/autograph/impl/conversion.py,221,function, +774,cache_allowlisted,tensorflow/tensorflow/python/autograph/impl/conversion.py,229,function, +775,set_element_type,tensorflow/tensorflow/python/autograph/lang/directives.py,33,function,"Indicates that the entity is expected hold items of specified type/shape. The staged TensorFlow ops will reflect and assert this data type. Ignored otherwise. @@ -4449,7 +4198,7 @@ Args: entity: The entity to annotate. dtype: TensorFlow dtype value to assert for entity. shape: Optional shape to assert for entity." -1124,set_loop_options,tensorflow/tensorflow/python/autograph/lang/directives.py,50,function,"Specifies additional arguments to be passed to the enclosing while_loop. +776,set_loop_options,tensorflow/tensorflow/python/autograph/lang/directives.py,50,function,"Specifies additional arguments to be passed to the enclosing while_loop. The parameters apply to and only to the immediately enclosing loop. It only has effect if the loop is staged as a TF while_loop; otherwise the parameters @@ -4488,9 +4237,8 @@ Args: shape_invariants: Allows controlling the argument with the same name passed to tf.while_loop. Unlike tf.while_loop, this is a list of `(tensor, shape)` pairs." -1125,_validate_list_constructor,tensorflow/tensorflow/python/autograph/lang/special_functions.py,31,function,Validates the inputs of tensor_list. -1126,match_staging_level,tensorflow/tensorflow/python/autograph/lang/special_functions.py,50,function,Casts a value to be staged at the same level as another. -1127,tensor_list,tensorflow/tensorflow/python/autograph/lang/special_functions.py,57,function,"Creates an tensor list and populates it with the given elements. +777,match_staging_level,tensorflow/tensorflow/python/autograph/lang/special_functions.py,50,function,Casts a value to be staged at the same level as another. +778,tensor_list,tensorflow/tensorflow/python/autograph/lang/special_functions.py,57,function,"Creates an tensor list and populates it with the given elements. This function provides a more uniform access to tensor lists and tensor arrays, and allows optional initialization. @@ -4511,7 +4259,7 @@ Returns: Union[tf.Tensor, tf.TensorArray], the new list. Raises: ValueError: for invalid arguments" -1128,stack,tensorflow/tensorflow/python/autograph/lang/special_functions.py,92,function,"Stacks the input, if it admits the notion of stacking. +779,stack,tensorflow/tensorflow/python/autograph/lang/special_functions.py,92,function,"Stacks the input, if it admits the notion of stacking. For example, a list of tensors can be stacked into a larger tensor. This function is similar to tf.stack, but it accepts non-lists and lists of @@ -4530,20 +4278,9 @@ Returns: Raises: ValueError: if strict=True and the input is not stackable." -1129,SpecialFunctionsTest,tensorflow/tensorflow/python/autograph/lang/special_functions_test.py,31,class, -1130,if_exp,tensorflow/tensorflow/python/autograph/operators/conditional_expressions.py,27,function, -1131,_tf_if_exp,tensorflow/tensorflow/python/autograph/operators/conditional_expressions.py,34,function,Overload of if_exp that stages a TF cond. -1132,_py_if_exp,tensorflow/tensorflow/python/autograph/operators/conditional_expressions.py,55,function, -1133,_basic_expr,tensorflow/tensorflow/python/autograph/operators/conditional_expressions_test.py,29,function, -1134,IfExpTest,tensorflow/tensorflow/python/autograph/operators/conditional_expressions_test.py,38,class, -1135,_verify_loop_init_vars,tensorflow/tensorflow/python/autograph/operators/control_flow.py,102,function,Ensures that all values in the state are defined when entering a loop. -1136,_is_subshape,tensorflow/tensorflow/python/autograph/operators/control_flow.py,117,function,Returns True if left shape is at least as specific as right shape. -1137,_verify_single_loop_var,tensorflow/tensorflow/python/autograph/operators/control_flow.py,134,function,"Verifies whether the initial, entry and exit values are consistent." -1138,_verify_tf_loop_vars,tensorflow/tensorflow/python/autograph/operators/control_flow.py,191,function,Verifies loop variables for consistency. -1139,verify_single_cond_var,tensorflow/tensorflow/python/autograph/operators/control_flow.py,233,function,Verifies whether body_var and orelse_var are consistent. -1140,_verify_tf_cond_branch_vars,tensorflow/tensorflow/python/autograph/operators/control_flow.py,263,function,Verifies variables output by a conditional branch for consistency. -1141,_verify_tf_cond_vars,tensorflow/tensorflow/python/autograph/operators/control_flow.py,276,function,Verifies variables manipulated by a conditional for consistency. -1142,for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,291,function,"Functional form of a for statement. +780,if_exp,tensorflow/tensorflow/python/autograph/operators/conditional_expressions.py,27,function, +781,verify_single_cond_var,tensorflow/tensorflow/python/autograph/operators/control_flow.py,233,function,Verifies whether body_var and orelse_var are consistent. +782,for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,291,function,"Functional form of a for statement. The loop operates on a state, which includes all symbols that are variant across loop iterations, excluding the variables local to the loop. @@ -4585,15 +4322,7 @@ Args: Returns: Tuple containing the final state." -1143,_py_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,371,function,Overload of for_stmt that executes a Python for loop. -1144,_known_len_tf_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,400,function,Overload of for_stmt that iterates over TF entities that admit a length. -1145,_tf_ragged_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,447,function,Overload of for_stmt that iterates over TF ragged tensors. -1146,_tf_range_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,494,function,Overload of for_stmt that iterates over a TF range (and elides it). -1147,_tf_iterator_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,555,function,Overload of for_stmt that iterates over TF Iterators. See for_loop. -1148,_general_purpose_scan,tensorflow/tensorflow/python/autograph/operators/control_flow.py,615,function,Variant of Dataset.scan with semantics of general-purpose computation. -1149,_tf_dataset_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,629,function,Overload of _dataset_for_stmt with early stopping. See for_stmt. -1150,_tf_distributed_iterable_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,700,function,Overload of for_stmt that iterates over TF distributed datasets. -1151,while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,727,function,"Functional form of a while statement. +783,while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,727,function,"Functional form of a while statement. The loop operates on a so-called state, which includes all symbols that are variant across loop iterations. In what follows we refer to state as either @@ -4618,11 +4347,7 @@ Args: Returns: Tuple containing the final state." -1152,_PythonLoopChecker,tensorflow/tensorflow/python/autograph/operators/control_flow.py,777,class,Verifies Python loops for TF-specific limits. -1153,_py_while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,851,function,Overload of while_stmt that executes a Python while loop. -1154,_shape_invariants_mapping_to_positional_list,tensorflow/tensorflow/python/autograph/operators/control_flow.py,872,function, -1155,_tf_while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,882,function,Overload of while_stmt that stages a TF while_stmt. -1156,if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,915,function,"Functional form of an if statement. +784,if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,915,function,"Functional form of an if statement. The conditional operates on a state, which includes all symbols whose values are a function of the branch taken. @@ -4663,15 +4388,7 @@ Args: not outputs will not be passed through staged control flow such as tf.cond. This includes variables that are defined before the conditional, but are not used after it." -1157,_tf_if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,965,function,Overload of if_stmt that stages a TF cond. -1158,_py_if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow.py,1011,function,Overload of if_stmt that executes a Python if statement. -1159,_disallow_undefs_into_loop,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,104,function,Ensures that all values in the state are defined when entering a loop. -1160,_is_subshape,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,120,function,Returns True if left shape is at least as specific as right shape. -1161,_verify_single_loop_var,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,137,function,"Verifies whether the initial, entry and exit values are consistent." -1162,_verify_tf_loop_vars,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,191,function,Verifies loop variables for consistency. -1163,_verify_single_cond_var,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,223,function,Verifies whether body_var and orelse_var are consistent. -1164,_verify_tf_cond_vars,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,248,function,Verifies variables manipulated by a conditional for consistency. -1165,for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,279,function,"Functional form of a for statement. +785,for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,279,function,"Functional form of a for statement. The loop operates on a state, which includes all symbols that are variant across loop iterations, excluding the iterate as well as the @@ -4710,17 +4427,7 @@ Args: Returns: Tuple containing the final state." -1166,_py_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,364,function,Overload of for_stmt that executes a Python for loop. -1167,_known_len_tf_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,383,function,Overload of for_stmt that iterates over TF entities that admit a length. -1168,_tf_ragged_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,446,function,Overload of for_stmt that iterates over TF ragged tensors. -1169,_tf_range_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,509,function,Overload of for_stmt that iterates over a TF range (and elides it). -1170,_tf_iterator_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,572,function,Overload of for_stmt that iterates over TF Iterators. See for_loop. -1171,_tf_dataset_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,636,function,Overload of for_stmt that iterates over TF Datasets. -1172,_general_purpose_scan,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,653,function,Variant of Dataset.scan with semantics of general-purpose computation. -1173,_dataset_for_stmt_with_extra_test,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,667,function,Overload of _dataset_for_stmt with early stopping. See for_stmt. -1174,_dataset_for_stmt_no_extra_test,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,725,function,Overload of _dataset_for_stmt without early stopping. See for_stmt. -1175,_tf_distributed_dataset_for_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,794,function,Overload of for..in statement that iterates over the input. -1176,while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,817,function,"Functional form of a while statement. +786,while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,817,function,"Functional form of a while statement. The loop operates on a so-called state, which includes all symbols that are variant across loop iterations. In what follows we refer to state as either @@ -4744,11 +4451,7 @@ Args: Returns: Tuple containing the final state." -1177,_shape_invariants_mapping_to_positional_list,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,873,function, -1178,_tf_while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,883,function,Overload of while_stmt that stages a TF while_stmt. -1179,_PythonLoopChecker,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,925,class,Verifies Python loops for TF-specific limits. -1180,_py_while_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,987,function,Overload of while_stmt that executes a Python while loop. -1181,if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1008,function,"Functional form of an if statement. +787,if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1008,function,"Functional form of an if statement. Args: cond: Boolean. @@ -4772,42 +4475,17 @@ Args: Returns: Tuple containing the statement outputs." -1182,tf_if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1048,function,Overload of if_stmt that stages a TF cond. -1183,_isolate_state,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1088,function,"Wraps func to (best-effort) isolate state mutations that func may do. - -The simplest example of state mutation is mutation of variables (via e.g. -attributes), or modification of globals. - -This allows us to more safely execute this function without worrying about -side effects when the function wasn't normally expected to execute. For -example, staging requires that the function is executed ahead of time, and -we need to ensure its effects are not observed during normal execution. - -Args: - func: () -> Any - get_state: () -> Any, returns the current state - set_state: (Any) -> None, resets the state to the specified values. - Typically the result of an earlier call to `get_state`. - -Returns: - Tuple[Any, Any], where the first element is the return value of `func`, - and the second is the final state values." -1184,_wrap_disallow_undefs_from_cond,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1121,function,Wraps conditional branch to disallow returning undefined symbols. -1185,_py_if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1152,function,Overload of if_stmt that executes a Python if statement. -1186,ForLoopTest,tensorflow/tensorflow/python/autograph/operators/control_flow_test.py,49,class, -1187,WhileLoopTest,tensorflow/tensorflow/python/autograph/operators/control_flow_test.py,540,class, -1188,IfStmtTest,tensorflow/tensorflow/python/autograph/operators/control_flow_test.py,775,class, -1189,new_list,tensorflow/tensorflow/python/autograph/operators/data_structures.py,36,function,"The list constructor. +788,tf_if_stmt,tensorflow/tensorflow/python/autograph/operators/control_flow_deprecated_py2.py,1048,function,Overload of if_stmt that stages a TF cond. +789,new_list,tensorflow/tensorflow/python/autograph/operators/data_structures.py,36,function,"The list constructor. Args: iterable: Optional elements to fill the list with. Returns: A list-like object. The exact return value depends on the initial elements." -1190,tf_tensor_array_new,tensorflow/tensorflow/python/autograph/operators/data_structures.py,57,function,Overload of new_list that stages a Tensor list creation. -1191,tf_tensor_list_new,tensorflow/tensorflow/python/autograph/operators/data_structures.py,107,function,Overload of new_list that stages a Tensor list creation. -1192,_py_list_new,tensorflow/tensorflow/python/autograph/operators/data_structures.py,166,function,Overload of new_list that creates a Python list. -1193,list_append,tensorflow/tensorflow/python/autograph/operators/data_structures.py,171,function,"The list append function. +790,tf_tensor_array_new,tensorflow/tensorflow/python/autograph/operators/data_structures.py,57,function,Overload of new_list that stages a Tensor list creation. +791,tf_tensor_list_new,tensorflow/tensorflow/python/autograph/operators/data_structures.py,107,function,Overload of new_list that stages a Tensor list creation. +792,list_append,tensorflow/tensorflow/python/autograph/operators/data_structures.py,171,function,"The list append function. Note: it is unspecified where list_ will be mutated or not. If list_ is a TensorFlow entity, it will not be typically mutated. If list_ is a plain @@ -4823,11 +4501,8 @@ Returns: Raises: ValueError: if list_ is not of a known list-like type." -1194,_tf_tensor_list_append,tensorflow/tensorflow/python/autograph/operators/data_structures.py,202,function,Overload of list_append that stages a Tensor list write. -1195,_tf_tensorarray_append,tensorflow/tensorflow/python/autograph/operators/data_structures.py,218,function,Overload of list_append that stages a TensorArray write. -1196,_py_list_append,tensorflow/tensorflow/python/autograph/operators/data_structures.py,223,function,Overload of list_append that executes a Python list append. -1197,ListPopOpts,tensorflow/tensorflow/python/autograph/operators/data_structures.py,230,class, -1198,list_pop,tensorflow/tensorflow/python/autograph/operators/data_structures.py,235,function,"The list pop function. +793,ListPopOpts,tensorflow/tensorflow/python/autograph/operators/data_structures.py,230,class, +794,list_pop,tensorflow/tensorflow/python/autograph/operators/data_structures.py,235,function,"The list pop function. Note: it is unspecified where list_ will be mutated or not. If list_ is a TensorFlow entity, it will not be typically mutated. If list_ is a plain @@ -4847,10 +4522,8 @@ Returns: Raises: ValueError: if list_ is not of a known list-like type or the operation is not supported for that type." -1199,_tf_tensor_list_pop,tensorflow/tensorflow/python/autograph/operators/data_structures.py,272,function,Overload of list_pop that stages a Tensor list pop. -1200,_py_list_pop,tensorflow/tensorflow/python/autograph/operators/data_structures.py,289,function,Overload of list_pop that executes a Python list append. -1201,ListStackOpts,tensorflow/tensorflow/python/autograph/operators/data_structures.py,299,class, -1202,list_stack,tensorflow/tensorflow/python/autograph/operators/data_structures.py,305,function,"The list stack function. +795,ListStackOpts,tensorflow/tensorflow/python/autograph/operators/data_structures.py,299,class, +796,list_stack,tensorflow/tensorflow/python/autograph/operators/data_structures.py,305,function,"The list stack function. This does not have a direct correspondent in Python. The closest idiom to this is tf.append or np.stack. It's different from those in the sense that it @@ -4864,16 +4537,13 @@ Args: Returns: The output of the stack operation, typically a Tensor." -1203,_tf_tensorarray_stack,tensorflow/tensorflow/python/autograph/operators/data_structures.py,335,function,Overload of list_stack that stages a TensorArray stack. -1204,_tf_tensor_list_stack,tensorflow/tensorflow/python/autograph/operators/data_structures.py,340,function,Overload of list_stack that stages a Tensor list write. -1205,_py_list_stack,tensorflow/tensorflow/python/autograph/operators/data_structures.py,348,function,Overload of list_stack that executes a Python list append. -1206,ListTest,tensorflow/tensorflow/python/autograph/operators/data_structures_test.py,31,class, -1207,DispatchContext,tensorflow/tensorflow/python/autograph/operators/dispatch_context.py,27,class,"Allows passing additional parameters to the specific implementations. +797,DispatchContext,tensorflow/tensorflow/python/autograph/operators/dispatch_context.py,27,class,"Allows passing additional parameters to the specific implementations. Attributes: options: Optional dict of extra arguments that may be required by specific implementations." -1208,assert_stmt,tensorflow/tensorflow/python/autograph/operators/exceptions.py,26,function,"Functional form of an assert statement. +798,option,tensorflow/tensorflow/python/autograph/operators/dispatch_context.py,37,method, +799,assert_stmt,tensorflow/tensorflow/python/autograph/operators/exceptions.py,26,function,"Functional form of an assert statement. This follows the semantics of the Python assert statement, however the concrete implementations may deviate from it. See the respective @@ -4895,41 +4565,16 @@ Returns: Raises: ValueError: if any arguments are illegal." -1209,_tf_assert_stmt,tensorflow/tensorflow/python/autograph/operators/exceptions.py,62,function,"Overload of assert_stmt that stages a TF Assert. - -This implementation deviates from Python semantics as follows: - (1) the assertion is verified regardless of the state of __debug__ - (2) on assertion failure, the graph execution will fail with - tensorflow.errors.ValueError, rather than AssertionError. - -Args: - expression1: tensorflow.Tensor, must evaluate to a tf.bool scalar - expression2: Callable[[], Union[tensorflow.Tensor, List[tensorflow.Tensor]]] - -Returns: - tensorflow.Operation" -1210,_py_assert_stmt,tensorflow/tensorflow/python/autograph/operators/exceptions.py,83,function,Overload of assert_stmt that executes a Python assert statement. -1211,ExceptionsTest,tensorflow/tensorflow/python/autograph/operators/exceptions_test.py,28,class, -1212,not_,tensorflow/tensorflow/python/autograph/operators/logical.py,26,function,"Functional form of ""not""." -1213,_tf_not,tensorflow/tensorflow/python/autograph/operators/logical.py,33,function,"Implementation of the ""not_"" operator for TensorFlow." -1214,_py_not,tensorflow/tensorflow/python/autograph/operators/logical.py,38,function,"Default Python implementation of the ""not_"" operator." -1215,and_,tensorflow/tensorflow/python/autograph/operators/logical.py,43,function,"Functional form of ""and"". Uses lazy evaluation semantics." -1216,_tf_lazy_and,tensorflow/tensorflow/python/autograph/operators/logical.py,51,function,"Lazy-eval equivalent of ""and"" for Tensors." -1217,_py_lazy_and,tensorflow/tensorflow/python/autograph/operators/logical.py,57,function,"Lazy-eval equivalent of ""and"" in Python." -1218,or_,tensorflow/tensorflow/python/autograph/operators/logical.py,62,function,"Functional form of ""or"". Uses lazy evaluation semantics." -1219,_tf_lazy_or,tensorflow/tensorflow/python/autograph/operators/logical.py,70,function,"Lazy-eval equivalent of ""or"" for Tensors." -1220,_py_lazy_or,tensorflow/tensorflow/python/autograph/operators/logical.py,76,function,"Lazy-eval equivalent of ""or"" in Python." -1221,eq,tensorflow/tensorflow/python/autograph/operators/logical.py,81,function,"Functional form of ""equal""." -1222,_tf_equal,tensorflow/tensorflow/python/autograph/operators/logical.py,88,function,"Overload of ""equal"" for Tensors." -1223,_py_equal,tensorflow/tensorflow/python/autograph/operators/logical.py,93,function,"Overload of ""equal"" that falls back to Python's default implementation." -1224,not_eq,tensorflow/tensorflow/python/autograph/operators/logical.py,98,function,"Functional form of ""not-equal""." -1225,LogicalOperatorsTest,tensorflow/tensorflow/python/autograph/operators/logical_test.py,27,class, -1226,overload_of,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,65,function, -1227,_find_originating_frame,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,71,function,Locates the frame in which `caller_fn_scope` was defined. -1228,locals_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,92,function,Executes the locals function in the context of a specified function. -1229,globals_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,97,function,Executes the locals function in the context of a specified function. -1230,eval_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,102,function,Executes the eval function in the context of a specified function. -1231,super_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,117,function,"Executes the super function in the context of a specified function. +800,not_,tensorflow/tensorflow/python/autograph/operators/logical.py,26,function,"Functional form of ""not""." +801,and_,tensorflow/tensorflow/python/autograph/operators/logical.py,43,function,"Functional form of ""and"". Uses lazy evaluation semantics." +802,or_,tensorflow/tensorflow/python/autograph/operators/logical.py,62,function,"Functional form of ""or"". Uses lazy evaluation semantics." +803,eq,tensorflow/tensorflow/python/autograph/operators/logical.py,81,function,"Functional form of ""equal""." +804,not_eq,tensorflow/tensorflow/python/autograph/operators/logical.py,98,function,"Functional form of ""not-equal""." +805,overload_of,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,65,function, +806,locals_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,92,function,Executes the locals function in the context of a specified function. +807,globals_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,97,function,Executes the locals function in the context of a specified function. +808,eval_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,102,function,Executes the eval function in the context of a specified function. +809,super_in_original_context,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,117,function,"Executes the super function in the context of a specified function. See https://docs.python.org/3/library/functions.html#super for the exact details @@ -4943,86 +4588,24 @@ Args: Returns: The result of calling `f` as if it was called in the frame indicated by `caller_fn_scope`." -1232,abs_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,179,function, -1233,_tf_abs,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,187,function, -1234,_tf_dataset_abs,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,191,function, -1235,_py_abs,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,198,function, -1236,float_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,202,function, -1237,_tf_float,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,208,function, -1238,_py_float,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,215,function, -1239,int_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,219,function, -1240,_tf_int,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,225,function, -1241,_py_int,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,235,function, -1242,len_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,241,function, -1243,_tf_tensor_array_len,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,253,function, -1244,_tf_tensor_list_len,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,257,function, -1245,_tf_tensor_len,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,261,function,Overload of len_ for Tensor arguments. -1246,_tf_dataset_len,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,294,function, -1247,_py_len,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,314,function, -1248,print_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,318,function,Overload of the print builtin. -1249,_py_print,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,334,function, -1250,_tf_py_func_print,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,338,function,Overload of print_ as a py_func implementation. -1251,range_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,360,function, -1252,_tf_range,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,366,function,Overload of range_ that generates a TF range tensor. -1253,_py_range,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,383,function, -1254,enumerate_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,391,function, -1255,_tf_dataset_enumerate,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,401,function, -1256,_py_enumerate,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,405,function, -1257,zip_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,409,function, -1258,_tf_dataset_zip,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,415,function, -1259,_py_zip,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,419,function, -1260,map_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,423,function, -1261,_tf_dataset_map,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,429,function, -1262,_py_map,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,433,function, -1263,next_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,437,function, -1264,_verify_spec_compatible,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,444,function,"Verifies that a symbol has a type compatible vith a given spec. - -Here, compatibility is viewed in the general TensorFlow sense: that the dtypes -are the same after implicit conversion, if both are tensors. - -This verifier ensures consistent treatment of types across AutoGraph. - -Args: - input_name: A name to use for `input_` in error messages. - spec_name: A name to use for `spec` in error messages. - input_: Any, value to verify. - spec: TypeSpec that `input_` must be compatible with. - -Raises: - ValueError if the two types have been determined not to be compatible." -1265,_verify_structure_compatible,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,480,function,"Verifies that possibly-structured symbol has types compatible vith another. - -See _verify_spec_compatible for a more concrete meaning of ""compatible"". -Unspec _verify_spec_compatible, which handles singular Tensor-spec objects, -verify_structures_compatible can process structures recognized by tf.nest. - -Args: - input_name: A name to use for `input_` in error messages. - spec_name: A name to use for `spec` in error messages. - input_: Any, value to verify. May, but doesn't need to, be a structure. - spec: Any, value that `input_` must be compatible with. May, but doesn't - need to, be a structure. - -Raises: - ValueError if the two types have been determined not to be compatible." -1266,next_tf_iterator,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,509,function, -1267,next_py,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,521,function, -1268,filter_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,527,function, -1269,_tf_dataset_filter,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,533,function, -1270,_py_filter,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,537,function, -1271,any_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,541,function, -1272,_tf_dataset_any,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,552,function, -1273,_py_any,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,566,function, -1274,all_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,570,function, -1275,_tf_dataset_all,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,578,function, -1276,_py_all,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,592,function, -1277,sorted_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,596,function, -1278,_tf_sorted,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,602,function,Overload of sorted_ for Tensor iterable. -1279,_py_sorted,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,627,function, -1280,TestBase,tensorflow/tensorflow/python/autograph/operators/py_builtins_test.py,41,class, -1281,PyBuiltinsTest,tensorflow/tensorflow/python/autograph/operators/py_builtins_test.py,48,class, -1282,GetItemOpts,tensorflow/tensorflow/python/autograph/operators/slices.py,34,class, -1283,get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,38,function,"The slice read operator (i.e. __getitem__). +810,abs_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,179,function, +811,float_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,202,function, +812,int_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,219,function, +813,len_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,241,function, +814,print_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,318,function,Overload of the print builtin. +815,range_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,360,function, +816,enumerate_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,391,function, +817,zip_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,409,function, +818,map_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,423,function, +819,next_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,437,function, +820,next_tf_iterator,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,509,function, +821,next_py,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,521,function, +822,filter_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,527,function, +823,any_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,541,function, +824,all_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,570,function, +825,sorted_,tensorflow/tensorflow/python/autograph/operators/py_builtins.py,596,function, +826,GetItemOpts,tensorflow/tensorflow/python/autograph/operators/slices.py,34,class, +827,get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,38,function,"The slice read operator (i.e. __getitem__). Note: it is unspecified whether target will be mutated or not. In general, if target is mutable (like Python lists), it will be mutated. @@ -5037,12 +4620,7 @@ Returns: Raises: ValueError: if target is not of a supported type." -1284,_tf_tensorarray_get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,70,function,Overload of get_item that stages a TensorArray read. -1285,_tf_tensor_list_get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,75,function,Overload of get_item that stages a Tensor list read. -1286,_tf_tensor_get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,84,function,Overload of get_item that stages a Tensor (not Tensor list) read. -1287,_tf_tensor_string_get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,89,function,Overload of get_item that stages a Tensor string read. -1288,_py_get_item,tensorflow/tensorflow/python/autograph/operators/slices.py,95,function,Overload of get_item that executes a Python list modification. -1289,set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,100,function,"The slice write operator (i.e. __setitem__). +828,set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,100,function,"The slice write operator (i.e. __setitem__). Note: it is unspecified whether target will be mutated or not. In general, if target is mutable (like Python lists), it will be mutated. @@ -5057,13 +4635,8 @@ Returns: Raises: ValueError: if target is not of a supported type." -1290,_tf_tensorarray_set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,128,function,Overload of set_item that stages a TensorArray write. -1291,_tf_tensor_list_set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,133,function,Overload of set_item that stages a Tensor list update. -1292,_tf_tensor_set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,138,function,Overload of set_item that stages a Tensor scatter update. -1293,_py_set_item,tensorflow/tensorflow/python/autograph/operators/slices.py,143,function,Overload of set_item that executes a Python list modification. -1294,SlicesTest,tensorflow/tensorflow/python/autograph/operators/slices_test.py,27,class, -1295,ld,tensorflow/tensorflow/python/autograph/operators/variables.py,22,function,Load variable operator. -1296,ldu,tensorflow/tensorflow/python/autograph/operators/variables.py,29,function,"Load variable operator that returns Undefined when failing to evaluate. +829,ld,tensorflow/tensorflow/python/autograph/operators/variables.py,22,function,Load variable operator. +830,ldu,tensorflow/tensorflow/python/autograph/operators/variables.py,29,function,"Load variable operator that returns Undefined when failing to evaluate. Note: the name (""load or return undefined"") is abbreviated to minimize the amount of clutter in generated code. @@ -5079,7 +4652,7 @@ Args: Returns: Either the value of the symbol, or Undefined, if the symbol is not fully defined." -1297,Undefined,tensorflow/tensorflow/python/autograph/operators/variables.py,54,class,"Represents an undefined symbol in Python. +831,Undefined,tensorflow/tensorflow/python/autograph/operators/variables.py,54,class,"Represents an undefined symbol in Python. This is used to reify undefined symbols, which is required to use the functional form of loops. @@ -5103,22 +4676,22 @@ Converted version of the above showing the possible usage of this class: Attributes: symbol_name: Text, identifier for the undefined symbol" -1298,UndefinedReturnValue,tensorflow/tensorflow/python/autograph/operators/variables.py,106,class,Represents a return value that is undefined. -1299,SpecialValuesTest,tensorflow/tensorflow/python/autograph/operators/variables_test.py,25,class, -1300,NoValue,tensorflow/tensorflow/python/autograph/pyct/anno.py,37,class, -1301,Basic,tensorflow/tensorflow/python/autograph/pyct/anno.py,43,class,"Container for basic annotation keys. +832,read,tensorflow/tensorflow/python/autograph/operators/variables.py,86,method, +833,UndefinedReturnValue,tensorflow/tensorflow/python/autograph/operators/variables.py,106,class,Represents a return value that is undefined. +834,NoValue,tensorflow/tensorflow/python/autograph/pyct/anno.py,37,class, +835,Basic,tensorflow/tensorflow/python/autograph/pyct/anno.py,43,class,"Container for basic annotation keys. The enum values are used strictly for documentation purposes." -1302,Static,tensorflow/tensorflow/python/autograph/pyct/anno.py,67,class,"Container for static analysis annotation keys. +836,Static,tensorflow/tensorflow/python/autograph/pyct/anno.py,67,class,"Container for static analysis annotation keys. The enum values are used strictly for documentation purposes." -1303,keys,tensorflow/tensorflow/python/autograph/pyct/anno.py,110,function, -1304,getanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,116,function, -1305,hasanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,123,function, -1306,setanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,127,function, -1307,delanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,137,function, -1308,copyanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,145,function, -1309,dup,tensorflow/tensorflow/python/autograph/pyct/anno.py,154,function,"Recursively copies annotations in an AST tree. +837,keys,tensorflow/tensorflow/python/autograph/pyct/anno.py,110,function, +838,getanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,116,function, +839,hasanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,123,function, +840,setanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,127,function, +841,delanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,137,function, +842,copyanno,tensorflow/tensorflow/python/autograph/pyct/anno.py,145,function, +843,dup,tensorflow/tensorflow/python/autograph/pyct/anno.py,154,function,"Recursively copies annotations in an AST tree. Args: node: ast.AST @@ -5126,9 +4699,9 @@ Args: key. All annotations with the source key will be copied to identical annotations with the destination key. field_name: str" -1310,AnnoTest,tensorflow/tensorflow/python/autograph/pyct/anno_test.py,30,class, -1311,CleanCopier,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,30,class,NodeTransformer-like visitor that copies an AST. -1312,copy_clean,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,63,function,"Creates a deep copy of an AST. +844,CleanCopier,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,30,class,NodeTransformer-like visitor that copies an AST. +845,copy,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,37,method,"Returns a deep copy of node (excluding some fields, see copy_clean)." +846,copy_clean,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,63,function,"Creates a deep copy of an AST. The copy will not include fields that are prefixed by '__', with the exception of user-specified annotations. @@ -5139,11 +4712,20 @@ Args: copy Returns: ast.AST" -1313,SymbolRenamer,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,79,class,Transformer that can rename symbols to a simple names. -1314,rename_symbols,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,130,function,Renames symbols in an AST. Requires qual_names annotations. -1315,keywords_to_dict,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,140,function,Converts a list of ast.keyword objects to a dict. -1316,PatternMatcher,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,150,class,Matches a node against a pattern represented by a node. -1317,matches,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,214,function,"Basic pattern matcher for AST. +847,SymbolRenamer,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,79,class,Transformer that can rename symbols to a simple names. +848,visit_Nonlocal,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,106,method, +849,visit_Global,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,110,method, +850,visit_Name,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,114,method, +851,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,117,method, +852,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,123,method, +853,rename_symbols,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,130,function,Renames symbols in an AST. Requires qual_names annotations. +854,keywords_to_dict,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,140,function,Converts a list of ast.keyword objects to a dict. +855,PatternMatcher,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,150,class,Matches a node against a pattern represented by a node. +856,compare_and_visit,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,158,method, +857,no_match,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,164,method, +858,is_wildcard,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,168,method, +859,generic_visit,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,177,method, +860,matches,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,214,function,"Basic pattern matcher for AST. The pattern may contain wildcards represented by the symbol '_'. A node matches a pattern if for every node in the tree, either there is a node of @@ -5154,7 +4736,7 @@ Args: pattern: ast.AST Returns: bool" -1318,apply_to_single_assignments,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,236,function,"Applies a function to each individual assignment. +861,apply_to_single_assignments,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,236,function,"Applies a function to each individual assignment. This function can process a possibly-unpacked (e.g. a, b = c, d) assignment. It tries to break down the unpacking if possible. In effect, it has the same @@ -5183,7 +4765,7 @@ Args: values: ast.AST apply_fn: Callable[[ast.AST, ast.AST], None], called with the respective nodes of each single assignment" -1319,parallel_walk,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,283,function,"Walks two ASTs in parallel. +862,parallel_walk,tensorflow/tensorflow/python/autograph/pyct/ast_util.py,283,function,"Walks two ASTs in parallel. The two trees must have identical structure. @@ -5194,14 +4776,7 @@ Yields: Tuple[ast.AST, ast.AST] Raises: ValueError: if the two trees don't have identical structure." -1320,AstUtilTest,tensorflow/tensorflow/python/autograph/pyct/ast_util_test.py,35,class, -1321,_TransformedFnCache,tensorflow/tensorflow/python/autograph/pyct/cache.py,26,class,"Generic hierarchical cache for transformed functions. - -The keys are soft references (i.e. they are discarded when the key is -destroyed) created from the source function by `_get_key`. The subkeys are -strong references and can be any value. Typically they identify different -kinds of transformation." -1322,CodeObjectCache,tensorflow/tensorflow/python/autograph/pyct/cache.py,63,class,"A function cache based on code objects. +863,CodeObjectCache,tensorflow/tensorflow/python/autograph/pyct/cache.py,63,class,"A function cache based on code objects. Code objects are good proxies for the source code of a function. @@ -5209,7 +4784,7 @@ This cache efficiently handles functions that share code objects, such as functions defined in a loop, bound methods, etc. The cache falls back to the function object, if it doesn't have a code object." -1323,UnboundInstanceCache,tensorflow/tensorflow/python/autograph/pyct/cache.py,81,class,"A function cache based on unbound function objects. +864,UnboundInstanceCache,tensorflow/tensorflow/python/autograph/pyct/cache.py,81,class,"A function cache based on unbound function objects. Using the function for the cache key allows efficient handling of object methods. @@ -5217,8 +4792,7 @@ methods. Unlike the _CodeObjectCache, this discriminates between different functions even if they have the same code. This is needed for decorators that may masquerade as another function." -1324,CacheTest,tensorflow/tensorflow/python/autograph/pyct/cache_test.py,25,class, -1325,Node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,54,class,"A node in the CFG. +865,Node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,54,class,"A node in the CFG. Although new instances of this class are mutable, the objects that a user finds in the CFG are typically not. @@ -5233,7 +4807,8 @@ Attributes: prev: FrozenSet[Node, ...], the nodes that precede this node, in reverse control flow order ast_node: ast.AST, the AST node corresponding to this CFG node" -1326,Graph,tensorflow/tensorflow/python/autograph/pyct/cfg.py,95,class,"A Control Flow Graph. +866,freeze,tensorflow/tensorflow/python/autograph/pyct/cfg.py,77,method, +867,Graph,tensorflow/tensorflow/python/autograph/pyct/cfg.py,95,class,"A Control Flow Graph. The CFG maintains an index to allow looking up a CFG node by the AST node to which it is associated. The index can also be enumerated in top-down, depth @@ -5262,8 +4837,8 @@ Attributes: nodes to their predecessor CFG nodes stmt_next: Dict[ast.Node, FrozenSet[Node, ...]], mapping statement AST nodes to their successor CFG nodes" -1327,_WalkMode,tensorflow/tensorflow/python/autograph/pyct/cfg.py,145,class, -1328,GraphVisitor,tensorflow/tensorflow/python/autograph/pyct/cfg.py,152,class,"Base class for a CFG visitors. +868,as_dot,tensorflow/tensorflow/python/autograph/pyct/cfg.py,133,method,Print CFG in DOT format. +869,GraphVisitor,tensorflow/tensorflow/python/autograph/pyct/cfg.py,152,class,"Base class for a CFG visitors. This implementation is not thread safe. @@ -5282,7 +4857,25 @@ Attributes: graph: Graph in_: Dict[Node, Any], stores node-keyed state during a visit out: Dict[Node, Any], stores node-keyed state during a visit" -1329,GraphBuilder,tensorflow/tensorflow/python/autograph/pyct/cfg.py,252,class,"Builder that constructs a CFG from a given AST. +870,init_state,tensorflow/tensorflow/python/autograph/pyct/cfg.py,178,method,"State initialization function. Optional to overload. + +An in/out state slot will be created for each node in the graph. Subclasses +must overload this to control what that is initialized to. + +Args: + node: Node" +871,visit_node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,190,method,"Visitor function. + +Args: + node: Node +Returns: + bool, whether the node should be revisited; subclasses can visit every + reachable node exactly once by always returning False" +872,reset,tensorflow/tensorflow/python/autograph/pyct/cfg.py,201,method, +873,can_ignore,tensorflow/tensorflow/python/autograph/pyct/cfg.py,209,method,Returns True if the node can safely be assumed not to touch variables. +874,visit_forward,tensorflow/tensorflow/python/autograph/pyct/cfg.py,245,method, +875,visit_reverse,tensorflow/tensorflow/python/autograph/pyct/cfg.py,248,method, +876,GraphBuilder,tensorflow/tensorflow/python/autograph/pyct/cfg.py,252,class,"Builder that constructs a CFG from a given AST. This GraphBuilder facilitates constructing the DAG that forms the CFG when nodes @@ -5312,79 +4905,139 @@ Important concepts: edges; there are various types of nodes, each admitting various types of jump nodes; sections are identified by their corresponding AST node" -1330,AstToCfg,tensorflow/tensorflow/python/autograph/pyct/cfg.py,647,class,"Converts an AST to CFGs. - -A separate CFG will be constructed for each function." -1331,build,tensorflow/tensorflow/python/autograph/pyct/cfg.py,964,function, -1332,CountingVisitor,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,28,class, -1333,GraphVisitorTest,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,42,class, -1334,AstToCfgTest,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,93,class, -1335,FrameInfo,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,26,class, -1336,_stack_trace_inside_mapped_code,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,34,function,"Summarizes inner traceback frames up to the call to a given function. - -This functions locates the innermost (i.e. most recent) frame that corresponds -to code that can be mapped by source_map originated from, and returns a -translated stack trace ending at that frame. If no such frame is found, the -entire stack trace is summarized. - -For example, the following code: - - def f(): - for i in tf.range(1): - z = y + i # z only defined here - -Would generate this traceback: - - - ag__.for_stmt(...) - - return _known_len_tf_for_stmt(iter_, extra_test, body, init_state) - <_known_len_tf_for_stmt> - _disallow_undefs_into_loop(*init_state) - <_disallow_undefs_into_loop> - raise ... - -Which is then processed into: - - - for i in tf.range(1): - - return _known_len_tf_for_stmt(iter_, extra_test, body, init_state) - <_known_len_tf_for_stmt> - _disallow_undefs_into_loop(*init_state) - <_disallow_undefs_into_loop> - raise ... +877,reset,tensorflow/tensorflow/python/autograph/pyct/cfg.py,292,method,Resets the state of this factory. +878,begin_statement,tensorflow/tensorflow/python/autograph/pyct/cfg.py,372,method,"Marks the beginning of a statement. Args: - tb: traceback.FrameSummary, The traceback corresponding to an error. - Typically, the output of traceback.Summary.extract(capture_locals=True). - source_map: Dict[LineLocation, OriginInfo], a source map as created by - origin_info.create_source_map. - converter_filename: str, the file path of the converted module. Call frames - corresponding to this module are elided and their preceding frames are - marked as allowlisted. Note that frames enclosing converted code are - dropped using a different mechanism. + stmt: Hashable, a key by which the statement can be identified in + the CFG's stmt_prev and stmt_next attributes" +879,end_statement,tensorflow/tensorflow/python/autograph/pyct/cfg.py,381,method,"Marks the end of a statement. + +Args: + stmt: Hashable, a key by which the statement can be identified in + the CFG's stmt_prev and stmt_next attributes; must match a key + previously passed to begin_statement." +880,add_ordinary_node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,391,method,"Grows the graph by adding an ordinary CFG node. + +Ordinary nodes are followed by the next node, in lexical order, that is, +they become the new leaf set. + +Args: + ast_node: ast.AST +Returns: + Node" +881,add_exit_node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,438,method,"Grows the graph by adding an exit node. + +This node becomes an exit for the current section. + +Args: + ast_node: ast.AST + section_id: Hashable, the node for which ast_node should be considered + to be an exit node + guards: Tuple[ast.AST, ...], the finally sections that guard ast_node +Returns: + Node" +882,add_continue_node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,455,method,"Grows the graph by adding a reentry node. + +This node causes control flow to go back to the loop section's entry. + +Args: + ast_node: ast.AST + section_id: Hashable, the node for which ast_node should be considered + to be an exit node + guards: Tuple[ast.AST, ...], the finally sections that guard ast_node" +883,connect_raise_node,tensorflow/tensorflow/python/autograph/pyct/cfg.py,469,method,"Adds extra connection between a raise node and containing except guards. + +The node is a graph node, not an ast node. + +Args: + node: Node + except_guards: Tuple[ast.AST, ...], the except sections that guard node" +884,enter_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,484,method,"Enters a regular section. + +Regular sections admit exit jumps, which end the section. + +Args: + section_id: Hashable, the same node that will be used in calls to the + ast_node arg passed to add_exit_node" +885,exit_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,496,method,Exits a regular section. +886,enter_loop_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,505,method,"Enters a loop section. + +Loop sections define an entry node. The end of the section always flows back +to the entry node. These admit continue jump nodes which also flow to the +entry node. + +Args: + section_id: Hashable, the same node that will be used in calls to the + ast_node arg passed to add_continue_node + entry_node: ast.AST, the entry node into the loop (e.g. the test node + for while loops)" +887,exit_loop_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,524,method,Exits a loop section. +888,enter_cond_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,539,method,"Enters a conditional section. + +Conditional sections define an entry node, and one or more branches. + +Args: + section_id: Hashable, the same node that will be used in calls to the + section_id arg passed to new_cond_branch" +889,new_cond_branch,tensorflow/tensorflow/python/autograph/pyct/cfg.py,553,method,Begins a new branch in a cond section. +890,exit_cond_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,567,method,Exits a conditional section. +891,enter_except_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,574,method,Enters an except section. +892,enter_finally_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,579,method,Enters a finally section. +893,exit_finally_section,tensorflow/tensorflow/python/autograph/pyct/cfg.py,589,method,Exits a finally section. +894,build,tensorflow/tensorflow/python/autograph/pyct/cfg.py,599,method,"Returns the CFG accumulated so far and resets the builder. Returns: - List[FrameInfo]" -1337,MultilineMessageKeyError,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,141,class, -1338,ErrorMetadataBase,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,153,class,"Container objects attached to exceptions raised in user code. + Graph" +895,AstToCfg,tensorflow/tensorflow/python/autograph/pyct/cfg.py,647,class,"Converts an AST to CFGs. + +A separate CFG will be constructed for each function." +896,visit_ClassDef,tensorflow/tensorflow/python/autograph/pyct/cfg.py,714,method, +897,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/cfg.py,767,method, +898,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/cfg.py,770,method, +899,visit_Return,tensorflow/tensorflow/python/autograph/pyct/cfg.py,773,method, +900,visit_Import,tensorflow/tensorflow/python/autograph/pyct/cfg.py,776,method, +901,visit_ImportFrom,tensorflow/tensorflow/python/autograph/pyct/cfg.py,779,method, +902,visit_Expr,tensorflow/tensorflow/python/autograph/pyct/cfg.py,782,method, +903,visit_Assign,tensorflow/tensorflow/python/autograph/pyct/cfg.py,785,method, +904,visit_AnnAssign,tensorflow/tensorflow/python/autograph/pyct/cfg.py,788,method, +905,visit_AugAssign,tensorflow/tensorflow/python/autograph/pyct/cfg.py,791,method, +906,visit_Pass,tensorflow/tensorflow/python/autograph/pyct/cfg.py,794,method, +907,visit_Global,tensorflow/tensorflow/python/autograph/pyct/cfg.py,797,method, +908,visit_Nonlocal,tensorflow/tensorflow/python/autograph/pyct/cfg.py,800,method, +909,visit_Print,tensorflow/tensorflow/python/autograph/pyct/cfg.py,803,method, +910,visit_Raise,tensorflow/tensorflow/python/autograph/pyct/cfg.py,806,method, +911,visit_Assert,tensorflow/tensorflow/python/autograph/pyct/cfg.py,811,method, +912,visit_Delete,tensorflow/tensorflow/python/autograph/pyct/cfg.py,815,method, +913,visit_If,tensorflow/tensorflow/python/autograph/pyct/cfg.py,818,method, +914,visit_While,tensorflow/tensorflow/python/autograph/pyct/cfg.py,840,method, +915,visit_For,tensorflow/tensorflow/python/autograph/pyct/cfg.py,863,method, +916,visit_Break,tensorflow/tensorflow/python/autograph/pyct/cfg.py,894,method, +917,visit_Continue,tensorflow/tensorflow/python/autograph/pyct/cfg.py,897,method, +918,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/pyct/cfg.py,900,method, +919,visit_Try,tensorflow/tensorflow/python/autograph/pyct/cfg.py,914,method, +920,visit_With,tensorflow/tensorflow/python/autograph/pyct/cfg.py,956,method, +921,build,tensorflow/tensorflow/python/autograph/pyct/cfg.py,964,function, +922,CountingVisitor,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,28,class, +923,init_state,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,34,method, +924,visit_node,tensorflow/tensorflow/python/autograph/pyct/cfg_test.py,37,method, +925,FrameInfo,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,26,class, +926,MultilineMessageKeyError,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,141,class, +927,ErrorMetadataBase,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,153,class,"Container objects attached to exceptions raised in user code. This metadata allows re-raising exceptions that occur in generated code, with a custom error message that includes a stack trace relative to user-readable code from which the generated code originated." -1339,ErrorMetadataBaseTest,tensorflow/tensorflow/python/autograph/pyct/error_utils_test.py,28,class, -1340,PyCTError,tensorflow/tensorflow/python/autograph/pyct/errors.py,22,class,Base class for all exceptions. -1341,UnsupportedLanguageElementError,tensorflow/tensorflow/python/autograph/pyct/errors.py,27,class,Raised for code patterns that AutoGraph does not support. -1342,_is_constant_gast_2,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,31,function, -1343,_is_constant_gast_3,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,36,function, -1344,is_literal,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,40,function,Tests whether node represents a Python literal. -1345,_is_ellipsis_gast_2,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,53,function, -1346,_is_ellipsis_gast_3,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,57,function, -1347,islambda,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,60,function, -1348,isnamedtuple,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,68,function,Returns True if the argument is a namedtuple-like. -1349,isbuiltin,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,82,function,Returns True if the argument is a built-in function. -1350,isconstructor,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,96,function,"Returns True if the argument is an object constructor. +928,get_message,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,177,method,Returns the message for the underlying exception. +929,create_exception,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,211,method, +930,to_exception,tensorflow/tensorflow/python/autograph/pyct/error_utils.py,221,method, +931,PyCTError,tensorflow/tensorflow/python/autograph/pyct/errors.py,22,class,Base class for all exceptions. +932,UnsupportedLanguageElementError,tensorflow/tensorflow/python/autograph/pyct/errors.py,27,class,Raised for code patterns that AutoGraph does not support. +933,is_literal,tensorflow/tensorflow/python/autograph/pyct/gast_util.py,40,function,Tests whether node represents a Python literal. +934,islambda,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,60,function, +935,isnamedtuple,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,68,function,Returns True if the argument is a namedtuple-like. +936,isbuiltin,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,82,function,Returns True if the argument is a built-in function. +937,isconstructor,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,96,function,"Returns True if the argument is an object constructor. In general, any object of type class is a constructor, with the exception of classes created using a callable metaclass. @@ -5395,20 +5048,8 @@ Args: cls: Any Returns: Bool" -1351,_fix_linecache_record,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,116,function,"Fixes potential corruption of linecache in the presence of functools.wraps. - -functools.wraps modifies the target object's __module__ field, which seems -to confuse linecache in special instances, for example when the source is -loaded from a .par file (see https://google.github.io/subpar/subpar.html). - -This function simply triggers a call to linecache.updatecache when a mismatch -was detected between the object's __module__ property and the object's source -file. - -Args: - obj: Any" -1352,getimmediatesource,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,143,function,A variant of inspect.getsource that ignores the __wrapped__ property. -1353,getnamespace,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,151,function,"Returns the complete namespace of a function. +938,getimmediatesource,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,143,function,A variant of inspect.getsource that ignores the __wrapped__ property. +939,getnamespace,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,151,function,"Returns the complete namespace of a function. Namespace is defined here as the mapping of all non-local variables to values. This includes the globals and the closure variables. Note that this captures @@ -5419,7 +5060,7 @@ Args: f: User defined function. Returns: A dict mapping symbol names to values." -1354,getqualifiedname,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,177,function,"Returns the name by which a value can be referred to in a given namespace. +940,getqualifiedname,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,177,function,"Returns the name by which a value can be referred to in a given namespace. If the object defines a parent module, the function attempts to use it to locate the object. @@ -5435,9 +5076,8 @@ Args: visited: Optional[Set[int]], ID of modules to avoid visiting. Returns: Union[str, None], the fully-qualified name that resolves to the value o, or None if it couldn't be found." -1355,_get_unbound_function,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,240,function, -1356,getdefiningclass,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,250,function,Resolves the class (e.g. one of the superclasses) that defined a method. -1357,getmethodclass,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,265,function,"Resolves a function's owner, e.g. a method's class. +941,getdefiningclass,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,250,function,Resolves the class (e.g. one of the superclasses) that defined a method. +942,getmethodclass,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,265,function,"Resolves a function's owner, e.g. a method's class. Note that this returns the object that the function was retrieved from, not necessarily the class where it was defined. @@ -5458,24 +5098,21 @@ Returns: Raises: ValueError: if the class could not be resolved for any unexpected reason." -1358,getfutureimports,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,339,function,"Detects what future imports are necessary to safely execute entity source. +943,getfutureimports,tensorflow/tensorflow/python/autograph/pyct/inspect_utils.py,339,function,"Detects what future imports are necessary to safely execute entity source. Args: entity: Any object Returns: A tuple of future strings" -1359,decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,37,function, -1360,function_decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,41,function, -1361,wrapping_decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,47,function, -1362,TestClass,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,59,class, -1363,free_function,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,85,function, -1364,factory,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,89,function, -1365,free_factory,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,93,function, -1366,InspectUtilsTest,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,99,class, -1367,_remove_file,tensorflow/tensorflow/python/autograph/pyct/loader.py,37,function,"Remove a file, if it exists." -1368,load_source,tensorflow/tensorflow/python/autograph/pyct/loader.py,50,function,Loads the given source code as a Python module. -1369,load_ast,tensorflow/tensorflow/python/autograph/pyct/loader.py,70,function,"Loads the given AST as a Python module. +944,decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,37,function, +945,function_decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,41,function, +946,wrapping_decorator,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,47,function, +947,free_function,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,85,function, +948,factory,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,89,function, +949,free_factory,tensorflow/tensorflow/python/autograph/pyct/inspect_utils_test.py,93,function, +950,load_source,tensorflow/tensorflow/python/autograph/pyct/loader.py,50,function,Loads the given source code as a Python module. +951,load_ast,tensorflow/tensorflow/python/autograph/pyct/loader.py,70,function,"Loads the given AST as a Python module. Compiling the AST code this way ensures that the source code is readable by e.g. `pdb` or `inspect`. @@ -5493,8 +5130,8 @@ Returns: the module containing the unparsed nodes, the source code corresponding to nodes, and the source map. Is include_source_map is False, the source map will be None." -1370,load_source,tensorflow/tensorflow/python/autograph/pyct/loader_deprecated_py2.py,40,function,Loads the given source code as a Python module. -1371,load_ast,tensorflow/tensorflow/python/autograph/pyct/loader_deprecated_py2.py,58,function,"Loads the given AST as a Python module. +952,load_source,tensorflow/tensorflow/python/autograph/pyct/loader_deprecated_py2.py,40,function,Loads the given source code as a Python module. +953,load_ast,tensorflow/tensorflow/python/autograph/pyct/loader_deprecated_py2.py,58,function,"Loads the given AST as a Python module. Compiling the AST code this way ensures that the source code is readable by e.g. `pdb` or `inspect`. @@ -5512,29 +5149,30 @@ Returns: the module containing the unparsed nodes, the source code corresponding to nodes, and the source map. Is include_source_map is False, the source map will be None." -1372,LoaderTest,tensorflow/tensorflow/python/autograph/pyct/loader_test.py,33,class, -1373,Namer,tensorflow/tensorflow/python/autograph/pyct/naming.py,24,class,Symbol name generator. -1374,NamerTest,tensorflow/tensorflow/python/autograph/pyct/naming_test.py,25,class, -1375,LineLocation,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,35,class,"Similar to Location, but without column information. +954,Namer,tensorflow/tensorflow/python/autograph/pyct/naming.py,24,class,Symbol name generator. +955,new_symbol,tensorflow/tensorflow/python/autograph/pyct/naming.py,31,method,See control_flow.SymbolNamer.new_symbol. +956,LineLocation,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,35,class,"Similar to Location, but without column information. Attributes: filename: Text lineno: int, 1-based" -1376,Location,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,46,class,"Encodes code location information. +957,Location,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,46,class,"Encodes code location information. Attributes: filename: Text lineno: int, 1-based col_offset: int line_loc: LineLocation" -1377,OriginInfo,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,62,class,"Container for information about the source code before conversion. +958,line_loc,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,58,method, +959,OriginInfo,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,62,class,"Container for information about the source code before conversion. Attributes: loc: Location function_name: Optional[Text] source_code_line: Text comment: Optional[Text]" -1378,create_source_map,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,89,function,"Creates a source map between an annotated AST and the code it compiles to. +960,as_frame,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,75,method,Returns a 4-tuple consistent with the return of traceback.extract_tb. +961,create_source_map,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,89,function,"Creates a source map between an annotated AST and the code it compiles to. Note: this function assumes nodes nodes, code and filepath correspond to the same code. @@ -5547,9 +5185,9 @@ Args: Returns: Dict[LineLocation, OriginInfo], mapping locations in code to locations indicated by origin annotations in node." -1379,_Function,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,160,class, -1380,OriginResolver,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,166,class,Annotates an AST with additional source information like file name. -1381,resolve,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,226,function,"Adds origin information to an AST, based on the source it was loaded from. +962,OriginResolver,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,166,class,Annotates an AST with additional source information like file name. +963,visit,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,212,method, +964,resolve,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,226,function,"Adds origin information to an AST, based on the source it was loaded from. This allows us to map the original source code line numbers to generated source code. @@ -5568,11 +5206,9 @@ Args: context_filepath: Text context_lineno: int context_col_offset: int" -1382,resolve_entity,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,271,function,"Like resolve, but extracts the context information from an entity." -1383,OriginInfoTest,tensorflow/tensorflow/python/autograph/pyct/origin_info_test.py,34,class, -1384,_unfold_continuations,tensorflow/tensorflow/python/autograph/pyct/parser.py,60,function,Removes any backslash line continuations from the code. -1385,dedent_block,tensorflow/tensorflow/python/autograph/pyct/parser.py,65,function,Dedents a code so that its first line starts at row zero. -1386,parse_entity,tensorflow/tensorflow/python/autograph/pyct/parser.py,133,function,"Returns the AST and source code of given entity. +965,resolve_entity,tensorflow/tensorflow/python/autograph/pyct/origin_info.py,271,function,"Like resolve, but extracts the context information from an entity." +966,dedent_block,tensorflow/tensorflow/python/autograph/pyct/parser.py,65,function,Dedents a code so that its first line starts at row zero. +967,parse_entity,tensorflow/tensorflow/python/autograph/pyct/parser.py,133,function,"Returns the AST and source code of given entity. Args: entity: Any, Python function/method/class @@ -5583,18 +5219,7 @@ Args: Returns: gast.AST, Text: the parsed AST node; the source code that was parsed to generate the AST (including any prefixes that this function may have added)." -1387,_without_context,tensorflow/tensorflow/python/autograph/pyct/parser.py,169,function,Returns a clean node and source code without indenting and context. -1388,_arg_name,tensorflow/tensorflow/python/autograph/pyct/parser.py,203,function, -1389,_node_matches_argspec,tensorflow/tensorflow/python/autograph/pyct/parser.py,212,function,Returns True is node fits the argspec of func. -1390,_parse_lambda,tensorflow/tensorflow/python/autograph/pyct/parser.py,234,function,"Returns the AST and source code of given lambda function. - -Args: - lam: types.LambdaType, Python function/method/class - -Returns: - gast.AST, Text: the parsed AST node; the source code that was parsed to - generate the AST (including any prefixes that this function may have added)." -1391,parse,tensorflow/tensorflow/python/autograph/pyct/parser.py,323,function,"Returns the AST of given piece of code. +968,parse,tensorflow/tensorflow/python/autograph/pyct/parser.py,323,function,"Returns the AST of given piece of code. Args: src: Text @@ -5605,7 +5230,7 @@ Args: Returns: ast.AST" -1392,parse_expression,tensorflow/tensorflow/python/autograph/pyct/parser.py,347,function,"Returns the AST of given identifier. +969,parse_expression,tensorflow/tensorflow/python/autograph/pyct/parser.py,347,function,"Returns the AST of given identifier. Args: src: A piece of code that represents a single Python expression @@ -5613,7 +5238,7 @@ Returns: A gast.AST object. Raises: ValueError: if src does not consist of a single Expression." -1393,unparse,tensorflow/tensorflow/python/autograph/pyct/parser.py,366,function,"Returns the source code of given AST. +970,unparse,tensorflow/tensorflow/python/autograph/pyct/parser.py,366,function,"Returns the source code of given AST. Args: node: The code to compile, as an AST object. @@ -5625,29 +5250,67 @@ Args: Returns: code: The source code generated from the AST object source_mapping: A mapping between the user and AutoGraph generated code." -1394,ParserTest,tensorflow/tensorflow/python/autograph/pyct/parser_test.py,31,class, -1395,PrettyPrinter,tensorflow/tensorflow/python/autograph/pyct/pretty_printer.py,26,class,Print AST nodes. -1396,fmt,tensorflow/tensorflow/python/autograph/pyct/pretty_printer.py,128,function, -1397,PrettyPrinterTest,tensorflow/tensorflow/python/autograph/pyct/pretty_printer_test.py,28,class, -1398,CallerMustSetThis,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,36,class, -1399,Symbol,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,40,class,Represents a Python symbol. -1400,Literal,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,44,class,Represents a Python numeric literal. -1401,QN,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,57,class,Represents a qualified name. -1402,QnResolver,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,210,class,"Annotates nodes with QN information. +971,PrettyPrinter,tensorflow/tensorflow/python/autograph/pyct/pretty_printer.py,26,class,Print AST nodes. +972,generic_visit,tensorflow/tensorflow/python/autograph/pyct/pretty_printer.py,59,method, +973,fmt,tensorflow/tensorflow/python/autograph/pyct/pretty_printer.py,128,function, +974,CallerMustSetThis,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,36,class, +975,Symbol,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,40,class,Represents a Python symbol. +976,Literal,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,44,class,Represents a Python numeric literal. +977,QN,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,57,class,Represents a qualified name. +978,is_symbol,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,95,method, +979,is_simple,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,98,method, +980,is_composite,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,101,method, +981,has_subscript,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,104,method, +982,has_attr,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,107,method, +983,parent,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,111,method, +984,owner_set,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,117,method,"Returns all the symbols (simple or composite) that own this QN. + +In other words, if this symbol was modified, the symbols in the owner set +may also be affected. + +Examples: + 'a.b[c.d]' has two owners, 'a' and 'a.b'" +985,support_set,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,133,method,"Returns the set of simple symbols that this QN relies on. + +This would be the smallest set of symbols necessary for the QN to +statically resolve (assuming properties and index ranges are verified +at runtime). + +Examples: + 'a.b' has only one support symbol, 'a' + 'a[i]' has two support symbols, 'a' and 'i'" +986,ssf,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,175,method,Simple symbol form. +987,ast,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,187,method,AST representation. +988,QnResolver,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,210,class,"Annotates nodes with QN information. Note: Not using NodeAnnos to avoid circular dependencies." -1403,resolve,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,251,function, -1404,from_str,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,255,function, -1405,QNTest,tensorflow/tensorflow/python/autograph/pyct/qual_names_test.py,31,class, -1406,QNResolverTest,tensorflow/tensorflow/python/autograph/pyct/qual_names_test.py,183,class, -1407,ContextAdjuster,tensorflow/tensorflow/python/autograph/pyct/templates.py,35,class,"Adjusts the ctx field of nodes to ensure consistency. +989,visit_Name,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,216,method, +990,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,221,method, +991,visit_Subscript,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,228,method, +992,resolve,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,251,function, +993,from_str,tensorflow/tensorflow/python/autograph/pyct/qual_names.py,255,function, +994,ContextAdjuster,tensorflow/tensorflow/python/autograph/pyct/templates.py,35,class,"Adjusts the ctx field of nodes to ensure consistency. This transformer can change the ctx fields of a variable, tuple and other AST elements that allow one, based on whether the element is being read or written." -1408,ReplaceTransformer,tensorflow/tensorflow/python/autograph/pyct/templates.py,108,class,Replace AST nodes. -1409,_convert_to_ast,tensorflow/tensorflow/python/autograph/pyct/templates.py,218,function,Converts from a known data type to AST. -1410,replace,tensorflow/tensorflow/python/autograph/pyct/templates.py,234,function,"Replaces placeholders in a Python template. +995,visit,tensorflow/tensorflow/python/autograph/pyct/templates.py,46,method, +996,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/templates.py,58,method, +997,visit_Tuple,tensorflow/tensorflow/python/autograph/pyct/templates.py,64,method, +998,visit_List,tensorflow/tensorflow/python/autograph/pyct/templates.py,68,method, +999,visit_Name,tensorflow/tensorflow/python/autograph/pyct/templates.py,72,method, +1000,visit_Call,tensorflow/tensorflow/python/autograph/pyct/templates.py,76,method, +1001,visit_Dict,tensorflow/tensorflow/python/autograph/pyct/templates.py,83,method, +1002,visit_Subscript,tensorflow/tensorflow/python/autograph/pyct/templates.py,89,method, +1003,visit_comprehension,tensorflow/tensorflow/python/autograph/pyct/templates.py,95,method, +1004,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/templates.py,101,method, +1005,ReplaceTransformer,tensorflow/tensorflow/python/autograph/pyct/templates.py,108,class,Replace AST nodes. +1006,visit_Expr,tensorflow/tensorflow/python/autograph/pyct/templates.py,146,method, +1007,visit_keyword,tensorflow/tensorflow/python/autograph/pyct/templates.py,154,method, +1008,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/templates.py,172,method, +1009,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/templates.py,185,method, +1010,visit_Name,tensorflow/tensorflow/python/autograph/pyct/templates.py,197,method, +1011,replace,tensorflow/tensorflow/python/autograph/pyct/templates.py,234,function,"Replaces placeholders in a Python template. AST Name and Tuple nodes always receive the context that inferred from the template. However, when replacing more complex nodes (that can potentially @@ -5670,13 +5333,9 @@ Returns: Raises: ValueError: if the arguments are incorrect." -1411,replace_as_expression,tensorflow/tensorflow/python/autograph/pyct/templates.py,279,function,"Variant of replace that generates expressions, instead of code blocks." -1412,_CtxClearer,tensorflow/tensorflow/python/autograph/pyct/templates_test.py,33,class, -1413,_parse_with_unset_ctx,tensorflow/tensorflow/python/autograph/pyct/templates_test.py,42,function, -1414,_CtxChecker,tensorflow/tensorflow/python/autograph/pyct/templates_test.py,48,class, -1415,TemplatesTest,tensorflow/tensorflow/python/autograph/pyct/templates_test.py,64,class, -1416,AnalysisLevel,tensorflow/tensorflow/python/autograph/pyct/transformer.py,32,class, -1417,Context,tensorflow/tensorflow/python/autograph/pyct/transformer.py,41,class,"Contains information about a source code transformation. +1012,replace_as_expression,tensorflow/tensorflow/python/autograph/pyct/templates.py,279,function,"Variant of replace that generates expressions, instead of code blocks." +1013,AnalysisLevel,tensorflow/tensorflow/python/autograph/pyct/transformer.py,32,class, +1014,Context,tensorflow/tensorflow/python/autograph/pyct/transformer.py,41,class,"Contains information about a source code transformation. This object is mutable, and is updated during conversion. Not thread safe. @@ -5687,7 +5346,7 @@ Attributes: AST node to be processed successfully. Useful for error handling. user: An user-supplied context object. The object is opaque to the infrastructure, but will pe passed through to all custom transformations." -1418,EntityInfo,tensorflow/tensorflow/python/autograph/pyct/transformer.py,63,class,"Contains information about a Python entity. +1015,EntityInfo,tensorflow/tensorflow/python/autograph/pyct/transformer.py,63,class,"Contains information about a Python entity. Immutable. @@ -5702,62 +5361,7 @@ Attributes: https://docs.python.org/2/reference/simple_stmts.html#future. namespace: Dict[str, ], containing symbols visible to the entity (excluding parameters)." -1419,_StateStack,tensorflow/tensorflow/python/autograph/pyct/transformer.py,87,class,"Templated context manager. - -This class provides syntactic sugar for a stack of objects of known -type. It allows accessing attributes of the object at the top of the stack -directly against this object, which allows for very terse syntax. - -For example, this code: - - stack = _StateStack(Foo) - stack.enter() - stack.bar - -Is equivalent to: - - stack = [] - stack.append(Foo()) - foo = stack[-1] - foo.bar - -See _State for more on how this is used. - -Attributes: - type: Any, the type of objects that this stack holds - level: int, the current stack depth - stack: List[Any], the actual stack - value: Any, the instance of the object at the top of the stack" -1420,_State,tensorflow/tensorflow/python/autograph/pyct/transformer.py,159,class,"Syntactic sugar for accessing an instance of a StateStack context manager. - -This structure offers syntactic sugar over a dict of stacks of objects -of known type. These structures are useful to keep state during AST walks. -Multiple different scopes can be tracked in parallel. For example: - - s = _State() - - s[foo].enter() - s[bar].enter() # this will not affect s[foo] - -Element access has special semantics: - * keys are a data type - * element values are _StateStack(type=key) objects - * missing elements are automatically added, similarly to defaultdict - -For example, the following block : - - _State s - s[Foo] - -Is equivalent to: - - s = {} - if Foo not in s: - s[Foo] = Foo() - s[Foo] - -See Base for how it's used." -1421,NodeStateTracker,tensorflow/tensorflow/python/autograph/pyct/transformer.py,200,class,"Base class for general-purpose Python code transformation. +1016,NodeStateTracker,tensorflow/tensorflow/python/autograph/pyct/transformer.py,200,class,"Base class for general-purpose Python code transformation. This abstract class provides helpful functions, like state tracking within the scope of arbitrary node, helpers for processing code blocks, debugging, @@ -5803,11 +5407,91 @@ statement: foo.foo_property = node return self.generic_visit(node) ```" -1422,Base,tensorflow/tensorflow/python/autograph/pyct/transformer.py,360,class,"Base class for general-purpose Python-to-Python code transformation. +1017,debug_print,tensorflow/tensorflow/python/autograph/pyct/transformer.py,270,method,Helper method useful for debugging. Prints the AST. +1018,debug_print_src,tensorflow/tensorflow/python/autograph/pyct/transformer.py,276,method,Helper method useful for debugging. Prints the AST as code. +1019,visit_block,tensorflow/tensorflow/python/autograph/pyct/transformer.py,282,method,"A more powerful version of generic_visit for statement blocks. + +An example of a block is the body of an if statement. + +This function allows specifying a postprocessing callback (the +after_visit argument) argument which can be used to move nodes to a new +destination. This is done by after_visit by returning a non-null +second return value, e.g. return new_node, new_destination. + +For example, a transformer could perform the following move: + + foo() + bar() + baz() + + foo() + if cond: + bar() + baz() + +The above could be done with a postprocessor of this kind: + + def after_visit(node): + if node_is_function_call(bar): + new_container_node = build_cond() + new_container_node.body.append(node) + return new_container_node, new_container_node.body + else: + # Once we set a new destination, all subsequent items will be + # moved to it, so we don't need to explicitly handle baz. + return node, None + +Args: + nodes: enumerable of AST node objects. If None, the function returns None. + before_visit: optional callable that is called before visiting each item + in nodes + after_visit: optional callable that takes in an AST node and returns a + tuple (new_node, new_destination). It is called after visiting each item + in nodes. Is used in the same was as the + visit_* methods: new_node will replace the node; if not None, + new_destination must be a list, and subsequent nodes will be placed + in this list instead of the list returned by visit_block. + +Returns: + A list of AST node objects containing the transformed items fron nodes, + except those nodes that have been relocated using after_visit." +1020,Base,tensorflow/tensorflow/python/autograph/pyct/transformer.py,360,class,"Base class for general-purpose Python-to-Python code transformation. This is an extension of ast.NodeTransformer that provides the additional functions offered by NodeStateTracker." -1423,CodeGenerator,tensorflow/tensorflow/python/autograph/pyct/transformer.py,478,class,"Base class for general-purpose Python-to-string code transformation. +1021,create_assignment,tensorflow/tensorflow/python/autograph/pyct/transformer.py,367,method, +1022,apply_to_single_assignments,tensorflow/tensorflow/python/autograph/pyct/transformer.py,374,method,"Applies a function to each individual assignment. + +This function can process a possibly-unpacked (e.g. a, b = c, d) assignment. +It tries to break down the unpacking if possible. In effect, it has the same +effect as passing the assigned values in SSA form to apply_fn. + +Examples: + +The following will result in apply_fn(a, c), apply_fn(b, d): + + a, b = c, d + +The following will result in apply_fn(a, c[0]), apply_fn(b, c[1]): + + a, b = c + +The following will result in apply_fn(a, (b, c)): + + a = b, c + +It uses the visitor pattern to allow subclasses to process single +assignments individually. + +Args: + targets: list, tuple of or individual AST node. Should be used with the + targets field of an ast.Assign node. + values: an AST node. + apply_fn: a function of a single argument, which will be called with the + respective nodes of each single assignment. The signature is + apply_fn(target, value), no return value." +1023,visit,tensorflow/tensorflow/python/autograph/pyct/transformer.py,421,method, +1024,CodeGenerator,tensorflow/tensorflow/python/autograph/pyct/transformer.py,478,class,"Base class for general-purpose Python-to-string code transformation. Similar to Base, but outputs arbitrary strings instead of a Python AST. @@ -5833,75 +5517,10 @@ Example: gen = SimpleCodeGen() gen.visit(node) # gen.code_buffer contains the resulting code" -1424,TransformerTest,tensorflow/tensorflow/python/autograph/pyct/transformer_test.py,30,class, -1425,CodeGeneratorTest,tensorflow/tensorflow/python/autograph/pyct/transformer_test.py,302,class, -1426,_wrap_into_factory,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,38,function,"Wraps an AST into the body of a factory with consistent lexical context. - -The AST is expected to define some symbol with a name given by `entity_name`. - -This mechanism ensures that the resulting transformed entity has lexical -scoping identical to that of the source entity, while allowing extra -parametrization. - -Two nested factories achieve the following: - - 1. The inner factory dynamically creates the entity represented by `nodes`. - 2. The inner factory is parametrized by a custom set of arguments. - 3. The inner factory has a closure identical to that of the transformed - entity. - 4. The inner factory has local variables named like `args`, which `nodes` may - use as additional parameters. - 5. The inner factory returns the variables given by `entity_name`. - 6. The outer factory is niladic. - 7. The outer factory has no closure. - 8. The outer factory creates the necessary lexical scope for the inner - factory, so that the loaded code has the given configuration for - closure/globals. - 9. The outer factory returns the inner factory. - -Roughly speaking, the following code is generated: - - from __future__ import future_feature_1 - from __future__ import future_feature_2 - ... - - def outer_factory(): - closure_var_1 = None - closure_var_2 = None - ... - - def inner_factory(arg_1, arg_2, ...): - <> - return entity - - return inner_factory - -The lexical scoping is created using dummy symbol declarations which create -local fariables in the body of the outer factory, so that the Python parser -correctly marks them as free non-global variables upon load (that is, it -creates cell slots for each symbol. Thes symbols are initialized with None, -but their values are not expected to be used; instead, the caller is expected -to replace them with the cells of the source entity. For more details, see: -https://docs.python.org/3/reference/executionmodel.html#binding-of-names - -Args: - nodes: Tuple[ast.AST], the source code to wrap. - entity_name: Union[Text, ast.AST], the name of the principal entity that - `nodes` define. - inner_factory_name: Text, the name of the inner factory. - outer_factory_name: Text, the name of the outer factory. - closure_vars: Iterable[Text], names of the closure variables for the inner - factory. - factory_args: Iterable[Text], names of additional arguments for the - inner factory. Useful to configure variables that the converted code can - use. Typically, these are modules. - future_features: Iterable[Text], names of future statements to associate the - code with. - -Returns: - ast.AST" -1427,_PythonFnFactory,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,147,class,Helper object that wraps a Python function factory. -1428,GenericTranspiler,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,227,class,"A generic transpiler for Python functions. +1025,emit,tensorflow/tensorflow/python/autograph/pyct/transformer.py,513,method, +1026,code_buffer,tensorflow/tensorflow/python/autograph/pyct/transformer.py,517,method, +1027,visit,tensorflow/tensorflow/python/autograph/pyct/transformer.py,520,method, +1028,GenericTranspiler,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,227,class,"A generic transpiler for Python functions. Its interface is the `transform` API, which can process Python function objects. Internally, it handles parsing. @@ -5922,7 +5541,59 @@ Example: result = transformer.transform(f, ...) # result is the output" -1429,PyToPy,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,368,class,"A generic Python-to-Python transpiler. +1029,get_transformed_name,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,251,method,Returns a name for the output function. Subclasses may override this. +1030,transform_ast,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,259,method,"Performs an actual transformation of a function's AST. + +Subclasses must implement this method, and do not usually call it. + +Args: + node: One or more ast.AST nodes representing the AST to be transformed. + ctx: transformer.Context." +1031,transform,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,270,method,"Transforms a Python object. + +Users typically call this method. + +Args: + obj: A Python object, function, type, etc. + user_context: An opaque object (may be None) that is forwarded to + transform_ast, through the ctx.user_context argument. +Returns: + Tre result of calling transform_function. + +Raises: + NotImplementedError: if the type of obj is not handled." +1032,transform_module,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,300,method,"Transforms a module. + +Subclasses may override this method. The return value is opaque. + +The method receives the original AST. The result is passed as-is to the +output of `transform`. + +Args: + mod: A Python module. + user_context: An opaque object (may be None) that is forwarded to + transform_ast, through the ctx.user_context argument. +Returns: + List[Tuple[Any, Any]]. By default it returns the output of transform_ast, + evaluated on each supported member, other than modules, together with a + `transformer.Context` containing information about the transformation + process." +1033,transform_function,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,328,method,"Transforms a function. + +Subclasses may override this method. The return value is opaque. + +The method receives the original AST. The result is passed as-is to the +output of `transform`. + +Args: + fn: A function or lambda. + user_context: An opaque object (may be None) that is forwarded to + transform_ast, through the ctx.user_context argument. +Returns: + Tuple[Any, Any]. By default it returns the output of transform_ast, + together with a `transformer.Context` containing information about the + transformation process." +1034,PyToPy,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,368,class,"A generic Python-to-Python transpiler. Its `transform` method offers a function-in, function-out interface. Internally, it takes care of parsing, caching and loading of the translated @@ -5949,11 +5620,48 @@ Example: The transformed function has access to the same namespace as the original function. To allow access to internal APIs, users may inject additional symbols by overriding `get_extra_locals`." -1430,FlipSignTransformer,tensorflow/tensorflow/python/autograph/pyct/transpiler_test.py,30,class, -1431,TestTranspiler,tensorflow/tensorflow/python/autograph/pyct/transpiler_test.py,38,class, -1432,PyToPyTest,tensorflow/tensorflow/python/autograph/pyct/transpiler_test.py,55,class, -1433,DummyGensym,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,40,class,A dumb gensym that suffixes a stem by sequential numbers from 1000. -1434,ASTEdgePattern,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,60,class,"A pattern defining a type of AST edge. +1035,get_extra_locals,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,402,method,"Returns extra static local variables to be made to transformed code. + +Subclasses must override this. + +Returns: + extra_locals: A Dict[Text, Any] containing additional variables to make + available to the transformed code." +1036,get_caching_key,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,413,method,"Returns a unique key to use for caching. + +Subclasses must override this. + +Calls made to `transform_function` with functions that have the same code +object and caching key will return a cached instance on subsequent +invocations. + +Args: + user_context: The context object which was passed to `transform`. + +Returns: + extra_locals: A hashable." +1037,transform_function,tensorflow/tensorflow/python/autograph/pyct/transpiler.py,436,method,"Transforms a function. See GenericTranspiler.trasnform_function. + +This overload wraps the parent's `transform_function`, adding caching and +facilities to instantiate the output as a Python object. It also +adds facilities to make new symbols available to the generated Python code, +visible as local variables - see `get_extra_locals`. + +Args: + fn: A function or lambda. + user_context: An opaque object (may be None) that is forwarded to + transform_ast, through the ctx.user_context argument. +Returns: + A tuple: + * A function or lambda with the same signature and closure as `fn` + * The temporary module into which the transformed function was loaded + * The source map as a + Dict[origin_info.LineLocation, origin_info.OriginInfo]" +1038,FlipSignTransformer,tensorflow/tensorflow/python/autograph/pyct/transpiler_test.py,30,class, +1039,visit_BinOp,tensorflow/tensorflow/python/autograph/pyct/transpiler_test.py,32,method, +1040,DummyGensym,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,40,class,A dumb gensym that suffixes a stem by sequential numbers from 1000. +1041,new_name,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,50,method, +1042,ASTEdgePattern,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,60,class,"A pattern defining a type of AST edge. This consists of three components: - The type of the parent node, checked with isinstance, @@ -5964,22 +5672,47 @@ If all three match, the whole pattern is considered to match. In all three slots, the special value `anf.ANY` is treated as ""match anything"". The internal nodes are produced from the `gast` library rather than the standard `ast` module, which may affect `isinstance` checks." -1435,AnfTransformer,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,89,class,Performs the conversion to A-normal form (ANF). -1436,_is_py2_name_constant,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,483,function, -1437,_is_trivial,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,487,function,"Returns whether to consider the given node 'trivial'. - -The definition of 'trivial' is a node that can't meaningfully be pulled out -into its own assignment statement. - -This is surprisingly difficult to do robustly across versions of Python and -gast, as the parsing of constants has changed, if I may, constantly. - -Args: - node: An AST node to check for triviality - -Returns: - trivial: A Python `bool` indicating whether the node is trivial." -1438,transform,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,527,function,"Converts the given node to A-normal form (ANF). +1043,matches,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,76,method,Computes whether this pattern matches the given edge. +1044,AnfTransformer,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,89,class,Performs the conversion to A-normal form (ANF). +1045,visit_Return,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,256,method, +1046,visit_Delete,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,259,method, +1047,visit_Assign,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,262,method, +1048,visit_AugAssign,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,265,method, +1049,visit_Print,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,268,method, +1050,visit_For,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,271,method, +1051,visit_AsyncFor,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,290,method, +1052,visit_While,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,295,method, +1053,visit_If,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,307,method, +1054,visit_With,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,324,method, +1055,visit_AsyncWith,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,343,method, +1056,visit_Raise,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,348,method, +1057,visit_Assert,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,353,method, +1058,visit_Exec,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,361,method, +1059,visit_Expr,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,366,method, +1060,visit_BoolOp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,371,method, +1061,visit_BinOp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,376,method, +1062,visit_UnaryOp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,379,method, +1063,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,382,method, +1064,visit_IfExp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,387,method, +1065,visit_Dict,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,393,method, +1066,visit_Set,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,396,method, +1067,visit_ListComp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,399,method, +1068,visit_SetComp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,405,method, +1069,visit_DictComp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,411,method, +1070,visit_GeneratorExp,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,417,method, +1071,visit_Await,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,423,method, +1072,visit_Yield,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,428,method, +1073,visit_YieldFrom,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,431,method, +1074,visit_Compare,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,436,method, +1075,visit_Call,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,443,method, +1076,visit_Repr,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,446,method, +1077,visit_FormattedValue,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,451,method, +1078,visit_JoinedStr,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,456,method, +1079,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,461,method, +1080,visit_Subscript,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,464,method, +1081,visit_List,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,470,method, +1082,visit_Tuple,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,476,method, +1083,transform,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf.py,527,function,"Converts the given node to A-normal form (ANF). The general idea of A-normal form: https://en.wikipedia.org/wiki/A-normal_form @@ -6054,16 +5787,8 @@ Args: argument provide? config: Optional ANF configuration. If omitted, ANF replaces all expression expect literal constants." -1439,exec_test_function,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,34,function, -1440,exec_expected_result,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,40,function, -1441,AnfTestBase,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,49,class, -1442,AnfTransformerTest,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,85,class, -1443,AnfNonTransformationTest,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,433,class,"Test that specifying ""no transformation"" does nothing. - -Reuses all the examples of AnfTransformerTest by overriding -`assert_body_anfs_as_expected_`." -1444,AnfConfiguredTest,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,454,class, -1445,Scope,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,36,class,"Encloses local symbol definition and usage information. +1084,exec_expected_result,tensorflow/tensorflow/python/autograph/pyct/common_transformers/anf_test.py,40,function, +1085,Scope,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,36,class,"Encloses local symbol definition and usage information. This can track for instance whether a symbol is modified in the current scope. Note that scopes do not necessarily align with Python's scopes. For example, @@ -6119,26 +5844,62 @@ time. However, compound ones like if statements can. In that latter case, it's undefined whether the symbol is actually modified or deleted upon statement exit. Certain analyses like reaching definitions need to be careful about this." -1446,_Comprehension,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,214,class, -1447,_FunctionOrClass,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,224,class, -1448,ActivityAnalyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,230,class,"Annotates nodes with local scope information. +1086,enclosing_scope,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,130,method, +1087,referenced,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,137,method, +1088,free_vars,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,143,method, +1089,copy_from,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,147,method,Recursively copies the contents of this scope from another scope. +1090,copy_of,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,162,method, +1091,merge_from,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,172,method,Adds all activity from another scope to this scope. +1092,finalize,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,185,method,Freezes this scope. +1093,mark_param,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,207,method, +1094,ActivityAnalyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,230,class,"Annotates nodes with local scope information. See Scope. The use of this class requires that qual_names.resolve() has been called on the node. This class will ignore nodes have not been annotated with their qualified names." -1449,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,707,function, -1450,ActivityAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity_py3_test.py,31,class,Tests which can only run in Python 3. -1451,ScopeTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity_test.py,41,class, -1452,ActivityAnalyzerTestBase,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity_test.py,114,class, -1453,ActivityAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity_test.py,148,class, -1454,NoValue,tensorflow/tensorflow/python/autograph/pyct/static_analysis/annos.py,27,class, -1455,NodeAnno,tensorflow/tensorflow/python/autograph/pyct/static_analysis/annos.py,33,class,"Additional annotations used by the static analyzer. +1095,visit_Import,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,353,method, +1096,visit_ImportFrom,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,356,method, +1097,visit_Global,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,359,method, +1098,visit_Nonlocal,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,368,method, +1099,visit_Expr,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,378,method, +1100,visit_Raise,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,381,method, +1101,visit_Return,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,384,method, +1102,visit_Assign,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,387,method, +1103,visit_AnnAssign,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,390,method, +1104,visit_AugAssign,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,399,method, +1105,visit_Delete,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,413,method, +1106,visit_Name,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,416,method, +1107,visit_alias,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,422,method, +1108,visit_Attribute,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,435,method, +1109,visit_Subscript,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,443,method, +1110,visit_Print,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,450,method, +1111,visit_Assert,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,457,method, +1112,visit_Call,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,460,method, +1113,visit_comprehension,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,509,method, +1114,visit_DictComp,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,516,method, +1115,visit_ListComp,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,519,method, +1116,visit_SetComp,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,522,method, +1117,visit_GeneratorExp,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,525,method, +1118,visit_ClassDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,528,method, +1119,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,568,method, +1120,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,606,method, +1121,visit_With,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,648,method, +1122,visit_withitem,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,654,method, +1123,visit_If,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,657,method, +1124,visit_For,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,668,method, +1125,visit_While,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,685,method, +1126,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,696,method, +1127,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/activity.py,707,function, +1128,NoValue,tensorflow/tensorflow/python/autograph/pyct/static_analysis/annos.py,27,class, +1129,NodeAnno,tensorflow/tensorflow/python/autograph/pyct/static_analysis/annos.py,33,class,"Additional annotations used by the static analyzer. These are in addition to the basic annotations declared in anno.py." -1456,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,40,class,CFG visitor that performs liveness analysis at statement level. -1457,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,96,class,"Runs liveness analysis on each of the functions defined in the AST. +1130,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,40,class,CFG visitor that performs liveness analysis at statement level. +1131,init_state,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,47,method, +1132,visit_node,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,50,method, +1133,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,96,class,"Runs liveness analysis on each of the functions defined in the AST. If a function defined other local functions, those will have separate CFGs. However, dataflow analysis needs to tie up these CFGs to properly emulate the @@ -6153,7 +5914,17 @@ subfunction. For example: This analyzer runs liveness analysis on each individual function, accounting for the effect above." -1458,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,206,function,"Resolves the live symbols at the exit of control flow statements. +1134,visit,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,121,method, +1135,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,142,method, +1136,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,145,method, +1137,visit_If,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,168,method, +1138,visit_For,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,173,method, +1139,visit_While,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,178,method, +1140,visit_Try,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,183,method, +1141,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,188,method, +1142,visit_With,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,193,method, +1143,visit_Expr,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,197,method, +1144,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness.py,206,function,"Resolves the live symbols at the exit of control flow statements. Args: node: ast.AST @@ -6163,10 +5934,7 @@ Args: the analysis. Returns: ast.AST" -1459,LivenessAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness_py3_test.py,30,class,Tests which can only run in Python 3. -1460,LivenessAnalyzerTestBase,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness_test.py,37,class, -1461,LivenessAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/liveness_test.py,76,class, -1462,Definition,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,40,class,"Definition objects describe a unique definition of a variable. +1145,Definition,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,40,class,"Definition objects describe a unique definition of a variable. Subclasses of this may be used by passing an appropriate factory function to resolve. @@ -6174,15 +5942,10 @@ resolve. Attributes: param_of: Optional[ast.AST] directives: Dict, optional definition annotations" -1463,_NodeState,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,59,class,"Abstraction for the state of the CFG walk for reaching definition analysis. - -This is a value type. Only implements the strictly necessary operators. - -Attributes: - value: Dict[qual_names.QN, Set[Definition, ...]], the defined symbols and - their possible definitions" -1464,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,112,class,CFG visitor that determines reaching definitions at statement level. -1465,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,169,class,"AST visitor that annotates each symbol name with its reaching definitions. +1146,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,112,class,CFG visitor that determines reaching definitions at statement level. +1147,init_state,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,120,method, +1148,visit_node,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,123,method, +1149,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,169,class,"AST visitor that annotates each symbol name with its reaching definitions. Simultaneously, the visitor runs the dataflow analysis on each function node, accounting for the effect of closures. For example: @@ -6191,7 +5954,15 @@ accounting for the effect of closures. For example: bar = 1 def baz(): # bar = 1 reaches here" -1466,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,279,function,"Resolves reaching definitions for each symbol. +1150,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,189,method, +1151,visit_Name,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,204,method, +1152,visit_If,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,233,method, +1153,visit_For,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,237,method, +1154,visit_While,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,253,method, +1155,visit_Try,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,257,method, +1156,visit_ExceptHandler,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,261,method, +1157,visit,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,267,method, +1158,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py,279,function,"Resolves reaching definitions for each symbol. Args: node: ast.AST @@ -6200,19 +5971,11 @@ Args: definition_factory: Callable[[], Definition] Returns: ast.AST" -1467,ReachingDefinitionsAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions_py3_test.py,26,class,Tests which can only run in Python 3. -1468,ReachingDefinitionsAnalyzerTestBase,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions_test.py,38,class, -1469,ReachingDefinitionsAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_definitions_test.py,88,class, -1470,Definition,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,32,class,Definition objects describe a unique definition of a function. -1471,_NodeState,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,39,class,"Abstraction for the state of the CFG walk for reaching definition analysis. - -This is a value type. Only implements the strictly necessary operators. - -Attributes: - value: Dict[qual_names.QN, Set[Definition, ...]], the defined symbols and - their possible definitions" -1472,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,76,class,CFG visitor that determines reaching definitions at statement level. -1473,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,109,class,"AST visitor that annotates each symbol name with its reaching definitions. +1159,Definition,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,32,class,Definition objects describe a unique definition of a function. +1160,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,76,class,CFG visitor that determines reaching definitions at statement level. +1161,init_state,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,85,method, +1162,visit_node,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,88,method, +1163,TreeAnnotator,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,109,class,"AST visitor that annotates each symbol name with its reaching definitions. Simultaneously, the visitor runs the dataflow analysis on each function node, accounting for the effect of closures. For example: @@ -6222,7 +5985,10 @@ accounting for the effect of closures. For example: pass def g(): # `def f` reaches here" -1474,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,170,function,"Resolves reaching definitions for each symbol. +1164,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,147,method, +1165,visit_Lambda,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,150,method, +1166,visit,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,153,method, +1167,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs.py,170,function,"Resolves reaching definitions for each symbol. Args: node: ast.AST @@ -6230,8 +5996,7 @@ Args: graphs: Dict[ast.FunctionDef, cfg.Graph] Returns: ast.AST" -1475,ReachingFndefsAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/reaching_fndefs_test.py,33,class, -1476,Resolver,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,41,class,"Resolver objects handle the process of looking up actual names and types. +1168,Resolver,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,41,class,"Resolver objects handle the process of looking up actual names and types. All resolve_* methods: * have a first namespace argument, mapping string to actual values @@ -6241,20 +6006,43 @@ All resolve_* methods: All resolve_* methods must return either: * a set of `type` objects * None" -1477,_SymbolTable,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,83,class,"Abstraction for the state of the CFG walk for type inference. +1169,res_name,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,54,method,"Resolves the type an external (e.g. closure, global) variable." +1170,res_value,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,58,method,Resolves the type a literal value. +1171,res_call,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,63,method,"Resolves the return type an external function or method call. -This is a value type. Only implements the strictly necessary operators. - -Attributes: - value: Dict[qual_names.QN, Set[Type]], mapping symbols to the set of - possible types." -1478,StmtInferrer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,162,class,"Runs type inference on a single AST statement. +Args: + ns: namespace + name: str, the function name + target: if this is a method call, the types of the method target, None + otherwise + args: list or argument types + keywords: dict of name to argument types + starargs: list of types of the *args arguments (should be at most one) + kwargs: list of types of the **kwargs arguments (in order of appearance)" +1172,res_arg,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,78,method,Resolves the type of a (possibly annotated) function argument. +1173,StmtInferrer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,162,class,"Runs type inference on a single AST statement. This visitor annotates most nodes with type information. It also sets types for the symbols modified by this statement in its types_out property." -1479,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,329,class,CFG visitor that propagates type information across statements. -1480,FunctionVisitor,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,394,class,AST visitor that applies type inference to each function separately. -1481,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,417,function,"Performs type inference. +1174,visit,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,178,method, +1175,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,185,method, +1176,visit_Constant,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,189,method, +1177,visit_Tuple,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,192,method, +1178,visit_List,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,203,method, +1179,visit_Set,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,212,method, +1180,visit_Name,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,215,method, +1181,visit_Call,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,244,method, +1182,visit_Index,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,273,method, +1183,visit_Assign,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,276,method, +1184,visit_Subscript,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,284,method, +1185,visit_Compare,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,294,method, +1186,visit_BinOp,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,316,method, +1187,Analyzer,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,329,class,CFG visitor that propagates type information across statements. +1188,init_state,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,348,method, +1189,visit_node,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,364,method, +1190,FunctionVisitor,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,394,class,AST visitor that applies type inference to each function separately. +1191,visit_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,402,method, +1192,resolve,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference.py,417,function,"Performs type inference. Args: node: ast.AST @@ -6264,30 +6052,51 @@ Args: Returns: ast.AST" -1482,TestResolver,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference_test.py,32,class,A very basic resolver for testing. -1483,TestTranspiler,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference_test.py,58,class, -1484,TypeInferenceAnalyzerTest,tensorflow/tensorflow/python/autograph/pyct/static_analysis/type_inference_test.py,77,class, -1485,simple_function,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,23,function,Docstring. -1486,nested_functions,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,28,function,Docstring. -1487,function_with_print,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,37,function, -1488,SimpleClass,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,44,class, -1489,function_with_multiline_call,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,53,function,Docstring. -1490,basic_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,61,function, -1491,decorated_function,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,67,function, -1492,NodeSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,30,class, -1493,StatementSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,39,class, -1494,ExpressionSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,49,class, -1495,CompareSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,58,class, -1496,BinaryOpSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,71,class, -1497,UnaryOpSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,83,class, -1498,NameSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,87,class, -1499,CodeGenerator,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,98,class,Generate random syntactically-valid Python ASTs. -1500,generate_random_functiondef,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,233,function, -1501,CodeGenTest,tensorflow/tensorflow/python/autograph/pyct/testing/codegen_test.py,28,class, -1502,wrapping_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,24,function, -1503,standalone_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,33,function, -1504,functional_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,41,function, -1505,set_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,41,function,"Sets the AutoGraph verbosity level. +1193,simple_function,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,23,function,Docstring. +1194,nested_functions,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,28,function,Docstring. +1195,function_with_print,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,37,function, +1196,SimpleClass,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,44,class, +1197,simple_method,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,46,method, +1198,method_with_print,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,49,method, +1199,function_with_multiline_call,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,53,function,Docstring. +1200,basic_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,61,function, +1201,decorated_function,tensorflow/tensorflow/python/autograph/pyct/testing/basic_definitions.py,67,function, +1202,NodeSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,30,class, +1203,sample,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,33,method, +1204,StatementSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,39,class, +1205,ExpressionSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,49,class, +1206,CompareSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,58,class, +1207,BinaryOpSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,71,class, +1208,UnaryOpSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,83,class, +1209,NameSampler,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,87,class, +1210,CodeGenerator,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,98,class,Generate random syntactically-valid Python ASTs. +1211,generate_statement,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,105,method,"Generate a statement node, dispatching to the correct class method." +1212,sample_node_list,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,124,method,"Generate a list of statements of random length. + +Args: + low: Fewest number of statements to generate. + high: Highest number of statements to generate. + generator: Function to call to generate nodes. + +Returns: + A list of statements." +1213,generate_Name,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,140,method, +1214,generate_BinOp,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,145,method, +1215,generate_Compare,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,151,method, +1216,generate_UnaryOp,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,155,method, +1217,generate_expression,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,160,method, +1218,generate_Assign,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,167,method,Generate an Assign node. +1219,generate_If,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,177,method,Generate an If node. +1220,generate_While,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,196,method,Generate a While node. +1221,generate_Call,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,207,method, +1222,generate_Return,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,210,method, +1223,generate_Print,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,213,method, +1224,generate_FunctionDef,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,216,method,Generate a FunctionDef node. +1225,generate_random_functiondef,tensorflow/tensorflow/python/autograph/pyct/testing/codegen.py,233,function, +1226,wrapping_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,24,function, +1227,standalone_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,33,function, +1228,functional_decorator,tensorflow/tensorflow/python/autograph/pyct/testing/decorators.py,41,function, +1229,set_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,41,function,"Sets the AutoGraph verbosity level. _Debug logging in AutoGraph_ @@ -6329,7 +6138,7 @@ Args: 0 means no logging. When reporting bugs, it is recommended to set this value to a larger number, like 10. alsologtostdout: bool, whether to also output log messages to `sys.stdout`." -1506,trace,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,92,function,"Traces argument information at compilation time. +1230,trace,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,92,function,"Traces argument information at compilation time. `trace` is useful when debugging, and it always executes during the tracing phase, that is, when the TF graph is constructed. @@ -6346,15 +6155,14 @@ for i in tf.range(10): Args: *args: Arguments to print to `sys.stdout`." -1507,get_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,114,function, -1508,has_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,121,function, -1509,_output_to_stdout,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,125,function, -1510,error,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,131,function, -1511,log,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,138,function, -1512,warn,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,145,function, -1513,BasicRef,tensorflow/tensorflow/python/autograph/utils/compat_util.py,27,class,This shim emulates the nonlocal keyword in Py2-compatible source. -1514,deprecated_py2_support,tensorflow/tensorflow/python/autograph/utils/compat_util.py,34,function,Swaps calling module with a Py2-specific implementation. Noop in Py3. -1515,control_dependency_on_returns,tensorflow/tensorflow/python/autograph/utils/context_managers.py,27,function,"Create a TF control dependency on the return values of a function. +1231,get_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,114,function, +1232,has_verbosity,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,121,function, +1233,error,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,131,function, +1234,log,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,138,function, +1235,warn,tensorflow/tensorflow/python/autograph/utils/ag_logging.py,145,function, +1236,BasicRef,tensorflow/tensorflow/python/autograph/utils/compat_util.py,27,class,This shim emulates the nonlocal keyword in Py2-compatible source. +1237,deprecated_py2_support,tensorflow/tensorflow/python/autograph/utils/compat_util.py,34,function,Swaps calling module with a Py2-specific implementation. Noop in Py3. +1238,control_dependency_on_returns,tensorflow/tensorflow/python/autograph/utils/context_managers.py,27,function,"Create a TF control dependency on the return values of a function. If the function had no return value, a no-op context is returned. @@ -6363,8 +6171,7 @@ Args: Returns: A context manager." -1516,ContextManagersTest,tensorflow/tensorflow/python/autograph/utils/context_managers_test.py,28,class, -1517,alias_tensors,tensorflow/tensorflow/python/autograph/utils/misc.py,27,function,"Wraps any Tensor arguments with an identity op. +1239,alias_tensors,tensorflow/tensorflow/python/autograph/utils/misc.py,27,function,"Wraps any Tensor arguments with an identity op. Any other argument, including Variables, is returned unchanged. @@ -6376,13 +6183,12 @@ Returns: Raises: ValueError: If args doesn't meet the requirements." -1518,get_range_len,tensorflow/tensorflow/python/autograph/utils/misc.py,55,function, -1519,MiscTest,tensorflow/tensorflow/python/autograph/utils/misc_test.py,30,class, -1520,MatchDType,tensorflow/tensorflow/python/autograph/utils/py_func.py,28,class,"Allows matching the dtype of an argument. +1240,get_range_len,tensorflow/tensorflow/python/autograph/utils/misc.py,55,function, +1241,MatchDType,tensorflow/tensorflow/python/autograph/utils/py_func.py,28,class,"Allows matching the dtype of an argument. Used in conjunction with function calls. For example, MatchDType(0) will match the DType of the first argument." -1521,wrap_py_func,tensorflow/tensorflow/python/autograph/utils/py_func.py,38,function,"Helper that wraps a callable to py_func. +1242,wrap_py_func,tensorflow/tensorflow/python/autograph/utils/py_func.py,38,function,"Helper that wraps a callable to py_func. The helper passes tensor arguments through the py_func interface. Non-tensor arguments are allowed, and will be passed to f directly. Note that non-tensor @@ -6405,54 +6211,32 @@ Returns: The return values of f converted to tensor. Raises: ValueError: if any of the arguments are incorrect." -1522,PyFuncTest,tensorflow/tensorflow/python/autograph/utils/py_func_test.py,27,class, -1523,dynamic_list_append,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,26,function,Converts a list append call inline. -1524,TensorList,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,43,class,Tensor list wrapper API-compatible with Python built-in list. -1525,TensorListTest,tensorflow/tensorflow/python/autograph/utils/tensor_list_test.py,32,class, -1526,is_dense_tensor,tensorflow/tensorflow/python/autograph/utils/tensors.py,32,function, -1527,is_tensor_array,tensorflow/tensorflow/python/autograph/utils/tensors.py,38,function, -1528,is_tensor_list,tensorflow/tensorflow/python/autograph/utils/tensors.py,42,function, -1529,is_range_tensor,tensorflow/tensorflow/python/autograph/utils/tensors.py,51,function,Returns True if a tensor is the result of a tf.range op. Best effort. -1530,TensorsTest,tensorflow/tensorflow/python/autograph/utils/tensors_test.py,30,class, -1531,AutoGraphTestCase,tensorflow/tensorflow/python/autograph/utils/testing.py,30,class,"Tests specialized for AutoGraph, which run as tf.functions. - -These tests use a staged programming-like approach: most of the test code runs -as-is inside a tf.function, but the assertions are lifted outside the -function, and run with the corresponding function values instead. - -For example, the test: - - def test_foo(self): - baz = bar(); - self.assertEqual(baz, value) - -is equivalent to writing: - - def test_foo(self): - @tf.function - def test_fn(): - baz = bar(); - return baz, value - - baz_actual, value_actual = test_fn() - self.assertEqual(baz_actual, value_actual)" -1532,list_local_devices,tensorflow/tensorflow/python/client/device_lib.py,25,function,"List the available devices available in the local process. +1243,dynamic_list_append,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,26,function,Converts a list append call inline. +1244,TensorList,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,43,class,Tensor list wrapper API-compatible with Python built-in list. +1245,append,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,51,method, +1246,pop,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,54,method, +1247,clear,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,58,method, +1248,count,tensorflow/tensorflow/python/autograph/utils/tensor_list.py,61,method, +1249,is_dense_tensor,tensorflow/tensorflow/python/autograph/utils/tensors.py,32,function, +1250,is_tensor_array,tensorflow/tensorflow/python/autograph/utils/tensors.py,38,function, +1251,is_tensor_list,tensorflow/tensorflow/python/autograph/utils/tensors.py,42,function, +1252,is_range_tensor,tensorflow/tensorflow/python/autograph/utils/tensors.py,51,function,Returns True if a tensor is the result of a tf.range op. Best effort. +1253,list_local_devices,tensorflow/tensorflow/python/client/device_lib.py,25,function,"List the available devices available in the local process. Args: session_config: a session config proto or None to use the default config. Returns: A list of `DeviceAttribute` protocol buffers." -1533,DeviceLibTest,tensorflow/tensorflow/python/client/device_lib_test.py,28,class, -1534,PywrapeventsWriterTest,tensorflow/tensorflow/python/client/events_writer_test.py,33,class, -1535,main,tensorflow/tensorflow/python/client/notebook.py,53,function, -1536,TF_NewSessionOptions,tensorflow/tensorflow/python/client/pywrap_tf_session.py,51,function, -1537,TF_Reset,tensorflow/tensorflow/python/client/pywrap_tf_session.py,65,function, -1538,SessionInterface,tensorflow/tensorflow/python/client/session.py,51,class,Base class for implementations of TensorFlow client sessions. -1539,_get_indexed_slices_value_from_fetches,tensorflow/tensorflow/python/client/session.py,77,function, -1540,_get_feeds_for_indexed_slices,tensorflow/tensorflow/python/client/session.py,83,function, -1541,_convert_to_numpy_obj,tensorflow/tensorflow/python/client/session.py,139,function,Explicitly convert obj based on numpy type except for string type. -1542,register_session_run_conversion_functions,tensorflow/tensorflow/python/client/session.py,144,function,"Register fetch and feed conversion functions for `tf.Session.run()`. +1254,TF_NewSessionOptions,tensorflow/tensorflow/python/client/pywrap_tf_session.py,51,function, +1255,TF_Reset,tensorflow/tensorflow/python/client/pywrap_tf_session.py,65,function, +1256,SessionInterface,tensorflow/tensorflow/python/client/session.py,51,class,Base class for implementations of TensorFlow client sessions. +1257,graph,tensorflow/tensorflow/python/client/session.py,55,method,"The underlying TensorFlow graph, to be used in building Operations." +1258,sess_str,tensorflow/tensorflow/python/client/session.py,60,method,The TensorFlow process to which this session will connect. +1259,run,tensorflow/tensorflow/python/client/session.py,64,method,Runs operations in the session. See `BaseSession.run()` for details. +1260,partial_run_setup,tensorflow/tensorflow/python/client/session.py,68,method,Sets up the feeds and fetches for partial runs in the session. +1261,partial_run,tensorflow/tensorflow/python/client/session.py,72,method,Continues the execution with additional feeds and fetches. +1262,register_session_run_conversion_functions,tensorflow/tensorflow/python/client/session.py,144,function,"Register fetch and feed conversion functions for `tf.Session.run()`. This function registers a triple of conversion functions for fetching and/or feeding values of user-defined types in a call to tf.Session.run(). @@ -6492,71 +6276,296 @@ Args: Raises: ValueError: If `tensor_type` has already been registered." -1543,_is_attrs_instance,tensorflow/tensorflow/python/client/session.py,199,function,Returns True if the given obj is an instance of attrs-decorated class. -1544,_get_attrs_values,tensorflow/tensorflow/python/client/session.py,204,function,Returns the list of values from an attrs instance. -1545,_FetchMapper,tensorflow/tensorflow/python/client/session.py,210,class,"Definition of the interface provided by fetch mappers. - -Fetch mappers are utility classes used by the _FetchHandler to handle -arbitrary structures for the `fetch` argument to `Session.run()`. - -The `fetch` argument can be of various shapes: single tensor or op, list of -fetches, tuple of fetches, namedtuple of fetches, or dict of fetches. The -structures can be arbitrarily nested. - -The low level run() API only wants a list of tensor or op names. The various -`_FetchMapper` subclasses below take care of handling the different shapes: -uniquifying the fetches, and constructing results with the original shape." -1546,_ElementFetchMapper,tensorflow/tensorflow/python/client/session.py,282,class,Fetch mapper for singleton tensors and ops. -1547,_uniquify_fetches,tensorflow/tensorflow/python/client/session.py,329,function,"Uniquifies fetches from a list of fetch_mappers. - -This is a utility function used by _ListFetchMapper and _DictFetchMapper. It -gathers all the unique fetches from a list of mappers and builds a list -containing all of them but without duplicates (unique_fetches). - -It also returns a 2-D list of integers (values_indices) indicating at which -index in unique_fetches the fetches of the mappers are located. - -This list is as follows: - values_indices[mapper_index][mapper_fetch_index] = unique_fetches_index - -Args: - fetch_mappers: list of fetch mappers. - -Returns: - A list of fetches. - A 2-D list of integers." -1548,_ListFetchMapper,tensorflow/tensorflow/python/client/session.py,365,class,"Fetch mapper for lists, tuples, and namedtuples." -1549,_DictFetchMapper,tensorflow/tensorflow/python/client/session.py,399,class,Fetch mapper for dicts. -1550,_AttrsFetchMapper,tensorflow/tensorflow/python/client/session.py,425,class,Fetch mapper for attrs decorated classes. -1551,_FetchHandler,tensorflow/tensorflow/python/client/session.py,449,class,"Handler for structured fetches. - -Given a graph, a user-provided structure for fetches, and a feed dict, this -class takes care of generating a list of tensor names to fetch and op names -to run for a low level `run()` call. - -Given the results of the low level run call, this class can also rebuild a -result structure matching the user-provided structure for fetches, but -containing the corresponding results." -1552,_name_list,tensorflow/tensorflow/python/client/session.py,573,function,"Utility function for transitioning to the new session API. - -Args: - tensor_list: a list of `Tensor`s. - -Returns: - A list of each `Tensor`s name (as byte arrays)." -1553,_DeviceAttributes,tensorflow/tensorflow/python/client/session.py,585,class,"Struct-like object describing a device's attributes. - -Each device has 3 key properties: - - name: the fully-qualified TensorFlow path to the device. For - example: /job:worker/replica:0/task:3/device:CPU:0 - - device_type: the type of the device (e.g. CPU, GPU, TPU, etc.) - - memory_limit_bytes: the maximum amount of memory available on the device - (in bytes)." -1554,BaseSession,tensorflow/tensorflow/python/client/session.py,627,class,"A class for interacting with a TensorFlow computation. +1263,BaseSession,tensorflow/tensorflow/python/client/session.py,627,class,"A class for interacting with a TensorFlow computation. The BaseSession enables incremental graph building with inline execution of Operations and evaluation of Tensors." -1555,Session,tensorflow/tensorflow/python/client/session.py,1509,class,"A class for running TensorFlow operations. +1264,list_devices,tensorflow/tensorflow/python/client/session.py,706,method,"Lists available devices in this session. + +```python +devices = sess.list_devices() +for d in devices: + print(d.name) +``` + +Where: + Each element in the list has the following properties + name: A string with the full name of the device. ex: + `/job:worker/replica:0/task:3/device:CPU:0` + device_type: The type of the device (e.g. `CPU`, `GPU`, `TPU`.) + memory_limit: The maximum amount of memory available on the device. + Note: depending on the device, it is possible the usable memory could + be substantially less. + +Raises: + tf.errors.OpError: If it encounters an error (e.g. session is in an + invalid state, or network errors occur). + +Returns: + A list of devices in the session." +1265,close,tensorflow/tensorflow/python/client/session.py,744,method,"Closes this session. + +Calling this method frees all resources associated with the session. + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + closing the TensorFlow session." +1266,graph,tensorflow/tensorflow/python/client/session.py,775,method,The graph that was launched in this session. +1267,graph_def,tensorflow/tensorflow/python/client/session.py,780,method,"A serializable version of the underlying TensorFlow graph. + +Returns: + A graph_pb2.GraphDef proto containing nodes for all of the Operations in + the underlying TensorFlow graph." +1268,sess_str,tensorflow/tensorflow/python/client/session.py,790,method, +1269,as_default,tensorflow/tensorflow/python/client/session.py,793,method,"Returns a context manager that makes this object the default session. + +Use with the `with` keyword to specify that calls to +`tf.Operation.run` or `tf.Tensor.eval` should be executed in +this session. + +```python +c = tf.constant(..) +sess = tf.compat.v1.Session() + +with sess.as_default(): + assert tf.compat.v1.get_default_session() is sess + print(c.eval()) +``` + +To get the current default session, use `tf.compat.v1.get_default_session`. + +*N.B.* The `as_default` context manager *does not* close the +session when you exit the context, and you must close the session +explicitly. + +```python +c = tf.constant(...) +sess = tf.compat.v1.Session() +with sess.as_default(): + print(c.eval()) +# ... +with sess.as_default(): + print(c.eval()) + +sess.close() +``` + +Alternatively, you can use `with tf.compat.v1.Session():` to create a +session that is automatically closed on exiting the context, +including when an uncaught exception is raised. + +*N.B.* The default session is a property of the current thread. If you +create a new thread, and wish to use the default session in that +thread, you must explicitly add a `with sess.as_default():` in that +thread's function. + +*N.B.* Entering a `with sess.as_default():` block does not affect +the current default graph. If you are using multiple graphs, and +`sess.graph` is different from the value of +`tf.compat.v1.get_default_graph`, you must explicitly enter a +`with sess.graph.as_default():` block to make `sess.graph` the default +graph. + +Returns: + A context manager using this session as the default session." +1270,run,tensorflow/tensorflow/python/client/session.py,848,method,"Runs operations and evaluates tensors in `fetches`. + +This method runs one ""step"" of TensorFlow computation, by +running the necessary graph fragment to execute every `Operation` +and evaluate every `Tensor` in `fetches`, substituting the values in +`feed_dict` for the corresponding input values. + +The `fetches` argument may be a single graph element, or an arbitrarily +nested list, tuple, namedtuple, dict, or OrderedDict containing graph +elements at its leaves. A graph element can be one of the following types: + +* A `tf.Operation`. + The corresponding fetched value will be `None`. +* A `tf.Tensor`. + The corresponding fetched value will be a numpy ndarray containing the + value of that tensor. +* A `tf.sparse.SparseTensor`. + The corresponding fetched value will be a + `tf.compat.v1.SparseTensorValue` + containing the value of that sparse tensor. +* A `get_tensor_handle` op. The corresponding fetched value will be a + numpy ndarray containing the handle of that tensor. +* A `string` which is the name of a tensor or operation in the graph. + +The value returned by `run()` has the same shape as the `fetches` argument, +where the leaves are replaced by the corresponding values returned by +TensorFlow. + +Example: + +```python + a = tf.constant([10, 20]) + b = tf.constant([1.0, 2.0]) + # 'fetches' can be a singleton + v = session.run(a) + # v is the numpy array [10, 20] + # 'fetches' can be a list. + v = session.run([a, b]) + # v is a Python list with 2 numpy arrays: the 1-D array [10, 20] and the + # 1-D array [1.0, 2.0] + # 'fetches' can be arbitrary lists, tuples, namedtuple, dicts: + MyData = collections.namedtuple('MyData', ['a', 'b']) + v = session.run({'k1': MyData(a, b), 'k2': [b, a]}) + # v is a dict with + # v['k1'] is a MyData namedtuple with 'a' (the numpy array [10, 20]) and + # 'b' (the numpy array [1.0, 2.0]) + # v['k2'] is a list with the numpy array [1.0, 2.0] and the numpy array + # [10, 20]. +``` + +The optional `feed_dict` argument allows the caller to override +the value of tensors in the graph. Each key in `feed_dict` can be +one of the following types: + +* If the key is a `tf.Tensor`, the + value may be a Python scalar, string, list, or numpy ndarray + that can be converted to the same `dtype` as that + tensor. Additionally, if the key is a + `tf.compat.v1.placeholder`, the shape of + the value will be checked for compatibility with the placeholder. +* If the key is a + `tf.sparse.SparseTensor`, + the value should be a + `tf.compat.v1.SparseTensorValue`. +* If the key is a nested tuple of `Tensor`s or `SparseTensor`s, the value + should be a nested tuple with the same structure that maps to their + corresponding values as above. + +Each value in `feed_dict` must be convertible to a numpy array of the dtype +of the corresponding key. + +The optional `options` argument expects a [`RunOptions`] proto. The options +allow controlling the behavior of this particular step (e.g. turning tracing +on). + +The optional `run_metadata` argument expects a [`RunMetadata`] proto. When +appropriate, the non-Tensor output of this step will be collected there. For +example, when users turn on tracing in `options`, the profiled info will be +collected into this argument and passed back. + +Args: + fetches: A single graph element, a list of graph elements, or a dictionary + whose values are graph elements or lists of graph elements (described + above). + feed_dict: A dictionary that maps graph elements to values (described + above). + options: A [`RunOptions`] protocol buffer + run_metadata: A [`RunMetadata`] protocol buffer + +Returns: + Either a single value if `fetches` is a single graph element, or + a list of values if `fetches` is a list, or a dictionary with the + same keys as `fetches` if that is a dictionary (described above). + Order in which `fetches` operations are evaluated inside the call + is undefined. + +Raises: + RuntimeError: If this `Session` is in an invalid state (e.g. has been + closed). + TypeError: If `fetches` or `feed_dict` keys are of an inappropriate type. + ValueError: If `fetches` or `feed_dict` keys are invalid or refer to a + `Tensor` that doesn't exist." +1271,partial_run,tensorflow/tensorflow/python/client/session.py,969,method,"Continues the execution with more feeds and fetches. + +This is EXPERIMENTAL and subject to change. + +To use partial execution, a user first calls `partial_run_setup()` and +then a sequence of `partial_run()`. `partial_run_setup` specifies the +list of feeds and fetches that will be used in the subsequent +`partial_run` calls. + +The optional `feed_dict` argument allows the caller to override +the value of tensors in the graph. See run() for more information. + +Below is a simple example: + +```python +a = array_ops.placeholder(dtypes.float32, shape=[]) +b = array_ops.placeholder(dtypes.float32, shape=[]) +c = array_ops.placeholder(dtypes.float32, shape=[]) +r1 = math_ops.add(a, b) +r2 = math_ops.multiply(r1, c) + +h = sess.partial_run_setup([r1, r2], [a, b, c]) +res = sess.partial_run(h, r1, feed_dict={a: 1, b: 2}) +res = sess.partial_run(h, r2, feed_dict={c: res}) +``` + +Args: + handle: A handle for a sequence of partial runs. + fetches: A single graph element, a list of graph elements, or a dictionary + whose values are graph elements or lists of graph elements (see + documentation for `run`). + feed_dict: A dictionary that maps graph elements to values (described + above). + +Returns: + Either a single value if `fetches` is a single graph element, or + a list of values if `fetches` is a list, or a dictionary with the + same keys as `fetches` if that is a dictionary + (see documentation for `run`). + +Raises: + tf.errors.OpError: Or one of its subclasses on error." +1272,partial_run_setup,tensorflow/tensorflow/python/client/session.py,1016,method,"Sets up a graph with feeds and fetches for partial run. + +This is EXPERIMENTAL and subject to change. + +Note that contrary to `run`, `feeds` only specifies the graph elements. +The tensors will be supplied by the subsequent `partial_run` calls. + +Args: + fetches: A single graph element, or a list of graph elements. + feeds: A single graph element, or a list of graph elements. + +Returns: + A handle for partial run. + +Raises: + RuntimeError: If this `Session` is in an invalid state (e.g. has been + closed). + TypeError: If `fetches` or `feed_dict` keys are of an inappropriate type. + tf.errors.OpError: Or one of its subclasses if a TensorFlow error happens." +1273,make_callable,tensorflow/tensorflow/python/client/session.py,1186,method,"Returns a Python callable that runs a particular step. + +The returned callable will take `len(feed_list)` arguments whose types +must be compatible feed values for the respective elements of `feed_list`. +For example, if element `i` of `feed_list` is a `tf.Tensor`, the `i`th +argument to the returned callable must be a numpy ndarray (or something +convertible to an ndarray) with matching element type and shape. See +`tf.Session.run` for details of the allowable feed key and value types. + +The returned callable will have the same return type as +`tf.Session.run(fetches, ...)`. For example, if `fetches` is a `tf.Tensor`, +the callable will return a numpy ndarray; if `fetches` is a `tf.Operation`, +it will return `None`. + +Args: + fetches: A value or list of values to fetch. See `tf.Session.run` for + details of the allowable fetch types. + feed_list: (Optional.) A list of `feed_dict` keys. See `tf.Session.run` + for details of the allowable feed key types. + accept_options: (Optional.) If `True`, the returned `Callable` will be + able to accept `tf.compat.v1.RunOptions` and `tf.compat.v1.RunMetadata` + as optional keyword arguments `options` and `run_metadata`, + respectively, with the same syntax and semantics as `tf.Session.run`, + which is useful for certain use cases (profiling and debugging) but will + result in measurable slowdown of the `Callable`'s + performance. Default: `False`. + +Returns: + A function that when called will execute the step defined by + `feed_list` and `fetches` in this session. + +Raises: + TypeError: If `fetches` or `feed_list` cannot be interpreted + as arguments to `tf.Session.run`." +1274,Session,tensorflow/tensorflow/python/client/session.py,1509,class,"A class for running TensorFlow operations. A `Session` object encapsulates the environment in which `Operation` objects are executed, and `Tensor` objects are evaluated. For @@ -6609,7 +6618,30 @@ sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto( allow_soft_placement=True, log_device_placement=True)) ```" -1556,InteractiveSession,tensorflow/tensorflow/python/client/session.py,1679,class,"A TensorFlow `Session` for use in interactive contexts, such as a shell. +1275,reset,tensorflow/tensorflow/python/client/session.py,1644,method,"Resets resource containers on `target`, and close all connected sessions. + +A resource container is distributed across all workers in the +same cluster as `target`. When a resource container on `target` +is reset, resources associated with that container will be cleared. +In particular, all Variables in the container will become undefined: +they lose their values and shapes. + +NOTE: +(i) reset() is currently only implemented for distributed sessions. +(ii) Any sessions on the master named by `target` will be closed. + +If no resource containers are provided, all containers are reset. + +Args: + target: The execution engine to connect to. + containers: A list of resource container name strings, or `None` if all of + all the containers are to be reset. + config: (Optional.) Protocol buffer with configuration options. + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + resetting containers." +1276,InteractiveSession,tensorflow/tensorflow/python/client/session.py,1679,class,"A TensorFlow `Session` for use in interactive contexts, such as a shell. The only difference with a regular `Session` is that an `InteractiveSession` installs itself as the default session on construction. @@ -6645,31 +6677,59 @@ with tf.compat.v1.Session(): # We can also use 'c.eval()' here. print(c.eval()) ```" -1557,SessionBenchmark,tensorflow/tensorflow/python/client/session_benchmark.py,36,class,Tests and benchmarks for interacting with the `tf.compat.v1.Session`. -1558,SessionClusterSpecPropagationTest,tensorflow/tensorflow/python/client/session_clusterspec_prop_test.py,45,class, -1559,SessionListDevicesTest,tensorflow/tensorflow/python/client/session_list_devices_test.py,33,class, -1560,PartialRunTest,tensorflow/tensorflow/python/client/session_partial_run_test.py,35,class, -1561,SessionTest,tensorflow/tensorflow/python/client/session_test.py,72,class, -1562,AllocationMaximum,tensorflow/tensorflow/python/client/timeline.py,32,class,"Stores the maximum allocation for a given allocator within the timelne. +1277,close,tensorflow/tensorflow/python/client/session.py,1771,method,Closes an `InteractiveSession`. +1278,SessionBenchmark,tensorflow/tensorflow/python/client/session_benchmark.py,36,class,Tests and benchmarks for interacting with the `tf.compat.v1.Session`. +1279,benchmarkGrpcSession,tensorflow/tensorflow/python/client/session_benchmark.py,178,method, +1280,benchmarkDirectSession,tensorflow/tensorflow/python/client/session_benchmark.py,204,method, +1281,AllocationMaximum,tensorflow/tensorflow/python/client/timeline.py,32,class,"Stores the maximum allocation for a given allocator within the timelne. Parameters: timestamp: `tensorflow::Env::NowMicros()` when this maximum was reached. num_bytes: the total memory used at this time. tensors: the set of tensors allocated at this time." -1563,StepStatsAnalysis,tensorflow/tensorflow/python/client/timeline.py,44,class,"Stores the step stats analysis output. +1282,StepStatsAnalysis,tensorflow/tensorflow/python/client/timeline.py,44,class,"Stores the step stats analysis output. Parameters: chrome_trace: A dict containing the chrome trace analysis. allocator_maximums: A dict mapping allocator names to AllocationMaximum." -1564,_ChromeTraceFormatter,tensorflow/tensorflow/python/client/timeline.py,55,class,A helper class for generating traces in Chrome Trace Format. -1565,_TensorTracker,tensorflow/tensorflow/python/client/timeline.py,265,class,An internal class to track the lifetime of a Tensor. -1566,Timeline,tensorflow/tensorflow/python/client/timeline.py,346,class,A class for visualizing execution timelines of TensorFlow steps. -1567,TimelineTest,tensorflow/tensorflow/python/client/timeline_test.py,34,class, -1568,VirtualGpuTestUtil,tensorflow/tensorflow/python/client/virtual_gpu_test.py,38,class, -1569,VirtualGpuTest,tensorflow/tensorflow/python/client/virtual_gpu_test.py,195,class, -1570,_date_to_date_number,tensorflow/tensorflow/python/compat/compat.py,41,function, -1571,_update_forward_compatibility_date_number,tensorflow/tensorflow/python/compat/compat.py,45,function,Update the base date to compare in forward_compatible function. -1572,forward_compatible,tensorflow/tensorflow/python/compat/compat.py,70,function,"Return true if the forward compatibility window has expired. +1283,Timeline,tensorflow/tensorflow/python/client/timeline.py,346,class,A class for visualizing execution timelines of TensorFlow steps. +1284,analyze_step_stats,tensorflow/tensorflow/python/client/timeline.py,674,method,"Analyze the step stats and format it into Chrome Trace Format. + +Args: + show_dataflow: (Optional.) If True, add flow events to the trace + connecting producers and consumers of tensors. + show_memory: (Optional.) If True, add object snapshot events to the trace + showing the sizes and lifetimes of tensors. + op_time: (Optional.) How the execution time of op is shown in timeline. + Possible values are ""schedule"", ""gpu"" and ""all"". ""schedule"" will show op + from the time it is scheduled to the end of the scheduling. Notice by + the end of its scheduling its async kernels may not start yet. It is + shown using the default value from step_stats. ""gpu"" will show op with + the execution time of its kernels on GPU. ""all"" will show op from the + start of its scheduling to the end of its last kernel. + +Returns: + A 'StepStatsAnalysis' object." +1285,generate_chrome_trace_format,tensorflow/tensorflow/python/client/timeline.py,707,method,"Produces a trace in Chrome Trace Format. + +Args: + show_dataflow: (Optional.) If True, add flow events to the trace + connecting producers and consumers of tensors. + show_memory: (Optional.) If True, add object snapshot events to the trace + showing the sizes and lifetimes of tensors. + op_time: (Optional.) How the execution time of op is shown in timeline. + Possible values are ""schedule"", ""gpu"" and ""all"". + ""schedule"" will show op from the time it is scheduled to the end of + the scheduling. + Notice by the end of its scheduling its async kernels may not start + yet. It is shown using the default value from step_stats. + ""gpu"" will show op with the execution time of its kernels on GPU. + ""all"" will show op from the start of its scheduling to the end of + its last kernel. + +Returns: + A JSON formatted string in Chrome Trace format." +1286,forward_compatible,tensorflow/tensorflow/python/compat/compat.py,70,function,"Return true if the forward compatibility window has expired. See [Version compatibility](https://tensorflow.org/guide/version_compat#backward_forward). @@ -6722,7 +6782,7 @@ Returns: True if the caller can expect that serialized TensorFlow graphs produced can be consumed by programs that are compiled with the TensorFlow library source code after (year, month, day)." -1573,forward_compatibility_horizon,tensorflow/tensorflow/python/compat/compat.py,131,function,"Context manager for testing forward compatibility of generated graphs. +1287,forward_compatibility_horizon,tensorflow/tensorflow/python/compat/compat.py,131,function,"Context manager for testing forward compatibility of generated graphs. See [Version compatibility](https://tensorflow.org/guide/version_compat#backward_forward). @@ -6757,9 +6817,7 @@ Args: Yields: Nothing." -1574,CompatTest,tensorflow/tensorflow/python/compat/compat_test.py,27,class, -1575,DisableV2BehaviorTest,tensorflow/tensorflow/python/compat/disable_v2_behavior_test.py,27,class, -1576,enable_v2_behavior,tensorflow/tensorflow/python/compat/v2_compat.py,43,function,"Enables TensorFlow 2.x behaviors. +1288,enable_v2_behavior,tensorflow/tensorflow/python/compat/v2_compat.py,43,function,"Enables TensorFlow 2.x behaviors. This function can be called at the beginning of the program (before `Tensors`, `Graphs` or other structures have been created, and before devices have been @@ -6768,7 +6826,7 @@ TensorFlow 1.x and 2.x to behave as intended for 2.x. This function is called in the main TensorFlow `__init__.py` file, user should not need to call it, except during complex migrations." -1577,disable_v2_behavior,tensorflow/tensorflow/python/compat/v2_compat.py,82,function,"Disables TensorFlow 2.x behaviors. +1289,disable_v2_behavior,tensorflow/tensorflow/python/compat/v2_compat.py,82,function,"Disables TensorFlow 2.x behaviors. This function can be called at the beginning of the program (before `Tensors`, `Graphs` or other structures have been created, and before devices have been @@ -6776,7 +6834,7 @@ initialized. It switches all global behaviors that are different between TensorFlow 1.x and 2.x to behave as intended for 1.x. User can call this function to disable 2.x behavior during complex migrations." -1578,convert_graph_def,tensorflow/tensorflow/python/compiler/mlir/mlir.py,26,function,"Import a GraphDef and convert it to a textual MLIR module. +1290,convert_graph_def,tensorflow/tensorflow/python/compiler/mlir/mlir.py,26,function,"Import a GraphDef and convert it to a textual MLIR module. Args: graph_def: An object of type graph_pb2.GraphDef or a textual proto @@ -6788,11 +6846,9 @@ Args: Returns: A textual representation of the MLIR module corresponding to the graphdef. Raises a RuntimeError on error." -1579,MLIRImportTest,tensorflow/tensorflow/python/compiler/mlir/mlir_test.py,26,class, -1580,_to_bytes,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,84,function,Encode s if it is a sequence of chars. -1581,_to_string,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,91,function,Decode s if it is a sequence of bytes. -1582,TrtPrecisionMode,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,98,class, -1583,TrtConversionParams,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,117,class,"Parameters that are used for TF-TRT conversion. +1291,TrtPrecisionMode,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,98,class, +1292,supported_precision_modes,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,104,method, +1293,TrtConversionParams,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,117,class,"Parameters that are used for TF-TRT conversion. Fields: rewriter_config_template: a template RewriterConfig proto used to create a @@ -6831,20 +6887,7 @@ Fields: inputs during runtime, then a new TensorRT engine is built at runtime if allow_build_at_runtime=True, and otherwise native TF is used. This argument is only effective if is_dynamic_op=True." -1584,_check_conversion_params,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,188,function,"Validate the provided TrtConversionParams. - -Args: - conversion_params: a TrtConversionParams instance. - is_v2: whether we're getting a RewriterConfig for TF 2.0. - -Raises: - TypeError: if any of the parameters are of unexpected type. - ValueError: if any of the parameters are of unexpected value." -1585,_check_trt_version_compatibility,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,252,function,"Check compatibility of TensorRT version. - -Raises: - RuntimeError: if the TensorRT library version is incompatible." -1586,get_tensorrt_rewriter_config,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,292,function,"Returns a RewriterConfig proto for TRT transformation. +1294,get_tensorrt_rewriter_config,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,292,function,"Returns a RewriterConfig proto for TRT transformation. Args: conversion_params: a TrtConversionParams instance. @@ -6857,9 +6900,8 @@ Returns: Raises: TypeError: if any of the parameters are of unexpected type. ValueError: if any of the parameters are of unexpected value." -1587,_get_canonical_engine_name,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,383,function, -1588,is_explicit_batch_mode_enabled,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,387,function,Checks whether explicit batch is enabled by the rewriter config. -1589,TrtGraphConverter,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,398,class,"A converter for TF-TRT transformation for TF 1.x GraphDef/SavedModels. +1295,is_explicit_batch_mode_enabled,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,387,function,Checks whether explicit batch is enabled by the rewriter config. +1296,TrtGraphConverter,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,398,class,"A converter for TF-TRT transformation for TF 1.x GraphDef/SavedModels. To run the conversion without quantization calibration (e.g. for FP32/FP16 precision modes): @@ -6888,10 +6930,44 @@ converted_graph_def = converter.calibrate( converter.save(output_saved_model_dir) ```" -1590,_get_resource_handle,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,833,function, -1591,_TRTEngineResourceDeleter,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,838,class,Resource deleter for destroying TRT engine cache resource. -1592,_TRTEngineResource,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,853,class,Class to track the serialized engines resource. -1593,TrtGraphConverterV2,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,880,class,"An offline converter for TF-TRT transformation for TF 2.0 SavedModels. +1297,convert,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,643,method,"Run the TF-TRT conversion. + +Returns: + The converted GraphDef for TF 1.x." +1298,calibrate,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,656,method,"Run the calibration and return the calibrated GraphDef. + +Args: + fetch_names: a list of output tensor name to fetch during calibration. + num_runs: number of runs of the graph during calibration. + feed_dict_fn: a function that returns a dictionary mapping input names (as + strings) in the GraphDef to be calibrated to values (e.g. Python list, + numpy arrays, etc). One and only one of `feed_dict_fn` and + `input_map_fn` should be specified. + input_map_fn: a function that returns a dictionary mapping input names (as + strings) in the GraphDef to be calibrated to Tensor objects. The values + of the named input tensors in the GraphDef to be calibrated will be + re-mapped to the respective `Tensor` values during calibration. One and + only one of `feed_dict_fn` and `input_map_fn` should be specified. + +Raises: + ValueError: if the input combination is invalid. + RuntimeError: if this method is called in eager mode. + +Returns: + The GraphDef after the calibration." +1299,save,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,749,method,"Save the converted graph as a SavedModel. + +Args: + output_saved_model_dir: construct a SavedModel using the converted + GraphDef and save it to the specified directory. This option only works + when the input graph is loaded from a SavedModel, i.e. when + input_saved_model_dir is specified and input_graph_def is None in + __init__(). + +Raises: + ValueError: if the input to the converter is a GraphDef instead of a + SavedModel." +1300,TrtGraphConverterV2,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,880,class,"An offline converter for TF-TRT transformation for TF 2.0 SavedModels. Currently this is not available on Windows platform. @@ -6985,7 +7061,42 @@ There are several ways to run the conversion: # Save the TRT engine and the engines. converter.save(output_saved_model_dir) ```" -1594,create_inference_graph,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,1270,function,"Python wrapper for the TRT transformation. +1301,convert,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,1060,method,"Convert the input SavedModel in 2.0 format. + +Args: + calibration_input_fn: a generator function that yields input data as a + list or tuple, which will be used to execute the converted signature for + calibration. All the returned input data should have the same shape. + Example: `def input_fn(): yield input1, input2, input3` + +Raises: + ValueError: if the input combination is invalid. + +Returns: + The TF-TRT converted Function." +1302,build,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,1126,method,"Run inference with converted graph in order to build TensorRT engines. + +Args: + input_fn: a generator function that yields input data as a list or tuple, + which will be used to execute the converted signature to generate TRT + engines. Example: + `def input_fn(): + # Let's assume a network with 2 input tensors. We generate 3 sets + # of dummy input data: + input_shapes = [[(1, 16), (2, 16)], # 1st input list + [(2, 32), (4, 32)], # 2nd list of two tensors + [(4, 32), (8, 32)]] # 3rd input list + for shapes in input_shapes: + # return a list of input tensors + yield [np.zeros(x).astype(np.float32) for x in shapes]` +Raises: + NotImplementedError: build() is already called. + RuntimeError: the input_fx is None." +1303,save,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,1189,method,"Save the converted SavedModel. + +Args: + output_saved_model_dir: directory to saved the converted SavedModel." +1304,create_inference_graph,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert.py,1270,function,"Python wrapper for the TRT transformation. Args: input_graph_def: a GraphDef object containing a model to be transformed. If @@ -7040,9 +7151,8 @@ Returns: Raises: ValueError: if the combination of the parameters is invalid." -1595,TrtConvertTest,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_test.py,67,class,Class to test Tensorflow-TensorRT integration python API. -1596,TrtPrecisionMode,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,31,class, -1597,TrtConversionParams,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,43,class,"Parameters that are used for TF-TRT conversion. +1305,TrtPrecisionMode,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,31,class, +1306,TrtConversionParams,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,43,class,"Parameters that are used for TF-TRT conversion. Fields: rewriter_config_template: a template RewriterConfig proto used to create a @@ -7076,77 +7186,23 @@ Fields: tensors were trained with fake quantization. max_batch_size: max size for the input batch. This parameter is only effective when is_dynamic_op=False which is not supported in TF 2.0." -1598,TrtConverterWindows,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,97,class,"An offline converter for TF-TRT transformation for TF 2.0 SavedModels. +1307,TrtConverterWindows,tensorflow/tensorflow/python/compiler/tensorrt/trt_convert_windows.py,97,class,"An offline converter for TF-TRT transformation for TF 2.0 SavedModels. Currently this is not available on Windows platform." -1599,SimpleSingleEngineTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,34,class, -1600,SimpleMultiEnginesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,74,class, -1601,SimpleMultiEnginesTest2,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,134,class, -1602,ConstInputTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,175,class, -1603,ConstDataInputSingleEngineTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,211,class, -1604,ConstDataInputMultipleEnginesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,232,class, -1605,ControlDependencyTest,tensorflow/tensorflow/python/compiler/tensorrt/test/base_test.py,264,class, -1606,BatchMatMulTwoTensorTest,tensorflow/tensorflow/python/compiler/tensorrt/test/batch_matmul_test.py,32,class,Testing conversion of BatchMatMul where both inputs are tensors. -1607,BatchMatMulWeightBroadcastTest,tensorflow/tensorflow/python/compiler/tensorrt/test/batch_matmul_test.py,50,class,Testing BatchMatMulV2: one operand is weight and both have same rank. -1608,BatchMatMulWeightBroadcastDims2Test,tensorflow/tensorflow/python/compiler/tensorrt/test/batch_matmul_test.py,69,class,Testing BatchMatMulV2: weight operand must be broadcasted. -1609,BiasaddMatMulTest,tensorflow/tensorflow/python/compiler/tensorrt/test/biasadd_matmul_test.py,33,class,Testing conversion of BiasAdd MatMul in TF-TRT conversion. -1610,BinaryTensorWeightBroadcastTest,tensorflow/tensorflow/python/compiler/tensorrt/test/binary_tensor_weight_broadcast_test.py,30,class,Tests for scale & elementwise layers in TF-TRT. -1611,CastInt32ToFp32Test,tensorflow/tensorflow/python/compiler/tensorrt/test/cast_test.py,31,class,Tests cast to FP32 are splitted in FP16 mode. -1612,CombinedNmsTest,tensorflow/tensorflow/python/compiler/tensorrt/test/combined_nms_test.py,30,class,Test for CombinedNMS op in TF-TRT. -1613,ConcatenationTest,tensorflow/tensorflow/python/compiler/tensorrt/test/concatenation_test.py,32,class,Testing Concatenation in TF-TRT conversion. -1614,ConstBroadcastTest,tensorflow/tensorflow/python/compiler/tensorrt/test/const_broadcast_test.py,28,class,Test for Constant broadcasting in TF-TRT. -1615,conv2d_layer,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,32,function, -1616,div_round_up,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,62,function, -1617,build_graph,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,66,function, -1618,Conv2DNCHWTest,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,83,class,Testing conversion of Conv2D (data_format=NCHW) in TF-TRT conversion. -1619,Conv2DNHWCTest,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,118,class,Testing conversion of Conv2D (data_format=NCHW) in TF-TRT conversion. -1620,Conv2DStridedNCHWTest,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,141,class,Testing conversion of strided Conv2D (data_format=NCHW). -1621,Conv2DTranposeTest,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,172,class,Testing conversion of conv2d_transpose (AKA Conv2DBackpropInput) -1622,DynamicInputShapesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/dynamic_input_shapes_test.py,32,class, -1623,IdentityTest,tensorflow/tensorflow/python/compiler/tensorrt/test/identity_output_test.py,36,class,Testing engine with the same tensor repeated as output via identity. -1624,ExcludeUnsupportedInt32Test,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,32,class,Test exclusion of ops which are not supported in INT32 mode by TF-TRT -1625,CalibrationInt32Support,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,68,class,Test execution of calibration with int32 input -1626,LRUCacheTest,tensorflow/tensorflow/python/compiler/tensorrt/test/lru_cache_test.py,33,class, -1627,MemoryAlignmentTest,tensorflow/tensorflow/python/compiler/tensorrt/test/memory_alignment_test.py,31,class,Testing conversion of BatchMatMul in TF-TRT conversion. -1628,MultiConnectionNeighborEngineTest,tensorflow/tensorflow/python/compiler/tensorrt/test/multi_connection_neighbor_engine_test.py,31,class,Test for multi connection neighboring nodes wiring tests in TF-TRT. -1629,NeighboringEngineTest,tensorflow/tensorflow/python/compiler/tensorrt/test/neighboring_engine_test.py,32,class,Neighboring node wiring tests in TF-TRT conversion. -1630,QuantizationAwareTrainingMNISTTest,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py,59,class,Testing usage of quantization ranges inserted in graph. -1631,_GraphFn,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_test.py,33,function, -1632,_GetParams,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_test.py,53,function, -1633,QuantizationMissingAllRangesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_test.py,57,class,Create a graph containing single segment with no quantization ranges. -1634,QuantizationWithRangesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_test.py,82,class,Create a graph containing single segment with no quantization ranges. -1635,NonQuantizedPrecisionsWithRangesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/quantization_test.py,110,class,Create a graph containing single segment with no quantization ranges. -1636,RankTwoTest,tensorflow/tensorflow/python/compiler/tensorrt/test/rank_two_test.py,30,class,Test for rank 2 input in TF-TRT. -1637,ReshapeTest,tensorflow/tensorflow/python/compiler/tensorrt/test/reshape_transpose_test.py,28,class, -1638,TransposeTest,tensorflow/tensorflow/python/compiler/tensorrt/test/reshape_transpose_test.py,79,class, -1639,IncompatibleTransposeTest,tensorflow/tensorflow/python/compiler/tensorrt/test/reshape_transpose_test.py,108,class, -1640,IsQuantizationMode,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,95,function, -1641,IsQuantizationWithCalibration,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,99,function, -1642,GraphState,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,103,class, -1643,TfTrtIntegrationTestBase,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,109,class,Class to test Tensorflow-TensorRT integration. -1644,_GetTestConfigsV1,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,883,function,Returns the config combinations to run the test. -1645,_GetTestConfigsV2,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,902,function,Returns the config combinations to run the test. -1646,_GetTest,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,928,function,Gets a single test method based on the parameters. -1647,_AddTestsFor,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,942,function,Adds test methods to TfTrtIntegrationTestBase for specific TF version. -1648,_AddTests,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,967,function,Adds test methods to TfTrtIntegrationTestBase. -1649,TopKTest,tensorflow/tensorflow/python/compiler/tensorrt/test/topk_test.py,29,class,Testing Top-K in TF-TRT conversion. -1650,TopKOutputTypeTest,tensorflow/tensorflow/python/compiler/tensorrt/test/topk_test.py,50,class,Testing that output type of engine using Top-K is set correctly. -1651,TrtModeTestBase,tensorflow/tensorflow/python/compiler/tensorrt/test/trt_mode_test.py,31,class,Test squeeze on batch dim and some unary operations in TF-TRT. -1652,ImplicitBatchTest,tensorflow/tensorflow/python/compiler/tensorrt/test/trt_mode_test.py,81,class, -1653,ExplicitBatchTest,tensorflow/tensorflow/python/compiler/tensorrt/test/trt_mode_test.py,104,class, -1654,DynamicShapesTest,tensorflow/tensorflow/python/compiler/tensorrt/test/trt_mode_test.py,140,class,"Test with dynamic input shapes. - -DynamicShapesTest is different from ExplicitBatchTest in that it uses input -and output masks to change the input and output shapes to unknown shapes." -1655,UnaryTest,tensorflow/tensorflow/python/compiler/tensorrt/test/unary_test.py,33,class,Test for unary operations in TF-TRT. -1656,VGGBlockNCHWTest,tensorflow/tensorflow/python/compiler/tensorrt/test/vgg_block_nchw_test.py,35,class,Single vgg layer in NCHW unit tests in TF-TRT. -1657,VGGBlockTest,tensorflow/tensorflow/python/compiler/tensorrt/test/vgg_block_test.py,35,class,Single vgg layer test in TF-TRT conversion. -1658,GetGraph,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,49,function,Define graph. -1659,GenerateModelV2,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,59,function,Generate and convert a model using TFv2 API. -1660,GenerateModelV1,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,90,function,Generate and convert a model using TFv1 API. -1661,ExperimentalCompileTest,tensorflow/tensorflow/python/compiler/xla/experimental_compile_test.py,30,class, -1662,_XlaScope,tensorflow/tensorflow/python/compiler/xla/jit.py,32,class,"Keeps track of previous XLA scope calls, and depth of current call." -1663,experimental_jit_scope,tensorflow/tensorflow/python/compiler/xla/jit.py,42,function,"Enable or disable JIT compilation of operators within the scope. +1308,conv2d_layer,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,32,function, +1309,div_round_up,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,62,function, +1310,build_graph,tensorflow/tensorflow/python/compiler/tensorrt/test/conv2d_test.py,66,function, +1311,CalibrationInt32Support,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,68,class,Test execution of calibration with int32 input +1312,GraphFn,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,71,method, +1313,GetParams,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,76,method, +1314,ExpectedEnginesToBuild,tensorflow/tensorflow/python/compiler/tensorrt/test/int32_test.py,87,method, +1315,IsQuantizationMode,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,95,function, +1316,IsQuantizationWithCalibration,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,99,function, +1317,GraphState,tensorflow/tensorflow/python/compiler/tensorrt/test/tf_trt_integration_test_base.py,103,class, +1318,GetGraph,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,49,function,Define graph. +1319,GenerateModelV2,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,59,function,Generate and convert a model using TFv2 API. +1320,GenerateModelV1,tensorflow/tensorflow/python/compiler/tensorrt/test/testdata/gen_tftrt_model.py,90,function,Generate and convert a model using TFv1 API. +1321,experimental_jit_scope,tensorflow/tensorflow/python/compiler/xla/jit.py,42,function,"Enable or disable JIT compilation of operators within the scope. NOTE: This is an experimental feature. @@ -7192,10 +7248,8 @@ Raises: RuntimeError: if called when eager execution is enabled. Yields: The current scope, enabling or disabling compilation." -1664,enable_jit_nonstateful,tensorflow/tensorflow/python/compiler/xla/jit_test.py,39,function, -1665,JITTest,tensorflow/tensorflow/python/compiler/xla/jit_test.py,47,class, -1666,CompilationEnabledInGradientTest,tensorflow/tensorflow/python/compiler/xla/jit_test.py,187,class, -1667,compile,tensorflow/tensorflow/python/compiler/xla/xla.py,67,function,"Builds an operator that compiles and runs `computation` with XLA. +1322,enable_jit_nonstateful,tensorflow/tensorflow/python/compiler/xla/jit_test.py,39,function, +1323,compile,tensorflow/tensorflow/python/compiler/xla/xla.py,67,function,"Builds an operator that compiles and runs `computation` with XLA. NOTE: In eager mode, `computation` will have `@tf.function` semantics. @@ -7240,7 +7294,7 @@ Known issues: defined seed doesn't change the numbers generated by the operation. Second, when a seed is not specified, running the program multiple times will generate the same numbers." -1668,XLACompileContext,tensorflow/tensorflow/python/compiler/xla/xla.py,125,class,"A `ControlFlowContext` for nodes inside an XLA computation cluster. +1324,XLACompileContext,tensorflow/tensorflow/python/compiler/xla/xla.py,125,class,"A `ControlFlowContext` for nodes inside an XLA computation cluster. THIS IS ONLY FOR TENSORFLOW INTERNAL IMPLEMENTATION, DO NO USE DIRECTLY. @@ -7254,28 +7308,13 @@ with Tensorflow constructs like ResourceVariables. For example, if a `ResourceVariable` implementation can use `with ops.control_dependencies(None)` to build the variable's definition outside the compiled computation." -1669,_compile_internal,tensorflow/tensorflow/python/compiler/xla/xla.py,306,function,"Builds graph operators that compiles and symbolically executes computation. - -Args: - computation: A Python function that builds the computation to compile and - execute. - inputs: A list of inputs or `None` (equivalent to an empty list). Each input - can be a nested structure containing values that are convertible to - tensors. Note that passing an N-dimension list of compatible values will - result in a N-dimension list of scalar tensors rather than a single Rank-N - tensors. If you need different behavior, convert part of inputs to tensors - with `tf.convert_to_tensor`. - -Returns: - Same data structure as if computation(*inputs) is called directly with some - exceptions for correctness. Exceptions include: 1) None output 2) Single - value output 3) Operation-only outputs -Raises: - ValueError: If any element in computation outputs is neither an operations - or a value that can be converted to tensor. - ValueError: If computation outputs is non-flat and contains any Operations. - TypeError: If `inputs` is not a list or tuple." -1670,is_flat,tensorflow/tensorflow/python/compiler/xla/xla.py,409,function,"Checks if outputs is a flat structure. +1325,report_unsupported_operations,tensorflow/tensorflow/python/compiler/xla/xla.py,159,method, +1326,AddOp,tensorflow/tensorflow/python/compiler/xla/xla.py,195,method,Create op in XLACompileContext and notifies outer context recursively. +1327,AddValue,tensorflow/tensorflow/python/compiler/xla/xla.py,268,method,Add `val` to the current context and its outer context recursively. +1328,AddInnerOp,tensorflow/tensorflow/python/compiler/xla/xla.py,285,method, +1329,grad_state,tensorflow/tensorflow/python/compiler/xla/xla.py,291,method, +1330,back_prop,tensorflow/tensorflow/python/compiler/xla/xla.py,299,method,"Forwards to the enclosing while context, if any." +1331,is_flat,tensorflow/tensorflow/python/compiler/xla/xla.py,409,function,"Checks if outputs is a flat structure. Following structures and values are considered flat: 1) None @@ -7293,32 +7332,7 @@ Args: Returns: A boolean indicates whether outputs is flat." -1671,_postprocess_flat_outputs,tensorflow/tensorflow/python/compiler/xla/xla.py,451,function,"Validates flat outputs and adds back device assignments. - -Args: - outputs: Output from `computation` inside `xla.compile`. - -Returns: - Tensors and Operations extracted from outputs." -1672,_postprocess_non_flat_outputs,tensorflow/tensorflow/python/compiler/xla/xla.py,503,function,"Validates non-flat outputs and adds back device assignments. - -Args: - outputs: Output from `computation` inside `xla.compile`. - -Returns: - Tensors extracted from outputs and an empty list because Operations are not - allowed in non-flat outputs.." -1673,_disable_summary_context,tensorflow/tensorflow/python/compiler/xla/xla.py,539,function,"Enters a context where all summary ops are skipped. - -Summaries are not yet supported in xla.compile(). So we provide this context -manager that can skip creating summary ops. This is a temporary workaround due -to XLA not supporting summary ops. - -Yields: - None." -1674,_CapturedObject,tensorflow/tensorflow/python/compiler/xla/xla.py,558,class,A placeholder to capture an object. -1675,_get_scaffold,tensorflow/tensorflow/python/compiler/xla/xla.py,576,function,Retrieves the Scaffold from `captured_scaffold_fn`. -1676,check_function_argument_count,tensorflow/tensorflow/python/compiler/xla/xla.py,591,function,"Validate the number of input arguments to an XLA function. +1332,check_function_argument_count,tensorflow/tensorflow/python/compiler/xla/xla.py,591,function,"Validate the number of input arguments to an XLA function. Args: func: the Python function that will be called to generate the body of an XLA @@ -7330,227 +7344,139 @@ Args: Returns: None if function can be called with the supplied number of arguments, or an error string if it cannot." -1677,XLACompileContextTest,tensorflow/tensorflow/python/compiler/xla/xla_test.py,47,class, -1678,XlaCompileTest,tensorflow/tensorflow/python/compiler/xla/xla_test.py,217,class, -1679,CheckFunctionArgumentCountTest,tensorflow/tensorflow/python/compiler/xla/xla_test.py,260,class, -1680,BatchBenchmark,tensorflow/tensorflow/python/data/benchmarks/batch_benchmark.py,27,class,Benchmarks for `tf.data.Dataset.batch()`. -1681,DatasetBenchmarkBase,tensorflow/tensorflow/python/data/benchmarks/benchmark_base.py,31,class,Base class for dataset benchmarks. -1682,FilterBenchmark,tensorflow/tensorflow/python/data/benchmarks/filter_benchmark.py,26,class,Benchmarks for `tf.data.Dataset.filter()`. -1683,SingleThreadedFlatMapDataset,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,30,class,A `Dataset` that maps a function over its input and flattens the result. -1684,FromTensorSlicesBenchmark,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,62,class,Benchmarks for `tf.data.Dataset.from_tensor_slices()`. -1685,ListFilesBenchmark,tensorflow/tensorflow/python/data/benchmarks/list_files_benchmark.py,35,class,Benchmarks for `tf.data.Dataset.list_files()`. -1686,MapBenchmark,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,32,class,Benchmarks for `tf.data.Dataset.map()`. -1687,MetaBenchmark,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,31,class,Benchmark that compares various ways of running tf.data benchmarks. -1688,PrefetchBenchmark,tensorflow/tensorflow/python/data/benchmarks/prefetch_benchmark.py,24,class,Benchmarks for `tf.data.Dataset.prefetch()`. -1689,RangeBenchmark,tensorflow/tensorflow/python/data/benchmarks/range_benchmark.py,24,class,Benchmarks for `tf.data.Dataset.range()`. -1690,AutotuneBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,31,class,Benchmarks for autotuning performance knobs. -1691,ChooseFastestBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/choose_fastest_benchmark.py,31,class,Benchmarks for static optimizations. -1692,ChooseFastestBranchBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/choose_fastest_branch_benchmark.py,26,class,Benchmarks for ChooseFastestBranchDatast. -1693,CsvDatasetBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,38,class,Benchmarks for `tf.data.experimental.CsvDataset`. -1694,MapAndBatchBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,40,class,Benchmarks for `tf.data.experimental.map_and_batch()`. -1695,MapDefunBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py,34,class,Benchmarks for MapDefunOp. -1696,_generate_csv_test_case,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,37,function,Generates a `decode_csv()` test case. -1697,_generate_parse_single_example_test_case,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,57,function,Generates a `parse_single_example()` test case. -1698,MapVectorizationBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,97,class,Benchmarks for the `MapVectorization` optimization. -1699,MatchingFilesBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/matching_files_benchmark.py,35,class,Benchmark for the experimental `MatchingFilesDataset`. -1700,OptimizationBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py,32,class,Benchmarks for static optimizations. -1701,_make_fake_dataset_fn,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,36,function,"Returns a dataset that emulates a remote storage data source. +1333,BatchBenchmark,tensorflow/tensorflow/python/data/benchmarks/batch_benchmark.py,27,class,Benchmarks for `tf.data.Dataset.batch()`. +1334,benchmark_batch_sparse,tensorflow/tensorflow/python/data/benchmarks/batch_benchmark.py,30,method, +1335,benchmark_batch_dense,tensorflow/tensorflow/python/data/benchmarks/batch_benchmark.py,51,method, +1336,DatasetBenchmarkBase,tensorflow/tensorflow/python/data/benchmarks/benchmark_base.py,31,class,Base class for dataset benchmarks. +1337,run_benchmark,tensorflow/tensorflow/python/data/benchmarks/benchmark_base.py,34,method,"Benchmarks the dataset. -Returns a dataset factory which creates a dataset with 100 elements that -emulates the performance characteristic of a file-based dataset stored in a -remote storage. In particular, the first element will take an order of -magnitude longer to produce than the remaining elements (100ms vs. 1ms). +Runs the dataset `iters` times. In each iteration, the benchmark measures +the time it takes to go through `num_elements` elements of the dataset. Args: - initial_delay_us: How long to wait before producing the first element. - remainder_delay_us: How long to wait before producing subsequent elements." -1702,ParallelInterleaveBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,68,class,Benchmarks for `tf.data.experimental.parallel_interleave()`. -1703,_time_resampling,tensorflow/tensorflow/python/data/experimental/benchmarks/rejection_resample_benchmark.py,31,function, -1704,RejectionResampleBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/rejection_resample_benchmark.py,56,class,Benchmarks for `tf.data.experimental.rejection_resample()`. -1705,SnapshotDatasetBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,34,class,Benchmarks for `tf.data.experimental.snapshot()`. -1706,UnbatchBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/unbatch_benchmark.py,32,class,Benchmarks for `tf.data.Dataset.unbatch()`. -1707,AssertCardinalityTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/assert_cardinality_test.py,30,class,Tests for `tf.data.experimental.assert_cardinality()`. -1708,AssertNextTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/assert_next_test.py,30,class, -1709,chunk,tensorflow/tensorflow/python/data/experimental/kernel_tests/auto_shard_dataset_test.py,46,function, -1710,AutoShardDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/auto_shard_dataset_test.py,51,class, -1711,AutoShardTextLineDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/auto_shard_dataset_test.py,509,class, -1712,_element_length_fn,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,37,function, -1713,_to_sparse_tensor,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,42,function, -1714,_format_record,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,46,function, -1715,_get_record_type,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,56,function, -1716,_get_record_shape,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,66,function, -1717,BucketBySequenceLengthTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/bucket_by_sequence_length_test.py,76,class, -1718,_test_objects,tensorflow/tensorflow/python/data/experimental/kernel_tests/compression_ops_test.py,31,function, -1719,CompressionOpsTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/compression_ops_test.py,53,class, -1720,CopyToDeviceTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/copy_to_device_test.py,40,class, -1721,CounterTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/counter_test.py,30,class, -1722,CsvDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py,40,class, -1723,_make_scalar_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,38,function,Create a test dataset with scalar elements. -1724,_make_vector_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,43,function,Create a test dataset with vector elements (of varying size). -1725,_make_matrix_ds1,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,48,function,Create a test dataset with matrix elements (of varying size). -1726,_make_matrix_ds2,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,53,function,Create a test dataset with matrix elements (of varying size). -1727,_make_matrix_ds_fully_defined,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,58,function,Create a test dataset with matrix elements (of varying size). -1728,_make_5dtensor_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,63,function,Create a test dataset with matrix elements (of varying size). -1729,_make_ragged_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,69,function,Create a test dataset with RaggedTensor elements (of varying size). -1730,_make_dict_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,76,function,Create a test set with various element shapes. -1731,_make_tuple_ds,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,89,function,Create a test set with various element shapes. -1732,_to_list,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,98,function, -1733,RaggedBatchTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_ragged_batch_test.py,102,class, -1734,DenseToSparseBatchTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/dense_to_sparse_batch_test.py,32,class, -1735,DirectedInterleaveDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/directed_interleave_dataset_test.py,34,class, -1736,GetSingleElementTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/get_single_element_test.py,34,class, -1737,GroupByReducerTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/group_by_reducer_test.py,37,class, -1738,GroupByWindowTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/group_by_window_test.py,41,class, -1739,IgnoreErrorsTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/ignore_errors_test.py,40,class, -1740,IOTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/io_test.py,32,class, -1741,MakeBatchedFeaturesDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/make_batched_features_dataset_test.py,38,class, -1742,MakeCsvDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/make_csv_dataset_test.py,38,class, -1743,MakeTFRecordDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/make_tf_record_dataset_test.py,33,class, -1744,MapAndBatchTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py,43,class, -1745,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/map_defun_op_test.py,44,function, -1746,MapDefunTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/map_defun_op_test.py,48,class, -1747,MatchingFilesDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/matching_files_test.py,34,class, -1748,ModelDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/model_dataset_test.py,30,class, -1749,NonSerializableTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/non_serializable_test.py,29,class, -1750,_captured_refvar_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimize_dataset_test.py,44,function, -1751,OptimizeDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimize_dataset_test.py,106,class, -1752,OverrideThreadpoolTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/override_threadpool_test.py,38,class, -1753,ParallelInterleaveTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/parallel_interleave_test.py,42,class, -1754,ParseExampleDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py,54,class, -1755,PrefetchToDeviceTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/prefetch_to_device_test.py,37,class, -1756,PrefetchWithSlackTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/prefetch_with_slack_test.py,33,class, -1757,RandomDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/random_dataset_test.py,29,class, -1758,FixedLengthRecordDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/reader_dataset_ops_test_base.py,36,class,Base class for setting up and testing FixedLengthRecordDataset. -1759,MakeBatchedFeaturesDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/reader_dataset_ops_test_base.py,63,class,Base class for setting up and testing `make_batched_features_dataset`. -1760,TextLineDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/reader_dataset_ops_test_base.py,271,class,Base class for setting up and testing TextLineDataset. -1761,TFRecordDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/reader_dataset_ops_test_base.py,311,class,Base class for setting up and testing TFRecordDataset. -1762,BatchSizesForWorkerTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/rebatch_dataset_test.py,35,class, -1763,_flat_shapes,tensorflow/tensorflow/python/data/experimental/kernel_tests/rebatch_dataset_test.py,113,function, -1764,RebatchDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/rebatch_dataset_test.py,120,class, -1765,LegacyRebatchDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/rebatch_dataset_test.py,325,class, -1766,ComputeBatchSizeTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/rebatch_dataset_test.py,500,class, -1767,RejectionResampleTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/rejection_resample_test.py,36,class, -1768,LocalReplicateTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/replicate_test.py,44,class, -1769,_get_server_def,tensorflow/tensorflow/python/data/experimental/kernel_tests/replicate_test.py,225,function,Returns a server def with a single job + multiple tasks. -1770,EagerClusterReplicateTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/replicate_test.py,245,class, -1771,GraphClusterReplicateTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/replicate_test.py,327,class, -1772,ScanTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/scan_test.py,46,class, -1773,ShuffleAndRepeatTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/shuffle_and_repeat_test.py,32,class, -1774,SleepTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/sleep_test.py,32,class, -1775,SnapshotDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/snapshot_test.py,40,class, -1776,LegacySnapshotDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/snapshot_test.py,318,class, -1777,SqlDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/sql_dataset_test.py,32,class, -1778,SqlDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/sql_dataset_test_base.py,30,class,Base class for setting up and testing SqlDataset. -1779,StatsDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_ops_test.py,39,class, -1780,ThreadUtilizationStatsTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_ops_test.py,334,class, -1781,FeatureStatsDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_ops_test.py,399,class, -1782,StatsDatasetTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_test_base.py,37,class,Base class for testing statistics gathered in `StatsAggregator`. -1783,_events_from_file,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_test_base.py,311,function,"Returns all events in a single event file. - -Args: - filepath: Path to the event file. + dataset: Dataset to benchmark. + num_elements: Number of dataset elements to iterate through each benchmark + iteration. + iters: Number of times to repeat the timing. + warmup: If true, warms up the session caches by running an untimed run. + apply_default_optimizations: Determines whether default optimizations + should be applied. Returns: - A list of all tf.Event protos in the event file." -1784,_events_from_logdir,tensorflow/tensorflow/python/data/experimental/kernel_tests/stats_dataset_test_base.py,329,function,"Returns all events in the single eventfile in logdir. + A float, representing the per-element wall time of the dataset in seconds. + This is the median time (with respect to `iters`) it takes for the dataset + to go through `num_elements` elements, divided by `num_elements.`" +1338,run_and_report_benchmark,tensorflow/tensorflow/python/data/benchmarks/benchmark_base.py,87,method, +1339,FilterBenchmark,tensorflow/tensorflow/python/data/benchmarks/filter_benchmark.py,26,class,Benchmarks for `tf.data.Dataset.filter()`. +1340,benchmark_simple_function,tensorflow/tensorflow/python/data/benchmarks/filter_benchmark.py,34,method, +1341,benchmark_return_component_optimization,tensorflow/tensorflow/python/data/benchmarks/filter_benchmark.py,37,method, +1342,SingleThreadedFlatMapDataset,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,30,class,A `Dataset` that maps a function over its input and flattens the result. +1343,element_spec,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,54,method, +1344,FromTensorSlicesBenchmark,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,62,class,Benchmarks for `tf.data.Dataset.from_tensor_slices()`. +1345,benchmark_slice_repeat_batch,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,65,method, +1346,benchmark_reshape_slice_repeat,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,82,method, +1347,benchmark_slice_repeat_sparse,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,101,method, +1348,benchmark_slice_batch_cache_repeat,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,132,method, +1349,make_dataset,tensorflow/tensorflow/python/data/benchmarks/from_tensor_slices_benchmark.py,116,method, +1350,ListFilesBenchmark,tensorflow/tensorflow/python/data/benchmarks/list_files_benchmark.py,35,class,Benchmarks for `tf.data.Dataset.list_files()`. +1351,benchmark_nested_directories,tensorflow/tensorflow/python/data/benchmarks/list_files_benchmark.py,38,method, +1352,MapBenchmark,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,32,class,Benchmarks for `tf.data.Dataset.map()`. +1353,benchmark_chain_of_maps,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,35,method, +1354,benchmark_map_fan_out,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,53,method, +1355,benchmark_stats,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,72,method, +1356,benchmark_sequential_control_flow,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,85,method, +1357,benchmark_parallel_control_flow,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,103,method, +1358,benchmark_helper,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,37,method, +1359,benchmark_helper,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,56,method, +1360,fn,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,88,method, +1361,fn,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,107,method, +1362,body,tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py,91,method, +1363,MetaBenchmark,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,31,class,Benchmark that compares various ways of running tf.data benchmarks. +1364,setup_fast_dataset,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,37,method, +1365,benchmark_fast_dataset_with_only_cpp_iterations,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,44,method, +1366,benchmark_fast_dataset_with_session_run,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,48,method, +1367,benchmark_fast_dataset_with_session_callable,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,52,method, +1368,benchmark_fast_dataset_in_eager,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,56,method, +1369,setup_slow_dataset,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,61,method, +1370,benchmark_slow_dataset_with_only_cpp_iterations,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,67,method, +1371,benchmark_slow_dataset_with_session_run,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,71,method, +1372,benchmark_slow_dataset_with_session_callable,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,75,method, +1373,benchmark_slow_dataset_in_eager,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,79,method, +1374,report,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,84,method, +1375,run_benchmark_in_eager,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,105,method, +1376,run_benchmark_with_session_run,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,113,method, +1377,run_benchmark_with_only_cpp_iterations,tensorflow/tensorflow/python/data/benchmarks/meta_benchmark.py,132,method,Benchmarks the dataset with the iterations performed in C++. +1378,PrefetchBenchmark,tensorflow/tensorflow/python/data/benchmarks/prefetch_benchmark.py,24,class,Benchmarks for `tf.data.Dataset.prefetch()`. +1379,benchmark_prefetch,tensorflow/tensorflow/python/data/benchmarks/prefetch_benchmark.py,27,method, +1380,RangeBenchmark,tensorflow/tensorflow/python/data/benchmarks/range_benchmark.py,24,class,Benchmarks for `tf.data.Dataset.range()`. +1381,benchmark_range,tensorflow/tensorflow/python/data/benchmarks/range_benchmark.py,27,method, +1382,AutotuneBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,31,class,Benchmarks for autotuning performance knobs. +1383,benchmark_map,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,66,method, +1384,benchmark_map_and_batch,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,87,method, +1385,benchmark_interleave,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,110,method, +1386,benchmark_map_and_interleave,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,134,method, +1387,benchmark_map_batch_and_interleave,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,182,method, +1388,f1,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,152,method, +1389,f2,tensorflow/tensorflow/python/data/experimental/benchmarks/autotune_benchmark.py,155,method, +1390,CsvDatasetBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,38,class,Benchmarks for `tf.data.experimental.CsvDataset`. +1391,benchmark_map_with_floats,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,90,method, +1392,benchmark_map_with_strings,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,100,method, +1393,benchmark_csv_dataset_with_floats,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,110,method, +1394,benchmark_csv_dataset_with_strings,tensorflow/tensorflow/python/data/experimental/benchmarks/csv_dataset_benchmark.py,120,method, +1395,MapAndBatchBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,40,class,Benchmarks for `tf.data.experimental.map_and_batch()`. +1396,benchmark_map_and_batch,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,43,method,Measures the performance of parallelized batching. +1397,benchmark_map_and_batch_chaining_versus_fusing,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,97,method,"Compares the performance of chaining and fusing map and batch. -Args: - logdir: The directory in which the single event file is sought. - -Returns: - A list of all tf.Event protos from the single event file. - -Raises: - AssertionError: If logdir does not contain exactly one file." -1785,TakeWhileTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/take_while_test.py,34,class, -1786,TFRecordWriterTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/tf_record_writer_test.py,39,class, -1787,UniqueTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/unique_test.py,32,class, -1788,VariantTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/variant_test.py,28,class, -1789,WrapDatasetVariantTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/wrap_unwrap_test.py,31,class, -1790,ChooseFastestBranchDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/choose_fastest_branch_dataset_test.py,34,class, -1791,ChooseFastestDatasetTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/choose_fastest_dataset_test.py,31,class, -1792,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/filter_fusion_test.py,34,function, -1793,FilterFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/filter_fusion_test.py,62,class, -1794,FilterWithRandomUniformFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/filter_with_random_uniform_fusion_test.py,30,class, -1795,GrapplerTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/grappler_test.py,37,class, -1796,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/hoist_random_uniform_test.py,38,function, -1797,HoistRandomUniformTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/hoist_random_uniform_test.py,68,class, -1798,InjectPrefetchTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/inject_prefetch_test.py,29,class, -1799,LatencyAllEdgesTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/latency_all_edges_test.py,31,class, -1800,MapAndBatchFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_and_batch_fusion_test.py,29,class, -1801,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_and_filter_fusion_test.py,34,function, -1802,MapAndFilterFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_and_filter_fusion_test.py,77,class, -1803,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_fusion_test.py,34,function, -1804,MapFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_fusion_test.py,66,class, -1805,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_parallelization_test.py,37,function, -1806,MapParallelizationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_parallelization_test.py,58,class, -1807,_generate_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,51,function, -1808,_unary_bitwise_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,60,function, -1809,_unary_logical_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,65,function, -1810,_unary_complex_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,70,function, -1811,_unary_real_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,81,function, -1812,_binary_bitwise_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,135,function, -1813,_binary_logical_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,144,function, -1814,_binary_real_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,150,function, -1815,MapVectorizationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py,192,class, -1816,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/noop_elimination_test.py,34,function, -1817,NoopEliminationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/noop_elimination_test.py,90,class, -1818,ReorderDataDiscardingOpsTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/reorder_data_discarding_ops_test.py,29,class, -1819,ShuffleAndRepeatFusionTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/optimization/shuffle_and_repeat_fusion_test.py,30,class, -1820,AssertCardinalityDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/assert_cardinality_dataset_serialization_test.py,30,class, -1821,AutoShardDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/auto_shard_dataset_serialization_test.py,36,class, -1822,BatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/batch_dataset_serialization_test.py,33,class, -1823,CacheDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/cache_dataset_serialization_test.py,32,class, -1824,_test_combinations,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/checkpoint_input_pipeline_hook_test.py,40,function, -1825,CheckpointInputPipelineHookTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/checkpoint_input_pipeline_hook_test.py,44,class, -1826,ChooseFastestBranchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/choose_fastest_branch_dataset_serialization_test.py,33,class, -1827,ChooseFastestDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/choose_fastest_dataset_serialization_test.py,30,class, -1828,ConcatenateDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/concatenate_dataset_serialization_test.py,30,class, -1829,CsvDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/csv_dataset_serialization_test.py,32,class, -1830,FromTensorsSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_constructor_serialization_test.py,31,class, -1831,FromTensorSlicesSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_constructor_serialization_test.py,49,class, -1832,FromSparseTensorSlicesSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_constructor_serialization_test.py,71,class, -1833,remove_variants,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_serialization_test_base.py,41,function,"Remove variants from a nest structure, so sess.run will execute." -1834,DatasetSerializationTestBase,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_serialization_test_base.py,55,class,Base class for testing serializable datasets. -1835,FilterDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/filter_dataset_serialization_test.py,31,class, -1836,FixedLengthRecordDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/fixed_length_record_dataset_serialization_test.py,30,class, -1837,FlatMapDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/flat_map_dataset_serialization_test.py,38,class, -1838,GroupByReducerSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/group_by_reducer_serialization_test.py,31,class, -1839,GroupByWindowSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/group_by_window_serialization_test.py,31,class, -1840,IgnoreErrorsSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/ignore_errors_serialization_test.py,31,class, -1841,InterleaveDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/interleave_dataset_serialization_test.py,32,class, -1842,MapAndBatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/map_and_batch_dataset_serialization_test.py,34,class, -1843,MapDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/map_dataset_serialization_test.py,38,class, -1844,MatchingFilesDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/matching_files_dataset_serialization_test.py,33,class, -1845,OptimizeDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/optimize_dataset_serialization_test.py,30,class, -1846,PaddedBatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/padded_batch_dataset_serialization_test.py,32,class, -1847,ParallelInterleaveDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/parallel_interleave_dataset_serialization_test.py,33,class, -1848,ParallelMapDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/parallel_map_dataset_serialization_test.py,37,class, -1849,ParseExampleDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/parse_example_dataset_serialization_test.py,29,class, -1850,PrefetchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/prefetch_dataset_serialization_test.py,29,class, -1851,RangeDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/range_dataset_serialization_test.py,38,class, -1852,LegacyRebatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/rebatch_dataset_serialization_test.py,30,class, -1853,RebatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/rebatch_dataset_serialization_test.py,46,class, -1854,SampleFromDatasetsSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/sample_from_datasets_serialization_test.py,30,class, -1855,ScanDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/scan_dataset_serialization_test.py,30,class, -1856,SkipDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/sequence_dataset_serialization_test.py,30,class, -1857,TakeDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/sequence_dataset_serialization_test.py,61,class, -1858,RepeatDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/sequence_dataset_serialization_test.py,91,class, -1859,SerializationIntegrationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/serialization_integration_test.py,33,class, -1860,ShardDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/shard_dataset_serialization_test.py,29,class, -1861,ShuffleAndRepeatSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/shuffle_and_repeat_dataset_serialization_test.py,30,class, -1862,ShuffleDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/shuffle_dataset_serialization_test.py,32,class, -1863,SnapshotDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/snapshot_dataset_serialization_test.py,33,class, -1864,LegacySnapshotDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/snapshot_dataset_serialization_test.py,124,class, -1865,SqlDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/sql_dataset_serialization_test.py,34,class, -1866,StatsDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/stats_dataset_serialization_test.py,36,class, -1867,TakeWhileDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/take_while_dataset_serialization_test.py,30,class, -1868,TextLineDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/textline_dataset_serialization_test.py,30,class, -1869,TFRecordDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/tf_record_dataset_serialization_test.py,34,class, -1870,UnbatchDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/unbatch_dataset_serialization_test.py,30,class, -1871,UniqueDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/unique_dataset_serialization_test.py,30,class, -1872,ZipDatasetSerializationTest,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/zip_dataset_serialization_test.py,30,class, -1873,dense_to_ragged_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,36,function,"A transformation that batches ragged elements into `tf.RaggedTensor`s. +NOTE: It is recommended to build the benchmark with +`-c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-gmlt` +and execute it on a machine with at least 32 CPU cores." +1398,name,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,116,method, +1399,benchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,126,method,Runs benchmark the given series. +1400,make_dataset,tensorflow/tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py,129,method, +1401,MapDefunBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py,34,class,Benchmarks for MapDefunOp. +1402,benchmark_defun_vs_map_fn,tensorflow/tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py,52,method,Benchmarks to compare the performance of MapDefun vs tf.map_fn. +1403,defun,tensorflow/tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py,56,method, +1404,fn,tensorflow/tensorflow/python/data/experimental/benchmarks/map_defun_benchmark.py,59,method, +1405,MapVectorizationBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,97,class,Benchmarks for the `MapVectorization` optimization. +1406,benchmark_identity,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,147,method, +1407,benchmark_add_const,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,151,method, +1408,benchmark_return_const,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,154,method, +1409,benchmark_select,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,157,method, +1410,benchmark_cast,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,160,method, +1411,benchmark_reshape,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,164,method, +1412,benchmark_decode_csv,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,168,method, +1413,benchmark_parse_single_example,tensorflow/tensorflow/python/data/experimental/benchmarks/map_vectorization_benchmark.py,172,method, +1414,MatchingFilesBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/matching_files_benchmark.py,35,class,Benchmark for the experimental `MatchingFilesDataset`. +1415,benchmark_nested_directories,tensorflow/tensorflow/python/data/experimental/benchmarks/matching_files_benchmark.py,38,method, +1416,OptimizationBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py,32,class,Benchmarks for static optimizations. +1417,benchmark_map_fusion,tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py,35,method,Evaluates performance map of fusion. +1418,benchmark_map_and_filter_fusion,tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py,76,method,Evaluates performance map of fusion. +1419,benchmark_filter_fusion,tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py,119,method, +1420,ParallelInterleaveBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,68,class,Benchmarks for `tf.data.experimental.parallel_interleave()`. +1421,apply_interleave,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,71,method, +1422,make_dataset,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,89,method, +1423,benchmark_remote_file_simulation,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,126,method, +1424,benchmark_fast_input,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,135,method, +1425,benchmark_single_cycle,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,142,method, +1426,benchmark_single_parallel_call,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,152,method, +1427,benchmark_long_cycle,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,159,method, +1428,benchmark_stats,tensorflow/tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py,167,method, +1429,RejectionResampleBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/rejection_resample_benchmark.py,56,class,Benchmarks for `tf.data.experimental.rejection_resample()`. +1430,benchmark_resample_performance,tensorflow/tensorflow/python/data/experimental/benchmarks/rejection_resample_benchmark.py,59,method, +1431,SnapshotDatasetBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,34,class,Benchmarks for `tf.data.experimental.snapshot()`. +1432,benchmarkWriteSnapshotGzipCompression,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,68,method, +1433,benchmarkWriteSnapshotSnappyCompression,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,76,method, +1434,benchmarkWriteSnapshotSimple,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,84,method, +1435,benchmarkPassthroughSnapshotSimple,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,94,method, +1436,benchmarkReadSnapshotSimple,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,104,method, +1437,benchmarkReadSnapshotGzipCompression,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,114,method, +1438,benchmarkReadSnapshotSnappyCompression,tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py,123,method, +1439,UnbatchBenchmark,tensorflow/tensorflow/python/data/experimental/benchmarks/unbatch_benchmark.py,32,class,Benchmarks for `tf.data.Dataset.unbatch()`. +1440,benchmark_native_unbatch,tensorflow/tensorflow/python/data/experimental/benchmarks/unbatch_benchmark.py,35,method, +1441,benchmark_old_unbatch_implementation,tensorflow/tensorflow/python/data/experimental/benchmarks/unbatch_benchmark.py,72,method, +1442,chunk,tensorflow/tensorflow/python/data/experimental/kernel_tests/auto_shard_dataset_test.py,46,function, +1443,remove_variants,tensorflow/tensorflow/python/data/experimental/kernel_tests/serialization/dataset_serialization_test_base.py,41,function,"Remove variants from a nest structure, so sess.run will execute." +1444,dense_to_ragged_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,36,function,"A transformation that batches ragged elements into `tf.RaggedTensor`s. This transformation combines multiple consecutive elements of the input dataset into a single element. @@ -7602,7 +7528,7 @@ Args: Returns: Dataset: A `Dataset`." -1874,dense_to_sparse_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,102,function,"A transformation that batches ragged elements into `tf.sparse.SparseTensor`s. +1445,dense_to_sparse_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,102,function,"A transformation that batches ragged elements into `tf.sparse.SparseTensor`s. Like `Dataset.padded_batch()`, this transformation combines multiple consecutive elements of the dataset, which might have different @@ -7642,7 +7568,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1875,map_and_batch_with_legacy_function,tensorflow/tensorflow/python/data/experimental/ops/batching.py,153,function,"Fused implementation of `map` and `batch`. +1446,map_and_batch_with_legacy_function,tensorflow/tensorflow/python/data/experimental/ops/batching.py,153,function,"Fused implementation of `map` and `batch`. NOTE: This is an escape hatch for existing uses of `map_and_batch` that do not work with V2 functions. New uses are strongly discouraged and existing uses @@ -7673,7 +7599,7 @@ Returns: Raises: ValueError: If both `num_parallel_batches` and `num_parallel_calls` are specified." -1876,map_and_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,213,function,"Fused implementation of `map` and `batch`. +1447,map_and_batch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,213,function,"Fused implementation of `map` and `batch`. Maps `map_func` across `batch_size` consecutive elements of this dataset and then combines them into a batch. Functionally, it is equivalent to `map` @@ -7705,7 +7631,7 @@ Returns: Raises: ValueError: If both `num_parallel_batches` and `num_parallel_calls` are specified." -1877,unbatch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,269,function,"Splits elements of a dataset into multiple elements on the batch dimension. +1448,unbatch,tensorflow/tensorflow/python/data/experimental/ops/batching.py,269,function,"Splits elements of a dataset into multiple elements on the batch dimension. For example, if elements of the dataset are shaped `[B, a0, a1, ...]`, where `B` may vary for each input element, then for each element in the @@ -7724,17 +7650,7 @@ a.unbatch() == { Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1878,_DenseToSparseBatchDataset,tensorflow/tensorflow/python/data/experimental/ops/batching.py,297,class,A `Dataset` that batches ragged dense elements into `tf.sparse.SparseTensor`s. -1879,_MapAndBatchDataset,tensorflow/tensorflow/python/data/experimental/ops/batching.py,327,class,A `Dataset` that maps a function over a batch of elements. -1880,_DenseToRaggedDataset,tensorflow/tensorflow/python/data/experimental/ops/batching.py,380,class,"A `Dataset` that encodes dense inputs as ragged (w/ ragged_rank=0). - -In particular: - -* Any tf.Tensor elements with rank>0 are encoded as ragged tensors with - ragged_rank=0. This allows tensors with varying shape to be batched - together. -* Any other elements are left as-is." -1881,cardinality,tensorflow/tensorflow/python/data/experimental/ops/cardinality.py,38,function,"Returns the cardinality of `dataset`, if known. +1449,cardinality,tensorflow/tensorflow/python/data/experimental/ops/cardinality.py,38,function,"Returns the cardinality of `dataset`, if known. The operation returns the cardinality of `dataset`. The operation may return `tf.data.experimental.INFINITE_CARDINALITY` if `dataset` contains an infinite @@ -7761,7 +7677,7 @@ Returns: A scalar `tf.int64` `Tensor` representing the cardinality of `dataset`. If the cardinality is infinite or unknown, the operation returns the named constant `INFINITE_CARDINALITY` and `UNKNOWN_CARDINALITY` respectively." -1882,assert_cardinality,tensorflow/tensorflow/python/data/experimental/ops/cardinality.py,72,function,"Asserts the cardinality of the input dataset. +1450,assert_cardinality,tensorflow/tensorflow/python/data/experimental/ops/cardinality.py,72,function,"Asserts the cardinality of the input dataset. NOTE: The following assumes that ""examples.tfrecord"" contains 42 records. @@ -7784,8 +7700,7 @@ Raises: FailedPreconditionError: The assertion is checked at runtime (when iterating the dataset) and an error is raised if the actual and expected cardinality differ." -1883,_AssertCardinalityDataset,tensorflow/tensorflow/python/data/experimental/ops/cardinality.py,103,class,A `Dataset` that assert the cardinality of its input. -1884,compress,tensorflow/tensorflow/python/data/experimental/ops/compression_ops.py,24,function,"Compress a dataset element. +1451,compress,tensorflow/tensorflow/python/data/experimental/ops/compression_ops.py,24,function,"Compress a dataset element. Args: element: A nested structure of types supported by Tensorflow. @@ -7793,7 +7708,7 @@ Args: Returns: A variant tensor representing the compressed element. This variant can be passed to `uncompress` to get back the original element." -1885,uncompress,tensorflow/tensorflow/python/data/experimental/ops/compression_ops.py,39,function,"Uncompress a compressed dataset element. +1452,uncompress,tensorflow/tensorflow/python/data/experimental/ops/compression_ops.py,39,function,"Uncompress a compressed dataset element. Args: element: A scalar variant tensor to uncompress. The element should have been @@ -7803,7 +7718,7 @@ Args: Returns: The uncompressed element." -1886,CounterV2,tensorflow/tensorflow/python/data/experimental/ops/counter.py,29,function,"Creates a `Dataset` that counts from `start` in steps of size `step`. +1453,CounterV2,tensorflow/tensorflow/python/data/experimental/ops/counter.py,29,function,"Creates a `Dataset` that counts from `start` in steps of size `step`. For example: @@ -7823,72 +7738,10 @@ Args: Returns: A `Dataset` of scalar `dtype` elements." -1887,CounterV1,tensorflow/tensorflow/python/data/experimental/ops/counter.py,59,function, -1888,ProcessingMode,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,36,class, -1889,_DataServiceDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,49,class,A `Dataset` that reads elements from the tf.data service. -1890,_DataServiceDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,124,class,A `Dataset` that executes its input through the tf.data service. -1891,_parse_service,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,148,function,"Parses a tf.data service string into a (protocol, address) tuple. - -Args: - service: A string in the format ""protocol://address"". - -Returns: - The parsed (protocol, address) tuple" -1892,_from_dataset_id,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,175,function,"Creates a dataset which reads data from the tf.data service. - -This transformation is similar to `from_dataset_id`, but supports additional -parameters which we do not yet want to add to the public Python API. - -Args: - processing_mode: A string specifying the policy for how data should be - processed by tf.data workers. Currently, the only supported value is - ""parallel_epochs"". - service: A string indicating how to connect to the tf.data service. The - string should be in the format ""://
"", e.g. - ""grpc://localhost:5000"". - dataset_id: The id of the dataset to read from. This id is returned by - `register_dataset` when the dataset is registered with the tf.data - service. - element_spec: A nested structure of `tf.TypeSpec`s representing the type of - elements produced by the dataset. Use `tf.data.Dataset.element_spec` to - see the element spec for a given dataset. - job_name: (Optional.) The name of the job. This argument makes it possible - for multiple datasets to share the same job. The default behavior is that - the dataset creates anonymous, exclusively owned jobs. - max_outstanding_requests: (Optional.) A limit on how many elements may be - requested at the same time. You can use this option to control the amount - of memory used, since `distribute` won't use more than `element_size` * - `max_outstanding_requests` of memory. - task_refresh_interval_hint_ms: (Optional.) A hint for how often to query the - dispatcher for task changes. - -Returns: - A `tf.data.Dataset` which reads from the tf.data service." -1893,_distribute,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,248,function,"A transformation that moves dataset processing to the tf.data service. - -This transformation is similar to `distribute`, but supports additional -parameters which we do not yet want to add to the public Python API. - -Args: - processing_mode: A string specifying the policy for how data should be - processed by tf.data workers. Currently, the only supported value is - ""parallel_epochs"". - service: A string indicating how to connect to the tf.data service. The - string should be in the format ""://
"", e.g. - ""grpc://localhost:5000"". - job_name: (Optional.) The name of the job. This argument makes it possible - for multiple datasets to share the same job. The default behavior is that - the dataset creates anonymous, exclusively owned jobs. - max_outstanding_requests: (Optional.) A limit on how many elements may be - requested at the same time. You can use this option to control the amount - of memory used, since `distribute` won't use more than `element_size` * - `max_outstanding_requests` of memory. - task_refresh_interval_hint_ms: (Optional.) A hint for how often to query the - dispatcher for task changes. - -Returns: - Dataset: A `Dataset` of the elements produced by the data service." -1894,distribute,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,295,function,"A transformation that moves dataset processing to the tf.data service. +1454,CounterV1,tensorflow/tensorflow/python/data/experimental/ops/counter.py,59,function, +1455,ProcessingMode,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,36,class, +1456,validate,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,40,method,Raises a ValueError if the given object is not a valid processing mode. +1457,distribute,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,295,function,"A transformation that moves dataset processing to the tf.data service. When you iterate over a dataset containing the `distribute` transformation, the tf.data service creates a ""job"" which produces data for the dataset @@ -8004,7 +7857,7 @@ Args: Returns: Dataset: A `Dataset` of the elements produced by the data service." -1895,register_dataset,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,424,function,"Registers a dataset with the tf.data service. +1458,register_dataset,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,424,function,"Registers a dataset with the tf.data service. `register_dataset` registers a dataset with the tf.data service so that datasets can be created later with @@ -8040,7 +7893,7 @@ Args: Returns: A scalar int64 tensor of the registered dataset's id." -1896,from_dataset_id,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,491,function,"Creates a dataset which reads data from the tf.data service. +1459,from_dataset_id,tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py,491,function,"Creates a dataset which reads data from the tf.data service. This is useful when the dataset is registered by one process, then used in another process. When the same process is both registering and reading from @@ -8102,64 +7955,7 @@ Args: Returns: A `tf.data.Dataset` which reads from the tf.data service." -1897,_AutoShardDataset,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,34,class,"A `Dataset` that shards the `Dataset` automatically. - -This dataset takes in an existing dataset and tries to automatically figure -out how to shard the dataset in a multi-worker scenario. Currently, it uses -Grappler to walk up the dataset graph until it finds a reader dataset (e.g. -CSVDataset, TFRecordDataset), then inserts a ShardDataset op before that node -so that each worker only sees some files. - -Args: - num_workers: Total number of workers to shard this dataset across. - index: The current worker index (out of the total number of workers) this - dataset is for. - -Raises: - NotFoundError: If we cannot find a suitable reader dataset to begin - automatically sharding the dataset." -1898,_AutoShardDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,71,function, -1899,_RebatchDataset,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,76,class,"A `Dataset` that rebatches elements from its input into new batch sizes. - -`_RebatchDataset(input_dataset, batch_sizes)` is functionally equivalent to -`input_dataset.unbatch().batch(N)`, where the value of N cycles through the -`batch_sizes` input list. The elements produced by this dataset have the same -rank as the elements of the input dataset. - -For example: - -```python -ds = tf.data.Dataset.range(8) -ds = ds.batch(4) -ds = _RebatchDataset(ds, batch_sizes=[2, 1, 1]) -for elem in ds: - print(elem) ->> [0, 1], [2], [3], [4, 5], [6], [7] - -ds = tf.data.Dataset.range(16) -ds = ds.batch(4) -ds = _RebatchDataset(ds, batch_sizes=[6]) -for elem in ds: - print(elem) ->> [0, 1, 2, 3, 4, 5], [6, 7, 8, 9, 10, 11], [12, 13, 14, 15] -```" -1900,_LegacyRebatchDataset,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,209,class,"A `Dataset` that divides its input batches into `num_replicas` sub-batches. - -For each batch in the input dataset, _LegacyRebatchDataset will produce -`num_replicas` smaller batches whose sizes add up to the original batch size. - -For example: - -```python -ds = tf.data.Dataset.range(8) -ds = ds.batch(4) -ds = _LegacyRebatchDataset(ds, num_replicas=3) -for elem in ds: - print(elem) ->> [0, 1], [2, 3], [], [4, 5], [6, 7], [] -```" -1901,_RemoteDataset,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,280,class,Creates a dataset on a given `device` given a graph def. -1902,replicate,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,294,function,"A transformation that replicates `dataset` onto a list of devices. +1460,replicate,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,294,function,"A transformation that replicates `dataset` onto a list of devices. Args: dataset: A `tf.data.Dataset` object. @@ -8167,7 +7963,7 @@ Args: Returns: A dictionary mapping device name to a dataset on that device." -1903,batch_sizes_for_worker,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,328,function,"Determines how to rebatch a dataset for the given worker. +1461,batch_sizes_for_worker,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,328,function,"Determines how to rebatch a dataset for the given worker. Given the global batch size, number of workers, number of replicas per worker, and worker index, returns the correct batch sizes for rebatching a dataset @@ -8248,7 +8044,7 @@ Args: Returns: A `tf.int64` vector, representing the batch sizes to rebatch the dataset into." -1904,compute_batch_size,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,436,function,"An operation that returns the batch size of the dataset. +1462,compute_batch_size,tensorflow/tensorflow/python/data/experimental/ops/distribute.py,436,function,"An operation that returns the batch size of the dataset. This op tries to infer the batch size statically by walking up the dataset tree from the final dataset node and returning the batch size of the first @@ -8269,12 +8065,12 @@ Returns: A `tf.int64` Tensor representing the batch size of the dataset sans partial batches. If this cannot be inferred statically, the value of this tensor will be -1." -1905,AutoShardPolicy,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,27,class,"Represents the type of auto-sharding we enable. +1463,AutoShardPolicy,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,27,class,"Represents the type of auto-sharding we enable. Please see the DistributeOptions.auto_shard_policy documentation for more information on each type of autosharding." -1906,ExternalStatePolicy,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,39,class, -1907,DistributeOptions,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,46,class,"Represents options for distributed data processing. +1464,ExternalStatePolicy,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,39,class, +1465,DistributeOptions,tensorflow/tensorflow/python/data/experimental/ops/distribute_options.py,46,class,"Represents options for distributed data processing. You can set the distribution options of a dataset through the `experimental_distribute` property of `tf.data.Options`; the property is @@ -8285,7 +8081,7 @@ options = tf.data.Options() options.experimental_distribute.auto_shard_policy = AutoShardPolicy.OFF dataset = dataset.with_options(options) ```" -1908,enumerate_dataset,tensorflow/tensorflow/python/data/experimental/ops/enumerate_ops.py,26,function,"A transformation that enumerates the elements of a dataset. +1466,enumerate_dataset,tensorflow/tensorflow/python/data/experimental/ops/enumerate_ops.py,26,function,"A transformation that enumerates the elements of a dataset. It is similar to python's `enumerate`. For example: @@ -8311,7 +8107,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1909,ignore_errors,tensorflow/tensorflow/python/data/experimental/ops/error_ops.py,26,function,"Creates a `Dataset` from another `Dataset` and silently ignores any errors. +1467,ignore_errors,tensorflow/tensorflow/python/data/experimental/ops/error_ops.py,26,function,"Creates a `Dataset` from another `Dataset` and silently ignores any errors. Use this transformation to produce a dataset that contains the same elements as the input, but silently drops any elements that caused an error. For @@ -8332,8 +8128,7 @@ dataset = Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1910,_IgnoreErrorsDataset,tensorflow/tensorflow/python/data/experimental/ops/error_ops.py,56,class,A `Dataset` that silently ignores errors when computing its input. -1911,get_single_element,tensorflow/tensorflow/python/data/experimental/ops/get_single_element.py,27,function,"Returns the single element in `dataset` as a nested structure of tensors. +1468,get_single_element,tensorflow/tensorflow/python/data/experimental/ops/get_single_element.py,27,function,"Returns the single element in `dataset` as a nested structure of tensors. This function enables you to use a `tf.data.Dataset` in a stateless ""tensor-in tensor-out"" expression, without creating an iterator. @@ -8366,7 +8161,7 @@ Raises: TypeError: if `dataset` is not a `tf.data.Dataset` object. InvalidArgumentError (at runtime): if `dataset` does not contain exactly one element." -1912,group_by_reducer,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,38,function,"A transformation that groups elements and performs a reduction. +1469,group_by_reducer,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,38,function,"A transformation that groups elements and performs a reduction. This transformation maps element of a dataset to a key using `key_func` and groups the elements by key. The `reducer` is used to process each group; its @@ -8385,7 +8180,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1913,group_by_window,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,68,function,"A transformation that groups windows of elements by key and reduces them. +1470,group_by_window,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,68,function,"A transformation that groups windows of elements by key and reduces them. This transformation maps each consecutive element in a dataset to a key using `key_func` and groups the elements by key. It then applies @@ -8418,7 +8213,7 @@ Returns: Raises: ValueError: if neither or both of {`window_size`, `window_size_func`} are passed." -1914,bucket_by_sequence_length,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,128,function,"A transformation that buckets elements in a `Dataset` by length. +1471,bucket_by_sequence_length,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,128,function,"A transformation that buckets elements in a `Dataset` by length. Elements of the `Dataset` are grouped together by length and then are padded and batched. @@ -8458,15 +8253,16 @@ Returns: Raises: ValueError: if `len(bucket_batch_sizes) != len(bucket_boundaries) + 1`." -1915,_GroupByReducerDataset,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,247,class,A `Dataset` that groups its input and performs a reduction. -1916,_GroupByWindowDataset,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,370,class,A `Dataset` that groups its input and performs a windowed reduction. -1917,Reducer,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,443,class,"A reducer is used for reducing a set of elements. +1472,Reducer,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,443,class,"A reducer is used for reducing a set of elements. A reducer is represented as a tuple of the three functions: 1) initialization function: key => initial state 2) reduce function: (old state, input) => new state 3) finalization function: state => result" -1918,parallel_interleave,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,43,function,"A parallel version of the `Dataset.interleave()` transformation. +1473,init_func,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,458,method, +1474,reduce_func,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,462,method, +1475,finalize_func,tensorflow/tensorflow/python/data/experimental/ops/grouping.py,466,method, +1476,parallel_interleave,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,43,function,"A parallel version of the `Dataset.interleave()` transformation. `parallel_interleave()` maps `map_func` across its input to produce nested datasets, and outputs their elements interleaved. Unlike @@ -8510,8 +8306,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1919,_DirectedInterleaveDataset,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,104,class,A substitute for `Dataset.interleave()` on a fixed list of datasets. -1920,sample_from_datasets_v2,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,146,function,"Samples elements at random from the datasets in `datasets`. +1477,sample_from_datasets_v2,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,146,function,"Samples elements at random from the datasets in `datasets`. Args: datasets: A list of `tf.data.Dataset` objects with compatible structure. @@ -8532,8 +8327,8 @@ Raises: TypeError: If the `datasets` or `weights` arguments have the wrong type. ValueError: If the `weights` argument is specified and does not match the length of the `datasets` element." -1921,sample_from_datasets_v1,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,230,function, -1922,choose_from_datasets_v2,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,237,function,"Creates a dataset that deterministically chooses elements from `datasets`. +1478,sample_from_datasets_v1,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,230,function, +1479,choose_from_datasets_v2,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,237,function,"Creates a dataset that deterministically chooses elements from `datasets`. For example, given the following datasets: @@ -8566,8 +8361,8 @@ Returns: Raises: TypeError: If the `datasets` or `choice_dataset` arguments have the wrong type." -1923,choose_from_datasets_v1,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,280,function, -1924,save,tensorflow/tensorflow/python/data/experimental/ops/io.py,34,function,"Saves the content of the given dataset. +1480,choose_from_datasets_v1,tensorflow/tensorflow/python/data/experimental/ops/interleave_ops.py,280,function, +1481,save,tensorflow/tensorflow/python/data/experimental/ops/io.py,34,function,"Saves the content of the given dataset. Example usage: @@ -8610,8 +8405,7 @@ Args: to file shards. The function is expected to map elements of the input dataset to int64 shard IDs. If present, the function will be traced and executed as graph computation." -1925,_LoadDataset,tensorflow/tensorflow/python/data/experimental/ops/io.py,107,class,A dataset that loads previously saved dataset. -1926,load,tensorflow/tensorflow/python/data/experimental/ops/io.py,146,function,"Loads a previously saved dataset. +1482,load,tensorflow/tensorflow/python/data/experimental/ops/io.py,146,function,"Loads a previously saved dataset. Example usage: @@ -8663,8 +8457,7 @@ Args: Returns: A `tf.data.Dataset` instance." -1927,_convert_external_state_policy_to_enum,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,32,function, -1928,make_saveable_from_iterator,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,49,function,"Returns a SaveableObject for saving/restoring iterator state using Saver. +1483,make_saveable_from_iterator,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,49,function,"Returns a SaveableObject for saving/restoring iterator state using Saver. Args: iterator: Iterator. @@ -8711,7 +8504,7 @@ restoring the checkpoint. Note: Not all iterators support checkpointing yet. Attempting to save the state of an unsupported iterator will throw an error." -1929,CheckpointInputPipelineHook,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,106,class,"Checkpoints input pipeline state every N steps or seconds. +1484,CheckpointInputPipelineHook,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,106,class,"Checkpoints input pipeline state every N steps or seconds. This hook saves the state of the iterators in the `Graph` so that when training is resumed the input pipeline continues from where it left off. @@ -8753,11 +8546,12 @@ For saving the input pipeline checkpoint alongside the model weights use that you will need to be careful not to restore the training iterator during eval. You can do that by not adding the iterator to the SAVEABLE_OBJECTS collector when building the eval graph." -1930,_CustomSaver,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,297,class,"`Saver` with a different default `latest_filename`. - -This is used in the `CheckpointInputPipelineHook` to avoid conflicts with -the model ckpt saved by the `CheckpointSaverHook`." -1931,map_defun,tensorflow/tensorflow/python/data/experimental/ops/map_defun.py,26,function,"Map a function on the list of tensors unpacked from `elems` on dimension 0. +1485,begin,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,227,method, +1486,after_create_session,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,244,method, +1487,before_run,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,284,method, +1488,after_run,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,290,method, +1489,end,tensorflow/tensorflow/python/data/experimental/ops/iterator_ops.py,293,method, +1490,map_defun,tensorflow/tensorflow/python/data/experimental/ops/map_defun.py,26,function,"Map a function on the list of tensors unpacked from `elems` on dimension 0. Args: fn: A function (`function.defun`) that takes a list of tensors and returns @@ -8778,13 +8572,14 @@ Raises: Returns: A list of `Tensor` objects with the same types as `output_dtypes`." -1932,MatchingFilesDataset,tensorflow/tensorflow/python/data/experimental/ops/matching_files.py,28,class,A `Dataset` that list the files according to the input patterns. -1933,model,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,24,function,"A transformation that models performance. +1491,MatchingFilesDataset,tensorflow/tensorflow/python/data/experimental/ops/matching_files.py,28,class,A `Dataset` that list the files according to the input patterns. +1492,element_spec,tensorflow/tensorflow/python/data/experimental/ops/matching_files.py,38,method, +1493,model,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,24,function,"A transformation that models performance. Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1934,optimize,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,39,function,"A transformation that applies optimizations. +1494,optimize,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,39,function,"A transformation that applies optimizations. Args: optimizations: (Optional.) A `tf.string` vector `tf.Tensor` identifying @@ -8794,11 +8589,8 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1935,_ChooseFastestDataset,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,59,class,A `Dataset` that merges two input datasets. -1936,_ChooseFastestBranchDataset,tensorflow/tensorflow/python/data/experimental/ops/optimization.py,106,class,A `Dataset` that merges two input datasets. -1937,_AutotuneAlgorithm,tensorflow/tensorflow/python/data/experimental/ops/optimization_options.py,29,class,Controls what algorithm is used in the autotune implementation. -1938,MapVectorizationOptions,tensorflow/tensorflow/python/data/experimental/ops/optimization_options.py,36,class,Represents options for the MapVectorization optimization. -1939,OptimizationOptions,tensorflow/tensorflow/python/data/experimental/ops/optimization_options.py,70,class,"Represents options for dataset optimizations. +1495,MapVectorizationOptions,tensorflow/tensorflow/python/data/experimental/ops/optimization_options.py,36,class,Represents options for the MapVectorization optimization. +1496,OptimizationOptions,tensorflow/tensorflow/python/data/experimental/ops/optimization_options.py,70,class,"Represents options for dataset optimizations. You can set the optimization options of a dataset through the `experimental_optimization` property of `tf.data.Options`; the property is @@ -8811,8 +8603,7 @@ options.experimental_optimization.map_vectorization.enabled = True options.experimental_optimization.apply_default_optimizations = False dataset = dataset.with_options(options) ```" -1940,_ParseExampleDataset,tensorflow/tensorflow/python/data/experimental/ops/parsing_ops.py,31,class,A `Dataset` that parses `example` dataset into a `dict` dataset. -1941,parse_example_dataset,tensorflow/tensorflow/python/data/experimental/ops/parsing_ops.py,110,function,"A transformation that parses `Example` protos into a `dict` of tensors. +1497,parse_example_dataset,tensorflow/tensorflow/python/data/experimental/ops/parsing_ops.py,110,function,"A transformation that parses `Example` protos into a `dict` of tensors. Parses a number of serialized `Example` protos given in `serialized`. We refer to `serialized` as a batch with `batch_size` many entries of individual @@ -8845,7 +8636,7 @@ Returns: Raises: ValueError: if features argument is None." -1942,prefetch_to_device,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,37,function,"A transformation that prefetches dataset values to the given `device`. +1498,prefetch_to_device,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,37,function,"A transformation that prefetches dataset values to the given `device`. NOTE: Although the transformation creates a `tf.data.Dataset`, the transformation must be the final `Dataset` in the input pipeline. @@ -8858,7 +8649,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1943,copy_to_device,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,60,function,"A transformation that copies dataset elements to the given `target_device`. +1499,copy_to_device,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,60,function,"A transformation that copies dataset elements to the given `target_device`. Args: target_device: The name of a device to which elements will be copied. @@ -8867,9 +8658,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1944,_CopyToDeviceDataset,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,86,class,A `Dataset` that copies elements to another device. -1945,_MapOnGpuDataset,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,228,class,A `Dataset` that maps a function over elements in its using a GPU. -1946,map_on_gpu,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,260,function,"Maps `map_func` across the elements of this dataset. +1500,map_on_gpu,tensorflow/tensorflow/python/data/experimental/ops/prefetching_ops.py,260,function,"Maps `map_func` across the elements of this dataset. NOTE: This is a highly experimental version of `tf.data.Dataset.map` that runs `map_func` on GPU. It must be used after applying the @@ -8884,29 +8673,10 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1947,RandomDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/random_ops.py,32,class,A `Dataset` of pseudorandom values. -1948,RandomDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/random_ops.py,48,class,A `Dataset` of pseudorandom values. -1949,_is_valid_int32,tensorflow/tensorflow/python/data/experimental/ops/readers.py,50,function, -1950,_is_valid_int64,tensorflow/tensorflow/python/data/experimental/ops/readers.py,59,function, -1951,_is_valid_float,tensorflow/tensorflow/python/data/experimental/ops/readers.py,67,function, -1952,_infer_type,tensorflow/tensorflow/python/data/experimental/ops/readers.py,74,function,"Given a string, infers its tensor type. - -Infers the type of a value by picking the least 'permissive' type possible, -while still allowing the previous type inference for this column to be valid. - -Args: - str_val: String value to infer the type of. - na_value: Additional string to recognize as a NA/NaN CSV value. - prev_type: Type previously inferred based on values of this column that - we've seen up till now. -Returns: - Inferred dtype." -1953,_next_csv_row,tensorflow/tensorflow/python/data/experimental/ops/readers.py,111,function,Generator that yields rows of CSV file(s) in order. -1954,_infer_column_defaults,tensorflow/tensorflow/python/data/experimental/ops/readers.py,131,function,Infers column types from the first N valid CSV records of files. -1955,_infer_column_names,tensorflow/tensorflow/python/data/experimental/ops/readers.py,158,function,Infers column names from first rows of files. -1956,_get_sorted_col_indices,tensorflow/tensorflow/python/data/experimental/ops/readers.py,183,function,Transforms select_columns argument into sorted column indices. -1957,_maybe_shuffle_and_repeat,tensorflow/tensorflow/python/data/experimental/ops/readers.py,213,function,"Optionally shuffle and repeat dataset, as requested." -1958,make_tf_record_dataset,tensorflow/tensorflow/python/data/experimental/ops/readers.py,223,function,"Reads and optionally parses TFRecord files into a dataset. +1501,RandomDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/random_ops.py,32,class,A `Dataset` of pseudorandom values. +1502,element_spec,tensorflow/tensorflow/python/data/experimental/ops/random_ops.py,43,method, +1503,RandomDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/random_ops.py,48,class,A `Dataset` of pseudorandom values. +1504,make_tf_record_dataset,tensorflow/tensorflow/python/data/experimental/ops/readers.py,223,function,"Reads and optionally parses TFRecord files into a dataset. Provides common functionality such as batching, optional parsing, shuffling, and performant defaults. @@ -8946,7 +8716,7 @@ Returns: except it will have an additional leading `batch-size` dimension, or a `batch_size`-length 1-D tensor of strings if `parser_fn` is unspecified." -1959,make_csv_dataset_v2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,322,function,"Reads CSV files into a dataset. +1505,make_csv_dataset_v2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,322,function,"Reads CSV files into a dataset. Reads CSV files into a dataset, where each element is a (features, labels) tuple that corresponds to a batch of CSV rows. The features dictionary @@ -9032,10 +8802,11 @@ Returns: Raises: ValueError: If any of the arguments is malformed." -1960,make_csv_dataset_v1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,569,function, -1961,CsvDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,604,class,A Dataset comprising lines from one or more CSV files. -1962,CsvDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,783,class,A Dataset comprising lines from one or more CSV files. -1963,make_batched_features_dataset_v2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,874,function,"Returns a `Dataset` of feature dictionaries from `Example` protos. +1506,make_csv_dataset_v1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,569,function, +1507,CsvDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,604,class,A Dataset comprising lines from one or more CSV files. +1508,element_spec,tensorflow/tensorflow/python/data/experimental/ops/readers.py,778,method, +1509,CsvDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,783,class,A Dataset comprising lines from one or more CSV files. +1510,make_batched_features_dataset_v2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,874,function,"Returns a `Dataset` of feature dictionaries from `Example` protos. If label_key argument is provided, returns a `Dataset` of tuple comprising of feature dictionaries and label. @@ -9124,21 +8895,11 @@ Returns: Raises: TypeError: If `reader` is of the wrong type. ValueError: If `label_key` is not one of the `features` keys." -1964,make_batched_features_dataset_v1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1058,function, -1965,_get_file_names,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1082,function,"Parse list of file names from pattern, optionally shuffled. - -Args: - file_pattern: File glob pattern, or list of glob patterns. - shuffle: Whether to shuffle the order of file names. - -Returns: - List of file names matching `file_pattern`. - -Raises: - ValueError: If `file_pattern` is empty, or pattern matches no files." -1966,SqlDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1114,class,A `Dataset` consisting of the results from a SQL query. -1967,SqlDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1160,class,A `Dataset` consisting of the results from a SQL query. -1968,rejection_resample,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,37,function,"A transformation that resamples a dataset to achieve a target distribution. +1511,make_batched_features_dataset_v1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1058,function, +1512,SqlDatasetV2,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1114,class,A `Dataset` consisting of the results from a SQL query. +1513,element_spec,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1155,method, +1514,SqlDatasetV1,tensorflow/tensorflow/python/data/experimental/ops/readers.py,1160,class,A `Dataset` consisting of the results from a SQL query. +1515,rejection_resample,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,37,function,"A transformation that resamples a dataset to achieve a target distribution. **NOTE** Resampling is performed via rejection sampling; some fraction of the input values will be dropped. @@ -9155,109 +8916,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1969,_get_prob_original_static,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,109,function,"Returns the static probability of sampling from the original. - -`tensor_util.constant_value(prob_of_original)` returns `None` if it encounters -an Op that it isn't defined for. We have some custom logic to avoid this. - -Args: - initial_dist_t: A tensor of the initial distribution. - target_dist_t: A tensor of the target distribution. - -Returns: - The probability of sampling from the original distribution as a constant, - if it is a constant, or `None`." -1970,_filter_ds,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,132,function,"Filters a dataset based on per-class acceptance probabilities. - -Args: - dataset: The dataset to be filtered. - acceptance_dist_ds: A dataset of acceptance probabilities. - initial_dist_ds: A dataset of the initial probability distribution, given or - estimated. - class_func: A function mapping an element of the input dataset to a scalar - `tf.int32` tensor. Values should be in `[0, num_classes)`. - seed: (Optional.) Python integer seed for the resampler. - -Returns: - A dataset of (class value, data) after filtering." -1971,_estimate_initial_dist_ds,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,177,function, -1972,_get_target_to_initial_ratio,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,199,function, -1973,_estimate_data_distribution,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,205,function,"Estimate data distribution as labels are seen. - -Args: - c: The class labels. Type `int32`, shape `[batch_size]`. - num_examples_per_class_seen: Type `int64`, shape `[num_classes]`, - containing counts. - -Returns: - num_examples_per_lass_seen: Updated counts. Type `int64`, shape - `[num_classes]`. - dist: The updated distribution. Type `float32`, shape `[num_classes]`." -1974,_calculate_acceptance_probs_with_mixing,tensorflow/tensorflow/python/data/experimental/ops/resampling.py,230,function,"Calculates the acceptance probabilities and mixing ratio. - -In this case, we assume that we can *either* sample from the original data -distribution with probability `m`, or sample from a reshaped distribution -that comes from rejection sampling on the original distribution. This -rejection sampling is done on a per-class basis, with `a_i` representing the -probability of accepting data from class `i`. - -This method is based on solving the following analysis for the reshaped -distribution: - -Let F be the probability of a rejection (on any example). -Let p_i be the proportion of examples in the data in class i (init_probs) -Let a_i is the rate the rejection sampler should *accept* class i -Let t_i is the target proportion in the minibatches for class i (target_probs) - -``` -F = sum_i(p_i * (1-a_i)) - = 1 - sum_i(p_i * a_i) using sum_i(p_i) = 1 -``` - -An example with class `i` will be accepted if `k` rejections occur, then an -example with class `i` is seen by the rejector, and it is accepted. This can -be written as follows: - -``` -t_i = sum_k=0^inf(F^k * p_i * a_i) - = p_i * a_j / (1 - F) using geometric series identity, since 0 <= F < 1 - = p_i * a_i / sum_j(p_j * a_j) using F from above -``` - -Note that the following constraints hold: -``` -0 <= p_i <= 1, sum_i(p_i) = 1 -0 <= a_i <= 1 -0 <= t_i <= 1, sum_i(t_i) = 1 -``` - -A solution for a_i in terms of the other variables is the following: - ```a_i = (t_i / p_i) / max_i[t_i / p_i]``` - -If we try to minimize the amount of data rejected, we get the following: - -M_max = max_i [ t_i / p_i ] -M_min = min_i [ t_i / p_i ] - -The desired probability of accepting data if it comes from class `i`: - -a_i = (t_i/p_i - m) / (M_max - m) - -The desired probability of pulling a data element from the original dataset, -rather than the filtered one: - -m = M_min - -Args: - initial_probs: A Tensor of the initial probability distribution, given or - estimated. - target_probs: A Tensor of the corresponding classes. - -Returns: - (A 1D Tensor with the per-class acceptance probabilities, the desired - probability of pull from the original distribution.)" -1975,_ScanDataset,tensorflow/tensorflow/python/data/experimental/ops/scan_ops.py,29,class,A dataset that scans a function across its input. -1976,scan,tensorflow/tensorflow/python/data/experimental/ops/scan_ops.py,158,function,"A transformation that scans a function across an input dataset. +1516,scan,tensorflow/tensorflow/python/data/experimental/ops/scan_ops.py,158,function,"A transformation that scans a function across an input dataset. This transformation is a stateful relative of `tf.data.Dataset.map`. In addition to mapping `scan_func` across the elements of the input dataset, @@ -9275,8 +8934,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1977,_ShuffleAndRepeatDataset,tensorflow/tensorflow/python/data/experimental/ops/shuffle_ops.py,30,class,A `Dataset` that fuses `shuffle` and `repeat`. -1978,shuffle_and_repeat,tensorflow/tensorflow/python/data/experimental/ops/shuffle_ops.py,60,function,"Shuffles and repeats a Dataset, reshuffling with each repetition. +1517,shuffle_and_repeat,tensorflow/tensorflow/python/data/experimental/ops/shuffle_ops.py,60,function,"Shuffles and repeats a Dataset, reshuffling with each repetition. >>> d = tf.data.Dataset.from_tensor_slices([1, 2, 3]) >>> d = d.apply(tf.data.experimental.shuffle_and_repeat(2, count=2)) @@ -9319,8 +8977,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1979,_SleepDataset,tensorflow/tensorflow/python/data/experimental/ops/sleep.py,24,class,A `Dataset` that sleeps before producing each upstream element. -1980,sleep,tensorflow/tensorflow/python/data/experimental/ops/sleep.py,37,function,"Sleeps for `sleep_microseconds` before producing each input element. +1518,sleep,tensorflow/tensorflow/python/data/experimental/ops/sleep.py,37,function,"Sleeps for `sleep_microseconds` before producing each input element. Args: sleep_microseconds: The number of microseconds to sleep before producing an @@ -9329,8 +8986,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1981,_LegacySnapshotDataset,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,36,class,A Dataset that captures a snapshot or reads from a snapshot. -1982,legacy_snapshot,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,108,function,"Writes to/reads from a snapshot of a dataset. +1519,legacy_snapshot,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,108,function,"Writes to/reads from a snapshot of a dataset. This function attempts to determine whether a valid snapshot exists at the `path`, and reads from the snapshot if so. If not, it will run the @@ -9382,8 +9038,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1983,_SnapshotDataset,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,197,class,A dataset that allows saving and re-use of already processed data. -1984,snapshot,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,258,function,"API to persist the output of the input dataset. +1520,snapshot,tensorflow/tensorflow/python/data/experimental/ops/snapshot.py,258,function,"API to persist the output of the input dataset. The snapshot API allows users to transparently persist the output of their preprocessing pipeline to disk, and materialize the pre-processed data on a @@ -9457,7 +9112,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1985,StatsAggregatorV2,tensorflow/tensorflow/python/data/experimental/ops/stats_aggregator.py,31,class,"A stateful resource that aggregates statistics from one or more iterators. +1521,StatsAggregatorV2,tensorflow/tensorflow/python/data/experimental/ops/stats_aggregator.py,31,class,"A stateful resource that aggregates statistics from one or more iterators. To record statistics, use one of the custom transformation functions defined in this module when defining your `tf.data.Dataset`. All statistics will be @@ -9486,7 +9141,7 @@ dataset = dataset.with_options(options) Note: This interface is experimental and expected to change. In particular, we expect to add other implementations of `StatsAggregator` that provide different ways of exporting statistics, and add more types of statistics." -1986,StatsAggregatorV1,tensorflow/tensorflow/python/data/experimental/ops/stats_aggregator.py,82,class,"A stateful resource that aggregates statistics from one or more iterators. +1522,StatsAggregatorV1,tensorflow/tensorflow/python/data/experimental/ops/stats_aggregator.py,82,class,"A stateful resource that aggregates statistics from one or more iterators. To record statistics, use one of the custom transformation functions defined in this module when defining your `tf.data.Dataset`. All statistics will be @@ -9527,7 +9182,15 @@ tf.compat.v1.add_to_collection(tf.GraphKeys.SUMMARIES, stats_summary) Note: This interface is experimental and expected to change. In particular, we expect to add other implementations of `StatsAggregator` that provide different ways of exporting statistics, and add more types of statistics." -1987,set_stats_aggregator,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,29,function,"Set the given `stats_aggregator` for aggregating the input dataset stats. +1523,get_summary,tensorflow/tensorflow/python/data/experimental/ops/stats_aggregator.py,130,method,"Returns a string `tf.Tensor` that summarizes the aggregated statistics. + +The returned tensor will contain a serialized `tf.compat.v1.summary.Summary` +protocol +buffer, which can be used with the standard TensorBoard logging facilities. + +Returns: + A scalar string `tf.Tensor` that summarizes the aggregated statistics." +1524,set_stats_aggregator,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,29,function,"Set the given `stats_aggregator` for aggregating the input dataset stats. Args: stats_aggregator: A `tf.data.experimental.StatsAggregator` object. @@ -9539,7 +9202,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1988,bytes_produced_stats,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,52,function,"Records the number of bytes produced by each element of the input dataset. +1525,bytes_produced_stats,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,52,function,"Records the number of bytes produced by each element of the input dataset. To consume the statistics, associate a `StatsAggregator` with the output dataset. @@ -9551,7 +9214,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1989,latency_stats,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,75,function,"Records the latency of producing each element of the input dataset. +1526,latency_stats,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,75,function,"Records the latency of producing each element of the input dataset. To consume the statistics, associate a `StatsAggregator` with the output dataset. @@ -9563,8 +9226,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1990,_StatsDataset,tensorflow/tensorflow/python/data/experimental/ops/stats_ops.py,97,class,"A `Dataset` that acts as an identity, and also records statistics." -1991,StatsOptions,tensorflow/tensorflow/python/data/experimental/ops/stats_options.py,28,class,"Represents options for collecting dataset stats using `StatsAggregator`. +1527,StatsOptions,tensorflow/tensorflow/python/data/experimental/ops/stats_options.py,28,class,"Represents options for collecting dataset stats using `StatsAggregator`. You can set the stats options of a dataset through the `experimental_stats` property of `tf.data.Options`; the property is an instance of @@ -9579,8 +9241,7 @@ options.experimental_stats.aggregator = aggregator options.experimental_stats.latency_all_edges = True dataset = dataset.with_options(options) ```" -1992,_TakeWhileDataset,tensorflow/tensorflow/python/data/experimental/ops/take_while_ops.py,27,class,A dataset that stops iteration when `predicate` returns false. -1993,take_while,tensorflow/tensorflow/python/data/experimental/ops/take_while_ops.py,56,function,"A transformation that stops dataset iteration based on a `predicate`. +1528,take_while,tensorflow/tensorflow/python/data/experimental/ops/take_while_ops.py,56,function,"A transformation that stops dataset iteration based on a `predicate`. Args: predicate: A function that maps a nested structure of tensors (having shapes @@ -9590,7 +9251,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1994,assert_next,tensorflow/tensorflow/python/data/experimental/ops/testing.py,26,function,"A transformation that asserts which transformations happen next. +1529,assert_next,tensorflow/tensorflow/python/data/experimental/ops/testing.py,26,function,"A transformation that asserts which transformations happen next. Transformations should be referred to by their base name, not including version suffix. For example, use ""Batch"" instead of ""BatchV2"". ""Batch"" will @@ -9603,12 +9264,12 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1995,non_serializable,tensorflow/tensorflow/python/data/experimental/ops/testing.py,49,function,"A non-serializable identity transformation. +1530,non_serializable,tensorflow/tensorflow/python/data/experimental/ops/testing.py,49,function,"A non-serializable identity transformation. Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1996,sleep,tensorflow/tensorflow/python/data/experimental/ops/testing.py,64,function,"Sleeps for `sleep_microseconds` before producing each input element. +1531,sleep,tensorflow/tensorflow/python/data/experimental/ops/testing.py,64,function,"Sleeps for `sleep_microseconds` before producing each input element. Args: sleep_microseconds: The number of microseconds to sleep before producing an @@ -9617,10 +9278,7 @@ Args: Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -1997,_AssertNextDataset,tensorflow/tensorflow/python/data/experimental/ops/testing.py,82,class,A `Dataset` that asserts which transformations happen next. -1998,_NonSerializableDataset,tensorflow/tensorflow/python/data/experimental/ops/testing.py,100,class,A `Dataset` that performs non-serializable identity transformation. -1999,_SleepDataset,tensorflow/tensorflow/python/data/experimental/ops/testing.py,113,class,A `Dataset` that sleeps before producing each upstream element. -2000,ThreadingOptions,tensorflow/tensorflow/python/data/experimental/ops/threading_options.py,26,class,"Represents options for dataset threading. +1532,ThreadingOptions,tensorflow/tensorflow/python/data/experimental/ops/threading_options.py,26,class,"Represents options for dataset threading. You can set the threading options of a dataset through the `experimental_threading` property of `tf.data.Options`; the property is @@ -9631,10 +9289,8 @@ options = tf.data.Options() options.experimental_threading.private_threadpool_size = 10 dataset = dataset.with_options(options) ```" -2001,_generate_shared_name,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,31,function, -2002,PrivateThreadPool,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,41,class,A stateful resource that represents a private thread pool. -2003,_ThreadPoolDataset,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,63,class,"A `Dataset` that acts as an identity, and sets a custom threadpool." -2004,override_threadpool,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,78,function,"Returns a new dataset that uses the given thread pool for its operations. +1533,PrivateThreadPool,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,41,class,A stateful resource that represents a private thread pool. +1534,override_threadpool,tensorflow/tensorflow/python/data/experimental/ops/threadpool.py,78,function,"Returns a new dataset that uses the given thread pool for its operations. Args: dataset: A `tf.data.Dataset` object. @@ -9644,7 +9300,7 @@ Returns: A dataset containing the same values as `dataset`, but which uses `thread_pool` to compute any of its parallel operations (such as `tf.data.Dataset.map`)." -2005,unique,tensorflow/tensorflow/python/data/experimental/ops/unique.py,27,function,"Creates a `Dataset` from another `Dataset`, discarding duplicates. +1535,unique,tensorflow/tensorflow/python/data/experimental/ops/unique.py,27,function,"Creates a `Dataset` from another `Dataset`, discarding duplicates. Use this transformation to produce a dataset that contains one instance of each unique element in the input. For example: @@ -9659,8 +9315,7 @@ dataset = dataset.apply(tf.data.experimental.unique()) # ==> { 1, 37, 2 } Returns: A `Dataset` transformation function, which can be passed to `tf.data.Dataset.apply`." -2006,_UniqueDataset,tensorflow/tensorflow/python/data/experimental/ops/unique.py,51,class,A `Dataset` contains the unique elements from its input. -2007,TFRecordWriter,tensorflow/tensorflow/python/data/experimental/ops/writers.py,30,class,"Writes a dataset to a TFRecord file. +1536,TFRecordWriter,tensorflow/tensorflow/python/data/experimental/ops/writers.py,30,class,"Writes a dataset to a TFRecord file. The elements of the dataset must be scalar strings. To serialize dataset elements as strings, you can use the `tf.io.serialize_tensor` function. @@ -9695,7 +9350,25 @@ dataset = dataset.apply(tf.data.experimental.group_by_window( lambda i, _: i % NUM_SHARDS, reduce_func, tf.int64.max )) ```" -2008,DispatchServer,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,29,class,"An in-process tf.data service dispatch server. +1537,write,tensorflow/tensorflow/python/data/experimental/ops/writers.py,85,method,"Writes a dataset to a TFRecord file. + +An operation that writes the content of the specified dataset to the file +specified in the constructor. + +If the file exists, it will be overwritten. + +Args: + dataset: a `tf.data.Dataset` whose elements are to be written to a file + +Returns: + In graph mode, this returns an operation which when executed performs the + write. In eager mode, the write is performed by the method itself and + there is no return value. + +Raises + TypeError: if `dataset` is not a `tf.data.Dataset`. + TypeError: if the elements produced by the dataset are not scalar strings." +1538,DispatchServer,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,29,class,"An in-process tf.data service dispatch server. A `tf.data.experimental.service.DispatchServer` coordinates a cluster of `tf.data.experimental.service.WorkerServer`s. When the workers start, they @@ -9718,7 +9391,37 @@ indefinitely after starting up the server. dispatcher = tf.data.experimental.service.DispatchServer(port=5050) dispatcher.join() ```" -2009,WorkerServer,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,148,class,"An in-process tf.data service worker server. +1539,start,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,78,method,"Starts this server. + +>>> dispatcher = tf.data.experimental.service.DispatchServer(port=0, +... start=False) +>>> dispatcher.start() + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + starting the server." +1540,join,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,91,method,"Blocks until the server has shut down. + +This is useful when starting a dedicated dispatch process. + +``` +dispatcher = tf.data.experimental.service.DispatchServer(port=5050) +dispatcher.join() +``` + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + joining the server." +1541,target,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,108,method,"Returns a target that can be used to connect to the server. + +>>> dispatcher = tf.data.experimental.service.DispatchServer(port=0) +>>> dataset = tf.data.Dataset.range(10) +>>> dataset = dataset.apply(tf.data.experimental.service.distribute( +... processing_mode=""parallel_epochs"", service=dispatcher.target)) + +The returned string will be in the form protocol://address, e.g. +""grpc://localhost:5050""." +1542,WorkerServer,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,148,class,"An in-process tf.data service worker server. A `tf.data.experimental.service.WorkerServer` performs `tf.data.Dataset` processing for user-defined datasets, and provides the resulting elements over @@ -9743,98 +9446,31 @@ worker = tf.data.experimental.service.WorkerServer( port=5051, dispatcher_address=""grpc://localhost:5050"") worker.join() ```" -2010,ServerLibTest,tensorflow/tensorflow/python/data/experimental/service/server_lib_test.py,26,class, -2011,AsNumpyIteratorTest,tensorflow/tensorflow/python/data/kernel_tests/as_numpy_iterator_test.py,34,class, -2012,BatchTest,tensorflow/tensorflow/python/data/kernel_tests/batch_test.py,40,class, -2013,FileCacheTest,tensorflow/tensorflow/python/data/kernel_tests/cache_test.py,43,class, -2014,MemoryCacheTest,tensorflow/tensorflow/python/data/kernel_tests/cache_test.py,204,class, -2015,_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/cardinality_test.py,31,function, -2016,CardinalityTest,tensorflow/tensorflow/python/data/kernel_tests/cardinality_test.py,182,class,Tests for `tf.data.Dataset.cardinality()`. -2017,CheckpointTest,tensorflow/tensorflow/python/data/kernel_tests/checkpoint_test.py,48,class, -2018,ConcatenateTest,tensorflow/tensorflow/python/data/kernel_tests/concatenate_test.py,32,class, -2019,_make_distributed_dataset,tensorflow/tensorflow/python/data/kernel_tests/data_service_ops_test.py,48,function,Creates a distributed dataset with a short task refresh interval. -2020,DataServiceOpsTest,tensorflow/tensorflow/python/data/kernel_tests/data_service_ops_test.py,58,class, -2021,DatasetSpecTest,tensorflow/tensorflow/python/data/kernel_tests/dataset_spec_test.py,34,class, -2022,DatasetTest,tensorflow/tensorflow/python/data/kernel_tests/dataset_test.py,49,class, -2023,EnumerateTest,tensorflow/tensorflow/python/data/kernel_tests/enumerate_test.py,31,class, -2024,_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/filter_test.py,33,function, -2025,FilterTest,tensorflow/tensorflow/python/data/kernel_tests/filter_test.py,55,class, -2026,FixedLengthRecordDatasetTest,tensorflow/tensorflow/python/data/kernel_tests/fixed_length_record_dataset_test.py,34,class, -2027,FlatMapTest,tensorflow/tensorflow/python/data/kernel_tests/flat_map_test.py,41,class, -2028,FromGeneratorTest,tensorflow/tensorflow/python/data/kernel_tests/from_generator_test.py,35,class, -2029,FromSparseTensorSlicesTest,tensorflow/tensorflow/python/data/kernel_tests/from_sparse_tensor_slices_test.py,33,class, -2030,FromTensorSlicesTest,tensorflow/tensorflow/python/data/kernel_tests/from_tensor_slices_test.py,36,class, -2031,FromTensorsTest,tensorflow/tensorflow/python/data/kernel_tests/from_tensors_test.py,41,class, -2032,_interleave,tensorflow/tensorflow/python/data/kernel_tests/interleave_test.py,38,function,"Reference implementation of interleave used for testing. +1543,start,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,213,method,"Starts this server. -Args: - lists: a list of lists to interleave - cycle_length: the length of the interleave cycle - block_length: the length of the interleave block - num_parallel_calls: the number of parallel calls +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + starting the server." +1544,join,tensorflow/tensorflow/python/data/experimental/service/server_lib.py,222,method,"Blocks until the server has shut down. -Yields: - Elements of `lists` interleaved in the order determined by `cycle_length` - and `block_length`." -2033,_repeat,tensorflow/tensorflow/python/data/kernel_tests/interleave_test.py,92,function,"Produces a list of lists suitable for testing interleave. +This is useful when starting a dedicated worker process. -Args: - values: for each element `x` the result contains `[x] * x` - count: determines how many times to repeat `[x] * x` in the result +``` +worker_server = tf.data.experimental.service.WorkerServer( + port=5051, dispatcher_address=""grpc://localhost:5050"") +worker_server.join() +``` -Returns: - A list of lists of values suitable for testing interleave." -2034,InterleaveTest,tensorflow/tensorflow/python/data/kernel_tests/interleave_test.py,105,class, -2035,IteratorClusterTest,tensorflow/tensorflow/python/data/kernel_tests/iterator_cluster_test.py,43,class, -2036,IteratorTest,tensorflow/tensorflow/python/data/kernel_tests/iterator_test.py,56,class, -2037,LenTest,tensorflow/tensorflow/python/data/kernel_tests/len_test.py,28,class, -2038,ListFilesTest,tensorflow/tensorflow/python/data/kernel_tests/list_files_test.py,35,class, -2039,_test_combinations_with_mode_v1,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,61,function, -2040,_test_combinations_with_mode_v2,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,82,function, -2041,_test_combinations_with_mode,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,93,function, -2042,_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,98,function, -2043,_short_circuit_test_cases,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,103,function, -2044,_make_coordinated_sloppy_dataset,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,119,function,"Produces a dataset iterator and events to control the order of elements. +This method currently blocks forever. -Args: - apply_map: method that applies the `map` transformation - num_elements: the number of input elements - num_parallel_calls: the degree of map parallelism - -Returns: - A dataset iterator (represented as `get_next` op) and events that can be - used to control the order of output elements." -2045,Foo,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,153,class,Dummy class used for invalid return value tests. -2046,MapTest,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,160,class, -2047,MemoryCleanupTest,tensorflow/tensorflow/python/data/kernel_tests/memory_cleanup_test.py,47,class, -2048,skip_v2_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/multi_device_iterator_test.py,42,function, -2049,MultiDeviceIteratorTest,tensorflow/tensorflow/python/data/kernel_tests/multi_device_iterator_test.py,47,class, -2050,OwnedMultiDeviceIteratorTest,tensorflow/tensorflow/python/data/kernel_tests/multi_device_iterator_test.py,350,class, -2051,_optional_spec_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/optional_test.py,46,function, -2052,_get_next_as_optional_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/optional_test.py,80,function, -2053,OptionalTest,tensorflow/tensorflow/python/data/kernel_tests/optional_test.py,122,class, -2054,OptionsTest,tensorflow/tensorflow/python/data/kernel_tests/options_test.py,32,class, -2055,PaddedBatchTest,tensorflow/tensorflow/python/data/kernel_tests/padded_batch_test.py,40,class, -2056,PrefetchTest,tensorflow/tensorflow/python/data/kernel_tests/prefetch_test.py,31,class, -2057,RangeTest,tensorflow/tensorflow/python/data/kernel_tests/range_test.py,31,class, -2058,ReduceTest,tensorflow/tensorflow/python/data/kernel_tests/reduce_test.py,42,class, -2059,RepeatTest,tensorflow/tensorflow/python/data/kernel_tests/repeat_test.py,29,class, -2060,ShardTest,tensorflow/tensorflow/python/data/kernel_tests/shard_test.py,29,class, -2061,ShuffleTest,tensorflow/tensorflow/python/data/kernel_tests/shuffle_test.py,42,class, -2062,SkipTest,tensorflow/tensorflow/python/data/kernel_tests/skip_test.py,29,class, -2063,TakeTest,tensorflow/tensorflow/python/data/kernel_tests/take_test.py,29,class, -2064,default_test_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,39,function,Returns the default test combinations for tf.data tests. -2065,eager_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,44,function,Returns the default test combinations for eager mode only tf.data tests. -2066,graph_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,49,function,Returns the default test combinations for graph mode only tf.data tests. -2067,v2_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,54,function,Returns the default test combinations for v1 only tf.data tests. -2068,DatasetTestBase,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,59,class,Base class for dataset tests. -2069,TextLineDatasetTest,tensorflow/tensorflow/python/data/kernel_tests/text_line_dataset_test.py,41,class, -2070,TFRecordDatasetTest,tensorflow/tensorflow/python/data/kernel_tests/tf_record_dataset_test.py,36,class, -2071,UnbatchTest,tensorflow/tensorflow/python/data/kernel_tests/unbatch_test.py,38,class, -2072,WindowTest,tensorflow/tensorflow/python/data/kernel_tests/window_test.py,36,class, -2073,_dataset_factory,tensorflow/tensorflow/python/data/kernel_tests/zip_test.py,31,function, -2074,ZipTest,tensorflow/tensorflow/python/data/kernel_tests/zip_test.py,39,class, -2075,DatasetV2,tensorflow/tensorflow/python/data/ops/dataset_ops.py,106,class,"Represents a potentially large set of elements. +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + joining the server." +1545,Foo,tensorflow/tensorflow/python/data/kernel_tests/map_test.py,153,class,Dummy class used for invalid return value tests. +1546,eager_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,44,function,Returns the default test combinations for eager mode only tf.data tests. +1547,graph_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,49,function,Returns the default test combinations for graph mode only tf.data tests. +1548,v2_only_combinations,tensorflow/tensorflow/python/data/kernel_tests/test_base.py,54,function,Returns the default test combinations for v1 only tf.data tests. +1549,DatasetV2,tensorflow/tensorflow/python/data/ops/dataset_ops.py,106,class,"Represents a potentially large set of elements. The `tf.data.Dataset` API supports writing descriptive and efficient input pipelines. `Dataset` usage follows a common pattern: @@ -9909,14 +9545,1376 @@ representable by `tf.TypeSpec`, including `tf.Tensor`, `tf.data.Dataset`, >>> Point = collections.namedtuple(""Point"", [""x"", ""y""]) # doctest: +SKIP >>> e = Point(1, 2) # Named tuple # doctest: +SKIP >>> f = tf.data.Dataset.range(10) # Dataset element" -2076,DatasetV1,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2169,class,"Represents a potentially large set of elements. +1550,options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,348,method,"Returns the options for this dataset and its inputs. + +Returns: + A `tf.data.Options` object representing the dataset options." +1551,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,451,method,"The type specification of an element of this dataset. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> dataset.element_spec +TensorSpec(shape=(), dtype=tf.int32, name=None) + +Returns: + A nested structure of `tf.TypeSpec` objects matching the structure of an + element of this dataset and specifying the type of individual components." +1552,as_numpy_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,472,method,"Returns an iterator which converts all elements of the dataset to numpy. + +Use `as_numpy_iterator` to inspect the content of your dataset. To see +element shapes and types, print dataset elements directly instead of using +`as_numpy_iterator`. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> for element in dataset: +... print(element) +tf.Tensor(1, shape=(), dtype=int32) +tf.Tensor(2, shape=(), dtype=int32) +tf.Tensor(3, shape=(), dtype=int32) + +This method requires that you are running in eager mode and the dataset's +element_spec contains only `TensorSpec` components. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> for element in dataset.as_numpy_iterator(): +... print(element) +1 +2 +3 + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> print(list(dataset.as_numpy_iterator())) +[1, 2, 3] + +`as_numpy_iterator()` will preserve the nested structure of dataset +elements. + +>>> dataset = tf.data.Dataset.from_tensor_slices({'a': ([1, 2], [3, 4]), +... 'b': [5, 6]}) +>>> list(dataset.as_numpy_iterator()) == [{'a': (1, 3), 'b': 5}, +... {'a': (2, 4), 'b': 6}] +True + +Returns: + An iterable over the elements of the dataset, with their tensors converted + to numpy arrays. + +Raises: + TypeError: if an element contains a non-`Tensor` value. + RuntimeError: if eager execution is not enabled." +1553,from_tensors,tensorflow/tensorflow/python/data/ops/dataset_ops.py,570,method,"Creates a `Dataset` with a single element, comprising the given tensors. + +`from_tensors` produces a dataset containing only a single element. To slice +the input tensor into multiple elements, use `from_tensor_slices` instead. + +>>> dataset = tf.data.Dataset.from_tensors([1, 2, 3]) +>>> list(dataset.as_numpy_iterator()) +[array([1, 2, 3], dtype=int32)] +>>> dataset = tf.data.Dataset.from_tensors(([1, 2, 3], 'A')) +>>> list(dataset.as_numpy_iterator()) +[(array([1, 2, 3], dtype=int32), b'A')] + +>>> # You can use `from_tensors` to produce a dataset which repeats +>>> # the same example many times. +>>> example = tf.constant([1,2,3]) +>>> dataset = tf.data.Dataset.from_tensors(example).repeat(2) +>>> list(dataset.as_numpy_iterator()) +[array([1, 2, 3], dtype=int32), array([1, 2, 3], dtype=int32)] + +Note that if `tensors` contains a NumPy array, and eager execution is not +enabled, the values will be embedded in the graph as one or more +`tf.constant` operations. For large datasets (> 1 GB), this can waste +memory and run into byte limits of graph serialization. If `tensors` +contains one or more large NumPy arrays, consider the alternative described +in [this +guide](https://tensorflow.org/guide/data#consuming_numpy_arrays). + +Args: + tensors: A dataset element. + +Returns: + Dataset: A `Dataset`." +1554,from_tensor_slices,tensorflow/tensorflow/python/data/ops/dataset_ops.py,607,method,"Creates a `Dataset` whose elements are slices of the given tensors. + +The given tensors are sliced along their first dimension. This operation +preserves the structure of the input tensors, removing the first dimension +of each tensor and using it as the dataset dimension. All input tensors +must have the same size in their first dimensions. + +>>> # Slicing a 1D tensor produces scalar tensor elements. +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> list(dataset.as_numpy_iterator()) +[1, 2, 3] + +>>> # Slicing a 2D tensor produces 1D tensor elements. +>>> dataset = tf.data.Dataset.from_tensor_slices([[1, 2], [3, 4]]) +>>> list(dataset.as_numpy_iterator()) +[array([1, 2], dtype=int32), array([3, 4], dtype=int32)] + +>>> # Slicing a tuple of 1D tensors produces tuple elements containing +>>> # scalar tensors. +>>> dataset = tf.data.Dataset.from_tensor_slices(([1, 2], [3, 4], [5, 6])) +>>> list(dataset.as_numpy_iterator()) +[(1, 3, 5), (2, 4, 6)] + +>>> # Dictionary structure is also preserved. +>>> dataset = tf.data.Dataset.from_tensor_slices({""a"": [1, 2], ""b"": [3, 4]}) +>>> list(dataset.as_numpy_iterator()) == [{'a': 1, 'b': 3}, +... {'a': 2, 'b': 4}] +True + +>>> # Two tensors can be combined into one Dataset object. +>>> features = tf.constant([[1, 3], [2, 1], [3, 3]]) # ==> 3x2 tensor +>>> labels = tf.constant(['A', 'B', 'A']) # ==> 3x1 tensor +>>> dataset = Dataset.from_tensor_slices((features, labels)) +>>> # Both the features and the labels tensors can be converted +>>> # to a Dataset object separately and combined after. +>>> features_dataset = Dataset.from_tensor_slices(features) +>>> labels_dataset = Dataset.from_tensor_slices(labels) +>>> dataset = Dataset.zip((features_dataset, labels_dataset)) +>>> # A batched feature and label set can be converted to a Dataset +>>> # in similar fashion. +>>> batched_features = tf.constant([[[1, 3], [2, 3]], +... [[2, 1], [1, 2]], +... [[3, 3], [3, 2]]], shape=(3, 2, 2)) +>>> batched_labels = tf.constant([['A', 'A'], +... ['B', 'B'], +... ['A', 'B']], shape=(3, 2, 1)) +>>> dataset = Dataset.from_tensor_slices((batched_features, batched_labels)) +>>> for element in dataset.as_numpy_iterator(): +... print(element) +(array([[1, 3], + [2, 3]], dtype=int32), array([[b'A'], + [b'A']], dtype=object)) +(array([[2, 1], + [1, 2]], dtype=int32), array([[b'B'], + [b'B']], dtype=object)) +(array([[3, 3], + [3, 2]], dtype=int32), array([[b'A'], + [b'B']], dtype=object)) + +Note that if `tensors` contains a NumPy array, and eager execution is not +enabled, the values will be embedded in the graph as one or more +`tf.constant` operations. For large datasets (> 1 GB), this can waste +memory and run into byte limits of graph serialization. If `tensors` +contains one or more large NumPy arrays, consider the alternative described +in [this guide]( +https://tensorflow.org/guide/data#consuming_numpy_arrays). + +Args: + tensors: A dataset element, with each component having the same size in + the first dimension. + +Returns: + Dataset: A `Dataset`." +1555,from_generator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,721,method,"Creates a `Dataset` whose elements are generated by `generator`. + +The `generator` argument must be a callable object that returns +an object that supports the `iter()` protocol (e.g. a generator function). +The elements generated by `generator` must be compatible with the given +`output_types` and (optional) `output_shapes` arguments. + +>>> import itertools +>>> +>>> def gen(): +... for i in itertools.count(1): +... yield (i, [1] * i) +>>> +>>> dataset = tf.data.Dataset.from_generator( +... gen, +... (tf.int64, tf.int64), +... (tf.TensorShape([]), tf.TensorShape([None]))) +>>> +>>> list(dataset.take(3).as_numpy_iterator()) +[(1, array([1])), (2, array([1, 1])), (3, array([1, 1, 1]))] + +Note: The current implementation of `Dataset.from_generator()` uses +`tf.numpy_function` and inherits the same constraints. In particular, it +requires the dataset and iterator related operations to be placed +on a device in the same process as the Python program that called +`Dataset.from_generator()`. The body of `generator` will not be +serialized in a `GraphDef`, and you should not use this method if you +need to serialize your model and restore it in a different environment. + +Note: If `generator` depends on mutable global variables or other external +state, be aware that the runtime may invoke `generator` multiple times +(in order to support repeating the `Dataset`) and at any time +between the call to `Dataset.from_generator()` and the production of the +first element from the generator. Mutating global variables or external +state can cause undefined behavior, and we recommend that you explicitly +cache any external state in `generator` before calling +`Dataset.from_generator()`. + +Args: + generator: A callable object that returns an object that supports the + `iter()` protocol. If `args` is not specified, `generator` must take no + arguments; otherwise it must take as many arguments as there are values + in `args`. + output_types: A nested structure of `tf.DType` objects corresponding to + each component of an element yielded by `generator`. + output_shapes: (Optional.) A nested structure of `tf.TensorShape` objects + corresponding to each component of an element yielded by `generator`. + args: (Optional.) A tuple of `tf.Tensor` objects that will be evaluated + and passed to `generator` as NumPy-array arguments. + +Returns: + Dataset: A `Dataset`." +1556,range,tensorflow/tensorflow/python/data/ops/dataset_ops.py,921,method,"Creates a `Dataset` of a step-separated range of values. + +>>> list(Dataset.range(5).as_numpy_iterator()) +[0, 1, 2, 3, 4] +>>> list(Dataset.range(2, 5).as_numpy_iterator()) +[2, 3, 4] +>>> list(Dataset.range(1, 5, 2).as_numpy_iterator()) +[1, 3] +>>> list(Dataset.range(1, 5, -2).as_numpy_iterator()) +[] +>>> list(Dataset.range(5, 1).as_numpy_iterator()) +[] +>>> list(Dataset.range(5, 1, -2).as_numpy_iterator()) +[5, 3] +>>> list(Dataset.range(2, 5, output_type=tf.int32).as_numpy_iterator()) +[2, 3, 4] +>>> list(Dataset.range(1, 5, 2, output_type=tf.float32).as_numpy_iterator()) +[1.0, 3.0] + +Args: + *args: follows the same semantics as python's xrange. + len(args) == 1 -> start = 0, stop = args[0], step = 1. + len(args) == 2 -> start = args[0], stop = args[1], step = 1. + len(args) == 3 -> start = args[0], stop = args[1], step = args[2]. + **kwargs: + - output_type: Its expected dtype. (Optional, default: `tf.int64`). + +Returns: + Dataset: A `RangeDataset`. + +Raises: + ValueError: if len(args) == 0." +1557,zip,tensorflow/tensorflow/python/data/ops/dataset_ops.py,958,method,"Creates a `Dataset` by zipping together the given datasets. + +This method has similar semantics to the built-in `zip()` function +in Python, with the main difference being that the `datasets` +argument can be an arbitrary nested structure of `Dataset` objects. + +>>> # The nested structure of the `datasets` argument determines the +>>> # structure of elements in the resulting dataset. +>>> a = tf.data.Dataset.range(1, 4) # ==> [ 1, 2, 3 ] +>>> b = tf.data.Dataset.range(4, 7) # ==> [ 4, 5, 6 ] +>>> ds = tf.data.Dataset.zip((a, b)) +>>> list(ds.as_numpy_iterator()) +[(1, 4), (2, 5), (3, 6)] +>>> ds = tf.data.Dataset.zip((b, a)) +>>> list(ds.as_numpy_iterator()) +[(4, 1), (5, 2), (6, 3)] +>>> +>>> # The `datasets` argument may contain an arbitrary number of datasets. +>>> c = tf.data.Dataset.range(7, 13).batch(2) # ==> [ [7, 8], +... # [9, 10], +... # [11, 12] ] +>>> ds = tf.data.Dataset.zip((a, b, c)) +>>> for element in ds.as_numpy_iterator(): +... print(element) +(1, 4, array([7, 8])) +(2, 5, array([ 9, 10])) +(3, 6, array([11, 12])) +>>> +>>> # The number of elements in the resulting dataset is the same as +>>> # the size of the smallest dataset in `datasets`. +>>> d = tf.data.Dataset.range(13, 15) # ==> [ 13, 14 ] +>>> ds = tf.data.Dataset.zip((a, d)) +>>> list(ds.as_numpy_iterator()) +[(1, 13), (2, 14)] + +Args: + datasets: A nested structure of datasets. + +Returns: + Dataset: A `Dataset`." +1558,concatenate,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1002,method,"Creates a `Dataset` by concatenating the given dataset with this dataset. + +>>> a = tf.data.Dataset.range(1, 4) # ==> [ 1, 2, 3 ] +>>> b = tf.data.Dataset.range(4, 8) # ==> [ 4, 5, 6, 7 ] +>>> ds = a.concatenate(b) +>>> list(ds.as_numpy_iterator()) +[1, 2, 3, 4, 5, 6, 7] +>>> # The input dataset and dataset to be concatenated should have the same +>>> # nested structures and output types. +>>> c = tf.data.Dataset.zip((a, b)) +>>> a.concatenate(c) +Traceback (most recent call last): +TypeError: Two datasets to concatenate have different types + and (tf.int64, tf.int64) +>>> d = tf.data.Dataset.from_tensor_slices([""a"", ""b"", ""c""]) +>>> a.concatenate(d) +Traceback (most recent call last): +TypeError: Two datasets to concatenate have different types + and + +Args: + dataset: `Dataset` to be concatenated. + +Returns: + Dataset: A `Dataset`." +1559,prefetch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1031,method,"Creates a `Dataset` that prefetches elements from this dataset. + +Most dataset input pipelines should end with a call to `prefetch`. This +allows later elements to be prepared while the current element is being +processed. This often improves latency and throughput, at the cost of +using additional memory to store prefetched elements. + +Note: Like other `Dataset` methods, prefetch operates on the +elements of the input dataset. It has no concept of examples vs. batches. +`examples.prefetch(2)` will prefetch two elements (2 examples), +while `examples.batch(20).prefetch(2)` will prefetch 2 elements +(2 batches, of 20 examples each). + +>>> dataset = tf.data.Dataset.range(3) +>>> dataset = dataset.prefetch(2) +>>> list(dataset.as_numpy_iterator()) +[0, 1, 2] + +Args: + buffer_size: A `tf.int64` scalar `tf.Tensor`, representing the maximum + number of elements that will be buffered when prefetching. + +Returns: + Dataset: A `Dataset`." +1560,list_files,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1060,method,"A dataset of all files matching one or more glob patterns. + +The `file_pattern` argument should be a small number of glob patterns. +If your filenames have already been globbed, use +`Dataset.from_tensor_slices(filenames)` instead, as re-globbing every +filename with `list_files` may result in poor performance with remote +storage systems. + +Note: The default behavior of this method is to return filenames in +a non-deterministic random shuffled order. Pass a `seed` or `shuffle=False` +to get results in a deterministic order. + +Example: + If we had the following files on our filesystem: + + - /path/to/dir/a.txt + - /path/to/dir/b.py + - /path/to/dir/c.py + + If we pass ""/path/to/dir/*.py"" as the directory, the dataset + would produce: + + - /path/to/dir/b.py + - /path/to/dir/c.py + +Args: + file_pattern: A string, a list of strings, or a `tf.Tensor` of string type + (scalar or vector), representing the filename glob (i.e. shell wildcard) + pattern(s) that will be matched. + shuffle: (Optional.) If `True`, the file names will be shuffled randomly. + Defaults to `True`. + seed: (Optional.) A `tf.int64` scalar `tf.Tensor`, representing the random + seed that will be used to create the distribution. See + `tf.random.set_seed` for behavior. + +Returns: + Dataset: A `Dataset` of strings corresponding to file names." +1561,repeat,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1128,method,"Repeats this dataset so each original value is seen `count` times. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> dataset = dataset.repeat(3) +>>> list(dataset.as_numpy_iterator()) +[1, 2, 3, 1, 2, 3, 1, 2, 3] + +Note: If this dataset is a function of global state (e.g. a random number +generator), then different repetitions may produce different elements. + +Args: + count: (Optional.) A `tf.int64` scalar `tf.Tensor`, representing the + number of times the dataset should be repeated. The default behavior (if + `count` is `None` or `-1`) is for the dataset be repeated indefinitely. + +Returns: + Dataset: A `Dataset`." +1562,enumerate,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1149,method,"Enumerates the elements of this dataset. + +It is similar to python's `enumerate`. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> dataset = dataset.enumerate(start=5) +>>> for element in dataset.as_numpy_iterator(): +... print(element) +(5, 1) +(6, 2) +(7, 3) + +>>> # The nested structure of the input dataset determines the structure of +>>> # elements in the resulting dataset. +>>> dataset = tf.data.Dataset.from_tensor_slices([(7, 8), (9, 10)]) +>>> dataset = dataset.enumerate() +>>> for element in dataset.as_numpy_iterator(): +... print(element) +(0, array([7, 8], dtype=int32)) +(1, array([ 9, 10], dtype=int32)) + +Args: + start: A `tf.int64` scalar `tf.Tensor`, representing the start value for + enumeration. + +Returns: + Dataset: A `Dataset`." +1563,shuffle,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1182,method,"Randomly shuffles the elements of this dataset. + +This dataset fills a buffer with `buffer_size` elements, then randomly +samples elements from this buffer, replacing the selected elements with new +elements. For perfect shuffling, a buffer size greater than or equal to the +full size of the dataset is required. + +For instance, if your dataset contains 10,000 elements but `buffer_size` is +set to 1,000, then `shuffle` will initially select a random element from +only the first 1,000 elements in the buffer. Once an element is selected, +its space in the buffer is replaced by the next (i.e. 1,001-st) element, +maintaining the 1,000 element buffer. + +`reshuffle_each_iteration` controls whether the shuffle order should be +different for each epoch. In TF 1.X, the idiomatic way to create epochs +was through the `repeat` transformation: + +>>> dataset = tf.data.Dataset.range(3) +>>> dataset = dataset.shuffle(3, reshuffle_each_iteration=True) +>>> dataset = dataset.repeat(2) # doctest: +SKIP +[1, 0, 2, 1, 2, 0] + +>>> dataset = tf.data.Dataset.range(3) +>>> dataset = dataset.shuffle(3, reshuffle_each_iteration=False) +>>> dataset = dataset.repeat(2) # doctest: +SKIP +[1, 0, 2, 1, 0, 2] + +In TF 2.0, `tf.data.Dataset` objects are Python iterables which makes it +possible to also create epochs through Python iteration: + +>>> dataset = tf.data.Dataset.range(3) +>>> dataset = dataset.shuffle(3, reshuffle_each_iteration=True) +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[1, 0, 2] +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[1, 2, 0] + +>>> dataset = tf.data.Dataset.range(3) +>>> dataset = dataset.shuffle(3, reshuffle_each_iteration=False) +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[1, 0, 2] +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[1, 0, 2] + +Args: + buffer_size: A `tf.int64` scalar `tf.Tensor`, representing the number of + elements from this dataset from which the new dataset will sample. + seed: (Optional.) A `tf.int64` scalar `tf.Tensor`, representing the random + seed that will be used to create the distribution. See + `tf.random.set_seed` for behavior. + reshuffle_each_iteration: (Optional.) A boolean, which if true indicates + that the dataset should be pseudorandomly reshuffled each time it is + iterated over. (Defaults to `True`.) + +Returns: + Dataset: A `Dataset`." +1564,cache,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1242,method,"Caches the elements in this dataset. + +The first time the dataset is iterated over, its elements will be cached +either in the specified file or in memory. Subsequent iterations will +use the cached data. + +Note: For the cache to be finalized, the input dataset must be iterated +through in its entirety. Otherwise, subsequent iterations will not use +cached data. + +>>> dataset = tf.data.Dataset.range(5) +>>> dataset = dataset.map(lambda x: x**2) +>>> dataset = dataset.cache() +>>> # The first time reading through the data will generate the data using +>>> # `range` and `map`. +>>> list(dataset.as_numpy_iterator()) +[0, 1, 4, 9, 16] +>>> # Subsequent iterations read from the cache. +>>> list(dataset.as_numpy_iterator()) +[0, 1, 4, 9, 16] + +When caching to a file, the cached data will persist across runs. Even the +first iteration through the data will read from the cache file. Changing +the input pipeline before the call to `.cache()` will have no effect until +the cache file is removed or the filename is changed. + +>>> dataset = tf.data.Dataset.range(5) +>>> dataset = dataset.cache(""/path/to/file"") # doctest: +SKIP +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[0, 1, 2, 3, 4] +>>> dataset = tf.data.Dataset.range(10) +>>> dataset = dataset.cache(""/path/to/file"") # Same file! # doctest: +SKIP +>>> list(dataset.as_numpy_iterator()) # doctest: +SKIP +[0, 1, 2, 3, 4] + +Note: `cache` will produce exactly the same elements during each iteration +through the dataset. If you wish to randomize the iteration order, make sure +to call `shuffle` *after* calling `cache`. + +Args: + filename: A `tf.string` scalar `tf.Tensor`, representing the name of a + directory on the filesystem to use for caching elements in this Dataset. + If a filename is not provided, the dataset will be cached in memory. + +Returns: + Dataset: A `Dataset`." +1565,take,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1292,method,"Creates a `Dataset` with at most `count` elements from this dataset. + +>>> dataset = tf.data.Dataset.range(10) +>>> dataset = dataset.take(3) +>>> list(dataset.as_numpy_iterator()) +[0, 1, 2] + +Args: + count: A `tf.int64` scalar `tf.Tensor`, representing the number of + elements of this dataset that should be taken to form the new dataset. + If `count` is -1, or if `count` is greater than the size of this + dataset, the new dataset will contain all elements of this dataset. + +Returns: + Dataset: A `Dataset`." +1566,skip,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1311,method,"Creates a `Dataset` that skips `count` elements from this dataset. + +>>> dataset = tf.data.Dataset.range(10) +>>> dataset = dataset.skip(7) +>>> list(dataset.as_numpy_iterator()) +[7, 8, 9] + +Args: + count: A `tf.int64` scalar `tf.Tensor`, representing the number of + elements of this dataset that should be skipped to form the new dataset. + If `count` is greater than the size of this dataset, the new dataset + will contain no elements. If `count` is -1, skips the entire dataset. + +Returns: + Dataset: A `Dataset`." +1567,shard,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1330,method,"Creates a `Dataset` that includes only 1/`num_shards` of this dataset. + +`shard` is deterministic. The Dataset produced by `A.shard(n, i)` will +contain all elements of A whose index mod n = i. + +>>> A = tf.data.Dataset.range(10) +>>> B = A.shard(num_shards=3, index=0) +>>> list(B.as_numpy_iterator()) +[0, 3, 6, 9] +>>> C = A.shard(num_shards=3, index=1) +>>> list(C.as_numpy_iterator()) +[1, 4, 7] +>>> D = A.shard(num_shards=3, index=2) +>>> list(D.as_numpy_iterator()) +[2, 5, 8] + +This dataset operator is very useful when running distributed training, as +it allows each worker to read a unique subset. + +When reading a single input file, you can shard elements as follows: + +```python +d = tf.data.TFRecordDataset(input_file) +d = d.shard(num_workers, worker_index) +d = d.repeat(num_epochs) +d = d.shuffle(shuffle_buffer_size) +d = d.map(parser_fn, num_parallel_calls=num_map_threads) +``` + +Important caveats: + +- Be sure to shard before you use any randomizing operator (such as + shuffle). +- Generally it is best if the shard operator is used early in the dataset + pipeline. For example, when reading from a set of TFRecord files, shard + before converting the dataset to input samples. This avoids reading every + file on every worker. The following is an example of an efficient + sharding strategy within a complete pipeline: + +```python +d = Dataset.list_files(pattern) +d = d.shard(num_workers, worker_index) +d = d.repeat(num_epochs) +d = d.shuffle(shuffle_buffer_size) +d = d.interleave(tf.data.TFRecordDataset, + cycle_length=num_readers, block_length=1) +d = d.map(parser_fn, num_parallel_calls=num_map_threads) +``` + +Args: + num_shards: A `tf.int64` scalar `tf.Tensor`, representing the number of + shards operating in parallel. + index: A `tf.int64` scalar `tf.Tensor`, representing the worker index. + +Returns: + Dataset: A `Dataset`. + +Raises: + InvalidArgumentError: if `num_shards` or `index` are illegal values. + + Note: error checking is done on a best-effort basis, and errors aren't + guaranteed to be caught upon dataset creation. (e.g. providing in a + placeholder tensor bypasses the early checking, and will instead result + in an error during a session.run call.)" +1568,batch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1398,method,"Combines consecutive elements of this dataset into batches. + +>>> dataset = tf.data.Dataset.range(8) +>>> dataset = dataset.batch(3) +>>> list(dataset.as_numpy_iterator()) +[array([0, 1, 2]), array([3, 4, 5]), array([6, 7])] + +>>> dataset = tf.data.Dataset.range(8) +>>> dataset = dataset.batch(3, drop_remainder=True) +>>> list(dataset.as_numpy_iterator()) +[array([0, 1, 2]), array([3, 4, 5])] + +The components of the resulting element will have an additional outer +dimension, which will be `batch_size` (or `N % batch_size` for the last +element if `batch_size` does not divide the number of input elements `N` +evenly and `drop_remainder` is `False`). If your program depends on the +batches having the same outer dimension, you should set the `drop_remainder` +argument to `True` to prevent the smaller batch from being produced. + +Args: + batch_size: A `tf.int64` scalar `tf.Tensor`, representing the number of + consecutive elements of this dataset to combine in a single batch. + drop_remainder: (Optional.) A `tf.bool` scalar `tf.Tensor`, representing + whether the last batch should be dropped in the case it has fewer than + `batch_size` elements; the default behavior is not to drop the smaller + batch. + +Returns: + Dataset: A `Dataset`." +1569,padded_batch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1431,method,"Combines consecutive elements of this dataset into padded batches. + +This transformation combines multiple consecutive elements of the input +dataset into a single element. + +Like `tf.data.Dataset.batch`, the components of the resulting element will +have an additional outer dimension, which will be `batch_size` (or +`N % batch_size` for the last element if `batch_size` does not divide the +number of input elements `N` evenly and `drop_remainder` is `False`). If +your program depends on the batches having the same outer dimension, you +should set the `drop_remainder` argument to `True` to prevent the smaller +batch from being produced. + +Unlike `tf.data.Dataset.batch`, the input elements to be batched may have +different shapes, and this transformation will pad each component to the +respective shape in `padded_shapes`. The `padded_shapes` argument +determines the resulting shape for each dimension of each component in an +output element: + +* If the dimension is a constant, the component will be padded out to that + length in that dimension. +* If the dimension is unknown, the component will be padded out to the + maximum length of all elements in that dimension. + +>>> A = (tf.data.Dataset +... .range(1, 5, output_type=tf.int32) +... .map(lambda x: tf.fill([x], x))) +>>> # Pad to the smallest per-batch size that fits all elements. +>>> B = A.padded_batch(2) +>>> for element in B.as_numpy_iterator(): +... print(element) +[[1 0] + [2 2]] +[[3 3 3 0] + [4 4 4 4]] +>>> # Pad to a fixed size. +>>> C = A.padded_batch(2, padded_shapes=5) +>>> for element in C.as_numpy_iterator(): +... print(element) +[[1 0 0 0 0] + [2 2 0 0 0]] +[[3 3 3 0 0] + [4 4 4 4 0]] +>>> # Pad with a custom value. +>>> D = A.padded_batch(2, padded_shapes=5, padding_values=-1) +>>> for element in D.as_numpy_iterator(): +... print(element) +[[ 1 -1 -1 -1 -1] + [ 2 2 -1 -1 -1]] +[[ 3 3 3 -1 -1] + [ 4 4 4 4 -1]] +>>> # Components of nested elements can be padded independently. +>>> elements = [([1, 2, 3], [10]), +... ([4, 5], [11, 12])] +>>> dataset = tf.data.Dataset.from_generator( +... lambda: iter(elements), (tf.int32, tf.int32)) +>>> # Pad the first component of the tuple to length 4, and the second +>>> # component to the smallest size that fits. +>>> dataset = dataset.padded_batch(2, +... padded_shapes=([4], [None]), +... padding_values=(-1, 100)) +>>> list(dataset.as_numpy_iterator()) +[(array([[ 1, 2, 3, -1], [ 4, 5, -1, -1]], dtype=int32), + array([[ 10, 100], [ 11, 12]], dtype=int32))] +>>> # Pad with a single value and multiple components. +>>> E = tf.data.Dataset.zip((A, A)).padded_batch(2, padding_values=-1) +>>> for element in E.as_numpy_iterator(): +... print(element) +(array([[ 1, -1], + [ 2, 2]], dtype=int32), array([[ 1, -1], + [ 2, 2]], dtype=int32)) +(array([[ 3, 3, 3, -1], + [ 4, 4, 4, 4]], dtype=int32), array([[ 3, 3, 3, -1], + [ 4, 4, 4, 4]], dtype=int32)) + +See also `tf.data.experimental.dense_to_sparse_batch`, which combines +elements that may have different shapes into a `tf.sparse.SparseTensor`. + +Args: + batch_size: A `tf.int64` scalar `tf.Tensor`, representing the number of + consecutive elements of this dataset to combine in a single batch. + padded_shapes: (Optional.) A nested structure of `tf.TensorShape` or + `tf.int64` vector tensor-like objects representing the shape to which + the respective component of each input element should be padded prior + to batching. Any unknown dimensions will be padded to the maximum size + of that dimension in each batch. If unset, all dimensions of all + components are padded to the maximum size in the batch. `padded_shapes` + must be set if any component has an unknown rank. + padding_values: (Optional.) A nested structure of scalar-shaped + `tf.Tensor`, representing the padding values to use for the respective + components. None represents that the nested structure should be padded + with default values. Defaults are `0` for numeric types and the empty + string for string types. The `padding_values` should have the + same structure as the input dataset. If `padding_values` is a single + element and the input dataset has multiple components, then the same + `padding_values` will be used to pad every component of the dataset. + If `padding_values` is a scalar, then its value will be broadcasted + to match the shape of each component. + drop_remainder: (Optional.) A `tf.bool` scalar `tf.Tensor`, representing + whether the last batch should be dropped in the case it has fewer than + `batch_size` elements; the default behavior is not to drop the smaller + batch. + +Returns: + Dataset: A `Dataset`. + +Raises: + ValueError: If a component has an unknown rank, and the `padded_shapes` + argument is not set." +1570,map,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1557,method,"Maps `map_func` across the elements of this dataset. + +This transformation applies `map_func` to each element of this dataset, and +returns a new dataset containing the transformed elements, in the same +order as they appeared in the input. `map_func` can be used to change both +the values and the structure of a dataset's elements. For example, adding 1 +to each element, or projecting a subset of element components. + +>>> dataset = Dataset.range(1, 6) # ==> [ 1, 2, 3, 4, 5 ] +>>> dataset = dataset.map(lambda x: x + 1) +>>> list(dataset.as_numpy_iterator()) +[2, 3, 4, 5, 6] + +The input signature of `map_func` is determined by the structure of each +element in this dataset. + +>>> dataset = Dataset.range(5) +>>> # `map_func` takes a single argument of type `tf.Tensor` with the same +>>> # shape and dtype. +>>> result = dataset.map(lambda x: x + 1) + +>>> # Each element is a tuple containing two `tf.Tensor` objects. +>>> elements = [(1, ""foo""), (2, ""bar""), (3, ""baz"")] +>>> dataset = tf.data.Dataset.from_generator( +... lambda: elements, (tf.int32, tf.string)) +>>> # `map_func` takes two arguments of type `tf.Tensor`. This function +>>> # projects out just the first component. +>>> result = dataset.map(lambda x_int, y_str: x_int) +>>> list(result.as_numpy_iterator()) +[1, 2, 3] + +>>> # Each element is a dictionary mapping strings to `tf.Tensor` objects. +>>> elements = ([{""a"": 1, ""b"": ""foo""}, +... {""a"": 2, ""b"": ""bar""}, +... {""a"": 3, ""b"": ""baz""}]) +>>> dataset = tf.data.Dataset.from_generator( +... lambda: elements, {""a"": tf.int32, ""b"": tf.string}) +>>> # `map_func` takes a single argument of type `dict` with the same keys +>>> # as the elements. +>>> result = dataset.map(lambda d: str(d[""a""]) + d[""b""]) + +The value or values returned by `map_func` determine the structure of each +element in the returned dataset. + +>>> dataset = tf.data.Dataset.range(3) +>>> # `map_func` returns two `tf.Tensor` objects. +>>> def g(x): +... return tf.constant(37.0), tf.constant([""Foo"", ""Bar"", ""Baz""]) +>>> result = dataset.map(g) +>>> result.element_spec +(TensorSpec(shape=(), dtype=tf.float32, name=None), TensorSpec(shape=(3,), dtype=tf.string, name=None)) +>>> # Python primitives, lists, and NumPy arrays are implicitly converted to +>>> # `tf.Tensor`. +>>> def h(x): +... return 37.0, [""Foo"", ""Bar""], np.array([1.0, 2.0], dtype=np.float64) +>>> result = dataset.map(h) +>>> result.element_spec +(TensorSpec(shape=(), dtype=tf.float32, name=None), TensorSpec(shape=(2,), dtype=tf.string, name=None), TensorSpec(shape=(2,), dtype=tf.float64, name=None)) +>>> # `map_func` can return nested structures. +>>> def i(x): +... return (37.0, [42, 16]), ""foo"" +>>> result = dataset.map(i) +>>> result.element_spec +((TensorSpec(shape=(), dtype=tf.float32, name=None), + TensorSpec(shape=(2,), dtype=tf.int32, name=None)), + TensorSpec(shape=(), dtype=tf.string, name=None)) + +`map_func` can accept as arguments and return any type of dataset element. + +Note that irrespective of the context in which `map_func` is defined (eager +vs. graph), tf.data traces the function and executes it as a graph. To use +Python code inside of the function you have a few options: + +1) Rely on AutoGraph to convert Python code into an equivalent graph +computation. The downside of this approach is that AutoGraph can convert +some but not all Python code. + +2) Use `tf.py_function`, which allows you to write arbitrary Python code but +will generally result in worse performance than 1). For example: + +>>> d = tf.data.Dataset.from_tensor_slices(['hello', 'world']) +>>> # transform a string tensor to upper case string using a Python function +>>> def upper_case_fn(t: tf.Tensor): +... return t.numpy().decode('utf-8').upper() +>>> d = d.map(lambda x: tf.py_function(func=upper_case_fn, +... inp=[x], Tout=tf.string)) +>>> list(d.as_numpy_iterator()) +[b'HELLO', b'WORLD'] + +3) Use `tf.numpy_function`, which also allows you to write arbitrary +Python code. Note that `tf.py_function` accepts `tf.Tensor` whereas +`tf.numpy_function` accepts numpy arrays and returns only numpy arrays. +For example: + +>>> d = tf.data.Dataset.from_tensor_slices(['hello', 'world']) +>>> def upper_case_fn(t: np.ndarray): +... return t.decode('utf-8').upper() +>>> d = d.map(lambda x: tf.numpy_function(func=upper_case_fn, +... inp=[x], Tout=tf.string)) +>>> list(d.as_numpy_iterator()) +[b'HELLO', b'WORLD'] + +Note that the use of `tf.numpy_function` and `tf.py_function` +in general precludes the possibility of executing user-defined +transformations in parallel (because of Python GIL). + +Performance can often be improved by setting `num_parallel_calls` so that +`map` will use multiple threads to process elements. If deterministic order +isn't required, it can also improve performance to set +`deterministic=False`. + +>>> dataset = Dataset.range(1, 6) # ==> [ 1, 2, 3, 4, 5 ] +>>> dataset = dataset.map(lambda x: x + 1, +... num_parallel_calls=tf.data.experimental.AUTOTUNE, +... deterministic=False) + +Args: + map_func: A function mapping a dataset element to another dataset element. + num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`, + representing the number elements to process asynchronously in parallel. + If not specified, elements will be processed sequentially. If the value + `tf.data.experimental.AUTOTUNE` is used, then the number of parallel + calls is set dynamically based on available CPU. + deterministic: (Optional.) A boolean controlling whether determinism + should be traded for performance by allowing elements to be produced out + of order. If `deterministic` is `None`, the + `tf.data.Options.experimental_deterministic` dataset option (`True` by + default) is used to decide whether to produce elements + deterministically. + +Returns: + Dataset: A `Dataset`." +1571,flat_map,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1704,method,"Maps `map_func` across this dataset and flattens the result. + +Use `flat_map` if you want to make sure that the order of your dataset +stays the same. For example, to flatten a dataset of batches into a +dataset of their elements: + +>>> dataset = tf.data.Dataset.from_tensor_slices( +... [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) +>>> dataset = dataset.flat_map(lambda x: Dataset.from_tensor_slices(x)) +>>> list(dataset.as_numpy_iterator()) +[1, 2, 3, 4, 5, 6, 7, 8, 9] + +`tf.data.Dataset.interleave()` is a generalization of `flat_map`, since +`flat_map` produces the same output as +`tf.data.Dataset.interleave(cycle_length=1)` + +Args: + map_func: A function mapping a dataset element to a dataset. + +Returns: + Dataset: A `Dataset`." +1572,interleave,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1729,method,"Maps `map_func` across this dataset, and interleaves the results. + +For example, you can use `Dataset.interleave()` to process many input files +concurrently: + +>>> # Preprocess 4 files concurrently, and interleave blocks of 16 records +>>> # from each file. +>>> filenames = [""/var/data/file1.txt"", ""/var/data/file2.txt"", +... ""/var/data/file3.txt"", ""/var/data/file4.txt""] +>>> dataset = tf.data.Dataset.from_tensor_slices(filenames) +>>> def parse_fn(filename): +... return tf.data.Dataset.range(10) +>>> dataset = dataset.interleave(lambda x: +... tf.data.TextLineDataset(x).map(parse_fn, num_parallel_calls=1), +... cycle_length=4, block_length=16) + +The `cycle_length` and `block_length` arguments control the order in which +elements are produced. `cycle_length` controls the number of input elements +that are processed concurrently. If you set `cycle_length` to 1, this +transformation will handle one input element at a time, and will produce +identical results to `tf.data.Dataset.flat_map`. In general, +this transformation will apply `map_func` to `cycle_length` input elements, +open iterators on the returned `Dataset` objects, and cycle through them +producing `block_length` consecutive elements from each iterator, and +consuming the next input element each time it reaches the end of an +iterator. + +For example: + +>>> dataset = Dataset.range(1, 6) # ==> [ 1, 2, 3, 4, 5 ] +>>> # NOTE: New lines indicate ""block"" boundaries. +>>> dataset = dataset.interleave( +... lambda x: Dataset.from_tensors(x).repeat(6), +... cycle_length=2, block_length=4) +>>> list(dataset.as_numpy_iterator()) +[1, 1, 1, 1, + 2, 2, 2, 2, + 1, 1, + 2, 2, + 3, 3, 3, 3, + 4, 4, 4, 4, + 3, 3, + 4, 4, + 5, 5, 5, 5, + 5, 5] + +Note: The order of elements yielded by this transformation is +deterministic, as long as `map_func` is a pure function and +`deterministic=True`. If `map_func` contains any stateful operations, the +order in which that state is accessed is undefined. + +Performance can often be improved by setting `num_parallel_calls` so that +`interleave` will use multiple threads to fetch elements. If determinism +isn't required, it can also improve performance to set +`deterministic=False`. + +>>> filenames = [""/var/data/file1.txt"", ""/var/data/file2.txt"", +... ""/var/data/file3.txt"", ""/var/data/file4.txt""] +>>> dataset = tf.data.Dataset.from_tensor_slices(filenames) +>>> dataset = dataset.interleave(lambda x: tf.data.TFRecordDataset(x), +... cycle_length=4, num_parallel_calls=tf.data.experimental.AUTOTUNE, +... deterministic=False) + +Args: + map_func: A function mapping a dataset element to a dataset. + cycle_length: (Optional.) The number of input elements that will be + processed concurrently. If not set, the tf.data runtime decides what it + should be based on available CPU. If `num_parallel_calls` is set to + `tf.data.experimental.AUTOTUNE`, the `cycle_length` argument identifies + the maximum degree of parallelism. + block_length: (Optional.) The number of consecutive elements to produce + from each input element before cycling to another input element. If not + set, defaults to 1. + num_parallel_calls: (Optional.) If specified, the implementation creates a + threadpool, which is used to fetch inputs from cycle elements + asynchronously and in parallel. The default behavior is to fetch inputs + from cycle elements synchronously with no parallelism. If the value + `tf.data.experimental.AUTOTUNE` is used, then the number of parallel + calls is set dynamically based on available CPU. + deterministic: (Optional.) A boolean controlling whether determinism + should be traded for performance by allowing elements to be produced out + of order. If `deterministic` is `None`, the + `tf.data.Options.experimental_deterministic` dataset option (`True` by + default) is used to decide whether to produce elements + deterministically. + +Returns: + Dataset: A `Dataset`." +1573,filter,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1841,method,"Filters this dataset according to `predicate`. + +>>> dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3]) +>>> dataset = dataset.filter(lambda x: x < 3) +>>> list(dataset.as_numpy_iterator()) +[1, 2] +>>> # `tf.math.equal(x, y)` is required for equality comparison +>>> def filter_fn(x): +... return tf.math.equal(x, 1) +>>> dataset = dataset.filter(filter_fn) +>>> list(dataset.as_numpy_iterator()) +[1] + +Args: + predicate: A function mapping a dataset element to a boolean. + +Returns: + Dataset: The `Dataset` containing the elements of this dataset for which + `predicate` is `True`." +1574,apply,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1864,method,"Applies a transformation function to this dataset. + +`apply` enables chaining of custom `Dataset` transformations, which are +represented as functions that take one `Dataset` argument and return a +transformed `Dataset`. + +>>> dataset = tf.data.Dataset.range(100) +>>> def dataset_fn(ds): +... return ds.filter(lambda x: x < 5) +>>> dataset = dataset.apply(dataset_fn) +>>> list(dataset.as_numpy_iterator()) +[0, 1, 2, 3, 4] + +Args: + transformation_func: A function that takes one `Dataset` argument and + returns a `Dataset`. + +Returns: + Dataset: The `Dataset` returned by applying `transformation_func` to this + dataset." +1575,window,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1894,method,"Combines (nests of) input elements into a dataset of (nests of) windows. + +A ""window"" is a finite dataset of flat elements of size `size` (or possibly +fewer if there are not enough input elements to fill the window and +`drop_remainder` evaluates to `False`). + +The `shift` argument determines the number of input elements by which the +window moves on each iteration. If windows and elements are both numbered +starting at 0, the first element in window `k` will be element `k * shift` +of the input dataset. In particular, the first element of the first window +will always be the first element of the input dataset. + +The `stride` argument determines the stride of the input elements, and the +`shift` argument determines the shift of the window. + +For example: + +>>> dataset = tf.data.Dataset.range(7).window(2) +>>> for window in dataset: +... print(list(window.as_numpy_iterator())) +[0, 1] +[2, 3] +[4, 5] +[6] +>>> dataset = tf.data.Dataset.range(7).window(3, 2, 1, True) +>>> for window in dataset: +... print(list(window.as_numpy_iterator())) +[0, 1, 2] +[2, 3, 4] +[4, 5, 6] +>>> dataset = tf.data.Dataset.range(7).window(3, 1, 2, True) +>>> for window in dataset: +... print(list(window.as_numpy_iterator())) +[0, 2, 4] +[1, 3, 5] +[2, 4, 6] + +Note that when the `window` transformation is applied to a dataset of +nested elements, it produces a dataset of nested windows. + +>>> nested = ([1, 2, 3, 4], [5, 6, 7, 8]) +>>> dataset = tf.data.Dataset.from_tensor_slices(nested).window(2) +>>> for window in dataset: +... def to_numpy(ds): +... return list(ds.as_numpy_iterator()) +... print(tuple(to_numpy(component) for component in window)) +([1, 2], [5, 6]) +([3, 4], [7, 8]) + +>>> dataset = tf.data.Dataset.from_tensor_slices({'a': [1, 2, 3, 4]}) +>>> dataset = dataset.window(2) +>>> for window in dataset: +... def to_numpy(ds): +... return list(ds.as_numpy_iterator()) +... print({'a': to_numpy(window['a'])}) +{'a': [1, 2]} +{'a': [3, 4]} + +Args: + size: A `tf.int64` scalar `tf.Tensor`, representing the number of elements + of the input dataset to combine into a window. Must be positive. + shift: (Optional.) A `tf.int64` scalar `tf.Tensor`, representing the + number of input elements by which the window moves in each iteration. + Defaults to `size`. Must be positive. + stride: (Optional.) A `tf.int64` scalar `tf.Tensor`, representing the + stride of the input elements in the sliding window. Must be positive. + The default value of 1 means ""retain every input element"". + drop_remainder: (Optional.) A `tf.bool` scalar `tf.Tensor`, representing + whether the last window should be dropped if its size is smaller than + `size`. + +Returns: + Dataset: A `Dataset` of (nests of) windows -- a finite datasets of flat + elements created from the (nests of) input elements." +1576,reduce,tensorflow/tensorflow/python/data/ops/dataset_ops.py,1975,method,"Reduces the input dataset to a single element. + +The transformation calls `reduce_func` successively on every element of +the input dataset until the dataset is exhausted, aggregating information in +its internal state. The `initial_state` argument is used for the initial +state and the final state is returned as the result. + +>>> tf.data.Dataset.range(5).reduce(np.int64(0), lambda x, _: x + 1).numpy() +5 +>>> tf.data.Dataset.range(5).reduce(np.int64(0), lambda x, y: x + y).numpy() +10 + +Args: + initial_state: An element representing the initial state of the + transformation. + reduce_func: A function that maps `(old_state, input_element)` to + `new_state`. It must take two arguments and return a new element + The structure of `new_state` must match the structure of + `initial_state`. + +Returns: + A dataset element corresponding to the final state of the transformation." +1577,unbatch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2088,method,"Splits elements of a dataset into multiple elements. + +For example, if elements of the dataset are shaped `[B, a0, a1, ...]`, +where `B` may vary for each input element, then for each element in the +dataset, the unbatched dataset will contain `B` consecutive elements +of shape `[a0, a1, ...]`. + +>>> elements = [ [1, 2, 3], [1, 2], [1, 2, 3, 4] ] +>>> dataset = tf.data.Dataset.from_generator(lambda: elements, tf.int64) +>>> dataset = dataset.unbatch() +>>> list(dataset.as_numpy_iterator()) +[1, 2, 3, 1, 2, 1, 2, 3, 4] + +Note: `unbatch` requires a data copy to slice up the batched tensor into +smaller, unbatched tensors. When optimizing performance, try to avoid +unnecessary usage of `unbatch`. + +Returns: + A `Dataset`." +1578,with_options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2112,method,"Returns a new `tf.data.Dataset` with the given options set. + +The options are ""global"" in the sense they apply to the entire dataset. +If options are set multiple times, they are merged as long as different +options do not use different non-default values. + +>>> ds = tf.data.Dataset.range(5) +>>> ds = ds.interleave(lambda x: tf.data.Dataset.range(5), +... cycle_length=3, +... num_parallel_calls=3) +>>> options = tf.data.Options() +>>> # This will make the interleave order non-deterministic. +>>> options.experimental_deterministic = False +>>> ds = ds.with_options(options) + +Args: + options: A `tf.data.Options` that identifies the options the use. + +Returns: + Dataset: A `Dataset` with the given options. + +Raises: + ValueError: when an option is set more than once to a non-default value" +1579,cardinality,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2139,method,"Returns the cardinality of the dataset, if known. + +`cardinality` may return `tf.data.INFINITE_CARDINALITY` if the dataset +contains an infinite number of elements or `tf.data.UNKNOWN_CARDINALITY` if +the analysis fails to determine the number of elements in the dataset +(e.g. when the dataset source is a file). + +>>> dataset = tf.data.Dataset.range(42) +>>> print(dataset.cardinality().numpy()) +42 +>>> dataset = dataset.repeat() +>>> cardinality = dataset.cardinality() +>>> print((cardinality == tf.data.INFINITE_CARDINALITY).numpy()) +True +>>> dataset = dataset.filter(lambda x: True) +>>> cardinality = dataset.cardinality() +>>> print((cardinality == tf.data.UNKNOWN_CARDINALITY).numpy()) +True + +Returns: + A scalar `tf.int64` `Tensor` representing the cardinality of the dataset. + If the cardinality is infinite or unknown, `cardinality` returns the + named constants `tf.data.INFINITE_CARDINALITY` and + `tf.data.UNKNOWN_CARDINALITY` respectively." +1580,is_tensor_or_parent_ref,tensorflow/tensorflow/python/data/ops/dataset_ops.py,323,method, +1581,get_next_id,tensorflow/tensorflow/python/data/ops/dataset_ops.py,699,method, +1582,get_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,709,method, +1583,iterator_completed,tensorflow/tensorflow/python/data/ops/dataset_ops.py,717,method, +1584,get_iterator_id_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,793,method,"Creates a unique `iterator_id` for each pass over the dataset. + +The returned `iterator_id` disambiguates between multiple concurrently +existing iterators. + +Args: + unused_dummy: Ignored value. + +Returns: + A `tf.int64` tensor whose value uniquely identifies an iterator in + `generator_state`." +1585,generator_next_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,809,method,"Generates the next element from iterator with ID `iterator_id_t`. + +We map this function across an infinite repetition of the +`iterator_id_t`, and raise `StopIteration` to terminate the iteration. + +Args: + iterator_id_t: A `tf.int64` tensor whose value uniquely identifies the + iterator in `generator_state` from which to generate an element. + +Returns: + The next element to generate from the iterator." +1586,finalize_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,878,method,Releases host-side state for the iterator with ID `iterator_id_t`. +1587,flat_map_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,895,method, +1588,generator_py_func,tensorflow/tensorflow/python/data/ops/dataset_ops.py,823,method,A `py_func` that will be called to invoke the iterator. +1589,finalize_py_func,tensorflow/tensorflow/python/data/ops/dataset_ops.py,881,method, +1590,DatasetV1,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2169,class,"Represents a potentially large set of elements. A `Dataset` can be used to represent an input pipeline as a collection of elements and a ""logical plan"" of transformations that act on those elements." -2077,DatasetV1Adapter,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2628,class,Wraps a V2 `Dataset` object in the `tf.compat.v1.data.Dataset` API. -2078,_ensure_same_dataset_graph,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2658,function,Walks the dataset graph to ensure all datasets come from the same graph. -2079,make_one_shot_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2684,function,"Creates an iterator for elements of `dataset`. +1591,make_one_shot_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2216,method,"Creates an iterator for elements of this dataset. + +Note: The returned iterator will be initialized automatically. +A ""one-shot"" iterator does not currently support re-initialization. For +that see `make_initializable_iterator`. + +Example: + +```python +# Building graph ... +dataset = ... +next_value = dataset.make_one_shot_iterator().get_next() + +# ... from within a session ... +try: + while True: + value = sess.run(next_value) + ... +except tf.errors.OutOfRangeError: + pass +``` + +Returns: + An `tf.data.Iterator` for elements of this dataset." +1592,make_initializable_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2309,method,"Creates an iterator for elements of this dataset. + +Note: The returned iterator will be in an uninitialized state, +and you must run the `iterator.initializer` operation before using it: + +```python +# Building graph ... +dataset = ... +iterator = dataset.make_initializable_iterator() +next_value = iterator.get_next() # This is a Tensor. + +# ... from within a session ... +sess.run(iterator.initializer) +try: + while True: + value = sess.run(next_value) + ... +except tf.errors.OutOfRangeError: + pass +``` + +Args: + shared_name: (Optional.) If non-empty, the returned iterator will be + shared under the given name across multiple sessions that share the same + devices (e.g. when using a remote server). + +Returns: + A `tf.data.Iterator` for elements of this dataset. + +Raises: + RuntimeError: If eager execution is enabled." +1593,output_classes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2367,method,"Returns the class of each component of an element of this dataset. + +Returns: + A nested structure of Python `type` objects corresponding to each + component of an element of this dataset." +1594,output_shapes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2381,method,"Returns the shape of each component of an element of this dataset. + +Returns: + A nested structure of `tf.TensorShape` objects corresponding to each + component of an element of this dataset." +1595,output_types,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2395,method,"Returns the type of each component of an element of this dataset. + +Returns: + A nested structure of `tf.DType` objects corresponding to each component + of an element of this dataset." +1596,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2407,method, +1597,from_tensors,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2415,method, +1598,from_tensor_slices,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2420,method, +1599,from_sparse_tensor_slices,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2425,method,"Splits each rank-N `tf.sparse.SparseTensor` in this dataset row-wise. + +Args: + sparse_tensor: A `tf.sparse.SparseTensor`. + +Returns: + Dataset: A `Dataset` of rank-(N-1) sparse tensors." +1600,from_generator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2438,method, +1601,range,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2444,method, +1602,zip,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2449,method, +1603,concatenate,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2453,method, +1604,prefetch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2457,method, +1605,list_files,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2462,method, +1606,repeat,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2466,method, +1607,shuffle,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2470,method, +1608,cache,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2475,method, +1609,take,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2479,method, +1610,skip,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2483,method, +1611,shard,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2487,method, +1612,batch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2491,method, +1613,padded_batch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2496,method, +1614,map,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2506,method, +1615,map_with_legacy_function,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2520,method,"Maps `map_func` across the elements of this dataset. + +Note: This is an escape hatch for existing uses of `map` that do not work +with V2 functions. New uses are strongly discouraged and existing uses +should migrate to `map` as this method will be removed in V2. + +Args: + map_func: A function mapping a nested structure of tensors (having shapes + and types defined by `self.output_shapes` and `self.output_types`) to + another nested structure of tensors. + num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`, + representing the number elements to process asynchronously in parallel. + If not specified, elements will be processed sequentially. If the value + `tf.data.experimental.AUTOTUNE` is used, then the number of parallel + calls is set dynamically based on available CPU. + deterministic: (Optional.) A boolean controlling whether determinism + should be traded for performance by allowing elements to be produced out + of order. If `deterministic` is `None`, the + `tf.data.Options.experimental_deterministic` dataset option (`True` by + default) is used to decide whether to produce elements + deterministically. + +Returns: + Dataset: A `Dataset`." +1616,flat_map,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2567,method, +1617,interleave,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2571,method, +1618,filter,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2582,method, +1619,filter_with_legacy_function,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2586,method,"Filters this dataset according to `predicate`. + +Note: This is an escape hatch for existing uses of `filter` that do not work +with V2 functions. New uses are strongly discouraged and existing uses +should migrate to `filter` as this method will be removed in V2. + +Args: + predicate: A function mapping a nested structure of tensors (having shapes + and types defined by `self.output_shapes` and `self.output_types`) to a + scalar `tf.bool` tensor. + +Returns: + Dataset: The `Dataset` containing the elements of this dataset for which + `predicate` is `True`." +1620,apply,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2605,method, +1621,window,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2609,method, +1622,unbatch,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2614,method, +1623,with_options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2618,method, +1624,DatasetV1Adapter,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2628,class,Wraps a V2 `Dataset` object in the `tf.compat.v1.data.Dataset` API. +1625,options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2647,method, +1626,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2651,method, +1627,make_one_shot_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2684,function,"Creates an iterator for elements of `dataset`. Note: The returned iterator will be initialized automatically. A ""one-shot"" iterator does not support re-initialization. @@ -9926,7 +10924,7 @@ Args: Returns: A `tf.data.Iterator` for elements of `dataset`." -2080,make_initializable_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2705,function,"Creates an iterator for elements of `dataset`. +1628,make_initializable_iterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2705,function,"Creates an iterator for elements of `dataset`. Note: The returned iterator will be in an uninitialized state, and you must run the `iterator.initializer` operation before using it: @@ -9949,7 +10947,7 @@ Returns: Raises: RuntimeError: If eager execution is enabled." -2081,get_structure,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2739,function,"Returns the type signature for elements of the input dataset / iterator. +1629,get_structure,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2739,function,"Returns the type signature for elements of the input dataset / iterator. Args: dataset_or_iterator: A `tf.data.Dataset` or an `tf.data.Iterator`. @@ -9962,7 +10960,7 @@ Returns: Raises: TypeError: If input is not a `tf.data.Dataset` or an `tf.data.Iterator` object." -2082,get_legacy_output_classes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2763,function,"Returns the output classes for elements of the input dataset / iterator. +1630,get_legacy_output_classes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2763,function,"Returns the output classes for elements of the input dataset / iterator. Args: dataset_or_iterator: A `tf.data.Dataset` or `tf.data.Iterator`. @@ -9971,7 +10969,7 @@ Returns: A nested structure of Python `type` objects matching the structure of the dataset / iterator elements and specifying the class of the individual components." -2083,get_legacy_output_shapes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2780,function,"Returns the output shapes for elements of the input dataset / iterator. +1631,get_legacy_output_shapes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2780,function,"Returns the output shapes for elements of the input dataset / iterator. Args: dataset_or_iterator: A `tf.data.Dataset` or `tf.data.Iterator`. @@ -9980,7 +10978,7 @@ Returns: A nested structure of `tf.TensorShape` objects matching the structure of the dataset / iterator elements and specifying the shape of the individual components." -2084,get_legacy_output_types,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2797,function,"Returns the output shapes for elements of the input dataset / iterator. +1632,get_legacy_output_types,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2797,function,"Returns the output shapes for elements of the input dataset / iterator. Args: dataset_or_iterator: A `tf.data.Dataset` or `tf.data.Iterator`. @@ -9989,7 +10987,7 @@ Returns: A nested structure of `tf.DType` objects objects matching the structure of dataset / iterator elements and specifying the shape of the individual components." -2085,Options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2814,class,"Represents options for tf.data.Dataset. +1633,Options,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2814,class,"Represents options for tf.data.Dataset. An `Options` object can be, for instance, used to control which graph optimizations to apply or whether to use performance modeling to dynamically @@ -10003,15 +11001,31 @@ apply the options to a dataset. >>> options = tf.data.Options() >>> # Set options here. >>> dataset = dataset.with_options(options)" -2086,DatasetSource,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2946,class,Abstract class representing a dataset with no inputs. -2087,UnaryDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2953,class,Abstract class representing a dataset with one input. -2088,UnaryUnchangedStructureDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2964,class,Represents a unary dataset with the same input and output structure. -2089,TensorDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2977,class,A `Dataset` with a single element. -2090,TensorSliceDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2996,class,A `Dataset` of slices from a dataset element. -2091,SparseTensorSliceDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3023,class,A `Dataset` that splits a rank-N `tf.sparse.SparseTensor` into its rows. -2092,_VariantDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3052,class,A Dataset wrapper around a `tf.variant`-typed function argument. -2093,_NestedVariant,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3067,class, -2094,from_variant,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3080,function,"Constructs a dataset from the given variant and structure. +1634,merge,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2927,method,"Merges itself with the given `tf.data.Options`. + +The given `tf.data.Options` can be merged as long as there does not exist an +attribute that is set to different values in `self` and `options`. + +Args: + options: a `tf.data.Options` to merge with + +Raises: + ValueError: if the given `tf.data.Options` cannot be merged + +Returns: + New `tf.data.Options()` object which is the result of merging self with + the input `tf.data.Options`." +1635,DatasetSource,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2946,class,Abstract class representing a dataset with no inputs. +1636,UnaryDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2953,class,Abstract class representing a dataset with one input. +1637,UnaryUnchangedStructureDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2964,class,Represents a unary dataset with the same input and output structure. +1638,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2973,method, +1639,TensorDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2977,class,A `Dataset` with a single element. +1640,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2992,method, +1641,TensorSliceDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,2996,class,A `Dataset` of slices from a dataset element. +1642,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3019,method, +1643,SparseTensorSliceDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3023,class,A `Dataset` that splits a rank-N `tf.sparse.SparseTensor` into its rows. +1644,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3048,method, +1645,from_variant,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3080,function,"Constructs a dataset from the given variant and structure. Args: variant: A scalar `tf.variant` tensor representing a dataset. @@ -10020,93 +11034,62 @@ Args: Returns: A `tf.data.Dataset` instance." -2095,to_variant,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3095,function,"Returns a variant representing the given dataset. +1646,to_variant,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3095,function,"Returns a variant representing the given dataset. Args: dataset: A `tf.data.Dataset`. Returns: A scalar `tf.variant` tensor representing the given dataset." -2096,DatasetSpec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3110,class,"Type specification for `tf.data.Dataset`. +1647,DatasetSpec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3110,class,"Type specification for `tf.data.Dataset`. See `tf.TypeSpec` for more information about TensorFlow type specifications. >>> dataset = tf.data.Dataset.range(3) >>> tf.data.DatasetSpec.from_value(dataset) DatasetSpec(TensorSpec(shape=(), dtype=tf.int64, name=None), TensorShape([]))" -2097,StructuredFunctionWrapper,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3183,class,A function wrapper that supports structured arguments and return values. -2098,_GeneratorDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3414,class,A `Dataset` that generates elements by invoking a function. -2099,ZipDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3469,class,A `Dataset` that zips its inputs together. -2100,ConcatenateDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3501,class,A `Dataset` that concatenates its input with given dataset. -2101,RepeatDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3549,class,A `Dataset` that repeats its input several times. -2102,RangeDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3567,class,A `Dataset` of a step separated range of values. -2103,CacheDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3610,class,A `Dataset` that caches elements of its input. -2104,ShuffleDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3632,class,A `Dataset` that randomly shuffles the elements of its input. -2105,TakeDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3688,class,A `Dataset` containing the first `count` elements from its input. -2106,SkipDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3702,class,A `Dataset` skipping the first `count` elements from its input. -2107,ShardDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3716,class,A `Dataset` for sharding its input. -2108,BatchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3733,class,A `Dataset` that batches contiguous elements from its input. -2109,_NumpyIterator,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3770,class,Iterator over a dataset with elements converted to numpy. -2110,_VariantTracker,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3788,class,"Allows export of functions capturing a Dataset in SavedModels. - -When saving a SavedModel, `tf.saved_model.save` traverses the object -graph. Since Datasets reference _VariantTracker objects, that traversal will -find a _VariantTracker for each Dataset and so know how to save and restore -functions which reference the Dataset's variant Tensor." -2111,_is_padded_shape_compatible_with,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3813,function,"Returns `True` if `input_component_shape` can be padded to `padded_shape`. - -Args: - padded_shape: A `tf.TensorShape`. - input_component_shape: A `tf.TensorShape`. - -Returns: - `True` if `input_component_shape` can be padded to `padded_shape`, otherwise - `False`." -2112,_padded_shape_to_tensor,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3837,function,"Converts `padded_shape` to a `tf.Tensor` representing that shape. - -Args: - padded_shape: A shape-like object, which may be a `tf.TensorShape`, a Python - sequence, or a 1-D `tf.Tensor` of `tf.int64` elements. - input_component_shape: A `tf.TensorShape`, with which `padded_shape` must - be compatible. - -Returns: - A 1-D `tf.Tensor` of `tf.int64` elements, representing `padded_shape`. - -Raises: - ValueError: If `padded_shape` is not a shape or not compatible with - `input_component_shape`. - TypeError: If `padded_shape` is not convertible to a `tf.int64` tensor." -2113,_padding_value_to_tensor,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3889,function,"Converts the padding value to a tensor. - -Args: - value: The padding value. - output_type: Its expected dtype. - -Returns: - A scalar `Tensor`. - -Raises: - ValueError: if the padding value is not a scalar. - TypeError: if the padding value's type does not match `output_type`." -2114,_padding_values_or_default,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3912,function,Returns padding values with None elements replaced with default values. -2115,PaddedBatchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3939,class,A `Dataset` that batches and pads contiguous elements from its input. -2116,_should_unpack_args,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4025,function,Returns `True` if `args` should be `*args` when passed to a callable. -2117,MapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4030,class,A `Dataset` that maps a function over elements in its input. -2118,ParallelMapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4068,class,A `Dataset` that maps a function over elements in its input in parallel. -2119,FlatMapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4118,class,A `Dataset` that maps a function over its input and flattens the result. -2120,InterleaveDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4149,class,A `Dataset` that interleaves the result of transformed inputs. -2121,ParallelInterleaveDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4188,class,A `Dataset` that maps a function over its input and interleaves the result. -2122,FilterDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4256,class,A `Dataset` that filters its input according to a predicate function. -2123,PrefetchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4288,class,A `Dataset` that asynchronously prefetches its input. -2124,WindowDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4321,class,A dataset that creates window datasets from the input elements. -2125,_OptionsDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4357,class,An identity `Dataset` that stores options. -2126,_ModelDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4374,class,"A `Dataset` that acts as an identity, and models performance." -2127,_OptimizeDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4387,class,"A `Dataset` that acts as an identity, and applies optimizations." -2128,_SetStatsAggregatorDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4406,class,"A `Dataset` that acts as an identity, and sets a stats aggregator." -2129,_MaxIntraOpParallelismDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4424,class,"A `Dataset` that acts as an identity, overriding intra-op parallelism." -2130,_PrivateThreadPoolDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4441,class,"A `Dataset` that acts as an identity, setting a private threadpool." -2131,normalize_to_dense,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4456,function,"Normalizes non-tensor components in a dataset to dense representations. +1648,value_type,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3127,method, +1649,from_value,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3154,method,Creates a `DatasetSpec` for the given `tf.data.Dataset` value. +1650,StructuredFunctionWrapper,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3183,class,A function wrapper that supports structured arguments and return values. +1651,output_structure,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3388,method, +1652,output_classes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3392,method, +1653,output_shapes,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3398,method, +1654,output_types,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3404,method, +1655,function,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3410,method, +1656,wrapper_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3330,method, +1657,wrapper_fn,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3363,method, +1658,ZipDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3469,class,A `Dataset` that zips its inputs together. +1659,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3497,method, +1660,ConcatenateDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3501,class,A `Dataset` that concatenates its input with given dataset. +1661,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3545,method, +1662,RepeatDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3549,class,A `Dataset` that repeats its input several times. +1663,RangeDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3567,class,A `Dataset` of a step separated range of values. +1664,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3606,method, +1665,CacheDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3610,class,A `Dataset` that caches elements of its input. +1666,ShuffleDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3632,class,A `Dataset` that randomly shuffles the elements of its input. +1667,TakeDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3688,class,A `Dataset` containing the first `count` elements from its input. +1668,SkipDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3702,class,A `Dataset` skipping the first `count` elements from its input. +1669,ShardDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3716,class,A `Dataset` for sharding its input. +1670,BatchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3733,class,A `Dataset` that batches contiguous elements from its input. +1671,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3766,method, +1672,PaddedBatchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3939,class,A `Dataset` that batches and pads contiguous elements from its input. +1673,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4021,method, +1674,check_types,tensorflow/tensorflow/python/data/ops/dataset_ops.py,3947,method, +1675,MapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4030,class,A `Dataset` that maps a function over elements in its input. +1676,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4061,method, +1677,ParallelMapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4068,class,A `Dataset` that maps a function over elements in its input in parallel. +1678,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4111,method, +1679,FlatMapDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4118,class,A `Dataset` that maps a function over its input and flattens the result. +1680,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4142,method, +1681,InterleaveDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4149,class,A `Dataset` that interleaves the result of transformed inputs. +1682,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4181,method, +1683,ParallelInterleaveDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4188,class,A `Dataset` that maps a function over its input and interleaves the result. +1684,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4249,method, +1685,FilterDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4256,class,A `Dataset` that filters its input according to a predicate function. +1686,PrefetchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4288,class,A `Dataset` that asynchronously prefetches its input. +1687,WindowDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4321,class,A dataset that creates window datasets from the input elements. +1688,element_spec,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4353,method, +1689,normalize_to_dense,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4456,function,"Normalizes non-tensor components in a dataset to dense representations. This is necessary for dataset transformations that slice along the batch dimension and are oblivious to non-tensors, e.g. `unbatch`, `rebatch`. @@ -10117,18 +11100,207 @@ Args: Returns: A dataset whose sparse and ragged tensors have been normalized to their dense representations." -2132,_RestructuredDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4488,class,An internal helper for changing the structure and shape of a dataset. -2133,_UnbatchDataset,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4503,class,A dataset that splits the elements of its input into multiple elements. -2134,_collect_resource_inputs,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4532,function,Collects resource inputs for the given ops (and its variant inputs). -2135,_resource_resolver,tensorflow/tensorflow/python/data/ops/dataset_ops.py,4575,function,Updates resource inputs for tf.data ops with indirect dependencies. -2136,_device_stack_is_empty,tensorflow/tensorflow/python/data/ops/iterator_ops.py,71,function, -2137,Iterator,tensorflow/tensorflow/python/data/ops/iterator_ops.py,81,class,Represents the state of iterating through a `Dataset`. -2138,_generate_shared_name,tensorflow/tensorflow/python/data/ops/iterator_ops.py,510,function, -2139,IteratorResourceDeleter,tensorflow/tensorflow/python/data/ops/iterator_ops.py,518,class,"An object which cleans up an iterator resource handle. +1690,Iterator,tensorflow/tensorflow/python/data/ops/iterator_ops.py,81,class,Represents the state of iterating through a `Dataset`. +1691,from_structure,tensorflow/tensorflow/python/data/ops/iterator_ops.py,125,method,"Creates a new, uninitialized `Iterator` with the given structure. + +This iterator-constructing method can be used to create an iterator that +is reusable with many different datasets. + +The returned iterator is not bound to a particular dataset, and it has +no `initializer`. To initialize the iterator, run the operation returned by +`Iterator.make_initializer(dataset)`. + +The following is an example + +```python +iterator = Iterator.from_structure(tf.int64, tf.TensorShape([])) + +dataset_range = Dataset.range(10) +range_initializer = iterator.make_initializer(dataset_range) + +dataset_evens = dataset_range.filter(lambda x: x % 2 == 0) +evens_initializer = iterator.make_initializer(dataset_evens) + +# Define a model based on the iterator; in this example, the model_fn +# is expected to take scalar tf.int64 Tensors as input (see +# the definition of 'iterator' above). +prediction, loss = model_fn(iterator.get_next()) + +# Train for `num_epochs`, where for each epoch, we first iterate over +# dataset_range, and then iterate over dataset_evens. +for _ in range(num_epochs): + # Initialize the iterator to `dataset_range` + sess.run(range_initializer) + while True: + try: + pred, loss_val = sess.run([prediction, loss]) + except tf.errors.OutOfRangeError: + break + + # Initialize the iterator to `dataset_evens` + sess.run(evens_initializer) + while True: + try: + pred, loss_val = sess.run([prediction, loss]) + except tf.errors.OutOfRangeError: + break +``` + +Args: + output_types: A nested structure of `tf.DType` objects corresponding to + each component of an element of this dataset. + output_shapes: (Optional.) A nested structure of `tf.TensorShape` objects + corresponding to each component of an element of this dataset. If + omitted, each component will have an unconstrainted shape. + shared_name: (Optional.) If non-empty, this iterator will be shared under + the given name across multiple sessions that share the same devices + (e.g. when using a remote server). + output_classes: (Optional.) A nested structure of Python `type` objects + corresponding to each component of an element of this iterator. If + omitted, each component is assumed to be of type `tf.Tensor`. + +Returns: + An `Iterator`. + +Raises: + TypeError: If the structures of `output_shapes` and `output_types` are + not the same." +1692,from_string_handle,tensorflow/tensorflow/python/data/ops/iterator_ops.py,229,method,"Creates a new, uninitialized `Iterator` based on the given handle. + +This method allows you to define a ""feedable"" iterator where you can choose +between concrete iterators by feeding a value in a `tf.Session.run` call. +In that case, `string_handle` would be a `tf.compat.v1.placeholder`, and you +would +feed it with the value of `tf.data.Iterator.string_handle` in each step. + +For example, if you had two iterators that marked the current position in +a training dataset and a test dataset, you could choose which to use in +each step as follows: + +```python +train_iterator = tf.data.Dataset(...).make_one_shot_iterator() +train_iterator_handle = sess.run(train_iterator.string_handle()) + +test_iterator = tf.data.Dataset(...).make_one_shot_iterator() +test_iterator_handle = sess.run(test_iterator.string_handle()) + +handle = tf.compat.v1.placeholder(tf.string, shape=[]) +iterator = tf.data.Iterator.from_string_handle( + handle, train_iterator.output_types) + +next_element = iterator.get_next() +loss = f(next_element) + +train_loss = sess.run(loss, feed_dict={handle: train_iterator_handle}) +test_loss = sess.run(loss, feed_dict={handle: test_iterator_handle}) +``` + +Args: + string_handle: A scalar `tf.Tensor` of type `tf.string` that evaluates to + a handle produced by the `Iterator.string_handle()` method. + output_types: A nested structure of `tf.DType` objects corresponding to + each component of an element of this dataset. + output_shapes: (Optional.) A nested structure of `tf.TensorShape` objects + corresponding to each component of an element of this dataset. If + omitted, each component will have an unconstrainted shape. + output_classes: (Optional.) A nested structure of Python `type` objects + corresponding to each component of an element of this iterator. If + omitted, each component is assumed to be of type `tf.Tensor`. + +Returns: + An `Iterator`." +1693,initializer,tensorflow/tensorflow/python/data/ops/iterator_ops.py,307,method,"A `tf.Operation` that should be run to initialize this iterator. + +Returns: + A `tf.Operation` that should be run to initialize this iterator + +Raises: + ValueError: If this iterator initializes itself automatically." +1694,make_initializer,tensorflow/tensorflow/python/data/ops/iterator_ops.py,323,method,"Returns a `tf.Operation` that initializes this iterator on `dataset`. + +Args: + dataset: A `Dataset` with compatible structure to this iterator. + name: (Optional.) A name for the created operation. + +Returns: + A `tf.Operation` that can be run to initialize this iterator on the given + `dataset`. + +Raises: + TypeError: If `dataset` and this iterator do not have a compatible + element structure." +1695,get_next,tensorflow/tensorflow/python/data/ops/iterator_ops.py,379,method,"Returns a nested structure of `tf.Tensor`s representing the next element. + +In graph mode, you should typically call this method *once* and use its +result as the input to another computation. A typical loop will then call +`tf.Session.run` on the result of that computation. The loop will terminate +when the `Iterator.get_next()` operation raises +`tf.errors.OutOfRangeError`. The following skeleton shows how to use +this method when building a training loop: + +```python +dataset = ... # A `tf.data.Dataset` object. +iterator = dataset.make_initializable_iterator() +next_element = iterator.get_next() + +# Build a TensorFlow graph that does something with each element. +loss = model_function(next_element) +optimizer = ... # A `tf.compat.v1.train.Optimizer` object. +train_op = optimizer.minimize(loss) + +with tf.compat.v1.Session() as sess: + try: + while True: + sess.run(train_op) + except tf.errors.OutOfRangeError: + pass +``` + +NOTE: It is legitimate to call `Iterator.get_next()` multiple times, e.g. +when you are distributing different elements to multiple devices in a single +step. However, a common pitfall arises when users call `Iterator.get_next()` +in each iteration of their training loop. `Iterator.get_next()` adds ops to +the graph, and executing each op allocates resources (including threads); as +a consequence, invoking it in every iteration of a training loop causes +slowdown and eventual resource exhaustion. To guard against this outcome, we +log a warning when the number of uses crosses a fixed threshold of +suspiciousness. + +Args: + name: (Optional.) A name for the created operation. + +Returns: + A nested structure of `tf.Tensor` objects." +1696,string_handle,tensorflow/tensorflow/python/data/ops/iterator_ops.py,435,method,"Returns a string-valued `tf.Tensor` that represents this iterator. + +Args: + name: (Optional.) A name for the created operation. + +Returns: + A scalar `tf.Tensor` of type `tf.string`." +1697,output_classes,tensorflow/tensorflow/python/data/ops/iterator_ops.py,453,method,"Returns the class of each component of an element of this iterator. + +The expected values are `tf.Tensor` and `tf.sparse.SparseTensor`. + +Returns: + A nested structure of Python `type` objects corresponding to each + component of an element of this dataset." +1698,output_shapes,tensorflow/tensorflow/python/data/ops/iterator_ops.py,469,method,"Returns the shape of each component of an element of this iterator. + +Returns: + A nested structure of `tf.TensorShape` objects corresponding to each + component of an element of this dataset." +1699,output_types,tensorflow/tensorflow/python/data/ops/iterator_ops.py,483,method,"Returns the type of each component of an element of this iterator. + +Returns: + A nested structure of `tf.DType` objects corresponding to each component + of an element of this dataset." +1700,element_spec,tensorflow/tensorflow/python/data/ops/iterator_ops.py,495,method, +1701,IteratorResourceDeleter,tensorflow/tensorflow/python/data/ops/iterator_ops.py,518,class,"An object which cleans up an iterator resource handle. An alternative to defining a __del__ method on an object. Even if the parent object is part of a reference cycle, the cycle will be collectable." -2140,IteratorBase,tensorflow/tensorflow/python/data/ops/iterator_ops.py,548,class,"Represents an iterator of a `tf.data.Dataset`. +1702,IteratorBase,tensorflow/tensorflow/python/data/ops/iterator_ops.py,548,class,"Represents an iterator of a `tf.data.Dataset`. `tf.data.Iterator` is the primary mechanism for enumerating elements of a `tf.data.Dataset`. It supports the Python Iterator protocol, which means @@ -10161,13 +11333,74 @@ tf.Tensor(True, shape=(), dtype=bool) >>> optional = iterator.get_next_as_optional() >>> print(optional.has_value()) tf.Tensor(False, shape=(), dtype=bool)" -2141,OwnedIterator,tensorflow/tensorflow/python/data/ops/iterator_ops.py,641,class,"An iterator producing tf.Tensor objects from a tf.data.Dataset. +1703,element_spec,tensorflow/tensorflow/python/data/ops/iterator_ops.py,586,method,"The type specification of an element of this iterator. + +>>> dataset = tf.data.Dataset.from_tensors(42) +>>> iterator = iter(dataset) +>>> iterator.element_spec +tf.TensorSpec(shape=(), dtype=tf.int32, name=None) + +Returns: + A nested structure of `tf.TypeSpec` objects matching the structure of an + element of this iterator, specifying the type of individual components." +1704,get_next,tensorflow/tensorflow/python/data/ops/iterator_ops.py,601,method,"Returns a nested structure of `tf.Tensor`s containing the next element. + +>>> dataset = tf.data.Dataset.from_tensors(42) +>>> iterator = iter(dataset) +>>> print(iterator.get_next()) +tf.Tensor(42, shape=(), dtype=int32) + +Returns: + A nested structure of `tf.Tensor` objects. + +Raises: + `tf.errors.OutOfRangeError`: If the end of the iterator has been reached." +1705,get_next_as_optional,tensorflow/tensorflow/python/data/ops/iterator_ops.py,618,method,"Returns a `tf.experimental.Optional` which contains the next element. + +If the iterator has reached the end of the sequence, the returned +`tf.experimental.Optional` will have no value. + +>>> dataset = tf.data.Dataset.from_tensors(42) +>>> iterator = iter(dataset) +>>> optional = iterator.get_next_as_optional() +>>> print(optional.has_value()) +tf.Tensor(True, shape=(), dtype=bool) +>>> print(optional.get_value()) +tf.Tensor(42, shape=(), dtype=int32) +>>> optional = iterator.get_next_as_optional() +>>> print(optional.has_value()) +tf.Tensor(False, shape=(), dtype=bool) + +Returns: + A `tf.experimental.Optional` object representing the next element." +1706,OwnedIterator,tensorflow/tensorflow/python/data/ops/iterator_ops.py,641,class,"An iterator producing tf.Tensor objects from a tf.data.Dataset. The iterator resource created through `OwnedIterator` is owned by the Python object and the life time of the underlying resource is tied to the life time of the `OwnedIterator` object. This makes `OwnedIterator` appropriate for use in eager mode and inside of tf.functions." -2142,IteratorSpec,tensorflow/tensorflow/python/data/ops/iterator_ops.py,857,class,"Type specification for `tf.data.Iterator`. +1707,next,tensorflow/tensorflow/python/data/ops/iterator_ops.py,737,method, +1708,output_classes,tensorflow/tensorflow/python/data/ops/iterator_ops.py,781,method,"Returns the class of each component of an element of this iterator. + +The expected values are `tf.Tensor` and `tf.sparse.SparseTensor`. + +Returns: + A nested structure of Python `type` objects corresponding to each + component of an element of this dataset." +1709,output_shapes,tensorflow/tensorflow/python/data/ops/iterator_ops.py,797,method,"Returns the shape of each component of an element of this iterator. + +Returns: + A nested structure of `tf.TensorShape` objects corresponding to each + component of an element of this dataset." +1710,output_types,tensorflow/tensorflow/python/data/ops/iterator_ops.py,811,method,"Returns the type of each component of an element of this iterator. + +Returns: + A nested structure of `tf.DType` objects corresponding to each component + of an element of this dataset." +1711,element_spec,tensorflow/tensorflow/python/data/ops/iterator_ops.py,823,method, +1712,get_next,tensorflow/tensorflow/python/data/ops/iterator_ops.py,826,method, +1713,get_next_as_optional,tensorflow/tensorflow/python/data/ops/iterator_ops.py,829,method, +1714,IteratorSpec,tensorflow/tensorflow/python/data/ops/iterator_ops.py,857,class,"Type specification for `tf.data.Iterator`. For instance, `tf.data.IteratorSpec` can be used to define a tf.function that takes `tf.data.Iterator` as an input argument: @@ -10185,8 +11418,9 @@ tf.Tensor(25, shape=(), dtype=int32) Attributes: element_spec: A nested structure of `TypeSpec` objects that represents the type specification of the iterator elements." -2143,_IteratorSaveable,tensorflow/tensorflow/python/data/ops/iterator_ops.py,912,class,SaveableObject for saving/restoring iterator state. -2144,get_next_as_optional,tensorflow/tensorflow/python/data/ops/iterator_ops.py,939,function,"Returns a `tf.experimental.Optional` with the next element of the iterator. +1715,value_type,tensorflow/tensorflow/python/data/ops/iterator_ops.py,884,method, +1716,from_value,tensorflow/tensorflow/python/data/ops/iterator_ops.py,907,method, +1717,get_next_as_optional,tensorflow/tensorflow/python/data/ops/iterator_ops.py,939,function,"Returns a `tf.experimental.Optional` with the next element of the iterator. If the iterator has reached the end of the sequence, the returned `tf.experimental.Optional` will have no value. @@ -10197,26 +11431,30 @@ Args: Returns: A `tf.experimental.Optional` object which either contains the next element of the iterator (if it exists) or no value." -2145,_PerDeviceGenerator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,38,class,A `dummy` generator dataset. -2146,_ReincarnatedPerDeviceGenerator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,151,class,"Creates a _PerDeviceGenerator-like dataset with a new incarnation_id. - -Re-uses the functions from the provided per_device_dataset and just switches -out the function argument corresponding to the incarnation_id." -2147,_create_device_dataset,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,193,function,Uses _prototype_device_datasets[i] to build a dataset for the device. -2148,MultiDeviceIterator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,211,class,An iterator over multiple devices. -2149,MultiDeviceIteratorResourceDeleter,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,373,class,"An object which cleans up a Multi Device Iterator resource. +1718,MultiDeviceIterator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,211,class,An iterator over multiple devices. +1719,get_next,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,322,method,"Returns the next element given a `device`, else returns all in a list." +1720,get_next_as_optional,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,334,method, +1721,initializer,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,343,method, +1722,element_spec,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,369,method, +1723,MultiDeviceIteratorResourceDeleter,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,373,class,"An object which cleans up a Multi Device Iterator resource. An alternative to defining a __del__ method on an object. Even if the parent object is part of a reference cycle, the cycle will be collectible." -2150,MultiDeviceIteratorSpec,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,411,class,Type specification for `OwnedMultiDeviceIterator`. -2151,OwnedMultiDeviceIterator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,461,class,"An iterator over multiple devices. +1724,MultiDeviceIteratorSpec,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,411,class,Type specification for `OwnedMultiDeviceIterator`. +1725,value_type,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,422,method, +1726,from_value,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,453,method, +1727,OwnedMultiDeviceIterator,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,461,class,"An iterator over multiple devices. The multi-device iterator resource created through `OwnedMultiDeviceIterator` is owned by the Python object and the life time of the underlying resource is tied to the life time of the `OwnedMultiDeviceIterator` object. This makes `OwnedMultiDeviceIterator` appropriate for use in eager mode and inside of tf.functions." -2152,Optional,tensorflow/tensorflow/python/data/ops/optional_ops.py,38,class,"Represents a value that may or may not be present. +1728,get_next,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,577,method,"Returns the next element given a `device`, else returns all in a list." +1729,next,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,592,method, +1730,get_next_as_optional,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,601,method, +1731,element_spec,tensorflow/tensorflow/python/data/ops/multi_device_iterator_ops.py,610,method, +1732,Optional,tensorflow/tensorflow/python/data/ops/optional_ops.py,38,class,"Represents a value that may or may not be present. A `tf.experimental.Optional` can represent the result of an operation that may fail as a value, rather than raising an exception and halting execution. For @@ -10243,11 +11481,72 @@ or without a value using the `empty()` method: ... tf.TensorSpec(shape=(), dtype=tf.int32, name=None)) >>> print(optional.has_value()) tf.Tensor(False, shape=(), dtype=bool)" -2153,_OptionalImpl,tensorflow/tensorflow/python/data/ops/optional_ops.py,166,class,"Concrete implementation of `tf.experimental.Optional`. +1733,has_value,tensorflow/tensorflow/python/data/ops/optional_ops.py,69,method,"Returns a tensor that evaluates to `True` if this optional has a value. -NOTE(mrry): This implementation is kept private, to avoid defining -`Optional.__init__()` in the public API." -2154,OptionalSpec,tensorflow/tensorflow/python/data/ops/optional_ops.py,206,class,"Type specification for `tf.experimental.Optional`. +>>> optional = tf.experimental.Optional.from_value(42) +>>> print(optional.has_value()) +tf.Tensor(True, shape=(), dtype=bool) + +Args: + name: (Optional.) A name for the created operation. + +Returns: + A scalar `tf.Tensor` of type `tf.bool`." +1734,get_value,tensorflow/tensorflow/python/data/ops/optional_ops.py,85,method,"Returns the value wrapped by this optional. + +If this optional does not have a value (i.e. `self.has_value()` evaluates to +`False`), this operation will raise `tf.errors.InvalidArgumentError` at +runtime. + +>>> optional = tf.experimental.Optional.from_value(42) +>>> print(optional.get_value()) +tf.Tensor(42, shape=(), dtype=int32) + +Args: + name: (Optional.) A name for the created operation. + +Returns: + The wrapped value." +1735,element_spec,tensorflow/tensorflow/python/data/ops/optional_ops.py,105,method,"The type specification of an element of this optional. + +>>> optional = tf.experimental.Optional.from_value(42) +>>> print(optional.element_spec) +tf.TensorSpec(shape=(), dtype=tf.int32, name=None) + +Returns: + A nested structure of `tf.TypeSpec` objects matching the structure of an + element of this optional, specifying the type of individual components." +1736,empty,tensorflow/tensorflow/python/data/ops/optional_ops.py,119,method,"Returns an `Optional` that has no value. + +NOTE: This method takes an argument that defines the structure of the value +that would be contained in the returned `Optional` if it had a value. + +>>> optional = tf.experimental.Optional.empty( +... tf.TensorSpec(shape=(), dtype=tf.int32, name=None)) +>>> print(optional.has_value()) +tf.Tensor(False, shape=(), dtype=bool) + +Args: + element_spec: A nested structure of `tf.TypeSpec` objects matching the + structure of an element of this optional. + +Returns: + A `tf.experimental.Optional` with no value." +1737,from_value,tensorflow/tensorflow/python/data/ops/optional_ops.py,140,method,"Returns a `tf.experimental.Optional` that wraps the given value. + +>>> optional = tf.experimental.Optional.from_value(42) +>>> print(optional.has_value()) +tf.Tensor(True, shape=(), dtype=bool) +>>> print(optional.get_value()) +tf.Tensor(42, shape=(), dtype=int32) + +Args: + value: A value to wrap. The value must be convertible to `tf.Tensor` or + `tf.CompositeTensor`. + +Returns: + A `tf.experimental.Optional` that wraps `value`." +1738,OptionalSpec,tensorflow/tensorflow/python/data/ops/optional_ops.py,206,class,"Type specification for `tf.experimental.Optional`. For instance, `tf.OptionalSpec` can be used to define a tf.function that takes `tf.experimental.Optional` as an input argument: @@ -10266,36 +11565,24 @@ tf.Tensor(25, shape=(), dtype=int32) Attributes: element_spec: A nested structure of `TypeSpec` objects that represents the type specification of the optional element." -2155,_create_or_validate_filenames_dataset,tensorflow/tensorflow/python/data/ops/readers.py,35,function,"Creates (or validates) a dataset of filenames. - -Args: - filenames: Either a list or dataset of filenames. If it is a list, it is - convert to a dataset. If it is a dataset, its type and shape is validated. - -Returns: - A dataset of filenames." -2156,_create_dataset_reader,tensorflow/tensorflow/python/data/ops/readers.py,66,function,"Creates a dataset that reads the given files using the given reader. - -Args: - dataset_creator: A function that takes in a single file name and returns a - dataset. - filenames: A `tf.data.Dataset` containing one or more filenames. - num_parallel_reads: The number of parallel reads we should do. - -Returns: - A `Dataset` that reads data from `filenames`." -2157,_TextLineDataset,tensorflow/tensorflow/python/data/ops/readers.py,99,class,A `Dataset` comprising records from one or more text files. -2158,TextLineDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,134,class,A `Dataset` comprising lines from one or more text files. -2159,TextLineDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,179,class,A `Dataset` comprising lines from one or more text files. -2160,_TFRecordDataset,tensorflow/tensorflow/python/data/ops/readers.py,202,class,A `Dataset` comprising records from one or more TFRecord files. -2161,ParallelInterleaveDataset,tensorflow/tensorflow/python/data/ops/readers.py,235,class,A `Dataset` that maps a function over its input and flattens the result. -2162,TFRecordDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,290,class,A `Dataset` comprising records from one or more TFRecord files. -2163,TFRecordDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,354,class,A `Dataset` comprising records from one or more TFRecord files. -2164,_FixedLengthRecordDataset,tensorflow/tensorflow/python/data/ops/readers.py,389,class,A `Dataset` of fixed-length records from one or more binary files. -2165,FixedLengthRecordDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,439,class,A `Dataset` of fixed-length records from one or more binary files. -2166,FixedLengthRecordDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,497,class,A `Dataset` of fixed-length records from one or more binary files. -2167,optional_param_to_tensor,tensorflow/tensorflow/python/data/util/convert.py,26,function, -2168,partial_shape_to_tensor,tensorflow/tensorflow/python/data/util/convert.py,38,function,"Returns a `tf.Tensor` that represents the given shape. +1739,value_type,tensorflow/tensorflow/python/data/ops/optional_ops.py,234,method, +1740,from_value,tensorflow/tensorflow/python/data/ops/optional_ops.py,252,method, +1741,TextLineDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,134,class,A `Dataset` comprising lines from one or more text files. +1742,element_spec,tensorflow/tensorflow/python/data/ops/readers.py,174,method, +1743,creator_fn,tensorflow/tensorflow/python/data/ops/readers.py,164,method, +1744,TextLineDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,179,class,A `Dataset` comprising lines from one or more text files. +1745,ParallelInterleaveDataset,tensorflow/tensorflow/python/data/ops/readers.py,235,class,A `Dataset` that maps a function over its input and flattens the result. +1746,element_spec,tensorflow/tensorflow/python/data/ops/readers.py,282,method, +1747,TFRecordDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,290,class,A `Dataset` comprising records from one or more TFRecord files. +1748,element_spec,tensorflow/tensorflow/python/data/ops/readers.py,349,method, +1749,creator_fn,tensorflow/tensorflow/python/data/ops/readers.py,327,method, +1750,TFRecordDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,354,class,A `Dataset` comprising records from one or more TFRecord files. +1751,FixedLengthRecordDatasetV2,tensorflow/tensorflow/python/data/ops/readers.py,439,class,A `Dataset` of fixed-length records from one or more binary files. +1752,element_spec,tensorflow/tensorflow/python/data/ops/readers.py,492,method, +1753,creator_fn,tensorflow/tensorflow/python/data/ops/readers.py,481,method, +1754,FixedLengthRecordDatasetV1,tensorflow/tensorflow/python/data/ops/readers.py,497,class,A `Dataset` of fixed-length records from one or more binary files. +1755,optional_param_to_tensor,tensorflow/tensorflow/python/data/util/convert.py,26,function, +1756,partial_shape_to_tensor,tensorflow/tensorflow/python/data/util/convert.py,38,function,"Returns a `tf.Tensor` that represents the given shape. Args: shape_like: A value that can be converted to a `tf.TensorShape` or a @@ -10304,18 +11591,7 @@ Args: Returns: A 1-D `tf.Tensor` of `tf.int64` elements representing the given shape, where `-1` is substituted for any unknown dimensions." -2169,ConvertTest,tensorflow/tensorflow/python/data/util/convert_test.py,30,class, -2170,_sorted,tensorflow/tensorflow/python/data/util/nest.py,45,function,"Returns a sorted list of the dict keys, with error if keys not sortable." -2171,_sequence_like,tensorflow/tensorflow/python/data/util/nest.py,53,function,"Converts the sequence `args` to the same type as `instance`. - -Args: - instance: an instance of `tuple`, `list`, or a `namedtuple` class. - args: elements to be converted to a sequence. - -Returns: - `args` with the type of `instance`." -2172,_yield_value,tensorflow/tensorflow/python/data/util/nest.py,81,function, -2173,assert_same_structure,tensorflow/tensorflow/python/data/util/nest.py,104,function,"Asserts that two structures are nested in the same way. +1757,assert_same_structure,tensorflow/tensorflow/python/data/util/nest.py,104,function,"Asserts that two structures are nested in the same way. Args: nest1: an arbitrarily nested structure. @@ -10332,24 +11608,7 @@ Raises: if the two structures are not nested in the same way. TypeError: If the two structures differ in the type of sequence in any of their substructures. Only possible if `check_types` is `True`." -2174,_packed_nest_with_indices,tensorflow/tensorflow/python/data/util/nest.py,126,function,"Helper function for pack_nest_as. - -Args: - structure: Substructure (tuple of elements and/or tuples) to mimic - flat: Flattened values to output substructure for. - index: Index at which to start reading from flat. - -Returns: - The tuple (new_index, child), where: - * new_index - the updated index into `flat` having processed `structure`. - * packed - the subset of `flat` corresponding to `structure`, - having started at `index`, and packed into the same nested - format. - -Raises: - ValueError: if `structure` contains more elements than `flat` - (assuming indexing starts from `index`)." -2175,pack_sequence_as,tensorflow/tensorflow/python/data/util/nest.py,157,function,"Returns a given flattened sequence packed into a nest. +1758,pack_sequence_as,tensorflow/tensorflow/python/data/util/nest.py,157,function,"Returns a given flattened sequence packed into a nest. If `structure` is a scalar, `flat_sequence` must be a single-element list; in this case the return value is `flat_sequence[0]`. @@ -10365,7 +11624,7 @@ Returns: Raises: ValueError: If nest and structure have different element counts." -2176,map_structure,tensorflow/tensorflow/python/data/util/nest.py,195,function,"Applies `func` to each entry in `structure` and returns a new structure. +1759,map_structure,tensorflow/tensorflow/python/data/util/nest.py,195,function,"Applies `func` to each entry in `structure` and returns a new structure. Applies `func(x[0], x[1], ...)` where x[i] is an entry in `structure[i]`. All structures in `structure` must have the same arity, @@ -10393,8 +11652,7 @@ Raises: ValueError: If no structure is provided or if the structures do not match each other by type. ValueError: If wrong keyword arguments are provided." -2177,_yield_flat_up_to,tensorflow/tensorflow/python/data/util/nest.py,248,function,Yields elements `input_tree` partially flattened up to `shallow_tree`. -2178,assert_shallow_structure,tensorflow/tensorflow/python/data/util/nest.py,259,function,"Asserts that `shallow_tree` is a shallow structure of `input_tree`. +1760,assert_shallow_structure,tensorflow/tensorflow/python/data/util/nest.py,259,function,"Asserts that `shallow_tree` is a shallow structure of `input_tree`. That is, this function tests if the `input_tree` structure can be created from the `shallow_tree` structure by replacing its leaf nodes with deeper @@ -10428,7 +11686,7 @@ Raises: `input_tree`. Only raised if `check_types` is `True`. ValueError: If the sequence lengths of `shallow_tree` are different from `input_tree`." -2179,flatten_up_to,tensorflow/tensorflow/python/data/util/nest.py,327,function,"Flattens `input_tree` up to `shallow_tree`. +1761,flatten_up_to,tensorflow/tensorflow/python/data/util/nest.py,327,function,"Flattens `input_tree` up to `shallow_tree`. Any further depth in structure in `input_tree` is retained as elements in the partially flatten output. @@ -10495,7 +11753,7 @@ Raises: `input_tree`. ValueError: If the sequence lengths of `shallow_tree` are different from `input_tree`." -2180,map_structure_up_to,tensorflow/tensorflow/python/data/util/nest.py,400,function,"Applies a function or op to a number of partially flattened inputs. +1762,map_structure_up_to,tensorflow/tensorflow/python/data/util/nest.py,400,function,"Applies a function or op to a number of partially flattened inputs. The `inputs` are flattened up to `shallow_tree` before being mapped. @@ -10554,13 +11812,11 @@ Raises: Returns: result of repeatedly applying `func`, with same structure as `shallow_tree`." -2181,NestTest,tensorflow/tensorflow/python/data/util/nest_test.py,34,class, -2182,_internal_attr_name,tensorflow/tensorflow/python/data/util/options.py,22,function, -2183,OptionsBase,tensorflow/tensorflow/python/data/util/options.py,26,class,"Base class for representing a set of tf.data options. +1763,OptionsBase,tensorflow/tensorflow/python/data/util/options.py,26,class,"Base class for representing a set of tf.data options. Attributes: _options: Stores the option values." -2184,create_option,tensorflow/tensorflow/python/data/util/options.py,59,function,"Creates a type-checked property. +1764,create_option,tensorflow/tensorflow/python/data/util/options.py,59,function,"Creates a type-checked property. Args: name: The name to use. @@ -10572,7 +11828,7 @@ Args: Returns: A type-checked property." -2185,merge_options,tensorflow/tensorflow/python/data/util/options.py,89,function,"Merges the given options, returning the result as a new options object. +1765,merge_options,tensorflow/tensorflow/python/data/util/options.py,89,function,"Merges the given options, returning the result as a new options object. The input arguments are expected to have a matching type that derives from `OptionsBase` (and thus each represent a set of options). The method outputs @@ -10595,10 +11851,7 @@ Raises: Returns: A new options object which is the result of merging the given options." -2186,_TestOptions,tensorflow/tensorflow/python/data/util/options_test.py,25,class, -2187,_NestedTestOptions,tensorflow/tensorflow/python/data/util/options_test.py,35,class, -2188,OptionsTest,tensorflow/tensorflow/python/data/util/options_test.py,40,class, -2189,get_seed,tensorflow/tensorflow/python/data/util/random_seed.py,29,function,"Returns the local seeds an operation should use given an op-specific seed. +1766,get_seed,tensorflow/tensorflow/python/data/util/random_seed.py,29,function,"Returns the local seeds an operation should use given an op-specific seed. See `random_seed.get_seed` for more details. This wrapper adds support for the case where `seed` may be a tensor. @@ -10609,15 +11862,14 @@ Args: Returns: A tuple of two `tf.int64` scalar tensors that should be used for the local seed of the calling dataset." -2190,RandomSeedTest,tensorflow/tensorflow/python/data/util/random_seed_test.py,30,class, -2191,any_sparse,tensorflow/tensorflow/python/data/util/sparse.py,28,function,"Checks for sparse tensor. +1767,any_sparse,tensorflow/tensorflow/python/data/util/sparse.py,28,function,"Checks for sparse tensor. Args: classes: a structure of objects that identify the dataset item classes Returns: `True` if `classes` contains a sparse tensor type and `False` otherwise." -2192,as_dense_shapes,tensorflow/tensorflow/python/data/util/sparse.py,40,function,"Converts sparse tensor shapes to their physical shapes. +1768,as_dense_shapes,tensorflow/tensorflow/python/data/util/sparse.py,40,function,"Converts sparse tensor shapes to their physical shapes. Args: shapes: a structure of shapes to convert. @@ -10627,7 +11879,7 @@ Returns: a structure matching the nested structure of `shapes`, containing `tensor_shape.unknown_shape()` at positions where `classes` contains `tf.sparse.SparseTensor` and matching contents of `shapes` otherwise" -2193,as_dense_types,tensorflow/tensorflow/python/data/util/sparse.py,59,function,"Converts sparse tensor types to `dtypes.variant`. +1769,as_dense_types,tensorflow/tensorflow/python/data/util/sparse.py,59,function,"Converts sparse tensor types to `dtypes.variant`. Args: types: a structure of types to convert. @@ -10637,7 +11889,7 @@ Returns: a structure matching the nested structure of `types`, containing `dtypes.variant` at positions where `classes` contains `tf.sparse.SparseTensor` and matching contents of `types` otherwise" -2194,deserialize_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,78,function,"Deserializes sparse tensors. +1770,deserialize_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,78,function,"Deserializes sparse tensors. Args: tensors: a structure of tensors to deserialize. @@ -10648,7 +11900,7 @@ Args: Returns: `tensors` with any serialized sparse tensors replaced by their deserialized version." -2195,get_classes,tensorflow/tensorflow/python/data/util/sparse.py,101,function,"Gets classes for a structure of tensors. +1771,get_classes,tensorflow/tensorflow/python/data/util/sparse.py,101,function,"Gets classes for a structure of tensors. Args: tensors: the tensor structure to get classes for. @@ -10657,26 +11909,21 @@ Returns: a structure matching the nested structure of `tensors`, containing `tf.sparse.SparseTensor` at positions where `tensors` contains a sparse tensor and `tf.Tensor` otherwise." -2196,serialize_many_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,119,function,"Serializes many sparse tensors into a batch. +1772,serialize_many_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,119,function,"Serializes many sparse tensors into a batch. Args: tensors: a tensor structure to serialize. Returns: `tensors` with any sparse tensors replaced by the serialized batch." -2197,serialize_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,137,function,"Serializes sparse tensors. +1773,serialize_sparse_tensors,tensorflow/tensorflow/python/data/util/sparse.py,137,function,"Serializes sparse tensors. Args: tensors: a tensor structure to serialize. Returns: `tensors` with any sparse tensors replaced by their serialized version." -2198,SparseTest,tensorflow/tensorflow/python/data/util/sparse_test.py,32,class, -2199,_TensorStructure,tensorflow/tensorflow/python/data/util/structure.py,44,function, -2200,_SparseTensorStructure,tensorflow/tensorflow/python/data/util/structure.py,50,function, -2201,_TensorArrayStructure,tensorflow/tensorflow/python/data/util/structure.py,56,function, -2202,_RaggedTensorStructure,tensorflow/tensorflow/python/data/util/structure.py,63,function, -2203,normalize_element,tensorflow/tensorflow/python/data/util/structure.py,70,function,"Normalizes a nested structure of element components. +1774,normalize_element,tensorflow/tensorflow/python/data/util/structure.py,70,function,"Normalizes a nested structure of element components. * Components matching `SparseTensorSpec` are converted to `SparseTensor`. * Components matching `RaggedTensorSpec` are converted to `RaggedTensor`. @@ -10690,7 +11937,7 @@ Args: Returns: A nested structure of `Tensor`, `Dataset`, `SparseTensor`, `RaggedTensor`, or `TensorArray` objects." -2204,convert_legacy_structure,tensorflow/tensorflow/python/data/util/structure.py,119,function,"Returns a `Structure` that represents the given legacy structure. +1775,convert_legacy_structure,tensorflow/tensorflow/python/data/util/structure.py,119,function,"Returns a `Structure` that represents the given legacy structure. This method provides a way to convert from the existing `Dataset` and `Iterator` structure-related properties to a `Structure` object. A ""legacy"" @@ -10715,22 +11962,7 @@ Returns: Raises: TypeError: If a structure cannot be built from the arguments, because one of the component classes in `output_classes` is not supported." -2205,_from_tensor_list_helper,tensorflow/tensorflow/python/data/util/structure.py,175,function,"Returns an element constructed from the given spec and tensor list. - -Args: - decode_fn: Method that constructs an element component from the element spec - component and a tensor list. - element_spec: A nested structure of `tf.TypeSpec` objects representing to - element type specification. - tensor_list: A list of tensors to use for constructing the value. - -Returns: - An element constructed from the given spec and tensor list. - -Raises: - ValueError: If the number of tensors needed to construct an element for - the given spec does not match the given number of tensors." -2206,from_compatible_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,210,function,"Returns an element constructed from the given spec and tensor list. +1776,from_compatible_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,210,function,"Returns an element constructed from the given spec and tensor list. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10743,7 +11975,7 @@ Returns: Raises: ValueError: If the number of tensors needed to construct an element for the given spec does not match the given number of tensors." -2207,from_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,233,function,"Returns an element constructed from the given spec and tensor list. +1777,from_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,233,function,"Returns an element constructed from the given spec and tensor list. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10757,7 +11989,7 @@ Raises: ValueError: If the number of tensors needed to construct an element for the given spec does not match the given number of tensors or the given spec is not compatible with the tensor list." -2208,get_flat_tensor_specs,tensorflow/tensorflow/python/data/util/structure.py,257,function,"Returns a list `tf.TypeSpec`s for the element tensor representation. +1778,get_flat_tensor_specs,tensorflow/tensorflow/python/data/util/structure.py,257,function,"Returns a list `tf.TypeSpec`s for the element tensor representation. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10765,7 +11997,7 @@ Args: Returns: A list `tf.TypeSpec`s for the element tensor representation." -2209,get_flat_tensor_shapes,tensorflow/tensorflow/python/data/util/structure.py,273,function,"Returns a list `tf.TensorShapes`s for the element tensor representation. +1779,get_flat_tensor_shapes,tensorflow/tensorflow/python/data/util/structure.py,273,function,"Returns a list `tf.TensorShapes`s for the element tensor representation. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10773,7 +12005,7 @@ Args: Returns: A list `tf.TensorShapes`s for the element tensor representation." -2210,get_flat_tensor_types,tensorflow/tensorflow/python/data/util/structure.py,286,function,"Returns a list `tf.DType`s for the element tensor representation. +1780,get_flat_tensor_types,tensorflow/tensorflow/python/data/util/structure.py,286,function,"Returns a list `tf.DType`s for the element tensor representation. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10781,24 +12013,7 @@ Args: Returns: A list `tf.DType`s for the element tensor representation." -2211,_to_tensor_list_helper,tensorflow/tensorflow/python/data/util/structure.py,299,function,"Returns a tensor list representation of the element. - -Args: - encode_fn: Method that constructs a tensor list representation from the - given element spec and element. - element_spec: A nested structure of `tf.TypeSpec` objects representing to - element type specification. - element: The element to convert to tensor list representation. - -Returns: - A tensor list representation of `element`. - -Raises: - ValueError: If `element_spec` and `element` do not have the same number of - elements or if the two structures are not nested in the same way. - TypeError: If `element_spec` and `element` differ in the type of sequence - in any of their substructures." -2212,to_batched_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,329,function,"Returns a tensor list representation of the element. +1781,to_batched_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,329,function,"Returns a tensor list representation of the element. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10814,7 +12029,7 @@ Raises: rank of any of the tensors in the tensor list representation is 0. TypeError: If `element_spec` and `element` differ in the type of sequence in any of their substructures." -2213,to_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,355,function,"Returns a tensor list representation of the element. +1782,to_tensor_list,tensorflow/tensorflow/python/data/util/structure.py,355,function,"Returns a tensor list representation of the element. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to @@ -10829,7 +12044,7 @@ Raises: elements or if the two structures are not nested in the same way. TypeError: If `element_spec` and `element` differ in the type of sequence in any of their substructures." -2214,are_compatible,tensorflow/tensorflow/python/data/util/structure.py,380,function,"Indicates whether two type specifications are compatible. +1783,are_compatible,tensorflow/tensorflow/python/data/util/structure.py,380,function,"Indicates whether two type specifications are compatible. Two type specifications are compatible if they have the same nested structure and the their individual components are pair-wise compatible. @@ -10840,7 +12055,7 @@ Args: Returns: `True` if the two type specifications are compatible and `False` otherwise." -2215,type_spec_from_value,tensorflow/tensorflow/python/data/util/structure.py,407,function,"Creates a type specification for the given value. +1784,type_spec_from_value,tensorflow/tensorflow/python/data/util/structure.py,407,function,"Creates a type specification for the given value. Args: element: The element to create the type specification for. @@ -10854,11 +12069,12 @@ Returns: Raises: TypeError: If a `TypeSpec` cannot be built for `element`, because its type is not supported." -2216,NoneTensor,tensorflow/tensorflow/python/data/util/structure.py,471,class,Composite tensor representation for `None` value. -2217,NoneTensorSpec,tensorflow/tensorflow/python/data/util/structure.py,481,class,Type specification for `None` value. -2218,StructureTest,tensorflow/tensorflow/python/data/util/structure_test.py,53,class, -2219,CustomMap,tensorflow/tensorflow/python/data/util/structure_test.py,759,class,"Custom, immutable map." -2220,obtain_all_variant_tensor_ops,tensorflow/tensorflow/python/data/util/traverse.py,25,function,"Given an input dataset, finds all dataset ops used for construction. +1785,NoneTensor,tensorflow/tensorflow/python/data/util/structure.py,471,class,Composite tensor representation for `None` value. +1786,NoneTensorSpec,tensorflow/tensorflow/python/data/util/structure.py,481,class,Type specification for `None` value. +1787,value_type,tensorflow/tensorflow/python/data/util/structure.py,485,method, +1788,from_value,tensorflow/tensorflow/python/data/util/structure.py,505,method, +1789,CustomMap,tensorflow/tensorflow/python/data/util/structure_test.py,759,class,"Custom, immutable map." +1790,obtain_all_variant_tensor_ops,tensorflow/tensorflow/python/data/util/traverse.py,25,function,"Given an input dataset, finds all dataset ops used for construction. A series of transformations would have created this dataset with each transformation including zero or more Dataset ops, each producing a dataset @@ -10870,24 +12086,107 @@ Args: Returns: A list of variant_tensor producing dataset ops used to construct this dataset." -2221,_TestDataset,tensorflow/tensorflow/python/data/util/traverse_test.py,29,class, -2222,TraverseTest,tensorflow/tensorflow/python/data/util/traverse_test.py,42,class, -2223,_add_main_menu,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,61,function,"Generate main menu for the screen output from a command. +1791,DebugAnalyzer,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,130,class,Analyzer for debug data from dump directories. +1792,add_tensor_filter,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,420,method,"Add a tensor filter. + +A tensor filter is a named callable of the signature: + filter_callable(dump_datum, tensor), + +wherein dump_datum is an instance of debug_data.DebugTensorDatum carrying +metadata about the dumped tensor, including tensor name, timestamps, etc. +tensor is the value of the dumped tensor as an numpy.ndarray object. +The return value of the function is a bool. +This is the same signature as the input argument to +debug_data.DebugDumpDir.find(). Args: - output: (debugger_cli_common.RichTextLines) the output object to modify. - node_name: (str or None) name of the node involved (if any). If None, - the menu items node_info, list_inputs and list_outputs will be - automatically disabled, overriding the values of arguments - enable_node_info, enable_list_inputs and enable_list_outputs. - enable_list_tensors: (bool) whether the list_tensor menu item will be - enabled. - enable_node_info: (bool) whether the node_info item will be enabled. - enable_print_tensor: (bool) whether the print_tensor item will be enabled. - enable_list_inputs: (bool) whether the item list_inputs will be enabled. - enable_list_outputs: (bool) whether the item list_outputs will be enabled." -2224,DebugAnalyzer,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,130,class,Analyzer for debug data from dump directories. -2225,create_analyzer_ui,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1583,function,"Create an instance of CursesUI based on a DebugDumpDir object. + filter_name: (str) name of the filter. Cannot be empty. + filter_callable: (callable) a filter function of the signature described + as above. + +Raises: + ValueError: If filter_name is an empty str. + TypeError: If filter_name is not a str. + Or if filter_callable is not callable." +1793,get_tensor_filter,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,460,method,"Retrieve filter function by name. + +Args: + filter_name: Name of the filter set during add_tensor_filter() call. + +Returns: + The callable associated with the filter name. + +Raises: + ValueError: If there is no tensor filter of the specified filter name." +1794,get_help,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,478,method, +1795,list_tensors,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,481,method,"Command handler for list_tensors. + +List tensors dumped during debugged Session.run() call. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object. + +Raises: + ValueError: If `--filter_exclude_node_names` is used without `-f` or + `--tensor_filter` being used." +1796,node_info,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,740,method,"Command handler for node_info. + +Query information about a given node. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1797,list_inputs,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,875,method,"Command handler for inputs. + +Show inputs to a given node. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1798,print_tensor,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,911,method,"Command handler for print_tensor. + +Print value of a given dumped tensor. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1799,list_outputs,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1053,method,"Command handler for inputs. + +Show inputs to a given node. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1800,evaluate_expression,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1089,method, +1801,print_source,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1112,method,Print the content of a source file. +1802,list_source,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1243,method,List Python source files that constructed nodes and tensors. +1803,create_analyzer_ui,tensorflow/tensorflow/python/debug/cli/analyzer_cli.py,1583,function,"Create an instance of CursesUI based on a DebugDumpDir object. Args: debug_dump: (debug_data.DebugDumpDir) The debug dump to use. @@ -10900,11 +12199,9 @@ Args: Returns: (base_ui.BaseUI) A BaseUI subtype object with a set of standard analyzer commands and tab-completions registered." -2226,_matmul_op_name,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,53,function, -2227,_cli_config_from_temp_file,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,57,function, -2228,no_rewrite_session_config,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,62,function, -2229,line_number_above,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,74,function, -2230,parse_op_and_node,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,78,function,"Parse a line containing an op node followed by a node name. +1804,no_rewrite_session_config,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,62,function, +1805,line_number_above,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,74,function, +1806,parse_op_and_node,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,78,function,"Parse a line containing an op node followed by a node name. For example, if the line is "" [Variable] hidden/weights"", @@ -10916,8 +12213,8 @@ Args: Returns: Name of the parsed op type. Name of the parsed node." -2231,assert_column_header_command_shortcut,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,102,function, -2232,assert_listed_tensors,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,116,function,"Check RichTextLines output for list_tensors commands. +1807,assert_column_header_command_shortcut,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,102,function, +1808,assert_listed_tensors,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,116,function,"Check RichTextLines output for list_tensors commands. Args: tst: A test_util.TensorFlowTestCase instance. @@ -10931,7 +12228,7 @@ Args: sort_by: (str) (timestamp | op_type | tensor_name) the field by which the tensors in the list are sorted. reverse: (bool) whether the sorting is in reverse (i.e., descending) order." -2233,assert_node_attribute_lines,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,261,function,"Check RichTextLines output for node_info commands. +1809,assert_node_attribute_lines,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,261,function,"Check RichTextLines output for node_info commands. Args: tst: A test_util.TensorFlowTestCase instance. @@ -10953,17 +12250,16 @@ Args: show_stack_trace: (bool) whether the stack trace of the node's construction is asserted to be present. stack_trace_available: (bool) whether Python stack trace is available." -2234,check_syntax_error_output,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,425,function,Check RichTextLines output for valid command prefix but invalid syntax. -2235,check_error_output,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,434,function,"Check RichTextLines output from invalid/erroneous commands. +1810,check_syntax_error_output,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,425,function,Check RichTextLines output for valid command prefix but invalid syntax. +1811,check_error_output,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,434,function,"Check RichTextLines output from invalid/erroneous commands. Args: tst: A test_util.TensorFlowTestCase instance. out: The RichTextLines object to be checked. command_prefix: The command prefix of the command that caused the error. args: The arguments (excluding prefix) of the command that caused the error." -2236,check_main_menu,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,450,function,Check the main menu annotation of an output. -2237,check_menu_item,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,497,function, -2238,create_analyzer_cli,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,514,function,"Create an analyzer CLI. +1812,check_menu_item,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,497,function, +1813,create_analyzer_cli,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,514,function,"Create an analyzer CLI. Args: dump: A `DebugDumpDir` object to base the analyzer CLI on. @@ -10972,14 +12268,73 @@ Returns: 1) A `DebugAnalyzer` object created based on `dump`. 2) A `CommandHandlerRegistry` that is based on the `DebugAnalyzer` object and has the common tfdbg commands, e.g., lt, ni, li, lo, registered." -2239,AnalyzerCLISimpleMulAddTest,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,577,class, -2240,AnalyzerCLIPrintLargeTensorTest,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,1638,class, -2241,AnalyzerCLIControlDepTest,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,1699,class, -2242,AnalyzerCLIWhileLoopTest,tensorflow/tensorflow/python/debug/cli/analyzer_cli_test.py,2027,class, -2243,BaseUI,tensorflow/tensorflow/python/debug/cli/base_ui.py,27,class,Base class of tfdbg user interface. -2244,CLIConfig,tensorflow/tensorflow/python/debug/cli/cli_config.py,30,class,Client-facing configurations for TFDBG command-line interfaces. -2245,CLIConfigTest,tensorflow/tensorflow/python/debug/cli/cli_config_test.py,31,class, -2246,bytes_to_readable_str,tensorflow/tensorflow/python/debug/cli/cli_shared.py,55,function,"Generate a human-readable string representing number of bytes. +1814,BaseUI,tensorflow/tensorflow/python/debug/cli/base_ui.py,27,class,Base class of tfdbg user interface. +1815,set_help_intro,tensorflow/tensorflow/python/debug/cli/base_ui.py,72,method,"Set an introductory message to the help output of the command registry. + +Args: + help_intro: (RichTextLines) Rich text lines appended to the beginning of + the output of the command ""help"", as introductory information." +1816,register_command_handler,tensorflow/tensorflow/python/debug/cli/base_ui.py,82,method,"A wrapper around CommandHandlerRegistry.register_command_handler(). + +In addition to calling the wrapped register_command_handler() method, this +method also registers the top-level tab-completion context based on the +command prefixes and their aliases. + +See the doc string of the wrapped method for more details on the args. + +Args: + prefix: (str) command prefix. + handler: (callable) command handler. + help_info: (str) help information. + prefix_aliases: (list of str) aliases of the command prefix." +1817,register_tab_comp_context,tensorflow/tensorflow/python/debug/cli/base_ui.py,109,method,Wrapper around TabCompletionRegistry.register_tab_comp_context(). +1818,run_ui,tensorflow/tensorflow/python/debug/cli/base_ui.py,114,method,"Run the UI until user- or command- triggered exit. + +Args: + init_command: (str) Optional command to run on CLI start up. + title: (str) Optional title to display in the CLI. + title_color: (str) Optional color of the title, e.g., ""yellow"". + enable_mouse_on_start: (bool) Whether the mouse mode is to be enabled on + start-up. + +Returns: + An exit token of arbitrary type. Can be None." +1819,config,tensorflow/tensorflow/python/debug/cli/base_ui.py,200,method,Obtain the CLIConfig of this `BaseUI` instance. +1820,CLIConfig,tensorflow/tensorflow/python/debug/cli/cli_config.py,30,class,Client-facing configurations for TFDBG command-line interfaces. +1821,get,tensorflow/tensorflow/python/debug/cli/cli_config.py,52,method, +1822,set,tensorflow/tensorflow/python/debug/cli/cli_config.py,57,method,"Set the value of a property. + +Supports limitd property value types: `bool`, `int` and `str`. + +Args: + property_name: Name of the property. + property_val: Value of the property. If the property has `bool` type and + this argument has `str` type, the `str` value will be parsed as a `bool` + +Raises: + ValueError: if a `str` property_value fails to be parsed as a `bool`. + KeyError: if `property_name` is an invalid property name." +1823,set_callback,tensorflow/tensorflow/python/debug/cli/cli_config.py,99,method,"Set a set-callback for given property. + +Args: + property_name: Name of the property. + callback: The callback as a `callable` of signature: + def cbk(config): + where config is the config after it is set to the new value. + The callback is invoked each time the set() method is called with the + matching property_name. + +Raises: + KeyError: If property_name does not exist. + TypeError: If `callback` is not callable." +1824,summarize,tensorflow/tensorflow/python/debug/cli/cli_config.py,130,method,"Get a text summary of the config. + +Args: + highlight: A property name to highlight in the output. + +Returns: + A `RichTextLines` output." +1825,bytes_to_readable_str,tensorflow/tensorflow/python/debug/cli/cli_shared.py,55,function,"Generate a human-readable string representing number of bytes. The units B, kB, MB and GB are used. @@ -10990,7 +12345,7 @@ Args: Returns: (`str`) A string representing the number of bytes in a human-readable way, including a unit at the end." -2247,time_to_readable_str,tensorflow/tensorflow/python/debug/cli/cli_shared.py,85,function,"Convert time value to human-readable string. +1826,time_to_readable_str,tensorflow/tensorflow/python/debug/cli/cli_shared.py,85,function,"Convert time value to human-readable string. Args: value_us: time value in microseconds. @@ -11002,7 +12357,7 @@ Returns: Raises: ValueError: if force_time_unit value is not in TIME_UNITS." -2248,parse_ranges_highlight,tensorflow/tensorflow/python/debug/cli/cli_shared.py,113,function,"Process ranges highlight string. +1827,parse_ranges_highlight,tensorflow/tensorflow/python/debug/cli/cli_shared.py,113,function,"Process ranges highlight string. Args: ranges_string: (str) A string representing a numerical range of a list of @@ -11012,8 +12367,8 @@ Args: Returns: An instance of tensor_format.HighlightOptions, if range_string is a valid representation of a range or a list of ranges." -2249,numpy_printoptions_from_screen_info,tensorflow/tensorflow/python/debug/cli/cli_shared.py,143,function, -2250,format_tensor,tensorflow/tensorflow/python/debug/cli/cli_shared.py,150,function,"Generate formatted str to represent a tensor or its slices. +1828,numpy_printoptions_from_screen_info,tensorflow/tensorflow/python/debug/cli/cli_shared.py,143,function, +1829,format_tensor,tensorflow/tensorflow/python/debug/cli/cli_shared.py,150,function,"Generate formatted str to represent a tensor or its slices. Args: tensor: (numpy ndarray) The tensor value. @@ -11038,7 +12393,7 @@ Args: Returns: An instance of `debugger_cli_common.RichTextLines` representing the (potentially sliced) tensor." -2251,error,tensorflow/tensorflow/python/debug/cli/cli_shared.py,218,function,"Generate a RichTextLines output for error. +1830,error,tensorflow/tensorflow/python/debug/cli/cli_shared.py,218,function,"Generate a RichTextLines output for error. Args: msg: (str) The error message. @@ -11046,20 +12401,8 @@ Args: Returns: (debugger_cli_common.RichTextLines) A representation of the error message for screen output." -2252,_recommend_command,tensorflow/tensorflow/python/debug/cli/cli_shared.py,233,function,"Generate a RichTextLines object that describes a recommended command. - -Args: - command: (str) The command to recommend. - description: (str) A description of what the command does. - indent: (int) How many spaces to indent in the beginning. - create_link: (bool) Whether a command link is to be applied to the command - string. - -Returns: - (RichTextLines) Formatted text (with font attributes) for recommending the - command." -2253,get_tfdbg_logo,tensorflow/tensorflow/python/debug/cli/cli_shared.py,261,function,Make an ASCII representation of the tfdbg logo. -2254,get_run_start_intro,tensorflow/tensorflow/python/debug/cli/cli_shared.py,279,function,"Generate formatted intro for run-start UI. +1831,get_tfdbg_logo,tensorflow/tensorflow/python/debug/cli/cli_shared.py,261,function,Make an ASCII representation of the tfdbg logo. +1832,get_run_start_intro,tensorflow/tensorflow/python/debug/cli/cli_shared.py,279,function,"Generate formatted intro for run-start UI. Args: run_call_count: (int) Run call counter. @@ -11074,7 +12417,7 @@ Args: Returns: (RichTextLines) Formatted intro message about the `Session.run()` call." -2255,get_run_short_description,tensorflow/tensorflow/python/debug/cli/cli_shared.py,386,function,"Get a short description of the run() call. +1833,get_run_short_description,tensorflow/tensorflow/python/debug/cli/cli_shared.py,386,function,"Get a short description of the run() call. Args: run_call_count: (int) Run call counter. @@ -11088,7 +12431,7 @@ Args: Returns: (str) A short description of the run() call, including information about the fetche(s) and feed(s)." -2256,get_error_intro,tensorflow/tensorflow/python/debug/cli/cli_shared.py,434,function,"Generate formatted intro for TensorFlow run-time error. +1834,get_error_intro,tensorflow/tensorflow/python/debug/cli/cli_shared.py,434,function,"Generate formatted intro for TensorFlow run-time error. Args: tf_error: (errors.OpError) TensorFlow run-time error object. @@ -11096,18 +12439,14 @@ Args: Returns: (RichTextLines) Formatted intro message about the run-time OpError, with sample commands for debugging." -2257,BytesToReadableStrTest,tensorflow/tensorflow/python/debug/cli/cli_shared_test.py,33,class, -2258,TimeToReadableStrTest,tensorflow/tensorflow/python/debug/cli/cli_shared_test.py,73,class, -2259,GetRunStartIntroAndDescriptionTest,tensorflow/tensorflow/python/debug/cli/cli_shared_test.py,109,class, -2260,GetErrorIntroTest,tensorflow/tensorflow/python/debug/cli/cli_shared_test.py,323,class, -2261,assert_lines_equal_ignoring_whitespace,tensorflow/tensorflow/python/debug/cli/cli_test_utils.py,25,function,"Assert equality in lines, ignoring all whitespace. +1835,assert_lines_equal_ignoring_whitespace,tensorflow/tensorflow/python/debug/cli/cli_test_utils.py,25,function,"Assert equality in lines, ignoring all whitespace. Args: test: An instance of unittest.TestCase or its subtypes (e.g., TensorFlowTestCase). expected_lines: Expected lines as an iterable of strings. actual_lines: Actual lines as an iterable of strings." -2262,assert_array_lines_close,tensorflow/tensorflow/python/debug/cli/cli_test_utils.py,48,function,"Assert that the array value represented by lines is close to expected. +1836,assert_array_lines_close,tensorflow/tensorflow/python/debug/cli/cli_test_utils.py,48,function,"Assert that the array value represented by lines is close to expected. Note that the shape of the array represented by the `array_lines` is ignored. @@ -11118,8 +12457,9 @@ Args: E.g., ""array([[ 1.0, 2.0 ], [ 3.0, 4.0 ]])"" Assumes that values are separated by commas, parentheses, brackets, ""|"" characters and whitespace." -2263,Interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,33,class,Represents an interval between a start and end value. -2264,parse_command,tensorflow/tensorflow/python/debug/cli/command_parser.py,56,function,"Parse command string into a list of arguments. +1837,Interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,33,class,Represents an interval between a start and end value. +1838,contains,tensorflow/tensorflow/python/debug/cli/command_parser.py,42,method, +1839,parse_command,tensorflow/tensorflow/python/debug/cli/command_parser.py,56,function,"Parse command string into a list of arguments. - Disregards whitespace inside double quotes and brackets. - Strips paired leading and trailing double quotes in arguments. @@ -11132,7 +12472,7 @@ Args: Returns: (list of str) List of arguments." -2265,extract_output_file_path,tensorflow/tensorflow/python/debug/cli/command_parser.py,104,function,"Extract output file path from command arguments. +1840,extract_output_file_path,tensorflow/tensorflow/python/debug/cli/command_parser.py,104,function,"Extract output file path from command arguments. Args: args: (list of str) command arguments. @@ -11143,7 +12483,7 @@ Returns: Raises: SyntaxError: If there is no file path after the last "">"" character." -2266,parse_tensor_name_with_slicing,tensorflow/tensorflow/python/debug/cli/command_parser.py,151,function,"Parse tensor name, potentially suffixed by slicing string. +1841,parse_tensor_name_with_slicing,tensorflow/tensorflow/python/debug/cli/command_parser.py,151,function,"Parse tensor name, potentially suffixed by slicing string. Args: in_str: (str) Input name of the tensor, potentially followed by a slicing @@ -11153,7 +12493,7 @@ Args: Returns: (str) name of the tensor (str) slicing string, if any. If no slicing string is present, return """"." -2267,validate_slicing_string,tensorflow/tensorflow/python/debug/cli/command_parser.py,174,function,"Validate a slicing string. +1842,validate_slicing_string,tensorflow/tensorflow/python/debug/cli/command_parser.py,174,function,"Validate a slicing string. Check if the input string contains only brackets, digits, commas and colons that are valid characters in numpy-style array slicing. @@ -11163,19 +12503,7 @@ Args: Returns: (bool) True if and only if the slicing string is valid." -2268,_parse_slices,tensorflow/tensorflow/python/debug/cli/command_parser.py,190,function,"Construct a tuple of slices from the slicing string. - -The string must be a valid slicing string. - -Args: - slicing_string: (str) Input slicing string to be parsed. - -Returns: - tuple(slice1, slice2, ...) - -Raises: - ValueError: If tensor_slicing is not a valid numpy ndarray slicing str." -2269,parse_indices,tensorflow/tensorflow/python/debug/cli/command_parser.py,219,function,"Parse a string representing indices. +1843,parse_indices,tensorflow/tensorflow/python/debug/cli/command_parser.py,219,function,"Parse a string representing indices. For example, if the input is ""[1, 2, 3]"", the return value will be a list of indices: [1, 2, 3] @@ -11186,7 +12514,7 @@ Args: Returns: (list of int): Parsed indices." -2270,parse_ranges,tensorflow/tensorflow/python/debug/cli/command_parser.py,243,function,"Parse a string representing numerical range(s). +1844,parse_ranges,tensorflow/tensorflow/python/debug/cli/command_parser.py,243,function,"Parse a string representing numerical range(s). Args: range_string: (str) A string representing a numerical range or a list of @@ -11199,7 +12527,7 @@ Returns: Raises: ValueError: If the input doesn't represent a range or a list of ranges." -2271,parse_memory_interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,284,function,"Convert a human-readable memory interval to a tuple of start and end value. +1845,parse_memory_interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,284,function,"Convert a human-readable memory interval to a tuple of start and end value. Args: interval_str: (`str`) A human-readable str representing an interval @@ -11212,7 +12540,7 @@ Returns: Raises: ValueError: if the input is not valid." -2272,parse_time_interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,314,function,"Convert a human-readable time interval to a tuple of start and end value. +1846,parse_time_interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,314,function,"Convert a human-readable time interval to a tuple of start and end value. Args: interval_str: (`str`) A human-readable str representing an interval @@ -11224,21 +12552,7 @@ Returns: Raises: ValueError: if the input is not valid." -2273,_parse_interval,tensorflow/tensorflow/python/debug/cli/command_parser.py,343,function,"Convert a human-readable interval to a tuple of start and end value. - -Args: - interval_str: (`str`) A human-readable str representing an interval - (e.g., ""[1M, 2M]"", ""<100k"", "">100ms""). The items following the "">"", ""<"", - "">="" and ""<="" signs have to start with a number (e.g., 3.0, -2, .98). - The same requirement applies to the items in the parentheses or brackets. - -Returns: - Interval object where start or end can be None - if the range is specified as ""N"" respectively. - -Raises: - ValueError: if the input is not valid." -2274,parse_readable_size_str,tensorflow/tensorflow/python/debug/cli/command_parser.py,409,function,"Convert a human-readable str representation to number of bytes. +1847,parse_readable_size_str,tensorflow/tensorflow/python/debug/cli/command_parser.py,409,function,"Convert a human-readable str representation to number of bytes. Only the units ""kB"", ""MB"", ""GB"" are supported. The ""B character at the end of the input `str` may be omitted. @@ -11252,7 +12566,7 @@ Returns: Raises: ValueError: on failure to parse the input `size_str`." -2275,parse_readable_time_str,tensorflow/tensorflow/python/debug/cli/command_parser.py,443,function,"Parses a time string in the format N, Nus, Nms, Ns. +1848,parse_readable_time_str,tensorflow/tensorflow/python/debug/cli/command_parser.py,443,function,"Parses a time string in the format N, Nus, Nms, Ns. Args: time_str: (`str`) string consisting of an integer time value optionally @@ -11261,7 +12575,7 @@ Args: Returns: Microseconds value." -2276,evaluate_tensor_slice,tensorflow/tensorflow/python/debug/cli/command_parser.py,471,function,"Call eval on the slicing of a tensor, with validation. +1849,evaluate_tensor_slice,tensorflow/tensorflow/python/debug/cli/command_parser.py,471,function,"Call eval on the slicing of a tensor, with validation. Args: tensor: (numpy ndarray) The tensor value. @@ -11273,7 +12587,7 @@ Returns: Raises: ValueError: If tensor_slicing is not a valid numpy ndarray slicing str." -2277,get_print_tensor_argparser,tensorflow/tensorflow/python/debug/cli/command_parser.py,494,function,"Get an ArgumentParser for a command that prints tensor values. +1850,get_print_tensor_argparser,tensorflow/tensorflow/python/debug/cli/command_parser.py,494,function,"Get an ArgumentParser for a command that prints tensor values. Examples of such commands include print_tensor and print_feed. @@ -11282,25 +12596,8 @@ Args: Returns: An instance of argparse.ArgumentParser." -2278,ParseCommandTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,27,class, -2279,ExtractOutputFilePathTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,104,class, -2280,ParseTensorNameTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,208,class, -2281,ValidateSlicingStringTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,227,class, -2282,ParseIndicesTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,243,class, -2283,ParseRangesTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,272,class, -2284,ParseReadableSizeStrTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,316,class, -2285,ParseReadableTimeStrTest,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,362,class, -2286,ParseInterval,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,391,class, -2287,_get_command_from_line_attr_segs,tensorflow/tensorflow/python/debug/cli/curses_ui.py,51,function,"Attempt to extract command from the attribute segments of a line. - -Args: - mouse_x: (int) x coordinate of the mouse event. - attr_segs: (list) The list of attribute segments of a line from a - RichTextLines object. - -Returns: - (str or None) If a command exists: the command as a str; otherwise, None." -2288,ScrollBar,tensorflow/tensorflow/python/debug/cli/curses_ui.py,71,class,"Vertical ScrollBar for Curses-based CLI. +1851,ParseInterval,tensorflow/tensorflow/python/debug/cli/command_parser_test.py,391,class, +1852,ScrollBar,tensorflow/tensorflow/python/debug/cli/curses_ui.py,71,class,"Vertical ScrollBar for Curses-based CLI. An object of this class has knowledge of the location of the scroll bar in the screen coordinates, the current scrolling position, and the total @@ -11311,27 +12608,89 @@ block in between, whose exact location is determined by the scrolling position. The object can also calculate the scrolling command (e.g., _SCROLL_UP_A_LINE, _SCROLL_DOWN) from the coordinate of a mouse click event in the screen region it occupies." -2289,CursesUI,tensorflow/tensorflow/python/debug/cli/curses_ui.py,209,class,"Curses-based Command-line UI. +1853,layout,tensorflow/tensorflow/python/debug/cli/curses_ui.py,154,method,"Get the RichTextLines layout of the scroll bar. + +Returns: + (debugger_cli_common.RichTextLines) The text layout of the scroll bar." +1854,get_click_command,tensorflow/tensorflow/python/debug/cli/curses_ui.py,192,method, +1855,CursesUI,tensorflow/tensorflow/python/debug/cli/curses_ui.py,209,class,"Curses-based Command-line UI. In this class, the methods with the prefix ""_screen_"" are the methods that interact with the actual terminal using the curses library." -2290,string_to_codes,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,39,function, -2291,codes_to_string,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,43,function, -2292,MockCursesUI,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,48,class,Mock subclass of CursesUI that bypasses actual terminal manipulations. -2293,CursesTest,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,235,class, -2294,ScrollBarTest,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,1532,class, -2295,NavigationHistoryItem,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,26,class,Individual item in navigation history. -2296,CursesNavigationHistory,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,42,class,"Navigation history containing commands, outputs and scroll info." -2297,CNHTest,tensorflow/tensorflow/python/debug/cli/curses_widgets_test.py,29,class, -2298,CommandLineExit,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,41,class, -2299,RichLine,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,52,class,"Rich single-line text. +1856,run_ui,tensorflow/tensorflow/python/debug/cli/curses_ui.py,487,method,Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details. +1857,get_help,tensorflow/tensorflow/python/debug/cli/curses_ui.py,520,method, +1858,string_to_codes,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,39,function, +1859,codes_to_string,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,43,function, +1860,MockCursesUI,tensorflow/tensorflow/python/debug/cli/curses_ui_test.py,48,class,Mock subclass of CursesUI that bypasses actual terminal manipulations. +1861,NavigationHistoryItem,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,26,class,Individual item in navigation history. +1862,CursesNavigationHistory,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,42,class,"Navigation history containing commands, outputs and scroll info." +1863,add_item,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,66,method,"Add an item to the navigation histoyr. + +Args: + command: command line text. + screen_output: screen output produced for the command. + scroll_position: (`int`) scroll position in the screen output." +1864,update_scroll_position,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,82,method,"Update the scroll position of the currently-pointed-to history item. + +Args: + new_scroll_position: (`int`) new scroll-position value. + +Raises: + ValueError: If the history is empty." +1865,size,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,95,method, +1866,pointer,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,98,method, +1867,go_back,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,101,method,"Go back one place in the history, if possible. + +Decrease the pointer value by 1, if possible. Otherwise, the pointer value +will be unchanged. + +Returns: + The updated pointer value. + +Raises: + ValueError: If history is empty." +1868,go_forward,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,120,method,"Go forward one place in the history, if possible. + +Increase the pointer value by 1, if possible. Otherwise, the pointer value +will be unchanged. + +Returns: + The updated pointer value. + +Raises: + ValueError: If history is empty." +1869,can_go_back,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,139,method,"Test whether client can go back one place. + +Returns: + (`bool`) Whether going back one place is possible." +1870,can_go_forward,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,147,method,"Test whether client can go forward one place. + +Returns: + (`bool`) Whether going back one place is possible." +1871,render,tensorflow/tensorflow/python/debug/cli/curses_widgets.py,155,method,"Render the rich text content of the single-line navigation bar. + +Args: + max_length: (`int`) Maximum length of the navigation bar, in characters. + backward_command: (`str`) command for going backward. Used to construct + the shortcut menu item. + forward_command: (`str`) command for going forward. Used to construct the + shortcut menu item. + latest_command_attribute: font attribute for lastest command. + old_command_attribute: font attribute for old (non-latest) command. + +Returns: + (`debugger_cli_common.RichTextLines`) the navigation bar text with + attributes." +1872,CommandLineExit,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,41,class, +1873,exit_token,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,48,method, +1874,RichLine,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,52,class,"Rich single-line text. Attributes: text: A plain string, the raw text represented by this object. Should not contain newlines. font_attr_segs: A list of (start, end, font attribute) triples, representing richness information applied to substrings of text." -2300,rich_text_lines_from_rich_line_list,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,113,function,"Convert a list of RichLine objects or strings to a RichTextLines object. +1875,rich_text_lines_from_rich_line_list,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,113,function,"Convert a list of RichLine objects or strings to a RichTextLines object. Args: rich_text_list: a list of RichLine objects or strings @@ -11339,7 +12698,7 @@ Args: Returns: A corresponding RichTextLines object." -2301,get_tensorflow_version_lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,135,function,"Generate RichTextLines with TensorFlow version info. +1876,get_tensorflow_version_lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,135,function,"Generate RichTextLines with TensorFlow version info. Args: include_dependency_versions: Include the version of TensorFlow's key @@ -11347,7 +12706,7 @@ Args: Returns: A formatted, multi-line `RichTextLines` object." -2302,RichTextLines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,154,class,"Rich multi-line text. +1877,RichTextLines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,154,class,"Rich multi-line text. Line-by-line text output, with font attributes (e.g., color) and annotations (e.g., indices in a multi-dimensional tensor). Used as the text output of CLI @@ -11355,7 +12714,55 @@ commands. Can be rendered on terminal environments such as curses. This is not to be confused with Rich Text Format (RTF). This class is for text lines only." -2303,regex_find,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,381,function,"Perform regex match in rich text lines. +1878,lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,216,method, +1879,font_attr_segs,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,220,method, +1880,annotations,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,224,method, +1881,num_lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,227,method, +1882,slice,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,230,method,"Slice a RichTextLines object. + +The object itself is not changed. A sliced instance is returned. + +Args: + begin: (int) Beginning line index (inclusive). Must be >= 0. + end: (int) Ending line index (exclusive). Must be >= 0. + +Returns: + (RichTextLines) Sliced output instance of RichTextLines. + +Raises: + ValueError: If begin or end is negative." +1883,extend,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,270,method,"Extend this instance of RichTextLines with another instance. + +The extension takes effect on the text lines, the font attribute segments, +as well as the annotations. The line indices in the font attribute +segments and the annotations are adjusted to account for the existing +lines. If there are duplicate, non-line-index fields in the annotations, +the value from the input argument ""other"" will override that in this +instance. + +Args: + other: (RichTextLines) The other RichTextLines instance to be appended at + the end of this instance." +1884,append,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,334,method,"Append a single line of text. + +Args: + line: (str) The text to be added to the end. + font_attr_segs: (list of tuples) Font attribute segments of the appended + line." +1885,append_rich_line,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,347,method, +1886,prepend,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,350,method,"Prepend (i.e., add to the front) a single line of text. + +Args: + line: (str) The text to be added to the front. + font_attr_segs: (list of tuples) Font attribute segments of the appended + line." +1887,write_to_file,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,364,method,"Write the object itself to file, in a plain format. + +The font_attr_segs and annotations are ignored. + +Args: + file_path: (str) path of the file to write to." +1888,regex_find,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,381,function,"Perform regex match in rich text lines. Produces a new RichTextLines object with font_attr_segs containing highlighted regex matches. @@ -11375,7 +12782,7 @@ Returns: Raises: ValueError: If input str regex is not a valid regular expression." -2304,wrap_rich_text_lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,434,function,"Wrap RichTextLines according to maximum number of columns. +1889,wrap_rich_text_lines,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,434,function,"Wrap RichTextLines according to maximum number of columns. Produces a new RichTextLines object with the text lines, font_attr_segs and annotations properly wrapped. This ought to be used sparingly, as in most @@ -11394,7 +12801,7 @@ Returns: wrapped into two lines, this return value will be: [0, 1, 3]. Raises: ValueError: If inputs have invalid types." -2305,CommandHandlerRegistry,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,530,class,"Registry of command handlers for CLI. +1890,CommandHandlerRegistry,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,530,class,"Registry of command handlers for CLI. Handler methods (callables) for user commands can be registered with this class, which then is able to dispatch commands to the correct handlers and @@ -11417,85 +12824,269 @@ or with the prefix alias: registry.dispatch_command(""e"", [""foo"", ""bar""], screen_info={""cols"": 80}) The call will return a RichTextLines object which can be rendered by a CLI." -2306,TabCompletionRegistry,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,846,class,Registry for tab completion responses. -2307,CommandHistory,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1004,class,Keeps command history and supports lookup. -2308,MenuItem,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1110,class,A class for an item in a text-based menu. -2309,Menu,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1151,class,A class for text-based menu. -2310,CommandLineExitTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,33,class, -2311,RichTextLinesTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,47,class, -2312,CommandHandlerRegistryTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,285,class, -2313,RegexFindTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,590,class, -2314,WrapScreenOutputTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,652,class, -2315,SliceRichTextLinesTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,774,class, -2316,TabCompletionRegistryTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,820,class, -2317,CommandHistoryTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,930,class, -2318,MenuNodeTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,1065,class, -2319,MenuTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,1091,class, -2320,GetTensorFlowVersionLinesTest,tensorflow/tensorflow/python/debug/cli/debugger_cli_common_test.py,1158,class, -2321,_parse_debug_tensor_name,tensorflow/tensorflow/python/debug/cli/evaluator.py,34,function,"Parse a debug tensor name in a to-be-evaluated expression. +1891,register_command_handler,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,591,method,"Register a callable as a command handler. Args: - debug_tensor_name: name of the debug tensor, with or without - device name as a prefix, with or without debug op, with or - without '[]' as a suffix. - E.g., without device name prefix, without debug op suffix: - ""hidden_0/MatMul:0"" - E.g., with device name prefix: - ""/job:worker/replica:0/task:1/gpu:0:hidden_0/MatMul:0"" - E.g., with debug op suffix: - ""hidden_0/MatMul:0:DebugNumericSummary"" - E.g., with device name prefix and debug op suffix: - ""/job:worker/replica:0/task:1/gpu:0:hidden_0/MatMul:0:DebugNumericSummary"" - E.g., with device name prefix, debug op and an exec index: - ""/job:worker/replica:0/task:1/gpu:0:hidden_0/MatMul:0:DebugNumericSummary[1]"" + prefix: Command prefix, i.e., the first word in a command, e.g., + ""print"" as in ""print tensor_1"". + handler: A callable of the following signature: + foo_handler(argv, screen_info=None), + where argv is the argument vector (excluding the command prefix) and + screen_info is a dictionary containing information about the screen, + such as number of columns, e.g., {""cols"": 100}. + The callable should return: + 1) a RichTextLines object representing the screen output. -Returns: - device_name: If device name prefix exists, the device name; otherwise, - `None`. - node_name: Name of the node. - output_slot: Output slot index as an `int`. - debug_op: If the debug op suffix exists, the debug op name; otherwise, - `None`. - exec_index: Execution index (applicable to cases in which a debug tensor - is computed multiple times in a `tf.Session.run` call, e.g., due to - `tf.while_loop`). If the exec_index suffix does not exist, this value - defaults to `0`. + The callable can also raise an exception of the type CommandLineExit, + which if caught by the command-line interface, will lead to its exit. + The exception can optionally carry an exit token of arbitrary type. + help_info: A help string. + prefix_aliases: Aliases for the command prefix, as a list of str. E.g., + shorthands for the command prefix: [""p"", ""pr""] Raises: - ValueError: If the input `debug_tensor_name` is malformed." -2322,ExpressionEvaluator,tensorflow/tensorflow/python/debug/cli/evaluator.py,106,class,Evaluates Python expressions using debug tensor values from a dump. -2323,ParseDebugTensorNameTest,tensorflow/tensorflow/python/debug/cli/evaluator_test.py,28,class, -2324,EvaluatorTest,tensorflow/tensorflow/python/debug/cli/evaluator_test.py,145,class, -2325,main,tensorflow/tensorflow/python/debug/cli/offline_analyzer.py,30,function, -2326,ProfileDataTableView,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,48,class,Table View of profiling data. -2327,_list_profile_filter,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,146,function,"Filter function for list_profile command. + ValueError: If + 1) the prefix is empty, or + 2) handler is not callable, or + 3) a handler is already registered for the prefix, or + 4) elements in prefix_aliases clash with existing aliases. + 5) help_info is not a str." +1892,dispatch_command,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,657,method,"Handles a command by dispatching it to a registered command handler. Args: - profile_datum: A `ProfileDatum` object. - node_name_regex: Regular expression pattern object to filter by name. - file_path_regex: Regular expression pattern object to filter by file path. - op_type_regex: Regular expression pattern object to filter by op type. - op_time_interval: `Interval` for filtering op time. - exec_time_interval: `Interval` for filtering exec time. - min_lineno: Lower bound for 1-based line number, inclusive. - If <= 0, has no effect. - max_lineno: Upper bound for 1-based line number, exclusive. - If <= 0, has no effect. - # TODO(cais): Maybe filter by function name. + prefix: Command prefix, as a str, e.g., ""print"". + argv: Command argument vector, excluding the command prefix, represented + as a list of str, e.g., + [""tensor_1""] + screen_info: A dictionary containing screen info, e.g., {""cols"": 100}. Returns: - True iff profile_datum should be included." -2328,_list_profile_sort_key,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,198,function,"Get a profile_datum property to sort by in list_profile command. + An instance of RichTextLines or None. If any exception is caught during + the invocation of the command handler, the RichTextLines will wrap the + error type and message. + +Raises: + ValueError: If + 1) prefix is empty, or + 2) no command handler is registered for the command prefix, or + 3) the handler is found for the prefix, but it fails to return a + RichTextLines or raise any exception. + CommandLineExit: + If the command handler raises this type of exception, this method will + simply pass it along." +1893,is_registered,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,718,method,"Test if a command prefix or its alias is has a registered handler. Args: - profile_datum: A `ProfileDatum` object. - sort_by: (string) indicates a value to sort by. - Must be one of SORT_BY* constants. + prefix: A prefix or its alias, as a str. Returns: - profile_datum property to sort by." -2329,ProfileAnalyzer,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,223,class,Analyzer for profiling data. -2330,create_profiler_ui,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,768,function,"Create an instance of CursesUI based on a `tf.Graph` and `RunMetadata`. + True iff a handler is registered for prefix." +1894,get_help,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,729,method,"Compile help information into a RichTextLines object. + +Args: + cmd_prefix: Optional command prefix. As the prefix itself or one of its + aliases. + +Returns: + A RichTextLines object containing the help information. If cmd_prefix + is None, the return value will be the full command-line help. Otherwise, + it will be the help information for the specified command." +1895,set_help_intro,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,759,method,"Set an introductory message to help output. + +Args: + help_intro: (RichTextLines) Rich text lines appended to the + beginning of the output of the command ""help"", as introductory + information." +1896,TabCompletionRegistry,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,846,class,Registry for tab completion responses. +1897,register_tab_comp_context,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,855,method,"Register a tab-completion context. + +Register that, for each word in context_words, the potential tab-completions +are the words in comp_items. + +A context word is a pre-existing, completed word in the command line that +determines how tab-completion works for another, incomplete word in the same +command line. +Completion items consist of potential candidates for the incomplete word. + +To give a general example, a context word can be ""drink"", and the completion +items can be [""coffee"", ""tea"", ""water""] + +Note: A context word can be empty, in which case the context is for the + top-level commands. + +Args: + context_words: A list of context words belonging to the context being + registered. It is a list of str, instead of a single string, to support + synonym words triggering the same tab-completion context, e.g., + both ""drink"" and the short-hand ""dr"" can trigger the same context. + comp_items: A list of completion items, as a list of str. + +Raises: + TypeError: if the input arguments are not all of the correct types." +1898,deregister_context,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,898,method,"Deregister a list of context words. + +Args: + context_words: A list of context words to deregister, as a list of str. + +Raises: + KeyError: if there are word(s) in context_words that do not correspond + to any registered contexts." +1899,extend_comp_items,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,917,method,"Add a list of completion items to a completion context. + +Args: + context_word: A single completion word as a string. The extension will + also apply to all other context words of the same context. + new_comp_items: (list of str) New completion items to add. + +Raises: + KeyError: if the context word has not been registered." +1900,remove_comp_items,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,936,method,"Remove a list of completion items from a completion context. + +Args: + context_word: A single completion word as a string. The removal will + also apply to all other context words of the same context. + comp_items: Completion items to remove. + +Raises: + KeyError: if the context word has not been registered." +1901,get_completions,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,955,method,"Get the tab completions given a context word and a prefix. + +Args: + context_word: The context word. + prefix: The prefix of the incomplete word. + +Returns: + (1) None if no registered context matches the context_word. + A list of str for the matching completion items. Can be an empty list + of a matching context exists, but no completion item matches the + prefix. + (2) Common prefix of all the words in the first return value. If the + first return value is None, this return value will be None, too. If + the first return value is not None, i.e., a list, this return value + will be a str, which can be an empty str if there is no common + prefix among the items of the list." +1902,CommandHistory,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1004,class,Keeps command history and supports lookup. +1903,add_command,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1053,method,"Add a command to the command history. + +Args: + command: The history command, as a str. + +Raises: + TypeError: if command is not a str." +1904,most_recent_n,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1077,method,"Look up the n most recent commands. + +Args: + n: Number of most recent commands to look up. + +Returns: + A list of n most recent commands, or all available most recent commands, + if n exceeds size of the command history, in chronological order." +1905,lookup_prefix,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1090,method,"Look up the n most recent commands that starts with prefix. + +Args: + prefix: The prefix to lookup. + n: Number of most recent commands to look up. + +Returns: + A list of n most recent commands that have the specified prefix, or all + available most recent commands that have the prefix, if n exceeds the + number of history commands with the prefix." +1906,MenuItem,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1110,class,A class for an item in a text-based menu. +1907,caption,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1130,method, +1908,type,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1134,method, +1909,content,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1138,method, +1910,is_enabled,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1141,method, +1911,disable,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1144,method, +1912,enable,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1147,method, +1913,Menu,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1151,class,A class for text-based menu. +1914,append,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1164,method,"Append an item to the Menu. + +Args: + item: (MenuItem) the item to be appended." +1915,insert,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1172,method, +1916,num_items,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1175,method, +1917,captions,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1178,method, +1918,caption_to_item,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1181,method,"Get a MenuItem from the caption. + +Args: + caption: (str) The caption to look up. + +Returns: + (MenuItem) The first-match menu item with the caption, if any. + +Raises: + LookupError: If a menu item with the caption does not exist." +1919,format_as_single_line,tensorflow/tensorflow/python/debug/cli/debugger_cli_common.py,1201,method,"Format the menu as a single-line RichTextLines object. + +Args: + prefix: (str) String added to the beginning of the line. + divider: (str) The dividing string between the menu items. + enabled_item_attrs: (list or str) Attributes applied to each enabled + menu item, e.g., [""bold"", ""underline""]. + disabled_item_attrs: (list or str) Attributes applied to each + disabled menu item, e.g., [""red""]. + +Returns: + (RichTextLines) A single-line output representing the menu, with + font_attr_segs marking the individual menu items." +1920,ExpressionEvaluator,tensorflow/tensorflow/python/debug/cli/evaluator.py,106,class,Evaluates Python expressions using debug tensor values from a dump. +1921,evaluate,tensorflow/tensorflow/python/debug/cli/evaluator.py,118,method,"Parse an expression. + +Args: + expression: the expression to be parsed. + +Returns: + The result of the evaluation. + +Raises: + ValueError: If the value of one or more of the debug tensors in the + expression are not available." +1922,ProfileDataTableView,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,48,class,Table View of profiling data. +1923,value,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,81,method,"Get the content of a cell of the table. + +Args: + row: (int) row index. + col: (int) column index. + device_name_filter: Regular expression to filter by device name. + node_name_filter: Regular expression to filter by node name. + op_type_filter: Regular expression to filter by op type. + +Returns: + A debuggre_cli_common.RichLine object representing the content of the + cell, potentially with a clickable MenuItem. + +Raises: + IndexError: if row index is out of range." +1924,row_count,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,133,method, +1925,column_count,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,136,method, +1926,column_names,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,139,method, +1927,column_sort_id,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,142,method, +1928,ProfileAnalyzer,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,223,class,Analyzer for profiling data. +1929,list_profile,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,382,method,"Command handler for list_profile. + +List per-operation profile information. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1930,print_source,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,601,method,"Print a Python source file with line-level profile information. + +Args: + args: Command-line arguments, excluding the command prefix, as a list of + str. + screen_info: Optional dict input containing screen information such as + cols. + +Returns: + Output text lines as a RichTextLines object." +1931,get_help,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,764,method, +1932,profile_data_generator,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,463,method, +1933,create_profiler_ui,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli.py,768,function,"Create an instance of CursesUI based on a `tf.Graph` and `RunMetadata`. Args: graph: Python `Graph` object. @@ -11507,18 +13098,12 @@ Args: Returns: (base_ui.BaseUI) A BaseUI subtype object with a set of standard analyzer commands and tab-completions registered." -2331,no_rewrite_session_config,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,39,function, -2332,_line_number_above,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,47,function, -2333,_at_least_one_line_matches,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,51,function, -2334,_assert_at_least_one_line_matches,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,59,function, -2335,_assert_no_lines_match,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,66,function, -2336,ProfileAnalyzerListProfileTest,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,74,class, -2337,ProfileAnalyzerPrintSourceTest,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,326,class, -2338,ReadlineUI,tensorflow/tensorflow/python/debug/cli/readline_ui.py,28,class,Readline-based Command-line UI. -2339,MockReadlineUI,tensorflow/tensorflow/python/debug/cli/readline_ui_test.py,34,class,Test subclass of ReadlineUI that bypasses terminal manipulations. -2340,CursesTest,tensorflow/tensorflow/python/debug/cli/readline_ui_test.py,56,class, -2341,HighlightOptions,tensorflow/tensorflow/python/debug/cli/tensor_format.py,40,class,Options for highlighting elements of a tensor. -2342,format_tensor,tensorflow/tensorflow/python/debug/cli/tensor_format.py,72,function,"Generate a RichTextLines object showing a tensor in formatted style. +1934,no_rewrite_session_config,tensorflow/tensorflow/python/debug/cli/profile_analyzer_cli_test.py,39,function, +1935,ReadlineUI,tensorflow/tensorflow/python/debug/cli/readline_ui.py,28,class,Readline-based Command-line UI. +1936,run_ui,tensorflow/tensorflow/python/debug/cli/readline_ui.py,53,method,Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details. +1937,MockReadlineUI,tensorflow/tensorflow/python/debug/cli/readline_ui_test.py,34,class,Test subclass of ReadlineUI that bypasses terminal manipulations. +1938,HighlightOptions,tensorflow/tensorflow/python/debug/cli/tensor_format.py,40,class,Options for highlighting elements of a tensor. +1939,format_tensor,tensorflow/tensorflow/python/debug/cli/tensor_format.py,72,function,"Generate a RichTextLines object showing a tensor in formatted style. Args: tensor: The tensor to be displayed, as a numpy ndarray or other @@ -11541,34 +13126,7 @@ Returns: A RichTextLines object. Its annotation field has line-by-line markups to indicate which indices in the array the first element of each line corresponds to." -2343,_annotate_ndarray_lines,tensorflow/tensorflow/python/debug/cli/tensor_format.py,202,function,"Generate annotations for line-by-line begin indices of tensor text. - -Parse the numpy-generated text representation of a numpy ndarray to -determine the indices of the first element of each text line (if any -element is present in the line). - -For example, given the following multi-line ndarray text representation: - [""array([[ 0. , 0.0625, 0.125 , 0.1875],"", - "" [ 0.25 , 0.3125, 0.375 , 0.4375],"", - "" [ 0.5 , 0.5625, 0.625 , 0.6875],"", - "" [ 0.75 , 0.8125, 0.875 , 0.9375]])""] -the generate annotation will be: - {0: {BEGIN_INDICES_KEY: [0, 0]}, - 1: {BEGIN_INDICES_KEY: [1, 0]}, - 2: {BEGIN_INDICES_KEY: [2, 0]}, - 3: {BEGIN_INDICES_KEY: [3, 0]}} - -Args: - array_lines: Text lines representing the tensor, as a list of str. - tensor: The tensor being formatted as string. - np_printoptions: A dictionary of keyword arguments that are passed to a - call of np.set_printoptions(). - offset: Line number offset applied to the line indices in the returned - annotation. - -Returns: - An annotation as a dict." -2344,locate_tensor_element,tensorflow/tensorflow/python/debug/cli/tensor_format.py,282,function,"Locate a tensor element in formatted text lines, given element indices. +1940,locate_tensor_element,tensorflow/tensorflow/python/debug/cli/tensor_format.py,282,function,"Locate a tensor element in formatted text lines, given element indices. Given a RichTextLines object representing a tensor and indices of the sought element, return the row number at which the element is located (if exists). @@ -11604,26 +13162,7 @@ Raises: 3) Indices contain negative value(s). 4) If in batch mode, and if not all sets of indices are in ascending order." -2345,_validate_indices_list,tensorflow/tensorflow/python/debug/cli/tensor_format.py,406,function, -2346,_locate_elements_in_line,tensorflow/tensorflow/python/debug/cli/tensor_format.py,429,function,"Determine the start and end indices of an element in a line. - -Args: - line: (str) the line in which the element is to be sought. - indices_list: (list of list of int) list of indices of the element to - search for. Assumes that the indices in the batch are unique and sorted - in ascending order. - ref_indices: (list of int) reference indices, i.e., the indices of the - first element represented in the line. - -Returns: - start_columns: (list of int) start column indices, if found. If not found, - None. - end_columns: (list of int) end column indices, if found. If not found, - None. - If found, the element is represented in the left-closed-right-open interval - [start_column, end_column]." -2347,_pad_string_to_length,tensorflow/tensorflow/python/debug/cli/tensor_format.py,484,function, -2348,numeric_summary,tensorflow/tensorflow/python/debug/cli/tensor_format.py,488,function,"Get a text summary of a numeric tensor. +1941,numeric_summary,tensorflow/tensorflow/python/debug/cli/tensor_format.py,488,function,"Get a text summary of a numeric tensor. This summary is only available for numeric (int*, float*, complex*) and Boolean tensors. @@ -11635,9 +13174,7 @@ Returns: The summary text as a `RichTextLines` object. If the type of `tensor` is not numeric or Boolean, a single-line `RichTextLines` object containing a warning message will reflect that." -2349,RichTextLinesTest,tensorflow/tensorflow/python/debug/cli/tensor_format_test.py,34,class, -2350,NumericSummaryTest,tensorflow/tensorflow/python/debug/cli/tensor_format_test.py,628,class, -2351,get_ui,tensorflow/tensorflow/python/debug/cli/ui_factory.py,26,function,"Create a `base_ui.BaseUI` subtype. +1942,get_ui,tensorflow/tensorflow/python/debug/cli/ui_factory.py,26,function,"Create a `base_ui.BaseUI` subtype. This factory method attempts to fallback to other available ui_types on ImportError. For example, if `ui_type` is `curses`, but `curses` cannot be @@ -11657,25 +13194,17 @@ Returns: Raises: ValueError: on invalid ui_type or on exhausting or fallback ui_types." -2352,main,tensorflow/tensorflow/python/debug/examples/debug_mnist.py,31,function, -2353,main,tensorflow/tensorflow/python/debug/examples/v1/debug_errors.py,32,function, -2354,main,tensorflow/tensorflow/python/debug/examples/v1/debug_fibonacci.py,34,function, -2355,main,tensorflow/tensorflow/python/debug/examples/v1/debug_keras.py,33,function, -2356,parse_args,tensorflow/tensorflow/python/debug/examples/v1/debug_mnist_v1.py,45,function,"Parses commandline arguments. +1943,parse_args,tensorflow/tensorflow/python/debug/examples/v1/debug_mnist_v1.py,45,function,"Parses commandline arguments. Returns: A tuple (parsed, unparsed) of the parsed object and a group of unparsed arguments that did not match the parser." -2357,main,tensorflow/tensorflow/python/debug/examples/v1/debug_mnist_v1.py,112,function, -2358,main,tensorflow/tensorflow/python/debug/examples/v1/debug_tflearn_iris.py,33,function, -2359,main,tensorflow/tensorflow/python/debug/examples/v2/debug_fibonacci_v2.py,33,function, -2360,parse_args,tensorflow/tensorflow/python/debug/examples/v2/debug_mnist_v2.py,45,function,"Parses commandline arguments. +1944,parse_args,tensorflow/tensorflow/python/debug/examples/v2/debug_mnist_v2.py,45,function,"Parses commandline arguments. Returns: A tuple (parsed, unparsed) of the parsed object and a group of unparsed arguments that did not match the parser." -2361,main,tensorflow/tensorflow/python/debug/examples/v2/debug_mnist_v2.py,125,function, -2362,limit_string_length,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,98,function,"Limit the length of input string. +1945,limit_string_length,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,98,function,"Limit the length of input string. Args: string: Input string. @@ -11683,8 +13212,7 @@ Args: Returns: Possibly length-limited string." -2363,_maybe_lookup_original_input_tensor,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,118,function, -2364,get_check_numerics_error_message,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,127,function,"Create a meaningful and user-friendly error message about offending tensor. +1946,get_check_numerics_error_message,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,127,function,"Create a meaningful and user-friendly error message about offending tensor. The error message reveals the following info about the op that outputs NaN/Infinity: dtype, shape (to the extent known at graph-construction time), @@ -11708,9 +13236,9 @@ Args: Returns: (str) A formatted error message." -2365,_debug_summary,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,220,function, -2366,CheckNumericsCallback,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,227,class,Wrapper for the numerics-checking callback for thread locality. -2367,enable_check_numerics,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,339,function,"Enable tensor numerics checking in an eager/graph unified fashion. +1947,CheckNumericsCallback,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,227,class,Wrapper for the numerics-checking callback for thread locality. +1948,callback,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,239,method,Eager-function unified callback for checking numerics. +1949,enable_check_numerics,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,339,function,"Enable tensor numerics checking in an eager/graph unified fashion. The numerics checking mechanism will cause any TensorFlow eager execution or graph execution to error out as soon as an op's output tensor contains @@ -11804,7 +13332,7 @@ Args: Applicable only to ops in `tf.function`s (graphs). path_length_limit: Limit to the file path included in the printed stack trace. Applicable only to ops in `tf.function`s (graphs)." -2368,disable_check_numerics,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,448,function,"Disable the eager/graph unified numerics checking mechanism. +1950,disable_check_numerics,tensorflow/tensorflow/python/debug/lib/check_numerics_callback.py,448,function,"Disable the eager/graph unified numerics checking mechanism. This method can be used after a call to `tf.debugging.enable_check_numerics()` to disable the numerics-checking mechanism that catches infinity and NaN @@ -11814,10 +13342,7 @@ This method is idempotent. Calling it multiple times has the same effect as calling it once. This method takes effect only on the thread in which it is called." -2369,LimitStringLengthTest,tensorflow/tensorflow/python/debug/lib/check_numerics_callback_test.py,45,class, -2370,CheckNumericsCallbackTest,tensorflow/tensorflow/python/debug/lib/check_numerics_callback_test.py,70,class, -2371,CheckNumericsCallbackUnhealthyTest,tensorflow/tensorflow/python/debug/lib/check_numerics_callback_test.py,131,class,Test for cases in which enable_check_numerics() catches infs or nans. -2372,get_graph_element_name,tensorflow/tensorflow/python/debug/lib/common.py,29,function,"Obtain the name or string representation of a graph element. +1951,get_graph_element_name,tensorflow/tensorflow/python/debug/lib/common.py,29,function,"Obtain the name or string representation of a graph element. If the graph element has the attribute ""name"", return name. Otherwise, return a __str__ representation of the graph element. Certain graph elements, such as @@ -11829,7 +13354,7 @@ Args: Returns: If the attribute 'name' is available, return the name. Otherwise, return str(fetch)." -2373,get_flattened_names,tensorflow/tensorflow/python/debug/lib/common.py,47,function,"Get a flattened list of the names in run() call feeds or fetches. +1952,get_flattened_names,tensorflow/tensorflow/python/debug/lib/common.py,47,function,"Get a flattened list of the names in run() call feeds or fetches. Args: feeds_or_fetches: Feeds or fetches of the `Session.run()` call. It maybe @@ -11838,7 +13363,7 @@ Args: Returns: (list of str) A flattened list of fetch names from `feeds_or_fetches`." -2374,get_run_key,tensorflow/tensorflow/python/debug/lib/common.py,74,function,"Summarize the names of feeds and fetches as a RunKey JSON string. +1953,get_run_key,tensorflow/tensorflow/python/debug/lib/common.py,74,function,"Summarize the names of feeds and fetches as a RunKey JSON string. Args: feed_dict: The feed_dict given to the `Session.run()` call. @@ -11848,10 +13373,9 @@ Returns: A JSON Array consisting of two items. They first items is a flattened Array of the names of the feeds. The second item is a flattened Array of the names of the fetches." -2375,CommonTest,tensorflow/tensorflow/python/debug/lib/common_test.py,28,class, -2376,_glob,tensorflow/tensorflow/python/debug/lib/debug_data.py,52,function, -2377,InconvertibleTensorProto,tensorflow/tensorflow/python/debug/lib/debug_data.py,59,class,Represents a TensorProto that cannot be converted to np.ndarray. -2378,load_tensor_from_event_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,83,function,"Load a tensor from an event file. +1954,InconvertibleTensorProto,tensorflow/tensorflow/python/debug/lib/debug_data.py,59,class,Represents a TensorProto that cannot be converted to np.ndarray. +1955,initialized,tensorflow/tensorflow/python/debug/lib/debug_data.py,79,method, +1956,load_tensor_from_event_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,83,function,"Load a tensor from an event file. Assumes that the event file contains a `Event` protobuf and the `Event` protobuf contains a `Tensor` value. @@ -11864,7 +13388,7 @@ Returns: uninitialized Tensors, returns `None`. For Tensors of data types that cannot be converted to `numpy.ndarray` (e.g., `tf.resource`), return `None`." -2379,load_tensor_from_event,tensorflow/tensorflow/python/debug/lib/debug_data.py,105,function,"Load a tensor from an Event proto. +1957,load_tensor_from_event,tensorflow/tensorflow/python/debug/lib/debug_data.py,105,function,"Load a tensor from an Event proto. Args: event: The Event proto, assumed to hold a tensor value in its @@ -11877,32 +13401,7 @@ Returns: cannot be represented as `numpy.ndarray` (e.g., `tf.resource`), return the `TensorProto` protobuf object without converting it to a `numpy.ndarray`." -2380,_load_graph_def_from_event_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,143,function, -2381,_load_log_message_from_event_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,151,function, -2382,_is_graph_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,159,function, -2383,_is_run_fetches_info_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,163,function, -2384,_is_run_feed_keys_info_file,tensorflow/tensorflow/python/debug/lib/debug_data.py,167,function, -2385,_get_tensor_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,171,function,"Get tensor name given node name and output slot index. - -Args: - node_name: Name of the node that outputs the tensor, as a string. - output_slot: Output slot index of the tensor, as an integer. - -Returns: - Name of the tensor, as a string." -2386,_get_tensor_watch_key,tensorflow/tensorflow/python/debug/lib/debug_data.py,185,function,"Get the string representation of a debug watch on a tensor. - -Args: - node_name: Name of the node by which the watched tensor is produced, as a - string. - output_slot: Output slot index of the tensor, as an integer. - debug_op: Name of the debug op that is used to watch the tensor, as a - string. - -Returns: - A string representing the debug watch on the tensor (i.e., the ""watch - key"")." -2387,has_inf_or_nan,tensorflow/tensorflow/python/debug/lib/debug_data.py,202,function,"A predicate for whether a tensor consists of any bad numerical values. +1958,has_inf_or_nan,tensorflow/tensorflow/python/debug/lib/debug_data.py,202,function,"A predicate for whether a tensor consists of any bad numerical values. This predicate is common enough to merit definition in this module. Bad numerical values include `nan`s and `inf`s. @@ -11916,16 +13415,16 @@ Args: Returns: (`bool`) True if and only if tensor consists of any nan or inf values." -2388,extract_core_metadata_from_event_proto,tensorflow/tensorflow/python/debug/lib/debug_data.py,240,function, -2389,device_name_to_device_path,tensorflow/tensorflow/python/debug/lib/debug_data.py,250,function,Convert device name to device path. -2390,device_path_to_device_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,257,function,"Parse device name from device path. +1959,extract_core_metadata_from_event_proto,tensorflow/tensorflow/python/debug/lib/debug_data.py,240,function, +1960,device_name_to_device_path,tensorflow/tensorflow/python/debug/lib/debug_data.py,250,function,Convert device name to device path. +1961,device_path_to_device_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,257,function,"Parse device name from device path. Args: device_dir: (str) a directory name for the device. Returns: (str) parsed device name." -2391,DebugTensorDatum,tensorflow/tensorflow/python/debug/lib/debug_data.py,273,class,"A single tensor dumped by TensorFlow Debugger (tfdbg). +1962,DebugTensorDatum,tensorflow/tensorflow/python/debug/lib/debug_data.py,273,class,"A single tensor dumped by TensorFlow Debugger (tfdbg). Contains metadata about the dumped tensor, including `timestamp`, `node_name`, `output_slot`, `debug_op`, and path to the dump file @@ -11934,24 +13433,524 @@ Contains metadata about the dumped tensor, including `timestamp`, This type does not hold the generally space-expensive tensor value (numpy array). Instead, it points to the file from which the tensor value can be loaded (with the `get_tensor` method) if needed." -2392,WatchKeyDoesNotExistInDebugDumpDirError,tensorflow/tensorflow/python/debug/lib/debug_data.py,458,class, -2393,DebugDumpDir,tensorflow/tensorflow/python/debug/lib/debug_data.py,462,class,"Data set from a debug-dump directory on filesystem. +1963,get_tensor,tensorflow/tensorflow/python/debug/lib/debug_data.py,343,method,"Get tensor from the dump (`Event`) file. + +Returns: + The tensor loaded from the dump (`Event`) file." +1964,timestamp,tensorflow/tensorflow/python/debug/lib/debug_data.py,354,method,"Timestamp of when this tensor value was dumped. + +Returns: + (`int`) The timestamp in microseconds." +1965,extended_timestamp,tensorflow/tensorflow/python/debug/lib/debug_data.py,364,method,"Extended timestamp, possibly with an index suffix. + +The index suffix, e.g., ""-1"", is for disambiguating multiple dumps of the +same tensor with the same timestamp, which can occur if the dumping events +are spaced by shorter than the temporal resolution of the timestamps. + +Returns: + (`str`) The extended timestamp." +1966,debug_op,tensorflow/tensorflow/python/debug/lib/debug_data.py,378,method,"Name of the debug op. + +Returns: + (`str`) debug op name (e.g., `DebugIdentity`)." +1967,device_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,388,method,"Name of the device that the tensor belongs to. + +Returns: + (`str`) device name." +1968,node_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,398,method,"Name of the node from which the tensor value was dumped. + +Returns: + (`str`) name of the node watched by the debug op." +1969,output_slot,tensorflow/tensorflow/python/debug/lib/debug_data.py,408,method,"Output slot index from which the tensor value was dumped. + +Returns: + (`int`) output slot index watched by the debug op." +1970,tensor_name,tensorflow/tensorflow/python/debug/lib/debug_data.py,418,method,"Name of the tensor watched by the debug op. + +Returns: + (`str`) `Tensor` name, in the form of `node_name`:`output_slot`" +1971,watch_key,tensorflow/tensorflow/python/debug/lib/debug_data.py,428,method,"Watch key identities a debug watch on a tensor. + +Returns: + (`str`) A watch key, in the form of `tensor_name`:`debug_op`." +1972,file_path,tensorflow/tensorflow/python/debug/lib/debug_data.py,439,method,Path to the file which stores the value of the dumped tensor. +1973,dump_size_bytes,tensorflow/tensorflow/python/debug/lib/debug_data.py,445,method,"Size of the dump file. + +Unit: byte. + +Returns: + If the dump file exists, size of the dump file, in bytes. + If the dump file does not exist, None." +1974,WatchKeyDoesNotExistInDebugDumpDirError,tensorflow/tensorflow/python/debug/lib/debug_data.py,458,class, +1975,DebugDumpDir,tensorflow/tensorflow/python/debug/lib/debug_data.py,462,class,"Data set from a debug-dump directory on filesystem. An instance of `DebugDumpDir` contains all `DebugTensorDatum` instances in a tfdbg dump root directory." -2394,DeviceNamePathConversionTest,tensorflow/tensorflow/python/debug/lib/debug_data_test.py,36,class, -2395,HasNanOrInfTest,tensorflow/tensorflow/python/debug/lib/debug_data_test.py,52,class, -2396,DebugTensorDatumTest,tensorflow/tensorflow/python/debug/lib/debug_data_test.py,111,class, -2397,DebugDumpDirTest,tensorflow/tensorflow/python/debug/lib/debug_data_test.py,151,class, -2398,BaseMonitor,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,49,class,Base class for debug event data monitors. -2399,InfNanAlert,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,84,class,Alert for Infinity and NaN values. -2400,InfNanMonitor,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,144,class,Monitor for Infinity and NaN in tensor values. -2401,TestMonitor,tensorflow/tensorflow/python/debug/lib/debug_events_monitors_test.py,40,class, -2402,DebugEventsMonitorTest,tensorflow/tensorflow/python/debug/lib/debug_events_monitors_test.py,63,class, -2403,AlertDataObjectsTest,tensorflow/tensorflow/python/debug/lib/debug_events_monitors_test.py,208,class,Unit tests for alert-class objects. -2404,InfNanMonitorTest,tensorflow/tensorflow/python/debug/lib/debug_events_monitors_test.py,233,class, -2405,DebugEventsReader,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,39,class,Reader class for a tfdbg v2 DebugEvents directory. -2406,BaseDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,322,class,"Base class for digest. +1976,set_python_graph,tensorflow/tensorflow/python/debug/lib/debug_data.py,658,method,"Provide Python `Graph` object to the wrapper. + +Unlike the partition graphs, which are protobuf `GraphDef` objects, `Graph` +is a Python object and carries additional information such as the traceback +of the construction of the nodes in the graph. + +Args: + python_graph: (ops.Graph) The Python Graph object." +1977,python_graph,tensorflow/tensorflow/python/debug/lib/debug_data.py,676,method,"Get the Python graph. + +Returns: + If the Python graph has been set, returns a `tf.Graph` object. Otherwise, + returns None." +1978,core_metadata,tensorflow/tensorflow/python/debug/lib/debug_data.py,687,method,"Metadata about the `Session.run()` call from the core runtime. + +Of the three counters available in the return value, `global_step` is +supplied by the caller of the debugged `Session.run()`, while +`session_run_index` and `executor_step_index` are determined by the state +of the core runtime, automatically. For the same fetch list, feed keys and +debug tensor watch options, the same executor will be used and +`executor_step_index` should increase by one at a time. However, runs with +different fetch lists, feed keys and debug_tensor watch options that all +share the same `Session` object can lead to gaps in `session_run_index`. + +Returns: + If core metadata are loaded, a `namedtuple` with the fields: + `global_step`: A global step count supplied by the caller of + `Session.run()`. It is optional to the caller. If the caller did not + supply this parameter, its value will be -1. + `session_run_index`: A sorted index for Run() calls to the underlying + TensorFlow `Session` object. + `executor_step_index`: A counter for invocations of a given runtime + executor. The same executor is re-used for the same fetched tensors, + target nodes, input feed keys and debug tensor watch options. + `input_names`: Names of the input (feed) Tensors. + `output_names`: Names of the output (fetched) Tensors. + `target_nodes`: Names of the target nodes. + If the core metadata have not been loaded, `None`. + If more than one core metadata files exist, return a list of the + `nametuple` described above." +1979,dumped_tensor_data,tensorflow/tensorflow/python/debug/lib/debug_data.py,721,method,Retrieve dumped tensor data. +1980,t0,tensorflow/tensorflow/python/debug/lib/debug_data.py,733,method,"Absolute timestamp of the first dumped tensor across all devices. + +Returns: + (`int`) absolute timestamp of the first dumped tensor, in microseconds." +1981,size,tensorflow/tensorflow/python/debug/lib/debug_data.py,742,method,"Total number of dumped tensors in the dump root directory. + +Returns: + (`int`) The total number of dumped tensors in the dump root directory." +1982,loaded_partition_graphs,tensorflow/tensorflow/python/debug/lib/debug_data.py,920,method,Test whether partition graphs have been loaded. +1983,partition_graphs,tensorflow/tensorflow/python/debug/lib/debug_data.py,924,method,"Get the partition graphs. + +Returns: + Partition graphs as a list of GraphDef. + +Raises: + LookupError: If no partition graphs have been loaded." +1984,reconstructed_non_debug_partition_graphs,tensorflow/tensorflow/python/debug/lib/debug_data.py,938,method,"Reconstruct partition graphs with the debugger-inserted ops stripped. + +The reconstructed partition graphs are identical to the original (i.e., +non-debugger-decorated) partition graphs except in the following respects: + 1) The exact names of the runtime-inserted internal nodes may differ. + These include _Send, _Recv, _HostSend, _HostRecv, _Retval ops. + 2) As a consequence of 1, the nodes that receive input directly from such + send- and recv-type ops will have different input names. + 3) The parallel_iteration attribute of while-loop Enter ops are set to 1. + +Returns: + A dict mapping device names (`str`s) to reconstructed + `tf.compat.v1.GraphDef`s." +1985,run_fetches_info,tensorflow/tensorflow/python/debug/lib/debug_data.py,959,method,"Get a str representation of the fetches used in the Session.run() call. + +Returns: + If the information is available from one `Session.run` call, a `str` + obtained from `repr(fetches)`. + If the information is available from multiple `Session.run` calls, a + `list` of `str` from `repr(fetches)`. + If the information is not available, `None`." +1986,run_feed_keys_info,tensorflow/tensorflow/python/debug/lib/debug_data.py,974,method,"Get a str representation of the feed_dict used in the Session.run() call. + +Returns: + If the information is available from one `Session.run` call, a `str` + obtained from `repr(feed_dict)`. + If the information is available from multiple `Session.run` calls, a + `list` of `str` obtained from `repr(feed_dict)`. + If the information is not available, `None`." +1987,nodes,tensorflow/tensorflow/python/debug/lib/debug_data.py,1022,method,"Get a list of all nodes from the partition graphs. + +Args: + device_name: (`str`) name of device. If None, all nodes from all available + devices will be included. + +Returns: + All nodes' names, as a list of str. + +Raises: + LookupError: If no partition graphs have been loaded. + ValueError: If specified node name does not exist." +1988,node_attributes,tensorflow/tensorflow/python/debug/lib/debug_data.py,1048,method,"Get the attributes of a node. + +Args: + node_name: Name of the node in question. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + Attributes of the node. + +Raises: + LookupError: If no partition graphs have been loaded." +1989,node_inputs,tensorflow/tensorflow/python/debug/lib/debug_data.py,1068,method,"Get the inputs of given node according to partition graphs. + +Args: + node_name: Name of the node. + is_control: (`bool`) Whether control inputs, rather than non-control + inputs, are to be returned. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + (`list` of `str`) inputs to the node, as a list of node names. + +Raises: + LookupError: If node inputs and control inputs have not been loaded + from partition graphs yet." +1990,transitive_inputs,tensorflow/tensorflow/python/debug/lib/debug_data.py,1095,method,"Get the transitive inputs of given node according to partition graphs. + +Args: + node_name: Name of the node. + include_control: Include control inputs (True by default). + include_reversed_ref: Whether a ref input, say from A to B, is to be also + considered as an input from B to A. The rationale is that ref inputs + generally let the recipient (e.g., B in this case) mutate the value of + the source (e.g., A in this case). So the reverse direction of the ref + edge reflects the direction of information flow. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + (`list` of `str`) all transitive inputs to the node, as a list of node + names. + +Raises: + LookupError: If node inputs and control inputs have not been loaded + from partition graphs yet." +1991,find_some_path,tensorflow/tensorflow/python/debug/lib/debug_data.py,1153,method,"Find a path between a source node and a destination node. + +Limitation: the source and destination are required to be on the same +device, i.e., this method does not yet take into account Send/Recv nodes +across devices. + +TODO(cais): Make this method work across device edges by tracing Send/Recv + nodes. + +Args: + src_node_name: (`str`) name of the source node or name of an output tensor + of the node. + dst_node_name: (`str`) name of the destination node or name of an output + tensor of the node. + include_control: (`bool`) whrther control edges are considered in the + graph tracing. + include_reversed_ref: Whether a ref input, say from A to B, is to be also + considered as an input from B to A. The rationale is that ref inputs + generally let the recipient (e.g., B in this case) mutate the value of + the source (e.g., A in this case). So the reverse direction of the ref + edge reflects the direction of information flow. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + A path from the src_node_name to dst_node_name, as a `list` of `str`, if + it exists. The list includes src_node_name as the first item and + dst_node_name as the last. + If such a path does not exist, `None`. + +Raises: + ValueError: If the source and destination nodes are not on the same + device." +1992,node_recipients,tensorflow/tensorflow/python/debug/lib/debug_data.py,1231,method,"Get recipient of the given node's output according to partition graphs. + +Args: + node_name: (`str`) name of the node. + is_control: (`bool`) whether control outputs, rather than non-control + outputs, are to be returned. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + (`list` of `str`) all inputs to the node, as a list of node names. + +Raises: + LookupError: If node inputs and control inputs have not been loaded + from partition graphs yet." +1993,devices,tensorflow/tensorflow/python/debug/lib/debug_data.py,1260,method,"Get the list of device names. + +Returns: + (`list` of `str`) names of the devices." +1994,node_exists,tensorflow/tensorflow/python/debug/lib/debug_data.py,1268,method,"Test if a node exists in the partition graphs. + +Args: + node_name: (`str`) name of the node to be checked. + device_name: optional device name. If None, will search for the node + on all available devices. Otherwise, search for the node only on + the given device. + +Returns: + A boolean indicating whether the node exists. + +Raises: + LookupError: If no partition graphs have been loaded yet. + ValueError: If device_name is specified but cannot be found." +1995,node_device,tensorflow/tensorflow/python/debug/lib/debug_data.py,1297,method,"Get the names of the devices that has nodes of the specified name. + +Args: + node_name: (`str`) name of the node. + +Returns: + (`str` or `list` of `str`) name of the device(s) on which the node of the + given name is found. Returns a `str` if there is only one such device, + otherwise return a `list` of `str`. + +Raises: + LookupError: If node inputs and control inputs have not been loaded + from partition graphs yet. + ValueError: If the node does not exist in partition graphs." +1996,node_op_type,tensorflow/tensorflow/python/debug/lib/debug_data.py,1324,method,"Get the op type of given node. + +Args: + node_name: (`str`) name of the node. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + (`str`) op type of the node. + +Raises: + LookupError: If node op types have not been loaded + from partition graphs yet." +1997,debug_watch_keys,tensorflow/tensorflow/python/debug/lib/debug_data.py,1346,method,"Get all tensor watch keys of given node according to partition graphs. + +Args: + node_name: (`str`) name of the node. + device_name: (`str`) name of the device. If there is only one device or if + node_name exists on only one device, this argument is optional. + +Returns: + (`list` of `str`) all debug tensor watch keys. Returns an empty list if + the node name does not correspond to any debug watch keys. + +Raises: + `LookupError`: If debug watch information has not been loaded from + partition graphs yet." +1998,watch_key_to_data,tensorflow/tensorflow/python/debug/lib/debug_data.py,1380,method,"Get all `DebugTensorDatum` instances corresponding to a debug watch key. + +Args: + debug_watch_key: (`str`) debug watch key. + device_name: (`str`) name of the device. If there is only one device or if + the specified debug_watch_key exists on only one device, this argument + is optional. + +Returns: + A list of `DebugTensorDatum` instances that correspond to the debug watch + key. If the watch key does not exist, returns an empty list. + +Raises: + ValueError: If there are multiple devices that have the debug_watch_key, + but device_name is not specified." +1999,find,tensorflow/tensorflow/python/debug/lib/debug_data.py,1417,method,"Find dumped tensor data by a certain predicate. + +Args: + predicate: A callable that takes two input arguments: + + ```python + def predicate(debug_tensor_datum, tensor): + # returns a bool + ``` + + where `debug_tensor_datum` is an instance of `DebugTensorDatum`, which + carries the metadata, such as the `Tensor`'s node name, output slot + timestamp, debug op name, etc.; and `tensor` is the dumped tensor value + as a `numpy.ndarray`. + first_n: (`int`) return only the first n `DebugTensotDatum` instances (in + time order) for which the predicate returns True. To return all the + `DebugTensotDatum` instances, let first_n be <= 0. + device_name: optional device name. + exclude_node_names: Optional regular expression to exclude nodes with + names matching the regular expression. + +Returns: + A list of all `DebugTensorDatum` objects in this `DebugDumpDir` object + for which predicate returns True, sorted in ascending order of the + timestamp." +2000,get_tensor_file_paths,tensorflow/tensorflow/python/debug/lib/debug_data.py,1466,method,"Get the file paths from a debug-dumped tensor. + +Args: + node_name: (`str`) name of the node that the tensor is produced by. + output_slot: (`int`) output slot index of tensor. + debug_op: (`str`) name of the debug op. + device_name: (`str`) name of the device. If there is only one device or if + the specified debug_watch_key exists on only one device, this argument + is optional. + +Returns: + List of file path(s) loaded. This is a list because each debugged tensor + may be dumped multiple times. + +Raises: + WatchKeyDoesNotExistInDebugDumpDirError: If the tensor does not exist in + the debug-dump data." +2001,get_tensors,tensorflow/tensorflow/python/debug/lib/debug_data.py,1500,method,"Get the tensor value from for a debug-dumped tensor. + +The tensor may be dumped multiple times in the dump root directory, so a +list of tensors (`numpy.ndarray`) is returned. + +Args: + node_name: (`str`) name of the node that the tensor is produced by. + output_slot: (`int`) output slot index of tensor. + debug_op: (`str`) name of the debug op. + device_name: (`str`) name of the device. If there is only one device or if + the specified debug_watch_key exists on only one device, this argument + is optional. + +Returns: + List of tensors (`numpy.ndarray`) loaded from the debug-dump file(s). + +Raises: + WatchKeyDoesNotExistInDebugDumpDirError: If the tensor does not exist in + the debug-dump data." +2002,get_rel_timestamps,tensorflow/tensorflow/python/debug/lib/debug_data.py,1532,method,"Get the relative timestamp from for a debug-dumped tensor. + +Relative timestamp means (absolute timestamp - `t0`), where `t0` is the +absolute timestamp of the first dumped tensor in the dump root. The tensor +may be dumped multiple times in the dump root directory, so a list of +relative timestamps (`numpy.ndarray`) is returned. + +Args: + node_name: (`str`) name of the node that the tensor is produced by. + output_slot: (`int`) output slot index of tensor. + debug_op: (`str`) name of the debug op. + device_name: (`str`) name of the device. If there is only one device or if + the specified debug_watch_key exists on only one device, this argument + is optional. + +Returns: + (`list` of `int`) list of relative timestamps. + +Raises: + WatchKeyDoesNotExistInDebugDumpDirError: If the tensor watch key does not + exist in the debug dump data." +2003,get_dump_sizes_bytes,tensorflow/tensorflow/python/debug/lib/debug_data.py,1569,method,"Get the sizes of the dump files for a debug-dumped tensor. + +Unit of the file size: byte. + +Args: + node_name: (`str`) name of the node that the tensor is produced by. + output_slot: (`int`) output slot index of tensor. + debug_op: (`str`) name of the debug op. + device_name: (`str`) name of the device. If there is only one device or if + the specified debug_watch_key exists on only one device, this argument + is optional. + +Returns: + (`list` of `int`): list of dump file sizes in bytes. + +Raises: + WatchKeyDoesNotExistInDebugDumpDirError: If the tensor watch key does not + exist in the debug dump data." +2004,node_traceback,tensorflow/tensorflow/python/debug/lib/debug_data.py,1603,method,"Try to retrieve the Python traceback of node's construction. + +Args: + element_name: (`str`) Name of a graph element (node or tensor). + +Returns: + (list) The traceback list object as returned by the `extract_trace` + method of Python's traceback module. + +Raises: + LookupError: If Python graph is not available for traceback lookup. + KeyError: If the node cannot be found in the Python graph loaded." +2005,BaseMonitor,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,49,class,Base class for debug event data monitors. +2006,on_execution,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,56,method,"Monitor method for top-level execution events. + +Return values (if any) are ignored by the associated DebugDataReader. + +Args: + execution_index: The index of the top-level execution event, as an int. + execution: An Execution data object, for a top-level op or function + execution event." +2007,on_graph_execution_trace,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,67,method,"Monitor method for intra-graph execution events. + +Return values (if any) are ignored by the associated DebugDataReader. + +Args: + graph_execution_trace_index: The index of the intra-graph execution + event, as an int. + graph_execution_trace: A GraphExecutionTrace data object, for an + intra-graph tensor event." +2008,InfNanAlert,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,84,class,Alert for Infinity and NaN values. +2009,wall_time,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,108,method, +2010,op_type,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,112,method, +2011,output_slot,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,116,method, +2012,size,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,120,method, +2013,num_neg_inf,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,124,method, +2014,num_pos_inf,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,128,method, +2015,num_nan,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,132,method, +2016,execution_index,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,136,method, +2017,graph_execution_trace_index,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,140,method, +2018,InfNanMonitor,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,144,class,Monitor for Infinity and NaN in tensor values. +2019,on_execution,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,262,method, +2020,on_graph_execution_trace,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,286,method,Monitor method for GraphExecutionTrace data object. +2021,alerts,tensorflow/tensorflow/python/debug/lib/debug_events_monitors.py,310,method, +2022,DebugEventsReader,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,39,class,Reader class for a tfdbg v2 DebugEvents directory. +2023,starting_wall_time,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,151,method,"Get the starting timestamp of the instrumented TensorFlow program. + +When there are multiple hosts (i.e., multiple tfdbg file sets), the earliest +timestamp among the file sets is returned. It is assumed to be the job that +starts first (e.g., the coordinator). + +Returns: + Starting timestamp in seconds since the epoch, as a float." +2024,tfdbg_run_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,163,method,Get the run ID of the instrumented TensorFlow program. +2025,tensorflow_version,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,167,method,Get the version string of TensorFlow that the debugged program ran on. +2026,tfdbg_file_version,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,171,method,Get the tfdbg file format version. +2027,source_files_iterator,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,236,method, +2028,stack_frames_iterator,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,239,method, +2029,graphs_iterator,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,242,method, +2030,read_source_files_event,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,245,method,Read a DebugEvent proto at given offset from the .source_files file. +2031,read_graphs_event,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,251,method,"Read a DebugEvent proto at a given offset from the .graphs file. + +Args: + offset: Offset to read the DebugEvent proto from. + +Returns: + A DebugEventProto. + +Raises: + `errors.DataLossError` if offset is at a wrong location. + `IndexError` if offset is out of range of the file." +2032,execution_iterator,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,267,method, +2033,read_execution_event,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,270,method,"Read a DebugEvent proto at a given offset from the .execution file. + +Args: + offset: Offset to read the DebugEvent proto from. + +Returns: + A DebugEventProto. + +Raises: + `errors.DataLossError` if offset is at a wrong location. + `IndexError` if offset is out of range of the file." +2034,graph_execution_traces_iterators,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,287,method, +2035,read_graph_execution_traces_event,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,293,method,"Read DebugEvent at given offset from given .graph_execution_traces file. + +Args: + locator: A (file_index, offset) tuple that locates the DebugEvent + containing the graph execution trace. + +Returns: + A DebugEventProto. + +Raises: + `errors.DataLossError` if offset is at a wrong location. + `IndexError` if offset is out of range of the file." +2036,close,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,314,method, +2037,BaseDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,322,class,"Base class for digest. Properties: wall_time: A timestamp for the digest as a `float` (unit: s). @@ -11963,7 +13962,10 @@ Properties: 2. A tuple of a file index and a byte offset. This applies to case in which the same type of debugger data may come from multple files, e.g., graph execution traces." -2407,ExecutionDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,353,class,"Light-weight digest summarizing top-level execution event. +2038,wall_time,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,342,method, +2039,locator,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,346,method, +2040,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,349,method, +2041,ExecutionDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,353,class,"Light-weight digest summarizing top-level execution event. Use `DebugDataReader.read_execution(execution_digest)` to load the more detailed data object concerning the execution event (`Execution`). @@ -11976,8 +13978,10 @@ Properties: ""__inference_my_func_123""). output_tensor_device_ids: IDs of the devices on which the output tensors of the execution reside. For no-output execution, this is `None`." -2408,_tuple_or_none,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,395,function, -2409,Execution,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,399,class,"Detailed data relating to a top-level execution event. +2042,op_type,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,379,method, +2043,output_tensor_device_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,383,method, +2044,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,386,method, +2045,Execution,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,399,class,"Detailed data relating to a top-level execution event. The execution is of an individual op or a tf.function, which may have any number of output tensors. @@ -12002,7 +14006,16 @@ Properties (beyond the base class `ExecutionDigest`): See documentation of the various TensorDebugModes for the semantics of the numbers. If the eager execution produces no output tensor, this is `None`. Else, this is a `tuple` of `list`s." -2410,DebuggedGraph,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,495,class,"Data object representing debugging information about a tf.Graph. +2046,host_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,450,method, +2047,stack_frame_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,454,method, +2048,tensor_debug_mode,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,458,method, +2049,graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,462,method, +2050,input_tensor_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,466,method, +2051,num_outputs,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,470,method, +2052,output_tensor_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,474,method, +2053,debug_tensor_values,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,478,method, +2054,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,481,method, +2055,DebuggedGraph,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,495,class,"Data object representing debugging information about a tf.Graph. Includes `FuncGraph`s. @@ -12013,13 +14026,55 @@ Properties: enclosed by this graph. outer_graph_id: If this graph is nested within an outer graph, ID of the outer graph. If this is an outermost graph, `None`." -2411,DebuggedDevice,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,609,class,"Debugger data regarding a device involved in the debugged program. +2056,add_inner_graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,522,method,"Add the debugger-generated ID of a graph nested within this graph. + +Args: + inner_graph_id: The debugger-generated ID of the nested inner graph." +2057,add_op,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,531,method,"Add an op creation data object. + +Args: + graph_op_creation_digest: A GraphOpCreationDigest data object describing + the creation of an op inside this graph." +2058,add_op_consumer,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,545,method,"Add a consuming op for this op. + +Args: + src_op_name: Name of the op of which the output tensor is being consumed. + src_slot: 0-based output slot of the op being consumed. + dst_op_name: Name of the consuming op (e.g., ""Conv2D_3/BiasAdd"") + dst_slot: 0-based input slot of the consuming op that receives the tensor + from this op." +2059,name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,558,method, +2060,graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,562,method, +2061,outer_graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,566,method, +2062,inner_graph_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,570,method, +2063,get_tensor_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,573,method,Get the ID of a symbolic tensor in this graph. +2064,get_op_creation_digest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,577,method,Get the GraphOpCreationDigest for a op in the graph. +2065,get_op_consumers,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,581,method,"Get all the downstream consumers of this op. + +Only data (non-control) edges are tracked. + +Args: + src_op_name: Name of the op providing the tensor being consumed. + +Returns: + A list of (src_slot, dst_op_name, dst_slot) tuples. In each item of + the list: + src_slot: 0-based output slot of the op of which the output tensor + is being consumed. + dst_op_name: Name of the consuming op (e.g., ""Conv2D_3/BiasAdd"") + dst_slot: 0-based input slot of the consuming op that receives + the tensor from this op." +2066,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,600,method, +2067,DebuggedDevice,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,609,class,"Debugger data regarding a device involved in the debugged program. Properties: device_name: Name of the device, as a str. device_id: An integer ID for the device, unique for each device within the scope of the debugged TensorFlow program." -2412,GraphOpCreationDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,639,class,"Data object describing the creation of an op inside a graph. +2068,device_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,625,method, +2069,device_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,629,method, +2070,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,632,method, +2071,GraphOpCreationDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,639,class,"Data object describing the creation of an op inside a graph. For size efficiency, this digest object does not contain any stack frames or any references to them. To obtain the stack frames, use @@ -12037,7 +14092,17 @@ Properties (beyond the base class): host_name: Name of the host on which the op is created. stack_frame_ids: IDs of the frames of the stack trace at which the op is created." -2413,GraphExecutionTraceDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,732,class,"Light-weight summary of a intra-graph tensor execution event. +2072,graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,682,method, +2073,op_type,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,686,method, +2074,op_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,690,method, +2075,output_tensor_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,694,method, +2076,num_outputs,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,698,method, +2077,input_names,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,702,method, +2078,device_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,706,method, +2079,host_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,710,method, +2080,stack_frame_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,714,method, +2081,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,717,method, +2082,GraphExecutionTraceDigest,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,732,class,"Light-weight summary of a intra-graph tensor execution event. Use `DebugDataReader.read_graph_execution_trace()` on this object to read more detailed data (`GraphExecutionTrace`). @@ -12048,7 +14113,12 @@ Properties (beyond the base class): output_slot: Output slot index of the tensor. graph_id: The debugger-generated ID of the innermost (immediately-enclosing) graph." -2414,GraphExecutionTrace,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,781,class,"Detailed data object describing an intra-graph tensor execution. +2083,op_type,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,755,method, +2084,op_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,759,method, +2085,output_slot,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,763,method, +2086,graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,767,method, +2087,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,770,method, +2088,GraphExecutionTrace,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,781,class,"Detailed data object describing an intra-graph tensor execution. Attributes (in addition to GraphExecutionTraceDigest): graph_ids: The debugger-generated IDs of the graphs that enclose the @@ -12060,34 +14130,13 @@ Attributes (in addition to GraphExecutionTraceDigest): tensor_debug_mode). A list of numbers. See the documentation of the TensorDebugModes for the semantics of the numbers. device_name: Device on which the tensor resides (if available)" -2415,_parse_tensor_value,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,845,function,"Helper method for reading a tensor value from a tensor proto. - -The rationale for the distinction between `True` and `False value of -`return_list` is as follows: -- `return_list=True` is used for TensorDebugMode values other than - FULL_TENSOR, e.g., CONCISE_HEALTH, SHAPE and FULL_HEATLH. Under - those modes, the value is guaranteed (by contract) to be a 1D float64 - tensor. -- `return_list=False` is used for the FULL_HEALTH TensorDebugMode - specifically. Instead, we use `numpy.ndarray` to maximally preserve - the shape, dtype and value information regarding the underlying tensor - value. Under that mode, we don't use a python list to represent the - tensor value because that can lead to loss of information (e.g., both - float16 and float32 dtypes get mapped to Python floats). - -Args: - tensor_proto: The TensorProto instance from which the tensor value will be - loaded. - return_list: Whether the return value will be a nested Python list that - comes out from `numpy.ndarray.tolist()`. - -Returns: - If parsing is successful, the tensor value as a `numpy.ndarray` or the - nested Python list converted from it. - If parsing fails, `None`." -2416,_execution_digest_from_debug_event_proto,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,881,function,Convert a DebugEvent proto into an ExecutionDigest data object. -2417,_execution_from_debug_event_proto,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,891,function,Convert a DebugEvent proto into an Execution data object. -2418,DebugDataReader,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,917,class,"A reader that reads structured debugging data in the tfdbg v2 format. +2089,graph_ids,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,815,method, +2090,graph_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,819,method, +2091,tensor_debug_mode,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,823,method, +2092,debug_tensor_value,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,827,method, +2093,device_name,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,831,method, +2094,to_json,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,834,method, +2095,DebugDataReader,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,917,class,"A reader that reads structured debugging data in the tfdbg v2 format. The set of data read by an object of this class concerns the execution history of a tfdbg2-instrumented TensorFlow program. @@ -12098,29 +14147,313 @@ Note: from the last-successful reading positions in the files. - This object can be used as a context manager. Its `__exit__()` call closes the file readers cleanly." -2419,DebugEventsWriter,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,30,class,A writer for TF debugging events. Used by tfdbg v2. -2420,DebugEventsWriterTest,tensorflow/tensorflow/python/debug/lib/debug_events_writer_test.py,40,class, -2421,MultiSetReaderTest,tensorflow/tensorflow/python/debug/lib/debug_events_writer_test.py,602,class,Test for DebugDataReader for multiple file sets under a dump root. -2422,DataObjectsTest,tensorflow/tensorflow/python/debug/lib/debug_events_writer_test.py,682,class, -2423,_tensor_to_grad_debug_op_name,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,37,function, -2424,_parse_grad_debug_op_name,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,42,function,"Parse the name of a debug gradient op. - -Args: - op_name: the name of the debug gradient op. +2096,update,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1112,method,Perform incremental read of the file set. +2097,source_file_list,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1120,method,"Get a list of source files known to the debugger data reader. Returns: - 1) The UUID of the GradientsDebugger that created the debug gradient op. - 2) Name of the original tensor whose gradient is debugged by the debug - gradient op." -2425,GradientsDebugger,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,68,class,"Gradients Debugger. + A tuple of `(host_name, file_path)` tuples." +2098,source_lines,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1128,method,"Read the line-by-line content of a source file. + +Args: + host_name: Host name on which the source file is located. + file_path: File path at which the source file is located. + +Returns: + Lines of the source file as a `list` of `str`s." +2099,starting_wall_time,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1141,method,"Wall timestamp for when the debugged TensorFlow program started. + +Returns: + Stating wall time as seconds since the epoch, as a `float`." +2100,tensorflow_version,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1149,method,"TensorFlow version used in the debugged TensorFlow program. + +Note: this is not necessarily the same as the version of TensorFlow used to +load the DebugEvent file set. + +Returns: + TensorFlow version used by the debugged program, as a `str`." +2101,tfdbg_run_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1160,method,Get the debugger run ID of the debugged TensorFlow program. +2102,outermost_graphs,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1164,method,Get the number of outer most graphs read so far. +2103,graph_by_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1169,method,Get a DebuggedGraph object by its ID. +2104,device_name_by_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1173,method,Get the name of a device by the debugger-generated ID of the device. +2105,device_name_map,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1177,method,Get a map mapping device IDs to device names. +2106,graph_op_digests,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1182,method,"Get the list of the digests for graph-op creation so far. + +Args: + op_type: Optional op type to filter the creation events with. + +Returns: + A list of `GraphOpCreationDigest` objects." +2107,graph_execution_traces,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1197,method,"Get all the intra-graph execution tensor traces read so far. + +Args: + digest: Whether the results will be returned in the more light-weight + digest form. + begin: Optional beginning index for the requested traces or their digests. + Python-style negative indices are supported. + end: Optional ending index for the requested traces or their digests. + Python-style negative indices are supported. + +Returns: + If `digest`: a `list` of `GraphExecutionTraceDigest` objects. + Else: a `list` of `GraphExecutionTrace` objects." +2108,num_graph_execution_traces,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1222,method,Get the number of graph execution traces read so far. +2109,executions,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1226,method,"Get `Execution`s or `ExecutionDigest`s this reader has read so far. + +Args: + digest: Whether the results are returned in a digest form, i.e., + `ExecutionDigest` format, instead of the more detailed `Execution` + format. + begin: Optional beginning index for the requested execution data objects + or their digests. Python-style negative indices are supported. + end: Optional ending index for the requested execution data objects or + their digests. Python-style negative indices are supported. + +Returns: + If `digest`: a `list` of `ExecutionDigest` objects. + Else: a `list` of `Execution` objects." +2110,num_executions,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1253,method,Get the number of execution events read so far. +2111,read_execution,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1257,method,Read a detailed Execution object. +2112,read_graph_execution_trace,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1263,method,"Read the detailed graph execution trace. + +Args: + graph_execution_trace_digest: A `GraphExecutionTraceDigest` object. + +Returns: + The corresponding `GraphExecutionTrace` object." +2113,read_execution_stack_trace,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1277,method,"Read the stack trace of a given Execution object. + +Args: + execution: The Execution object of interest. + +Returns: + 1. The host name. + 2. The stack trace, as a list of (file_path, lineno, func) tuples." +2114,read_graph_op_creation_stack_trace,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1292,method,"Read the stack trace of a given graph op creation object. + +Args: + graph_op_creation_digest: The GraphOpCreationDigest object of interest. + +Returns: + A tuple consisting of: + 1. The host name. + 2. The stack trace, as a list of (file_path, lineno, func) tuples." +2115,execution_to_tensor_values,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1312,method,"Read the full tensor values from an Execution or ExecutionDigest. + +Args: + execution: An `ExecutionDigest` or `ExeuctionDigest` object. + +Returns: + A list of numpy arrays representing the output tensor values of the + execution event." +2116,graph_execution_trace_to_tensor_value,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1326,method,"Read full tensor values from an Execution or ExecutionDigest. + +Args: + trace: An `GraphExecutionTraceDigest` or `GraphExecutionTrace` object. + +Returns: + A numpy array representing the output tensor value of the intra-graph + tensor execution event." +2117,symbolic_tensor_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1339,method,"Get the ID of a symbolic tensor. + +Args: + graph_id: The ID of the immediately-enclosing graph. + op_name: Name of the op. + output_slot: Output slot as an int. + +Returns: + The ID of the symbolic tensor as an int." +2118,graph_execution_trace_to_tensor_id,tensorflow/tensorflow/python/debug/lib/debug_events_reader.py,1352,method,Get symbolic tensor ID from a GraphExecutoinTraceDigest object. +2119,DebugEventsWriter,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,30,class,A writer for TF debugging events. Used by tfdbg v2. +2120,WriteSourceFile,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,60,method,"Write a SourceFile proto with the writer. + +Args: + source_file: A SourceFile proto, describing the content of a source file + involved in the execution of the debugged TensorFlow program." +2121,WriteGraphOpCreation,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,86,method,"Write a GraphOpCreation proto with the writer. + +Args: + graph_op_creation: A GraphOpCreation proto, describing the details of the + creation of an op inside a TensorFlow Graph." +2122,WriteDebuggedGraph,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,99,method,"Write a DebuggedGraph proto with the writer. + +Args: + debugged_graph: A DebuggedGraph proto, describing the details of a + TensorFlow Graph that has completed its construction." +2123,WriteExecution,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,110,method,"Write a Execution proto with the writer. + +Args: + execution: An Execution proto, describing a TensorFlow op or graph + execution event." +2124,WriteGraphExecutionTrace,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,121,method,"Write a GraphExecutionTrace proto with the writer. + +Args: + graph_execution_trace: A GraphExecutionTrace proto, concerning the value + of an intermediate tensor or a list of intermediate tensors that are + computed during the graph's execution." +2125,RegisterDeviceAndGetId,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,135,method, +2126,FlushNonExecutionFiles,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,139,method,Flush the non-execution debug event files. +2127,FlushExecutionFiles,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,143,method,"Flush the execution debug event files. + +Causes the current content of the cyclic buffers to be written to +the .execution and .graph_execution_traces debug events files. +Also clears those cyclic buffers." +2128,Close,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,152,method,Close the writer. +2129,dump_root,tensorflow/tensorflow/python/debug/lib/debug_events_writer.py,157,method, +2130,GradientsDebugger,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,68,class,"Gradients Debugger. Allows retrieval of gradient tensors created by TensorFlow's automatic differentiation algorithm, i.e., `tf.gradients` and optimizer classes that use it." -2426,clear_gradient_debuggers,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,351,function,Clear all globally registered gradient debuggers. -2427,_identify_gradient_grad,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,357,function,Gradient function for the DebugIdentity op. -2428,_identify_gradient_grad_ref,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,367,function,Gradient function for the DebugIdentity op. -2429,gradient_values_from_dump,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,372,function,"Find gradient values from a `DebugDumpDir` object. +2131,y_tensor,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,101,method, +2132,graph,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,105,method, +2133,identify_gradient,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,114,method,"Create a debug identity tensor that registers and forwards gradients. + +The side effect of this method is that when gradient tensor(s) are created +with respect to the any paths that include the `input_tensor`, the gradient +tensor(s) with respect to `input_tensor` will be registered with this +this `GradientsDebugger` instance and can later be retrieved, with the +methods `gradient_tensor` and `gradient_tensors`. + +Example: + +```python +x = tf.Variable(1.0) +y = tf.add(x, x) + +grad_debugger = tf_debug.GradientsDebugger() +debug_y = grad_debugger.identify_gradient(y) +z = tf.square(debug_y) + +# Create a train op under the grad_debugger context. +with grad_debugger: + train_op = tf.compat.v1.train.GradientDescentOptimizer(z) + +# Now we can reflect through grad_debugger to get the gradient tensor +# with respect to y. +y_grad = grad_debugger.gradient_tensor(y) +``` + +Args: + input_tensor: the input `tf.Tensor` object whose related gradient tensors + are to be registered with this `GradientsDebugger` instance when they + are created, e.g., during `tf.gradients` calls or the construction + of optimization (training) op that uses `tf.gradients`. + +Returns: + A forwarded identity of `input_tensor`, as a `tf.Tensor`. + +Raises: + ValueError: If an op with name that duplicates the gradient-debugging op + already exists in the graph (highly unlikely)." +2134,watch_gradients_by_tensors,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,171,method,"Watch gradient tensors by x-tensor(s). + +The side effect of this method is that when gradient tensor(s) are created +with respect to the any paths that include the `x_tensor`s, the gradient +tensor(s) with respect to the tensor will be registered with this +this `GradientsDebugger` instance and can later be retrieved, with the +methods `gradient_tensor` and `gradient_tensors`. + +Unlike the method `identify_gradient`, this method is used to retrieve +gradient tensors after the construction of the forward subgraph has +completed (but before the construction of the backward subgraph). + +This method is the same as `watch_gradients_by_x_tensor_names` except that +the tensors are specified by the Python `tf.Tensor` or `tf.Variable` +objects, instead by name patterns. + +Example: + +```python +x = tf.Variable(1.0) +y = tf.add(x, x, name=""y"") +z = tf.square(debug_y) + +# Create a train op under the grad_debugger context. +grad_debugger = tf_debug.GradientsDebugger() +with grad_debugger.watch_gradients_by_tensors(y): + train_op = tf.compat.v1.train.GradientDescentOptimizer(z) + +# Now we can reflect through grad_debugger to get the gradient tensor +# with respect to y. +y_grad = grad_debugger.gradient_tensor(y) +# or +y_grad = grad_debugger.gradient_tensor(""y:0"") +``` + +Args: + graph: the `tf.Graph` to watch the gradients on. + tensors: a `tf.Tensor` or `tf.Variable` object, or a list of such objects. + +Returns: + The GradientsDebugger instance itself." +2135,watch_gradients_by_tensor_names,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,224,method,"Watch gradient tensors by name(s) of the x-tensor(s). + +The side effect of this method is that when gradient tensor(s) are created +with respect to the x-tensors, the gradient tensor(s) will be registered +with this `GradientsDebugger` instance and can later be retrieved. + +Unlike the `identify_gradient` method, this method is used after the +construction of the forward graph has completed. Unlike the +`watch_gradients_by_tensor` method, this method does not use handles to the +tensors of interest; it uses their names. + +This method is the same as `watch_gradients_by_tensors` except that the +x-tensors are specified by name patterns, instead of `tf.Tensor` or +`tf.Variable` objects. + +Example: + +```python +x = tf.Variable(1.0, name=""x"") +y = tf.add(x, x, name=""y"") +z = tf.square(debug_y) + +# Create a train op under the grad_debugger context. +grad_debugger = tf_debug.GradientsDebugger() +with grad_debugger.watch_gradients_by_tensor_names(r""(x|y):0$""): + train_op = tf.compat.v1.train.GradientDescentOptimizer(z) + +# Now we can reflect through grad_debugger to get the gradient tensor +# with respect to x and y. +x_grad = grad_debugger.gradient_tensor(""x:0"") +y_grad = grad_debugger.gradient_tensor(""y:0"") +``` + +Args: + graph: the `tf.Graph` to watch the gradients on. + tensor_name_regex: the regular-expression pattern of the name(s) of the + x-tensor(s) to watch. x-tensor refers to the tensors on the denominator + of the differentiation. + +Returns: + The GradientsDebugger instance itself." +2136,register_gradient_tensor,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,294,method,"Register the gradient tensor for an x-tensor. + +Args: + x_tensor_name: (`str`) the name of the independent `tf.Tensor`, i.e., + the tensor on the denominator of the differentiation. + gradient_tensor: the gradient `tf.Tensor`." +2137,gradient_tensor,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,308,method,"Get the gradient tensor of an x-tensor. + +Args: + x_tensor: (`tf.Tensor`, `tf.Variable` or `str`) The x-tensor object or its + name. x-tensor refers to the independent `tf.Tensor`, i.e., the tensor + on the denominator of the differentiation. + +Returns: + If found, the gradient tensor. + +Raises: + TypeError: If `x_tensor` is not a `tf.Tensor`, `tf.Variable` or `str`. + LookupError: If the `x_tensor` has not been registered with a gradient + tensor." +2138,gradient_tensors,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,331,method,"Get the gradient tensors that this object is aware of. + +Returns: + A dict mapping x-tensor names to gradient tensor objects. x-tensor refers + to the tensors on the denominator of the differentation." +2139,clear_gradient_debuggers,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,351,function,Clear all globally registered gradient debuggers. +2140,gradient_values_from_dump,tensorflow/tensorflow/python/debug/lib/debug_gradients.py,372,function,"Find gradient values from a `DebugDumpDir` object. Args: grad_debugger: the `tf_debug.GradientsDebugger` instance to be used. @@ -12144,9 +14477,7 @@ Raises: ValueError: If this `GradientsDebugger` has a `tf.Graph` object that does not match the `tf.Graph` object of the `dump`. TypeError: If `x_tensor` is not a `tf.Tensor`, `tf.Variable` or `str`." -2430,IdentifyGradientTest,tensorflow/tensorflow/python/debug/lib/debug_gradients_test.py,40,class, -2431,ReconstructNonDebugGraphTest,tensorflow/tensorflow/python/debug/lib/debug_graph_reconstruction_test.py,40,class, -2432,parse_node_or_tensor_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,25,function,"Get the node name from a string that can be node or tensor name. +2141,parse_node_or_tensor_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,25,function,"Get the node name from a string that can be node or tensor name. Args: name: An input node name (e.g., ""node_a"") or tensor name (e.g., @@ -12158,8 +14489,8 @@ Returns: will be stripped. 2) If the input name is a tensor name, the output slot, as an int. If the input name is not a tensor name, None." -2433,get_node_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,49,function, -2434,get_output_slot,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,54,function,"Get the output slot number from the name of a graph element. +2142,get_node_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,49,function, +2143,get_output_slot,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,54,function,"Get the output slot number from the name of a graph element. If element_name is a node name without output slot at the end, 0 will be assumed. @@ -12169,7 +14500,7 @@ Args: Returns: (`int`) output slot number." -2435,is_copy_node,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,70,function,"Determine whether a node name is that of a debug Copy node. +2144,is_copy_node,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,70,function,"Determine whether a node name is that of a debug Copy node. Such nodes are inserted by TensorFlow core upon request in RunOptions.debug_options.debug_tensor_watch_opts. @@ -12180,7 +14511,7 @@ Args: Returns: A bool indicating whether the input argument is the name of a debug Copy node." -2436,is_debug_node,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,86,function,"Determine whether a node name is that of a debug node. +2145,is_debug_node,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,86,function,"Determine whether a node name is that of a debug node. Such nodes are inserted by TensorFlow core upon request in RunOptions.debug_options.debug_tensor_watch_opts. @@ -12190,7 +14521,7 @@ Args: Returns: A bool indicating whether the input argument is the name of a debug node." -2437,parse_debug_node_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,101,function,"Parse the name of a debug node. +2146,parse_debug_node_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,101,function,"Parse the name of a debug node. Args: node_name: Name of the debug node. @@ -12203,11 +14534,32 @@ Returns: Raises: ValueError: If the input node name is not a valid debug node name." -2438,GraphTracingReachedDestination,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,142,class, -2439,DFSGraphTracer,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,146,class,Graph input tracer using depth-first search. -2440,_infer_device_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,223,function,Infer device name from a partition GraphDef. -2441,DebugGraph,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,237,class,Represents a debugger-decorated graph. -2442,reconstruct_non_debug_graph_def,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,481,function,"Reconstruct original (non-debugger-decorated) partition GraphDef. +2147,GraphTracingReachedDestination,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,142,class, +2148,DFSGraphTracer,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,146,class,Graph input tracer using depth-first search. +2149,trace,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,180,method,"Trace inputs. + +Args: + graph_element_name: Name of the node or an output tensor of the node, as a + str. + +Raises: + GraphTracingReachedDestination: if destination_node_name of this tracer + object is not None and the specified node is reached." +2150,inputs,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,216,method, +2151,depth_list,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,219,method, +2152,DebugGraph,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,237,class,Represents a debugger-decorated graph. +2153,device_name,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,434,method, +2154,debug_graph_def,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,438,method,The debugger-decorated GraphDef. +2155,non_debug_graph_def,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,443,method,The GraphDef without the Copy* and Debug* nodes added by the debugger. +2156,node_devices,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,449,method, +2157,node_op_types,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,453,method, +2158,node_attributes,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,457,method, +2159,node_inputs,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,461,method, +2160,node_ctrl_inputs,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,465,method, +2161,node_reversed_ref_inputs,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,469,method, +2162,node_recipients,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,473,method, +2163,node_ctrl_recipients,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,477,method, +2164,reconstruct_non_debug_graph_def,tensorflow/tensorflow/python/debug/lib/debug_graphs.py,481,function,"Reconstruct original (non-debugger-decorated) partition GraphDef. This method strips the input `tf.compat.v1.GraphDef` of the Copy* and Debug*-type nodes inserted by the debugger. @@ -12227,22 +14579,23 @@ Args: Returns: The reconstructed `tf.compat.v1.GraphDef` stripped of the debugger-inserted nodes." -2443,ParseNodeOrTensorNameTest,tensorflow/tensorflow/python/debug/lib/debug_graphs_test.py,25,class, -2444,GetNodeNameAndOutputSlotTest,tensorflow/tensorflow/python/debug/lib/debug_graphs_test.py,42,class, -2445,NodeNameChecksTest,tensorflow/tensorflow/python/debug/lib/debug_graphs_test.py,56,class, -2446,ParseDebugNodeNameTest,tensorflow/tensorflow/python/debug/lib/debug_graphs_test.py,79,class, -2447,_grappler_enabled_session_config,tensorflow/tensorflow/python/debug/lib/debug_grappler_test.py,37,function,"Constructs a Session config proto that explicitly enables Grappler. - -Returns: - A config proto that obtains extra safety for the unit tests in this - file by ensuring that the relevant Grappler rewrites are always enabled." -2448,SessionDebugGrapplerInteractionTest,tensorflow/tensorflow/python/debug/lib/debug_grappler_test.py,51,class, -2449,EventListenerStub,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,30,class,"EventListener: Receives Event protos, e.g., from debugged TensorFlow +2165,EventListenerStub,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,30,class,"EventListener: Receives Event protos, e.g., from debugged TensorFlow runtime(s)." -2450,EventListenerServicer,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,58,class,"EventListener: Receives Event protos, e.g., from debugged TensorFlow +2166,EventListenerServicer,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,58,class,"EventListener: Receives Event protos, e.g., from debugged TensorFlow runtime(s)." -2451,add_EventListenerServicer_to_server,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,91,function, -2452,add_debug_tensor_watch,tensorflow/tensorflow/python/debug/lib/debug_utils.py,26,function,"Add watch on a `Tensor` to `RunOptions`. +2167,SendEvents,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,63,method,"Client(s) can use this RPC method to send the EventListener Event protos. +The Event protos can hold information such as: +1) intermediate tensors from a debugged graph being executed, which can +be sent from DebugIdentity ops configured with grpc URLs. +2) GraphDefs of partition graphs, which can be sent from special debug +ops that get executed immediately after the beginning of the graph +execution." +2168,SendTracebacks,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,76,method,"Send the tracebacks of ops in a Python graph definition. + " +2169,SendSourceFiles,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,83,method,"Send a collection of source code files being debugged. + " +2170,add_EventListenerServicer_to_server,tensorflow/tensorflow/python/debug/lib/debug_service_pb2_grpc.py,91,function, +2171,add_debug_tensor_watch,tensorflow/tensorflow/python/debug/lib/debug_utils.py,26,function,"Add watch on a `Tensor` to `RunOptions`. N.B.: 1. Under certain circumstances, the `Tensor` may not get actually watched @@ -12268,7 +14621,7 @@ Args: creation failures by not throwing exceptions. global_step: (`int`) Optional global_step count for this debug tensor watch." -2453,watch_graph,tensorflow/tensorflow/python/debug/lib/debug_utils.py,82,function,"Add debug watches to `RunOptions` for a TensorFlow graph. +2172,watch_graph,tensorflow/tensorflow/python/debug/lib/debug_utils.py,82,function,"Add debug watches to `RunOptions` for a TensorFlow graph. To watch all `Tensor`s on the graph, let both `node_name_regex_allowlist` and `op_type_regex_allowlist` be the default (`None`). @@ -12312,7 +14665,7 @@ Args: watch. reset_disk_byte_usage: (`bool`) whether to reset the tracked disk byte usage to zero (default: `False`)." -2454,watch_graph_with_denylists,tensorflow/tensorflow/python/debug/lib/debug_utils.py,202,function,"Add debug tensor watches, denylisting nodes and op types. +2173,watch_graph_with_denylists,tensorflow/tensorflow/python/debug/lib/debug_utils.py,202,function,"Add debug tensor watches, denylisting nodes and op types. This is similar to `watch_graph()`, but the node names and op types are denylisted, instead of allowlisted. @@ -12349,25 +14702,8 @@ Args: global_step: (`int`) Optional global_step count for this debug tensor watch. reset_disk_byte_usage: (`bool`) whether to reset the tracked disk byte usage to zero (default: `False`)." -2455,DebugUtilsTest,tensorflow/tensorflow/python/debug/lib/debug_utils_test.py,35,class, -2456,DebugIdentityV2OpTest,tensorflow/tensorflow/python/debug/lib/debug_v2_ops_test.py,43,class,"Tests for DebugIdentityV2Op: when DebugEventsWriter is initialized. - -DebugEventsWriter being initialized prior to DebugIdentityV2 ops being invoked -for the first time is the typical case (e.g., tfdbg2 running on a local -machine with only local devices.)" -2457,DebugIdentityV2OpUninitializedWriterTest,tensorflow/tensorflow/python/debug/lib/debug_v2_ops_test.py,231,class,"Tests for DebugIdentityV2Op: when DebugEventsWriter is not initialized. - -This case can occur when DebugIdentityV2Ops are running on a remote -TensorFlow server (e.g., a TPU worker)." -2458,DebugNumericSummaryV2Test,tensorflow/tensorflow/python/debug/lib/debug_v2_ops_test.py,287,class, -2459,DistributedSessionDebugTest,tensorflow/tensorflow/python/debug/lib/dist_session_debug_grpc_test.py,48,class,Test the debugging of distributed sessions. -2460,is_op_type_function,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,61,function, -2461,_debug_identity_v2_grad,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,66,function,Gradient function for the DebugIdentityV2 op. -2462,_get_tfdbg_run_id,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,72,function, -2463,_get_id,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,76,function,Get a short unique ID. -2464,_concrete_tensor_to_proto,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,81,function, -2465,_DumpingCallback,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,85,class,An object holding the states surrounding the dumping callback. -2466,enable_dump_debug_info,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,687,function,"Enable dumping debugging information from a TensorFlow program. +2174,is_op_type_function,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,61,function, +2175,enable_dump_debug_info,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,687,function,"Enable dumping debugging information from a TensorFlow program. The debugging information is dumped to a directory on the file system specified as `dump_root`. @@ -12476,30 +14812,155 @@ Returns: A DebugEventsWriter instance used by the dumping callback. The caller may use its flushing methods, including `FlushNonExecutionFiles()` and `FlushExecutionFiles()`." -2467,disable_dump_debug_info,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,878,function,"Disable the currently-enabled debugging dumping. +2176,disable_dump_debug_info,tensorflow/tensorflow/python/debug/lib/dumping_callback.py,878,function,"Disable the currently-enabled debugging dumping. If the `enable_dump_debug_info()` method under the same Python namespace has been invoked before, calling this method disables it. If no call to `enable_dump_debug_info()` has been made, calling this method is a no-op. Calling this method more than once is idempotent." -2468,DumpingCallbackTest,tensorflow/tensorflow/python/debug/lib/dumping_callback_test.py,53,class, -2469,DumpingCallbackTestBase,tensorflow/tensorflow/python/debug/lib/dumping_callback_test_lib.py,33,class,Base test-case class for tfdbg v2 callbacks. -2470,_state_change,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,41,function, -2471,EventListenerBaseStreamHandler,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,50,class,Per-stream handler of EventListener gRPC streams. -2472,EventListenerBaseServicer,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,103,class,Base Python class for gRPC debug server. -2473,_get_dump_file_path,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,47,function,"Get the file path of the dump file for a debug node. +2177,EventListenerBaseStreamHandler,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,50,class,Per-stream handler of EventListener gRPC streams. +2178,on_core_metadata_event,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,56,method,"Callback for core metadata. Args: - dump_root: (str) Root dump directory. - device_name: (str) Name of the device that the debug node resides on. - debug_node_name: (str) Name of the debug node, e.g., - cross_entropy/Log:0:DebugIdentity. + event: The Event proto that carries a JSON string in its + `log_message.message` field. Returns: - (str) Full path of the dump file." -2474,EventListenerTestStreamHandler,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,75,class,Implementation of EventListenerBaseStreamHandler that dumps to file. -2475,EventListenerTestServicer,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,217,class,An implementation of EventListenerBaseServicer for testing. -2476,start_server_on_separate_thread,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,368,function,"Create a test gRPC debug server and run on a separate thread. + `None` or an `EventReply` proto to be sent back to the client. If `None`, + an `EventReply` proto construct with the default no-arg constructor will + be sent back to the client." +2179,on_graph_def,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,72,method,"Callback for Event proto received through the gRPC stream. + +This Event proto carries a GraphDef, encoded as bytes, in its graph_def +field. + +Args: + graph_def: A GraphDef object. + device_name: Name of the device on which the graph was created. + wall_time: An epoch timestamp (in microseconds) for the graph. + +Returns: + `None` or an `EventReply` proto to be sent back to the client. If `None`, + an `EventReply` proto construct with the default no-arg constructor will + be sent back to the client." +2180,on_value_event,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,91,method,"Callback for Event proto received through the gRPC stream. + +This Event proto carries a Tensor in its summary.value[0] field. + +Args: + event: The Event proto from the stream to be processed." +2181,EventListenerBaseServicer,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,103,class,Base Python class for gRPC debug server. +2182,SendEvents,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,127,method,"Implementation of the SendEvents service method. + +This method receives streams of Event protos from the client, and processes +them in ways specified in the on_event() callback. The stream is +bi-directional, but currently only the client-to-server stream (i.e., the +stream from the debug ops to the server) is used. + +Args: + request_iterator: The incoming stream of Event protos. + context: Server context. + +Raises: + ValueError: If there are more than one core metadata events. + +Yields: + An empty stream of responses." +2183,run_server,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,332,method,"Start running the server. + +Args: + blocking: If `True`, block until `stop_server()` is invoked. + +Raises: + ValueError: If server stop has already been requested, or if the server + has already started running." +2184,stop_server,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,365,method,"Request server stopping. + +Once stopped, server cannot be stopped or started again. This method is +non-blocking. Call `wait()` on the returned event to block until the server +has completely stopped. + +Args: + grace: Grace period in seconds to be used when calling `server.stop()`. + +Raises: + ValueError: If server stop has already been requested, or if the server + has not started running yet. + +Returns: + A threading.Event that will be set when the server has completely stopped." +2185,request_watch,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,394,method,"Request enabling a debug tensor watchpoint or breakpoint. + +This will let the server send a EventReply to the client side +(i.e., the debugged TensorFlow runtime process) to request adding a watch +key (i.e., ::) to the list of enabled +watch keys. The list applies only to debug ops with the attribute +gated_grpc=True. + +To disable the watch, use `request_unwatch()`. + +Args: + node_name: (`str`) name of the node that the to-be-watched tensor belongs + to, e.g., ""hidden/Weights"". + output_slot: (`int`) output slot index of the tensor to watch. + debug_op: (`str`) name of the debug op to enable. This should not include + any attribute substrings. + breakpoint: (`bool`) Iff `True`, the debug op will block and wait until it + receives an `EventReply` response from the server. The `EventReply` + proto may carry a TensorProto that modifies the value of the debug op's + output tensor." +2186,request_unwatch,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,423,method,"Request disabling a debug tensor watchpoint or breakpoint. + +This is the opposite of `request_watch()`. + +Args: + node_name: (`str`) name of the node that the to-be-watched tensor belongs + to, e.g., ""hidden/Weights"". + output_slot: (`int`) output slot index of the tensor to watch. + debug_op: (`str`) name of the debug op to enable. This should not include + any attribute substrings." +2187,breakpoints,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,441,method,"Get a set of the currently-activated breakpoints. + +Returns: + A `set` of 3-tuples: (node_name, output_slot, debug_op), e.g., + {(""MatMul"", 0, ""DebugIdentity"")}." +2188,gated_grpc_debug_watches,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,450,method,"Get the list of debug watches with attribute gated_grpc=True. + +Since the server receives `GraphDef` from the debugged runtime, it can only +return such debug watches that it has received so far. + +Returns: + A `list` of `DebugWatch` `namedtuples` representing the debug watches with + gated_grpc=True. Each `namedtuple` element has the attributes: + `node_name` as a `str`, + `output_slot` as an `int`, + `debug_op` as a `str`." +2189,SendTracebacks,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,465,method,"Base implementation of the handling of SendTracebacks calls. + +The base implementation does nothing with the incoming request. +Override in an implementation of the server if necessary. + +Args: + request: A `CallTraceback` proto, containing information about the + type (e.g., graph vs. eager execution) and source-code traceback of the + call and (any) associated `tf.Graph`s. + context: Server context. + +Returns: + A `EventReply` proto." +2190,SendSourceFiles,tensorflow/tensorflow/python/debug/lib/grpc_debug_server.py,482,method,"Base implementation of the handling of SendSourceFiles calls. + +The base implementation does nothing with the incoming request. +Override in an implementation of the server if necessary. + +Args: + request: A `DebuggedSourceFiles` proto, containing the path, content, size + and last-modified timestamp of source files. + context: Server context. + +Returns: + A `EventReply` proto." +2191,start_server_on_separate_thread,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,368,function,"Create a test gRPC debug server and run on a separate thread. Args: dump_to_filesystem: (bool) whether the debug server will dump debug data @@ -12523,23 +14984,7 @@ Returns: Raises: ValueError: If polling the server process for ready state is not successful within maximum polling count." -2477,_poll_server_till_success,tensorflow/tensorflow/python/debug/lib/grpc_debug_test_server.py,428,function,"Poll server until success or exceeding max polling count. - -Args: - max_attempts: (int) How many times to poll at maximum - sleep_per_poll_sec: (float) How many seconds to sleep for after each - unsuccessful poll. - debug_server_url: (str) gRPC URL to the debug server. - dump_dir: (str) Dump directory to look for files in. If None, will directly - check data from the server object. - server: The server object. - gpu_memory_fraction: (float) Fraction of GPU memory to be - allocated for the Session used in server polling. - -Returns: - (bool) Whether the polling succeeded within max_polls attempts." -2478,LargeGraphAndLargeTensorsDebugTest,tensorflow/tensorflow/python/debug/lib/grpc_large_data_test.py,41,class, -2479,parse_cluster_spec,tensorflow/tensorflow/python/debug/lib/grpc_tensorflow_server.py,45,function,"Parse content of cluster_spec string and inject info into cluster protobuf. +2192,parse_cluster_spec,tensorflow/tensorflow/python/debug/lib/grpc_tensorflow_server.py,45,function,"Parse content of cluster_spec string and inject info into cluster protobuf. Args: cluster_spec: cluster specification string, e.g., @@ -12549,65 +14994,20 @@ Args: Raises: ValueError: if the cluster_spec string is invalid." -2480,main,tensorflow/tensorflow/python/debug/lib/grpc_tensorflow_server.py,91,function, -2481,ProfileDatum,tensorflow/tensorflow/python/debug/lib/profiling.py,24,class,Profile data point. -2482,AggregateProfile,tensorflow/tensorflow/python/debug/lib/profiling.py,65,class,Profile summary data for aggregating a number of ProfileDatum. -2483,AggregateProfile,tensorflow/tensorflow/python/debug/lib/profiling_test.py,27,class, -2484,SessionDebugFileTest,tensorflow/tensorflow/python/debug/lib/session_debug_file_test.py,38,class, -2485,SessionDebugConcurrentTest,tensorflow/tensorflow/python/debug/lib/session_debug_file_test.py,118,class, -2486,GrpcDebugServerTest,tensorflow/tensorflow/python/debug/lib/session_debug_grpc_test.py,48,class, -2487,SessionDebugGrpcTest,tensorflow/tensorflow/python/debug/lib/session_debug_grpc_test.py,96,class, -2488,SessionDebugConcurrentTest,tensorflow/tensorflow/python/debug/lib/session_debug_grpc_test.py,321,class, -2489,SessionDebugGrpcGatingTest,tensorflow/tensorflow/python/debug/lib/session_debug_grpc_test.py,358,class,Test server gating of debug ops. -2490,DelayedDebugServerTest,tensorflow/tensorflow/python/debug/lib/session_debug_grpc_test.py,736,class, -2491,SessionDebugMultiGPUTest,tensorflow/tensorflow/python/debug/lib/session_debug_multi_gpu_test.py,37,class, -2492,no_rewrite_session_config,tensorflow/tensorflow/python/debug/lib/session_debug_testlib.py,58,function, -2493,_RNNCellForTest,tensorflow/tensorflow/python/debug/lib/session_debug_testlib.py,67,class,RNN cell for testing. -2494,SessionDebugTestBase,tensorflow/tensorflow/python/debug/lib/session_debug_testlib.py,88,class,Base class for unit tests of tfdbg running with tf.Session. -2495,DebugConcurrentRunCallsTest,tensorflow/tensorflow/python/debug/lib/session_debug_testlib.py,1476,class,Test for debugging concurrent Session.run() calls. -2496,_load_debugged_source_file,tensorflow/tensorflow/python/debug/lib/source_remote.py,34,function, -2497,_string_to_id,tensorflow/tensorflow/python/debug/lib/source_remote.py,47,function, -2498,_format_origin_stack,tensorflow/tensorflow/python/debug/lib/source_remote.py,53,function,"Format a traceback stack for a `CallTraceback` proto. +2193,ProfileDatum,tensorflow/tensorflow/python/debug/lib/profiling.py,24,class,Profile data point. +2194,exec_time,tensorflow/tensorflow/python/debug/lib/profiling.py,60,method,Op execution time plus pre- and post-processing. +2195,AggregateProfile,tensorflow/tensorflow/python/debug/lib/profiling.py,65,class,Profile summary data for aggregating a number of ProfileDatum. +2196,add,tensorflow/tensorflow/python/debug/lib/profiling.py,82,method,"Accumulate a new instance of ProfileDatum. Args: - origin_stack: The stack list as returned by `traceback.extract_stack()`. - call_traceback_proto: A `CallTraceback` proto whose fields are to be - populated." -2499,_source_file_paths_outside_tensorflow_py_library,tensorflow/tensorflow/python/debug/lib/source_remote.py,76,function,"Extract source file paths outside TensorFlow Python library. - -Args: - code_defs: An iterable of `CodeDef` protos, i.e., an iterable of stack - traces. - id_to_string: A proto map from integer ids to strings. - -Returns: - An iterable of source file paths outside the TensorFlow Python library." -2500,_send_call_tracebacks,tensorflow/tensorflow/python/debug/lib/source_remote.py,98,function,"Send the tracebacks of a TensorFlow execution call. - -To gRPC debug server(s). This applies to graph execution (`tf.Session.run()`) -calls and eager execution calls. - -If `send_source`, also sends the underlying source files outside the -TensorFlow library. - -Args: - destinations: gRPC destination addresses, a `str` or a `list` of `str`s, - e.g., ""localhost:4242"". If a `list`, gRPC requests containing the same - `CallTraceback` proto payload will be sent to all the destinations. - origin_stack: The traceback stack for the origin of the execution call. For - graph execution, this is the traceback of the `tf.Session.run()` - invocation. For eager execution, this is the traceback of the Python - line that executes the eager operation. - is_eager_execution: (`bool`) whether an eager execution call (i.e., not a - `tf.Session.run` or derived methods) is being sent. - call_key: The key of the execution call, as a string. For graph execution, - this is a string describing the feeds, fetches (and targets) names of the - `tf.Session.run` call. For eager execution, this is ignored. - graph: A Python `tf.Graph` object (i.e., *not* a `tf.compat.v1.GraphDef`), - which contains op tracebacks, if applicable. - send_source: Whether the source files involved in the op tracebacks but - outside the TensorFlow library are to be sent." -2501,send_graph_tracebacks,tensorflow/tensorflow/python/debug/lib/source_remote.py,176,function,"Send the tracebacks of a graph execution call to debug server(s). + profile_datum: (`ProfileDatum`) an instance of `ProfileDatum` to + accumulate to this object." +2197,node_count,tensorflow/tensorflow/python/debug/lib/profiling.py,103,method, +2198,node_exec_count,tensorflow/tensorflow/python/debug/lib/profiling.py,107,method, +2199,AggregateProfile,tensorflow/tensorflow/python/debug/lib/profiling_test.py,27,class, +2200,setUp,tensorflow/tensorflow/python/debug/lib/profiling_test.py,29,method, +2201,no_rewrite_session_config,tensorflow/tensorflow/python/debug/lib/session_debug_testlib.py,58,function, +2202,send_graph_tracebacks,tensorflow/tensorflow/python/debug/lib/source_remote.py,176,function,"Send the tracebacks of a graph execution call to debug server(s). Args: destinations: gRPC destination addresses, a `str` or a `list` of `str`s, @@ -12620,7 +15020,7 @@ Args: which contains op tracebacks. send_source: Whether the source files involved in the op tracebacks but outside the TensorFlow library are to be sent." -2502,send_eager_tracebacks,tensorflow/tensorflow/python/debug/lib/source_remote.py,200,function,"Send the tracebacks of an eager execution call to debug server(s). +2203,send_eager_tracebacks,tensorflow/tensorflow/python/debug/lib/source_remote.py,200,function,"Send the tracebacks of an eager execution call to debug server(s). Args: destinations: gRPC destination addresses, a `str` or a `list` of `str`s, @@ -12628,13 +15028,10 @@ Args: origin_stack: The traceback of the eager operation invocation. send_source: Whether the source files involved in the op tracebacks but outside the TensorFlow library are to be sent." -2503,line_number_above,tensorflow/tensorflow/python/debug/lib/source_remote_test.py,42,function, -2504,SendTracebacksTest,tensorflow/tensorflow/python/debug/lib/source_remote_test.py,46,class, -2505,_norm_abs_path,tensorflow/tensorflow/python/debug/lib/source_utils.py,43,function, -2506,is_extension_uncompiled_python_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,47,function, -2507,is_extension_compiled_python_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,52,function, -2508,_convert_watch_key_to_tensor_name,tensorflow/tensorflow/python/debug/lib/source_utils.py,57,function, -2509,guess_is_tensorflow_py_library,tensorflow/tensorflow/python/debug/lib/source_utils.py,61,function,"Guess whether a Python source file is a part of the tensorflow library. +2204,line_number_above,tensorflow/tensorflow/python/debug/lib/source_remote_test.py,42,function, +2205,is_extension_uncompiled_python_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,47,function, +2206,is_extension_compiled_python_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,52,function, +2207,guess_is_tensorflow_py_library,tensorflow/tensorflow/python/debug/lib/source_utils.py,61,function,"Guess whether a Python source file is a part of the tensorflow library. Special cases: 1) Returns False for unit-test files in the library (*_test.py), @@ -12646,7 +15043,7 @@ Args: Returns: (`bool`) Whether the file is inferred to be a part of the tensorflow library." -2510,load_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,86,function,"Load the content of a Python source code file. +2208,load_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,86,function,"Load the content of a Python source code file. This function covers the following case: 1. source_file_path points to an existing Python (.py) file on the @@ -12665,22 +15062,7 @@ Returns: Raises: IOError: if loading is unsuccessful." -2511,_try_load_par_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,123,function,"Try loading the source code inside a .par file. - -A .par file is a zip-compressed, self-contained Python executable. -It contains the content of individual Python source files that can -be read only through extracting from the zip file. - -Args: - source_file_path: The full path to the file inside the .par file. This - path should include the path to the .par file itself, followed by the - intra-par path, e.g., - ""/tmp/my_executable.par/org-tensorflow/tensorflow/python/foo/bar.py"". - -Returns: - If successful, lines of the source file as a `list` of `str`s. - Else, `None`." -2512,annotate_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,156,function,"Annotate a Python source file with a list of ops created at each line. +2209,annotate_source,tensorflow/tensorflow/python/debug/lib/source_utils.py,156,function,"Annotate a Python source file with a list of ops created at each line. (The annotation doesn't change the source file itself.) @@ -12703,7 +15085,7 @@ Returns: Raises: ValueError: If the dump object does not have a Python graph set." -2513,list_source_files_against_dump,tensorflow/tensorflow/python/debug/lib/source_utils.py,223,function,"Generate a list of source files with information regarding ops and tensors. +2210,list_source_files_against_dump,tensorflow/tensorflow/python/debug/lib/source_utils.py,223,function,"Generate a list of source files with information regarding ops and tensors. Args: dump: (`DebugDumpDir`) A `DebugDumpDir` object of which the Python graph @@ -12732,7 +15114,7 @@ Returns: Raises: ValueError: If the dump object does not have a Python graph set." -2514,annotate_source_against_profile,tensorflow/tensorflow/python/debug/lib/source_utils.py,324,function,"Annotate a Python source file with profiling information at each line. +2211,annotate_source_against_profile,tensorflow/tensorflow/python/debug/lib/source_utils.py,324,function,"Annotate a Python source file with profiling information at each line. (The annotation doesn't change the source file itself.) @@ -12749,7 +15131,7 @@ Args: Returns: A `dict` mapping 1-based line number to a the namedtuple `profiling.LineOrFuncProfileSummary`." -2515,line_number_above,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,47,function,"Get lineno of the AST node immediately above this function's call site. +2212,line_number_above,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,47,function,"Get lineno of the AST node immediately above this function's call site. It is assumed that there is no empty line(s) between the call site and the preceding AST node. @@ -12759,55 +15141,138 @@ Returns: If the preceding AST spans multiple lines: - In Python 3.8+, the lineno of the first line is returned. - In older Python versions, the lineno of the last line is returned." -2516,_find_preceding_ast_node,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,74,function,Find the ast node immediately before and not including lineno. -2517,GuessIsTensorFlowLibraryTest,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,85,class, -2518,SourceHelperTest,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,141,class, -2519,ListSourceAgainstDumpTest,tensorflow/tensorflow/python/debug/lib/source_utils_test.py,324,class, -2520,DumpingDebugWrapperDiskUsageLimitTest,tensorflow/tensorflow/python/debug/wrappers/disk_usage_test.py,36,class, -2521,DumpingDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/dumping_wrapper.py,31,class,Debug Session wrapper that dumps debug data to filesystem. -2522,DumpingDebugWrapperSessionTest,tensorflow/tensorflow/python/debug/wrappers/dumping_wrapper_test.py,44,class, -2523,_check_type,tensorflow/tensorflow/python/debug/wrappers/framework.py,119,function,"Check if an object is of the expected type. +2213,DumpingDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/dumping_wrapper.py,31,class,Debug Session wrapper that dumps debug data to filesystem. +2214,prepare_run_debug_urls,tensorflow/tensorflow/python/debug/wrappers/dumping_wrapper.py,92,method,"Implementation of abstract method in superclass. + +See doc of `NonInteractiveDebugWrapperSession.prepare_run_debug_urls()` +for details. This implementation creates a run-specific subdirectory under +self._session_root and stores information regarding run `fetches` and +`feed_dict.keys()` in the subdirectory. Args: - obj: The object being checked. - expected_types: (`type` or an iterable of `type`s) The expected `type`(s) - of obj. + fetches: Same as the `fetches` argument to `Session.run()` + feed_dict: Same as the `feed_dict` argument to `Session.run()` -Raises: - TypeError: If obj is not an instance of expected_type." -2524,OnSessionInitRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,135,class,"Request to an on-session-init callback. +Returns: + debug_urls: (`str` or `list` of `str`) file:// debug URLs to be used in + this `Session.run()` call." +2215,OnSessionInitRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,135,class,"Request to an on-session-init callback. This callback is invoked during the __init__ call to a debug-wrapper session." -2525,OnSessionInitAction,tensorflow/tensorflow/python/debug/wrappers/framework.py,152,class,Enum-like values for possible action to take on session init. -2526,OnSessionInitResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,168,class,Response from an on-session-init callback. -2527,OnRunStartRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,181,class,"Request to an on-run-start callback. +2216,OnSessionInitAction,tensorflow/tensorflow/python/debug/wrappers/framework.py,152,class,Enum-like values for possible action to take on session init. +2217,OnSessionInitResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,168,class,Response from an on-session-init callback. +2218,OnRunStartRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,181,class,"Request to an on-run-start callback. This callback is invoked during a run() call of the debug-wrapper session, immediately after the run() call counter is incremented." -2528,OnRunStartAction,tensorflow/tensorflow/python/debug/wrappers/framework.py,212,class,Enum-like values for possible action to take on start of a run() call. -2529,OnRunStartResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,226,class,"Request from an on-run-start callback. +2219,OnRunStartAction,tensorflow/tensorflow/python/debug/wrappers/framework.py,212,class,Enum-like values for possible action to take on start of a run() call. +2220,OnRunStartResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,226,class,"Request from an on-run-start callback. The caller of the callback can use this response object to specify what action the debug-wrapper session actually takes on the run() call." -2530,OnRunEndRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,274,class,"Request to an on-run-end callback. +2221,OnRunEndRequest,tensorflow/tensorflow/python/debug/wrappers/framework.py,274,class,"Request to an on-run-end callback. The callback is invoked immediately before the wrapped run() call ends." -2531,OnRunEndResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,308,class,Response from an on-run-end callback. -2532,BaseDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/framework.py,318,class,"Base class of debug-wrapper session classes. +2222,OnRunEndResponse,tensorflow/tensorflow/python/debug/wrappers/framework.py,308,class,Response from an on-run-end callback. +2223,BaseDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/framework.py,318,class,"Base class of debug-wrapper session classes. Concrete classes that inherit from this class need to implement the abstract methods such as on_session_init, on_run_start and on_run_end." -2533,WatchOptions,tensorflow/tensorflow/python/debug/wrappers/framework.py,835,class,Type for return values of watch_fn. -2534,NonInteractiveDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/framework.py,885,class,"Base class for non-interactive (i.e., non-CLI) debug wrapper sessions." -2535,TestDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/framework_test.py,47,class,A concrete implementation of BaseDebugWrapperSession for test. -2536,TestDebugWrapperSessionBadAction,tensorflow/tensorflow/python/debug/wrappers/framework_test.py,91,class,"A concrete implementation of BaseDebugWrapperSession for test. +2224,graph,tensorflow/tensorflow/python/debug/wrappers/framework.py,382,method, +2225,graph_def,tensorflow/tensorflow/python/debug/wrappers/framework.py,386,method, +2226,sess_str,tensorflow/tensorflow/python/debug/wrappers/framework.py,390,method, +2227,session,tensorflow/tensorflow/python/debug/wrappers/framework.py,394,method, +2228,run,tensorflow/tensorflow/python/debug/wrappers/framework.py,397,method,"Wrapper around Session.run() that inserts tensor watch options. -This class intentionally puts a bad action value in OnSessionInitResponse -and/or in OnRunStartAction to test the handling of such invalid cases." -2537,DebugWrapperSessionTest,tensorflow/tensorflow/python/debug/wrappers/framework_test.py,145,class, -2538,_is_public_method_name,tensorflow/tensorflow/python/debug/wrappers/framework_test.py,411,function, -2539,SessionWrapperPublicMethodParityTest,tensorflow/tensorflow/python/debug/wrappers/framework_test.py,416,class, -2540,publish_traceback,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,31,function,"Publish traceback and source code if graph version is new. +Args: + fetches: Same as the `fetches` arg to regular `Session.run()`. + feed_dict: Same as the `feed_dict` arg to regular `Session.run()`. + options: Same as the `options` arg to regular `Session.run()`. + run_metadata: Same as the `run_metadata` arg to regular `Session.run()`. + callable_runner: A `callable` returned by `Session.make_callable()`. + If not `None`, `fetches` and `feed_dict` must both be `None`. + Mutually exclusive with `callable_options`. + callable_runner_args: An optional list of arguments to `callable_runner` + or for `callable_options`. + callable_options: An instance of `config_pb2.CallableOptions`, to be + used with `Session._make_callable_from_options()`. Mutually exclusive + with `callable_runner`. + +Returns: + Simply forwards the output of the wrapped `Session.run()` call. + +Raises: + ValueError: On invalid `OnRunStartAction` value. Or if `callable_runner` + is not `None` and either or both of `fetches` and `feed_dict` is `None`." +2229,run_step_fn,tensorflow/tensorflow/python/debug/wrappers/framework.py,643,method, +2230,partial_run_setup,tensorflow/tensorflow/python/debug/wrappers/framework.py,647,method,Sets up the feeds and fetches for partial runs in the session. +2231,partial_run,tensorflow/tensorflow/python/debug/wrappers/framework.py,652,method, +2232,list_devices,tensorflow/tensorflow/python/debug/wrappers/framework.py,656,method, +2233,reset,tensorflow/tensorflow/python/debug/wrappers/framework.py,659,method, +2234,make_callable,tensorflow/tensorflow/python/debug/wrappers/framework.py,662,method, +2235,run_call_count,tensorflow/tensorflow/python/debug/wrappers/framework.py,686,method, +2236,increment_run_call_count,tensorflow/tensorflow/python/debug/wrappers/framework.py,689,method, +2237,on_session_init,tensorflow/tensorflow/python/debug/wrappers/framework.py,755,method,"Callback invoked during construction of the debug-wrapper session. + +This is a blocking callback. +The invocation happens right before the constructor ends. + +Args: + request: (`OnSessionInitRequest`) callback request carrying information + such as the session being wrapped. + +Returns: + An instance of `OnSessionInitResponse`." +2238,on_run_start,tensorflow/tensorflow/python/debug/wrappers/framework.py,770,method,"Callback invoked on run() calls to the debug-wrapper session. + +This is a blocking callback. +The invocation happens after the wrapper's run() call is entered, +after an increment of run call counter. + +Args: + request: (`OnRunStartRequest`) callback request object carrying + information about the run call such as the fetches, feed dict, run + options, run metadata, and how many `run()` calls to this wrapper + session have occurred. + +Returns: + An instance of `OnRunStartResponse`, carrying information to + debug URLs used to watch the tensors." +2239,on_run_end,tensorflow/tensorflow/python/debug/wrappers/framework.py,789,method,"Callback invoked on run() calls to the debug-wrapper session. + +This is a blocking callback. +The invocation happens right before the wrapper exits its run() call. + +Args: + request: (`OnRunEndRequest`) callback request object carrying information + such as the actual action performed by the session wrapper for the + run() call. + +Returns: + An instance of `OnRunStartResponse`." +2240,as_default,tensorflow/tensorflow/python/debug/wrappers/framework.py,804,method, +2241,close,tensorflow/tensorflow/python/debug/wrappers/framework.py,820,method, +2242,should_stop,tensorflow/tensorflow/python/debug/wrappers/framework.py,826,method, +2243,is_empty,tensorflow/tensorflow/python/debug/wrappers/framework.py,444,method,Check whether a possibly nested structure is empty. +2244,wrapped_runner,tensorflow/tensorflow/python/debug/wrappers/framework.py,668,method, +2245,wrapped_runner,tensorflow/tensorflow/python/debug/wrappers/framework.py,678,method, +2246,WatchOptions,tensorflow/tensorflow/python/debug/wrappers/framework.py,835,class,Type for return values of watch_fn. +2247,NonInteractiveDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/framework.py,885,class,"Base class for non-interactive (i.e., non-CLI) debug wrapper sessions." +2248,on_session_init,tensorflow/tensorflow/python/debug/wrappers/framework.py,924,method,See doc of BaseDebugWrapperSession.on_run_start. +2249,prepare_run_debug_urls,tensorflow/tensorflow/python/debug/wrappers/framework.py,930,method,"Abstract method to be implemented by concrete subclasses. + +This method prepares the run-specific debug URL(s). + +Args: + fetches: Same as the `fetches` argument to `Session.run()` + feed_dict: Same as the `feed_dict` argument to `Session.run()` + +Returns: + debug_urls: (`str` or `list` of `str`) Debug URLs to be used in + this `Session.run()` call." +2250,on_run_start,tensorflow/tensorflow/python/debug/wrappers/framework.py,944,method,See doc of BaseDebugWrapperSession.on_run_start. +2251,on_run_end,tensorflow/tensorflow/python/debug/wrappers/framework.py,985,method,See doc of BaseDebugWrapperSession.on_run_end. +2252,publish_traceback,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,31,function,"Publish traceback and source code if graph version is new. `graph.version` is compared with `old_graph_version`. If the former is higher (i.e., newer), the graph traceback and the associated source code is sent to @@ -12824,10 +15289,21 @@ Args: Returns: If `graph.version > old_graph_version`, the new graph version as an `int`. Else, the `old_graph_version` is returned." -2541,GrpcDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,69,class,Debug Session wrapper that send debug data to gRPC stream(s). -2542,_signal_handler,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,144,function, -2543,register_signal_handler,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,154,function, -2544,TensorBoardDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,162,class,"A tfdbg Session wrapper that can be used with TensorBoard Debugger Plugin. +2253,GrpcDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,69,class,Debug Session wrapper that send debug data to gRPC stream(s). +2254,prepare_run_debug_urls,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,122,method,"Implementation of abstract method in superclass. + +See doc of `NonInteractiveDebugWrapperSession.prepare_run_debug_urls()` +for details. + +Args: + fetches: Same as the `fetches` argument to `Session.run()` + feed_dict: Same as the `feed_dict` argument to `Session.run()` + +Returns: + debug_urls: (`str` or `list` of `str`) file:// debug URLs to be used in + this `Session.run()` call." +2255,register_signal_handler,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,154,function, +2256,TensorBoardDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,162,class,"A tfdbg Session wrapper that can be used with TensorBoard Debugger Plugin. This wrapper is the same as `GrpcDebugWrapperSession`, except that it uses a predefined `watch_fn` that @@ -12836,17 +15312,37 @@ This wrapper is the same as `GrpcDebugWrapperSession`, except that it uses a breakpoints. 2) watches all tensors in the graph. This saves the need for the user to define a `watch_fn`." -2545,LocalCLIDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,30,class,"Command-line-interface debugger hook. +2257,run,tensorflow/tensorflow/python/debug/wrappers/grpc_wrapper.py,212,method, +2258,LocalCLIDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,30,class,"Command-line-interface debugger hook. Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and `tf.estimator.Estimator`s. Provides a substitute for `tfdbg.LocalCLIDebugWrapperSession` in cases where the session is not directly available." -2546,DumpingDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,151,class,"A debugger hook that dumps debug data to filesystem. +2259,add_tensor_filter,tensorflow/tensorflow/python/debug/wrappers/hooks.py,67,method,"Add a tensor filter. + +See doc of `LocalCLIDebugWrapperSession.add_tensor_filter()` for details. +Override default behavior to accommodate the possibility of this method +being +called prior to the initialization of the underlying +`LocalCLIDebugWrapperSession` object. + +Args: + filter_name: See doc of `LocalCLIDebugWrapperSession.add_tensor_filter()` + for details. + tensor_filter: See doc of + `LocalCLIDebugWrapperSession.add_tensor_filter()` for details." +2260,begin,tensorflow/tensorflow/python/debug/wrappers/hooks.py,88,method, +2261,before_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,91,method, +2262,after_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,143,method, +2263,DumpingDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,151,class,"A debugger hook that dumps debug data to filesystem. Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and `tf.estimator.Estimator`s." -2547,GrpcDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,223,class,"A hook that streams debugger-related events to any grpc_debug_server. +2264,begin,tensorflow/tensorflow/python/debug/wrappers/hooks.py,182,method, +2265,before_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,185,method, +2266,after_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,219,method, +2267,GrpcDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,223,class,"A hook that streams debugger-related events to any grpc_debug_server. For example, the debugger data server is a grpc_debug_server. The debugger data server writes debugger-related events it receives via GRPC to logdir. @@ -12857,7 +15353,15 @@ changing arguments here too so that features are available to tflearn users. Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and `tf.estimator.Estimator`s." -2548,TensorBoardDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,305,class,"A tfdbg hook that can be used with TensorBoard Debugger Plugin. +2268,before_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,266,method,"Called right before a session is run. + +Args: + run_context: A session_run_hook.SessionRunContext. Encapsulates + information on the run. + +Returns: + A session_run_hook.SessionRunArgs object." +2269,TensorBoardDebugHook,tensorflow/tensorflow/python/debug/wrappers/hooks.py,305,class,"A tfdbg hook that can be used with TensorBoard Debugger Plugin. This hook is the same as `GrpcDebugHook`, except that it uses a predefined `watch_fn` that @@ -12866,106 +15370,44 @@ This hook is the same as `GrpcDebugHook`, except that it uses a predefined breakpoints. 2) watches all tensors in the graph. This saves the need for the user to define a `watch_fn`." -2549,LocalCLIDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,43,class,"Concrete subclass of BaseDebugWrapperSession implementing a local CLI. +2270,before_run,tensorflow/tensorflow/python/debug/wrappers/hooks.py,351,method, +2271,LocalCLIDebugWrapperSession,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,43,class,"Concrete subclass of BaseDebugWrapperSession implementing a local CLI. This class has all the methods that a `session.Session` object has, in order to support debugging with minimal code changes. Invoking its `run()` method will launch the command-line interface (CLI) of tfdbg." -2550,LocalCLIDebuggerWrapperSessionForTest,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper_test.py,52,class,"Subclasses the wrapper class for testing. - -Overrides its CLI-related methods for headless testing environments. -Inserts observer variables for assertions." -2551,LocalCLIDebugWrapperSessionTest,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper_test.py,136,class, -2552,_flatten_tensors,tensorflow/tensorflow/python/distribute/all_reduce.py,31,function,"Check tensors for isomorphism and flatten. +2272,add_tensor_filter,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,209,method,"Add a tensor filter. Args: - tensors: list of `tf.Tensor` which must all have the same shape. - -Returns: - tensors: a list of `tf.Tensor` which are flattened (1D) views of tensors - shape: the original shape of each element of input tensors - -Raises: - ValueError: tensors are empty or non-isomorphic or have unknown shape." -2553,_reshape_tensors,tensorflow/tensorflow/python/distribute/all_reduce.py,60,function,"Reshape tensors flattened by _flatten_tensors. + filter_name: (`str`) name of the filter. + tensor_filter: (`callable`) the filter callable. See the doc string of + `DebugDumpDir.find()` for more details about its signature." +2273,on_session_init,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,220,method,"Overrides on-session-init callback. Args: - tensors: list of `tf.Tensor` of identical length 1D tensors. - shape: list of integers describing the desired shape. Product of - the elements must equal the length of each tensor. + request: An instance of `OnSessionInitRequest`. Returns: - list of `tf.Tensor` which are the reshaped inputs." -2554,_padded_split,tensorflow/tensorflow/python/distribute/all_reduce.py,78,function,"Like split for 1D tensors but pads-out case where len % pieces != 0. + An instance of `OnSessionInitResponse`." +2274,on_run_start,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,233,method,"Overrides on-run-start callback. Args: - tensor: `tf.Tensor` that must be 1D. - pieces: a positive integer specifying the number of pieces into which - tensor should be split. + request: An instance of `OnRunStartRequest`. Returns: - list of `tf.Tensor` of length pieces, which hold the values of - thin input tensor, in order. The final tensor may - be zero-padded on the end to make its size equal to those of all - of the other tensors. + An instance of `OnRunStartResponse`." +2275,on_run_end,tensorflow/tensorflow/python/debug/wrappers/local_cli_wrapper.py,306,method,"Overrides on-run-end callback. -Raises: - ValueError: The input tensor is not 1D." -2555,_strip_padding,tensorflow/tensorflow/python/distribute/all_reduce.py,131,function,"Strip the suffix padding added by _padded_split. +Actions taken: + 1) Load the debug dump. + 2) Bring up the Analyzer CLI. Args: - tensors: list of `tf.Tensor` of identical length 1D tensors. - pad_len: number of elements to be stripped from the end of each tensor. + request: An instance of OnSessionInitRequest. Returns: - list of `tf.Tensor` which are the stripped inputs. - -Raises: - ValueError: tensors must be a non-empty list of 1D tensors, and - each must be longer than pad_len." -2556,_ragged_split,tensorflow/tensorflow/python/distribute/all_reduce.py,160,function,"Like split for 1D tensors but allows case where len % pieces != 0. - -Args: - tensor: `tf.Tensor` that must be 1D. - pieces: a positive integer specifying the number of pieces into which - tensor should be split. - -Returns: - list of `tf.Tensor` of length pieces, which hold the values of - the input tensor, in order. The final tensor may be shorter - than the others, which will all be of equal length. - -Raises: - ValueError: input tensor must be 1D." -2557,_ring_permutations,tensorflow/tensorflow/python/distribute/all_reduce.py,193,function,"""Generate an array of device index arrays, one for each subchunk. - -In the basic ring reduction algorithm there are size(T)/num_devices -data chunks and each device process one chunk per tick, i.e. sending -one chunk and receiving one chunk. The idea of subchunking is that -each device processes num_subchunks smaller data regions per tick, -and the ring rank permutation is different for each subchunk index -so that a device is potentially sending to and receiving from -num_subchunks different other devices at each tick. Where multiple -independent data channels exist between devices, this strategy -supplies a method of using them in parallel. - -Args: - num_workers: number of worker tasks - num_subchunks: number of subchunks into which to divide each per-GPU chunk. - gpu_perm: an array of integers in [0, num_gpus-1] giving the default - ring order of GPUs at each worker. Other permutations will be generated - by rotating this array and splicing together per-worker instances. - -Raises: - ValueError: the number of subchunks may not exceed the number of GPUs. - -Returns: - pred_by_s_d: list of lists that maps (by index) from (subchunk, dev) to - preceding device in the permutation for that subchunk. The - device index of GPU i at worker j is i + (j * num_gpus). - rank_by_s_d: list of lists that maps (by index) from (subchunk, dev) to - local rank of device d in the permutation for that subchunk." -2558,build_ring_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,254,function,"Construct a subgraph performing a ring-style all-reduce of input_tensors. + An instance of OnSessionInitResponse." +2276,build_ring_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,254,function,"Construct a subgraph performing a ring-style all-reduce of input_tensors. Args: input_tensors: a list of `tf.Tensor` objects, which must all @@ -12985,47 +15427,7 @@ Raises: Returns: a list of `tf.Tensor` identical sum-reductions of input_tensors." -2559,_build_ring_gather,tensorflow/tensorflow/python/distribute/all_reduce.py,297,function,"Construct a subgraph for the first (reduction) pass of ring all-reduce. - -Args: - input_tensors: a list of `tf.Tensor` 1D input tensors of same - shape and type. - devices: array of device name strings - num_subchunks: number of subchunks each device should process in one tick. - pred_by_s_d: as produced by _ring_permutations - rank_by_s_d: as produced by _ring_permutations - red_op: a binary operator for elementwise reduction - -Raises: - ValueError: tensors must all be one dimensional. - -Returns: - list of list of `tf.Tensor` of (partially) reduced values where - exactly num_subchunks chunks at each device are fully reduced." -2560,_apply_unary_to_chunks,tensorflow/tensorflow/python/distribute/all_reduce.py,359,function,"Apply a unary op to each tensor in chunks_by_dev, on same device. - -Args: - f: a unary function over `tf.Tensor`. - chunks_by_dev: list of lists of `tf.Tensor`. - -Returns: - new list of lists of `tf.Tensor` with the same structure as - chunks_by_dev containing the derived tensors." -2561,_build_ring_scatter,tensorflow/tensorflow/python/distribute/all_reduce.py,377,function,"Construct subgraph for second (scatter) pass of ring all-reduce. - -Args: - pred_by_s_d: as produced by _ring_permutations - rank_by_s_d: as produced by _ring_permutations - chunks_by_dev: list of list of `tf.Tensor` indexed by ints - (device, chunk) - -Raises: - ValueError: chunks_by_dev is not well-formed - -Returns: - list of `tf.Tensor` which are the fully reduced tensors, one - at each device corresponding to the outer dimension of chunks_by_dev." -2562,build_recursive_hd_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,426,function,"Construct a subgraph for recursive halving-doubling all-reduce. +2277,build_recursive_hd_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,426,function,"Construct a subgraph for recursive halving-doubling all-reduce. The recursive halving-doubling algorithm is described in (Thakur et al., 2015). @@ -13066,30 +15468,7 @@ References: [Thakur et al., 2005] (https://journals.sagepub.com/doi/abs/10.1177/1094342005051521) ([pdf](http://wwwi10.lrr.in.tum.de/~gerndt/home/Teaching/HPCSeminar/mpich_multi_coll.pdf))" -2563,_build_recursive_hd_gather,tensorflow/tensorflow/python/distribute/all_reduce.py,480,function,"Construct the gather phase of recursive halving-doubling all-reduce. - -Args: - input_tensors: list of `tf.Tensor` to be elementwise reduced. - devices: a list of strings naming the devices hosting input_tensors, - which will also be used to host the (partial) reduction values. - red_op: a binary elementwise reduction Op. - -Returns: - list of `tf.Tensor` which are the fully reduced tensor shards. - -Raises: - ValueError: num_devices not a power of 2, or tensor len not divisible - by 2 the proper number of times." -2564,_build_recursive_hd_scatter,tensorflow/tensorflow/python/distribute/all_reduce.py,521,function,"Construct the scatter phase of recursive halving-doubling all-reduce. - -Args: - input_tensors: list of `tf.Tensor` that are fully-reduced shards. - devices: a list of strings naming the devices on which the reconstituted - full tensors should be placed. - -Returns: - list of `tf.Tensor` which are the fully reduced tensors." -2565,build_shuffle_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,558,function,"Construct a subgraph for shuffle all-reduce. +2278,build_shuffle_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,558,function,"Construct a subgraph for shuffle all-reduce. Shuffle reduce is essentially the algorithm implemented when using parameter servers. Suppose tensor length is n, there are d devices @@ -13111,46 +15490,7 @@ Args: Returns: list of `tf.Tensor` which are the fully reduced tensors." -2566,_build_shuffle_gather,tensorflow/tensorflow/python/distribute/all_reduce.py,592,function,"Construct the gather (concentrate and reduce) phase of shuffle all-reduce. - -Args: - input_tensors: list of `tf.Tensor` values to be reduced. - gather_devices: list of names of devices on which reduction shards - should be placed. - red_op: the binary reduction Op - un_op: optional elementwise unary Op to be applied to fully-reduced values. - -Returns: - list of `tf.Tensor` which are the fully reduced shards. - -Raises: - ValueError: inputs not well-formed." -2567,_build_shuffle_scatter,tensorflow/tensorflow/python/distribute/all_reduce.py,629,function,"Build the scatter phase of shuffle all-reduce. - -Args: - reduced_shards: list of `tf.Tensor` fully reduced shards - dst_devices: list of names of devices at which the fully-reduced value - should be reconstituted. - -Returns: - list of `tf.Tensor` scattered tensors." -2568,_split_by_task,tensorflow/tensorflow/python/distribute/all_reduce.py,648,function,"Partition devices and values by common task. - -Args: - devices: list of device name strings - values: list of `tf.Tensor` of same length as devices. - -Returns: - (per_task_devices, per_task_values) where both values are - lists of lists with isomorphic structure: the outer list is - indexed by task, and the inner list has length of the number - of values belonging to that task. per_task_devices contains - the specific devices to which the values are local, and - per_task_values contains the corresponding values. - -Raises: - ValueError: devices must be same length as values." -2569,build_nccl_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,685,function,"Build a subgraph that does one full all-reduce, using NCCL. +2279,build_nccl_all_reduce,tensorflow/tensorflow/python/distribute/all_reduce.py,685,function,"Build a subgraph that does one full all-reduce, using NCCL. Args: input_tensors: list of `tf.Tensor` of same-shape and type values to @@ -13164,43 +15504,12 @@ Returns: Raises: ValueError: red_op not supported." -2570,_build_nccl_hybrid,tensorflow/tensorflow/python/distribute/all_reduce.py,714,function,"Construct a subgraph for NCCL hybrid all-reduce. - -Args: - input_tensors: list of `tf.Tensor` of same-shape and type values to - be reduced. - red_op: binary elementwise reduction operator. - upper_level_f: function for reducing one value per worker, across - workers. - -Returns: - list of `tf.Tensor` of reduced values. - -Raises: - ValueError: inputs not well-formed." -2571,_reduce_non_singleton,tensorflow/tensorflow/python/distribute/all_reduce.py,765,function,"If len(input_tensors) > 1, apply red_f, else apply un_op." -2572,build_nccl_then_ring,tensorflow/tensorflow/python/distribute/all_reduce.py,779,function,"Construct hybrid of NCCL within workers, Ring across workers." -2573,build_nccl_then_recursive_hd,tensorflow/tensorflow/python/distribute/all_reduce.py,788,function,"Construct hybrid of NCCL within workers, Recursive-HD across workers." -2574,build_nccl_then_shuffle,tensorflow/tensorflow/python/distribute/all_reduce.py,794,function,"Construct hybrid of NCCL within workers, Shuffle across workers." -2575,_build_shuffle_hybrid,tensorflow/tensorflow/python/distribute/all_reduce.py,803,function,"Construct a subgraph for Shuffle hybrid all-reduce. - -Args: - input_tensors: list of `tf.Tensor` of same-shape and type values to - be reduced. - gather_devices: list of device names on which to host gather shards. - red_op: binary elementwise reduction operator. - upper_level_f: function for reducing one value per worker, across - workers. - -Returns: - list of `tf.Tensor` of reduced values. - -Raises: - ValueError: inputs not well-formed." -2576,build_shuffle_then_ring,tensorflow/tensorflow/python/distribute/all_reduce.py,845,function,"Construct hybrid of Shuffle within workers, Ring across workers." -2577,build_shuffle_then_shuffle,tensorflow/tensorflow/python/distribute/all_reduce.py,857,function,"Construct hybrid of Shuffle within workers, Shuffle across workers." -2578,AllReduceTest,tensorflow/tensorflow/python/distribute/all_reduce_test.py,38,class, -2579,CentralStorageStrategy,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,28,class,"A one-machine strategy that puts all variables on a single device. +2280,build_nccl_then_ring,tensorflow/tensorflow/python/distribute/all_reduce.py,779,function,"Construct hybrid of NCCL within workers, Ring across workers." +2281,build_nccl_then_recursive_hd,tensorflow/tensorflow/python/distribute/all_reduce.py,788,function,"Construct hybrid of NCCL within workers, Recursive-HD across workers." +2282,build_nccl_then_shuffle,tensorflow/tensorflow/python/distribute/all_reduce.py,794,function,"Construct hybrid of NCCL within workers, Shuffle across workers." +2283,build_shuffle_then_ring,tensorflow/tensorflow/python/distribute/all_reduce.py,845,function,"Construct hybrid of Shuffle within workers, Ring across workers." +2284,build_shuffle_then_shuffle,tensorflow/tensorflow/python/distribute/all_reduce.py,857,function,"Construct hybrid of Shuffle within workers, Shuffle across workers." +2285,CentralStorageStrategy,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,28,class,"A one-machine strategy that puts all variables on a single device. Variables are assigned to local CPU or the only GPU. If there is more than one GPU, compute operations (other than variable update operations) @@ -13224,11 +15533,160 @@ with strategy.scope(): # process dataset elements strategy.run(train_step, args=(x,)) ```" -2580,CentralStorageStrategyV1,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,256,class, -2581,_create_checkpoints,tensorflow/tensorflow/python/distribute/checkpoint_utils_test.py,42,function, -2582,CheckpointUtilsWithDistributionStrategyTest,tensorflow/tensorflow/python/distribute/checkpoint_utils_test.py,58,class, -2583,TrainingCheckpointTests,tensorflow/tensorflow/python/distribute/checkpointing_test.py,32,class, -2584,CollectiveAllReduceStrategy,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,48,class,"A distribution strategy for synchronous training on multiple workers. +2286,experimental_distribute_dataset,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,77,method,"Distributes a tf.data.Dataset instance provided via dataset. + +The returned dataset is a wrapped strategy dataset which creates a +multidevice iterator under the hood. It prefetches the input data to the +specified devices on the worker. The returned distributed dataset can be +iterated over similar to how regular datasets can. + +NOTE: Currently, the user cannot add any more transformations to a +distributed dataset. + +For Example: +``` +strategy = tf.distribute.CentralStorageStrategy() # with 1 CPU and 1 GPU +dataset = tf.data.Dataset.range(10).batch(2) +dist_dataset = strategy.experimental_distribute_dataset(dataset) +for x in dist_dataset: + print(x) # Prints PerReplica values [0, 1], [2, 3],... + +``` +Args: + dataset: `tf.data.Dataset` to be prefetched to device. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. + +Returns: + A ""distributed `Dataset`"" that the caller can iterate over." +2287,experimental_distribute_datasets_from_function,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,108,method,"Distributes `tf.data.Dataset` instances created by calls to `dataset_fn`. + +`dataset_fn` will be called once for each worker in the strategy. In this +case, we only have one worker so `dataset_fn` is called once. Each replica +on this worker will then dequeue a batch of elements from this local +dataset. + +The `dataset_fn` should take an `tf.distribute.InputContext` instance where +information about batching and input replication can be accessed. + +For Example: +``` +def dataset_fn(input_context): + batch_size = input_context.get_per_replica_batch_size(global_batch_size) + d = tf.data.Dataset.from_tensors([[1.]]).repeat().batch(batch_size) + return d.shard( + input_context.num_input_pipelines, input_context.input_pipeline_id) + +inputs = strategy.experimental_distribute_datasets_from_function(dataset_fn) + +for batch in inputs: + replica_results = strategy.run(replica_fn, args=(batch,)) +``` + +IMPORTANT: The `tf.data.Dataset` returned by `dataset_fn` should have a +per-replica batch size, unlike `experimental_distribute_dataset`, which uses +the global batch size. This may be computed using +`input_context.get_per_replica_batch_size`. + +Args: + dataset_fn: A function taking a `tf.distribute.InputContext` instance and + returning a `tf.data.Dataset`. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. + +Returns: + A ""distributed `Dataset`"", which the caller can iterate over like regular + datasets." +2288,experimental_local_results,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,154,method,"Returns the list of all local per-replica values contained in `value`. + +In `CentralStorageStrategy` there is a single worker so the value returned +will be all the values on that worker. + +Args: + value: A value returned by `run()`, `extended.call_for_each_replica()`, + or a variable created in `scope`. + +Returns: + A tuple of values contained in `value`. If `value` represents a single + value, this returns `(value,).`" +2289,run,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,170,method,"Run `fn` on each replica, with the given arguments. + +In `CentralStorageStrategy`, `fn` is called on each of the compute +replicas, with the provided ""per replica"" arguments specific to that device. + +Args: + fn: The function to run. The output must be a `tf.nest` of `Tensor`s. + args: (Optional) Positional arguments to `fn`. + kwargs: (Optional) Keyword arguments to `fn`. + options: (Optional) An instance of `tf.distribute.RunOptions` specifying + the options to run `fn`. + +Returns: + Return value from running `fn`." +2290,reduce,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,188,method,"Reduce `value` across replicas. + +Given a per-replica value returned by `run`, say a +per-example loss, the batch will be divided across all the replicas. This +function allows you to aggregate across replicas and optionally also across +batch elements. For example, if you have a global batch size of 8 and 2 +replicas, values for examples `[0, 1, 2, 3]` will be on replica 0 and +`[4, 5, 6, 7]` will be on replica 1. By default, `reduce` will just +aggregate across replicas, returning `[0+4, 1+5, 2+6, 3+7]`. This is useful +when each replica is computing a scalar or some other value that doesn't +have a ""batch"" dimension (like a gradient). More often you will want to +aggregate across the global batch, which you can get by specifying the batch +dimension as the `axis`, typically `axis=0`. In this case it would return a +scalar `0+1+2+3+4+5+6+7`. + +If there is a last partial batch, you will need to specify an axis so +that the resulting shape is consistent across replicas. So if the last +batch has size 6 and it is divided into [0, 1, 2, 3] and [4, 5], you +would get a shape mismatch unless you specify `axis=0`. If you specify +`tf.distribute.ReduceOp.MEAN`, using `axis=0` will use the correct +denominator of 6. Contrast this with computing `reduce_mean` to get a +scalar value on each replica and this function to average those means, +which will weigh some values `1/8` and others `1/4`. + +For Example: +``` +strategy = tf.distribute.experimental.CentralStorageStrategy( + compute_devices=['CPU:0', 'GPU:0'], parameter_device='CPU:0') +ds = tf.data.Dataset.range(10) +# Distribute that dataset +dist_dataset = strategy.experimental_distribute_dataset(ds) + +with strategy.scope(): + @tf.function + def train_step(val): + # pass through + return val + + # Iterate over the distributed dataset + for x in dist_dataset: + result = strategy.run(train_step, args=(x,)) + +result = strategy.reduce(tf.distribute.ReduceOp.SUM, result, + axis=None).numpy() +# result: array([ 4, 6, 8, 10]) + +result = strategy.reduce(tf.distribute.ReduceOp.SUM, result, axis=0).numpy() +# result: 28 +``` + +Args: + reduce_op: A `tf.distribute.ReduceOp` value specifying how values should + be combined. + value: A ""per replica"" value, e.g. returned by `run` to + be combined into a single tensor. + axis: Specifies the dimension to reduce along within each + replica's tensor. Should typically be set to the batch dimension, or + `None` to only reduce across replicas (e.g. if the tensor has no batch + dimension). + +Returns: + A `Tensor`." +2291,CentralStorageStrategyV1,tensorflow/tensorflow/python/distribute/central_storage_strategy.py,256,class, +2292,CollectiveAllReduceStrategy,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,48,class,"A distribution strategy for synchronous training on multiple workers. This strategy implements synchronous distributed training across multiple workers, each with potentially multiple GPUs. Similar to @@ -13273,15 +15731,23 @@ correct number of accelerators. The strategy uses all available GPUs if or `None`. * In eager mode, the strategy needs to be created before calling any other Tensorflow API." -2585,CollectiveAllReduceStrategyV1,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,153,class, -2586,CollectiveAllReduceExtended,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,176,class,Implementation of CollectiveAllReduceStrategy. -2587,create_test_objects,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,59,function, -2588,CollectiveAllReduceStrategyTestBase,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,86,class, -2589,DistributedCollectiveAllReduceStrategyTest,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,266,class, -2590,DistributedCollectiveAllReduceStrategyTestWithChief,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,444,class, -2591,LocalCollectiveAllReduceStrategy,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,468,class, -2592,LogicalDeviceTest,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,564,class, -2593,Hints,tensorflow/tensorflow/python/distribute/collective_util.py,25,class,"Hints for collective operations like AllReduce. +2293,cluster_resolver,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,140,method,"Returns the cluster resolver associated with this strategy. + +As a multi-worker strategy, +`tf.distribute.experimental.MultiWorkerMirroredStrategy` provides the +associated `tf.distribute.cluster_resolver.ClusterResolver`. If the user +provides one in `__init__`, that instance is returned; if the user does +not, a default `TFConfigClusterResolver` is provided." +2294,CollectiveAllReduceStrategyV1,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,153,class, +2295,CollectiveAllReduceExtended,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,176,class,Implementation of CollectiveAllReduceStrategy. +2296,experimental_between_graph,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,622,method, +2297,experimental_should_init,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,626,method, +2298,should_checkpoint,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,630,method, +2299,should_save_summary,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,634,method, +2300,initial_value_fn,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy.py,403,method, +2301,LocalCollectiveAllReduceStrategy,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,468,class, +2302,fn,tensorflow/tensorflow/python/distribute/collective_all_reduce_strategy_test.py,491,method, +2303,Hints,tensorflow/tensorflow/python/distribute/collective_util.py,25,class,"Hints for collective operations like AllReduce. This can be passed to methods like `tf.distribute.get_replica_context().all_reduce()` to optimize collective @@ -13302,14 +15768,16 @@ grads = tf.distribute.get_replica_context().all_reduce( optimizer.apply_gradients(zip(grads, vars), experimental_aggregate_gradients=False) ```" -2594,DistributionParameter,tensorflow/tensorflow/python/distribute/combinations.py,53,class,"Transforms arguments of type `NamedDistribution`. +2304,DistributionParameter,tensorflow/tensorflow/python/distribute/combinations.py,53,class,"Transforms arguments of type `NamedDistribution`. Convert all arguments of type `NamedDistribution` to the value of their `strategy` property." -2595,ClusterParameters,tensorflow/tensorflow/python/distribute/combinations.py,69,class,"Adds cluster parameters if a `NamedDistribution` has it. +2305,modified_arguments,tensorflow/tensorflow/python/distribute/combinations.py,60,method, +2306,ClusterParameters,tensorflow/tensorflow/python/distribute/combinations.py,69,class,"Adds cluster parameters if a `NamedDistribution` has it. It needs to be before DistributionParameter." -2596,NamedGPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,96,class,"Enable tests to request GPU hardware and skip non-GPU combinations. +2307,modified_arguments,tensorflow/tensorflow/python/distribute/combinations.py,75,method, +2308,NamedGPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,96,class,"Enable tests to request GPU hardware and skip non-GPU combinations. This class expects test_combinations to be generated with `NamedDistribution` wrapping instances of `tf.distribute.Strategy`. @@ -13320,8 +15788,11 @@ required, if its value is `True` or > 0. Attributes: GPU_TEST: The environment is considered to have GPU hardware available if the name of the program contains ""test_gpu"" or ""test_xla_gpu""." -2597,GPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,138,class,NamedGPUCombination that passes `tf.distribute.Strategy` to the tests. -2598,NamedTPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,148,class,"Allow to request TPU hardware and skip non-TPU combinations. +2309,should_execute_combination,tensorflow/tensorflow/python/distribute/combinations.py,112,method, +2310,parameter_modifiers,tensorflow/tensorflow/python/distribute/combinations.py,134,method, +2311,GPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,138,class,NamedGPUCombination that passes `tf.distribute.Strategy` to the tests. +2312,parameter_modifiers,tensorflow/tensorflow/python/distribute/combinations.py,141,method, +2313,NamedTPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,148,class,"Allow to request TPU hardware and skip non-TPU combinations. This class expects test_combinations to be generated with `NamedDistribution` wrapping instances of `tf.distribute.Strategy`. @@ -13336,77 +15807,134 @@ with `--tpu`) if `use_cloud_tpu` is `True`. Attributes: TPU_TEST: The environment is considered to have TPU hardware available if the name of the program contains ""test_tpu""." -2599,TPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,210,class,NamedTPUCombination that passes `tf.distribute.Strategy` to the tests. -2600,NamedDistribution,tensorflow/tensorflow/python/distribute/combinations.py,220,class,Wraps a `tf.distribute.Strategy` and adds a name for test titles. -2601,concat,tensorflow/tensorflow/python/distribute/combinations.py,279,function,Concats combinations. -2602,generate,tensorflow/tensorflow/python/distribute/combinations.py,287,function,"Distributed adapter of `framework.combinations_lib.generate`. +2314,should_execute_combination,tensorflow/tensorflow/python/distribute/combinations.py,168,method, +2315,parameter_modifiers,tensorflow/tensorflow/python/distribute/combinations.py,202,method, +2316,TPUCombination,tensorflow/tensorflow/python/distribute/combinations.py,210,class,NamedTPUCombination that passes `tf.distribute.Strategy` to the tests. +2317,parameter_modifiers,tensorflow/tensorflow/python/distribute/combinations.py,213,method, +2318,NamedDistribution,tensorflow/tensorflow/python/distribute/combinations.py,220,class,Wraps a `tf.distribute.Strategy` and adds a name for test titles. +2319,runner,tensorflow/tensorflow/python/distribute/combinations.py,268,method, +2320,strategy,tensorflow/tensorflow/python/distribute/combinations.py,272,method, +2321,concat,tensorflow/tensorflow/python/distribute/combinations.py,279,function,Concats combinations. +2322,generate,tensorflow/tensorflow/python/distribute/combinations.py,287,function,"Distributed adapter of `framework.combinations_lib.generate`. All tests with distributed strategy should use this one instead of `framework.test_combinations.generate`. This function has support of strategy combinations, GPU/TPU and multi worker support. See `framework.test_combinations_lib.generate` for usage." -2603,main,tensorflow/tensorflow/python/distribute/combinations.py,331,function,Tests must call this main(). -2604,_test_runner,tensorflow/tensorflow/python/distribute/combinations.py,345,function,"Executes the test with the given test_id. - -This is a simple wrapper around TestRunner to be used with -multi_process_runner. Similar to test.main(), but it executes only one test -specified by test_id and returns whether the test succeeds. If the test fails, -the function prints failures and errors to stdout. - -Args: - test_id: TestCase.id() - -Returns: - A boolean indicates whether the test succeeds." -2605,_multi_worker_test,tensorflow/tensorflow/python/distribute/combinations.py,385,function,"Decorate test_method so that it runs in each worker. - -We use `multi_process_runner` to simulate multiple workers. Since we run the -this function in the main process and all worker processes, this decoration -behaves differently in the main process and worker procssses. In the main -process, it spawns subprocesses and runs the test on each of them; in a worker -process, it executes test in the same way as a normal test, e.g. -setUp()/tearDown() are called before/after the test. - -Args: - test_method: a function which must be a test method. - -Returns: - Decorated `test_method`. Note that the decorated function has additional - arguments." -2606,_num_total_workers,tensorflow/tensorflow/python/distribute/combinations.py,467,function,Returns the number of workers including the chief. -2607,_multi_worker_session,tensorflow/tensorflow/python/distribute/combinations.py,474,function,"Returns a context manager that enters a session that is configured for the MultiWorkerMirroredStrategy. - -Args: - kwargs: a dict. Keyword arguments passed to the test. - -Returns: - A context manager. If MultiWorkerMirroredStrategy is the one and only one - strategy in kwargs and it's in graph mode, it's the seesion that is - configured for that strategy. Otherwise, it's a no-op context manager." -2608,ClusterParametersTest,tensorflow/tensorflow/python/distribute/combinations_test.py,33,class, -2609,ClusterParametersShouldFailTest,tensorflow/tensorflow/python/distribute/combinations_test.py,95,class, -2610,CombinationsExpectedFailureTest,tensorflow/tensorflow/python/distribute/combinations_test.py,123,class, -2611,CombinationsOnClassMultiWorkerExpectedFailureTest,tensorflow/tensorflow/python/distribute/combinations_test.py,150,class, -2612,check_destinations,tensorflow/tensorflow/python/distribute/cross_device_ops.py,49,function,"Checks whether `destinations` is not empty. +2323,check_destinations,tensorflow/tensorflow/python/distribute/cross_device_ops.py,49,function,"Checks whether `destinations` is not empty. Args: destinations: a `DistributedValues`, variable, or string object. Returns: Boolean which is True if `destinations` is not empty." -2613,validate_destinations,tensorflow/tensorflow/python/distribute/cross_device_ops.py,65,function,Validates the `destination` is one of expected types. -2614,reduce_non_distributed_value,tensorflow/tensorflow/python/distribute/cross_device_ops.py,79,function,Reduce a non-DistributedValue `value` to `destinations`. -2615,_make_tensor_into_per_replica,tensorflow/tensorflow/python/distribute/cross_device_ops.py,108,function,Converts a single tensor into a PerReplica object. -2616,_normalize_value_destination_pairs,tensorflow/tensorflow/python/distribute/cross_device_ops.py,123,function,Converts each tensor into a PerReplica object in the input list. -2617,_validate_value_destination_pairs,tensorflow/tensorflow/python/distribute/cross_device_ops.py,144,function, -2618,get_devices_from,tensorflow/tensorflow/python/distribute/cross_device_ops.py,159,function, -2619,_devices_match,tensorflow/tensorflow/python/distribute/cross_device_ops.py,167,function, -2620,_all_devices_match,tensorflow/tensorflow/python/distribute/cross_device_ops.py,172,function, -2621,simple_broadcast,tensorflow/tensorflow/python/distribute/cross_device_ops.py,181,function,Broadcast `value` to `destinations` using simple copies. -2622,_simple_reduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,196,function, -2623,CrossDeviceOps,tensorflow/tensorflow/python/distribute/cross_device_ops.py,217,class,Base class for cross-device reduction and broadcasting algorithms. -2624,ReductionToOneDevice,tensorflow/tensorflow/python/distribute/cross_device_ops.py,409,class,"Always do reduction to one device first and then do broadcasting. +2324,validate_destinations,tensorflow/tensorflow/python/distribute/cross_device_ops.py,65,function,Validates the `destination` is one of expected types. +2325,reduce_non_distributed_value,tensorflow/tensorflow/python/distribute/cross_device_ops.py,79,function,Reduce a non-DistributedValue `value` to `destinations`. +2326,get_devices_from,tensorflow/tensorflow/python/distribute/cross_device_ops.py,159,function, +2327,simple_broadcast,tensorflow/tensorflow/python/distribute/cross_device_ops.py,181,function,Broadcast `value` to `destinations` using simple copies. +2328,CrossDeviceOps,tensorflow/tensorflow/python/distribute/cross_device_ops.py,217,class,Base class for cross-device reduction and broadcasting algorithms. +2329,reduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,228,method,"Reduce `per_replica_value` to `destinations`. + +It runs the reduction operation defined by `reduce_op` and put the +result on `destinations`. + +Args: + reduce_op: An instance of `tf.distribute.ReduceOp` that indicates how + per_replica_value will be reduced. + per_replica_value: A `tf.distribute.DistributedValues` object or a tensor + with device set. + destinations: the reduction destinations. + experimental_hints: A `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + a Mirrored object. + +Raises: + ValueError: if per_replica_value can't be converted to a PerReplica + object or if destinations aren't strings, Variables or DistributedValues" +2330,batch_reduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,272,method,"Reduce PerReplica objects in a batch. + +Reduce each first element in `value_destination_pairs` to each second +element which indicates the destinations. + +This can be faster than multiple individual `reduce`s because we can +fuse several tensors into one or multiple packs before reduction. + +Args: + reduce_op: An instance of `tf.distribute.ReduceOp` that indicates how the + `per_replica_value` will be reduced. + value_destination_pairs: A list or a tuple of PerReplica objects (or + tensors with device set if there is one device) and destinations. + experimental_hints: A `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + a list of Mirrored objects. + +Raises: + ValueError: if `value_destination_pairs` is not an iterable of + tuples of PerReplica objects and destinations." +2331,broadcast,tensorflow/tensorflow/python/distribute/cross_device_ops.py,324,method,"Broadcast the `tensor` to destinations. + +Args: + tensor: the tensor to broadcast. + destinations: the broadcast destinations. + +Returns: + a Mirrored object." +2332,reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,338,method,"The implementation of reduce of `per_replica_value` to `destinations`. + +Overriding this method is useful for subclass implementers. + +It runs the reduction operation defined by `reduce_op` and put the +result on `destinations`. + +Args: + reduce_op: An instance `tf.distribute.ReduceOp` that indicates of how + per_replica_value will be reduced. + per_replica_value: A PerReplica object or a tensor with device set. + destinations: the reduction destinations. + experimental_hints: A `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + a Mirrored object. + +Raises: + ValueError: if per_replica_value can't be converted to a PerReplica + object." +2333,batch_reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,366,method,"Implementation of reduce PerReplica objects in a batch. + +Overriding this method is useful for subclass implementers. + +Reduce each first element in `value_destination_pairs` to each second +element which indicates the destinations. + +Args: + reduce_op: An instance of `tf.distribute.ReduceOp` that indicates how + per_replica_value will be reduced. + value_destination_pairs: An iterable of tuples of PerReplica objects + (or tensors with device set if there is one device) and destinations. + experimental_hints: A `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + a list of Mirrored objects. + +Raises: + ValueError: if `value_destination_pairs` is not an iterable of + tuples of PerReplica objects and destinations" +2334,broadcast_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,395,method,"Implementation of broadcast the `tensor` to destinations. + +Args: + tensor: the tensor to broadcast. + destinations: the broadcast destinations. + +Returns: + a Mirrored object." +2335,ReductionToOneDevice,tensorflow/tensorflow/python/distribute/cross_device_ops.py,409,class,"Always do reduction to one device first and then do broadcasting. Batch reduction is done by reduction on each element one by one. @@ -13414,45 +15942,13 @@ Batch reduction is done by reduction on each element one by one. mirrored_strategy = tf.distribute.MirroredStrategy( cross_device_ops=tf.distribute.ReductionToOneDevice()) ```" -2625,_group_value_by_device,tensorflow/tensorflow/python/distribute/cross_device_ops.py,457,function,"Group values into sublists by their devices. - -This grouping is needed to call the all-reduce library because it expects a -list of the following form: - [[(grad0_gpu0, v0_gpu0), (grad1_gpu0, v1_gpu0), (grad2_gpu0, v2_gpu0) ...], - [(grad0_gpu1, v0_gpu1), (grad1_gpu1, v1_gpu1), (grad2_gpu1, v2_gpu1) ...], - [(grad0_gpu2, v0_gpu2), (grad1_gpu0, v1_gpu2), (grad2_gpu0, v2_gpu2) ...], - ... - ] - -Args: - per_replica_values: a list of PerReplica objects. - -Returns: - a list of lists, each sublist has components for its corresponding device of - PerReplica objects, paired with a None." -2626,_ungroup_and_make_mirrored,tensorflow/tensorflow/python/distribute/cross_device_ops.py,485,function,"Ungroup results from all-reduce and make Mirrored objects. - -Each all-reduce result will be divided by the number of destinations before -Mirrored objects are created if reduce_op is ""mean"". - -Args: - grouped_reduced: a list of lists, each sublist has components for each - device, paired with a None. It is the result from - cross_device_utils.aggregate_gradients_using*. - destinations: a value to colocate the result with. - reduce_op: Indicates how values will be aggregated. Accepted values - are `tf.distribute.ReduceOp.SUM`, `tf.distribute.ReduceOp.MEAN`. - num_between_graph_workers: number of workers in the between-graph - replication. - -Returns: - a list of Mirrored objects." -2627,_ConcatAndSplitPacker,tensorflow/tensorflow/python/distribute/cross_device_ops.py,520,class,Concatenate and split tensors for reduction. -2628,_pack_tensors,tensorflow/tensorflow/python/distribute/cross_device_ops.py,624,function,Pack tensors if specified. -2629,_unpack_tensors,tensorflow/tensorflow/python/distribute/cross_device_ops.py,635,function,Unpack tensors if they are packed before all-reduce. -2630,AllReduceCrossDeviceOps,tensorflow/tensorflow/python/distribute/cross_device_ops.py,642,class,Reduction using all-reduce. -2631,NcclAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,747,class,Reduction using NCCL all-reduce. -2632,HierarchicalCopyAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,773,class,"Reduction using hierarchical copy all-reduce. +2336,reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,433,method, +2337,batch_reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,448,method, +2338,AllReduceCrossDeviceOps,tensorflow/tensorflow/python/distribute/cross_device_ops.py,642,class,Reduction using all-reduce. +2339,reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,661,method, +2340,batch_reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,670,method, +2341,NcclAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,747,class,Reduction using NCCL all-reduce. +2342,HierarchicalCopyAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,773,class,"Reduction using hierarchical copy all-reduce. It reduces to one GPU along edges in some hierarchy and broadcasts back to each GPU along the same path. Before performing all-reduce, tensors will be @@ -13461,19 +15957,22 @@ repacked or aggregated for more efficient cross-device transportation. This is a reduction created for Nvidia DGX-1 which assumes GPUs connects like that on DGX-1 machine. If you have different GPU inter-connections, it is likely that it would be slower than `tf.distribute.ReductionToOneDevice`." -2633,MultiWorkerAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,804,class,All-reduce algorithms for distributed TensorFlow. -2634,CollectiveCommunication,tensorflow/tensorflow/python/distribute/cross_device_ops.py,916,class,"Communication choices for CollectiveOps. +2343,MultiWorkerAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,804,class,All-reduce algorithms for distributed TensorFlow. +2344,validate_and_complete_spec,tensorflow/tensorflow/python/distribute/cross_device_ops.py,843,method,Validate and complete the all-reduce spec. +2345,CollectiveCommunication,tensorflow/tensorflow/python/distribute/cross_device_ops.py,916,class,"Communication choices for CollectiveOps. * `AUTO`: Default to runtime's automatic choices. * `RING`: TensorFlow's ring algorithms for all-reduce and all-gather. * `NCCL`: Use ncclAllReduce for all-reduce, and ring algorithms for all-gather." -2635,CollectiveAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,932,class,"All-reduce cross device ops using collective ops. +2346,CollectiveAllReduce,tensorflow/tensorflow/python/distribute/cross_device_ops.py,932,class,"All-reduce cross device ops using collective ops. In the between-graph replicated training, it will still do all-reduces across all workers and then put results on the right destinations." -2636,choose_the_best,tensorflow/tensorflow/python/distribute/cross_device_ops.py,1167,function,"Find the best CrossDeviceOps locally given a `tf.compat.v1.ConfigProto`. +2347,reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,981,method, +2348,batch_reduce_implementation,tensorflow/tensorflow/python/distribute/cross_device_ops.py,1012,method, +2349,choose_the_best,tensorflow/tensorflow/python/distribute/cross_device_ops.py,1167,function,"Find the best CrossDeviceOps locally given a `tf.compat.v1.ConfigProto`. Args: devices: a list of devices passed to `tf.distribute.Strategy`. @@ -13482,20 +15981,8 @@ Args: Returns: A subclass of `CrossDeviceOps`." -2637,_get_devices,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,54,function, -2638,_make_per_replica,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,64,function, -2639,_fake_mirrored,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,84,function,"Create a faked Mirrored object for testing. - -All components of the returned Mirrored have the same objects, which is not -true in reality." -2640,_make_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,100,function, -2641,_make_mirrored_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,109,function, -2642,CrossDeviceOpsTestBase,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,120,class, -2643,SingleWorkerCrossDeviceOpsTest,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,280,class, -2644,MultiWorkerCrossDeviceOpsTest,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,434,class, -2645,CollectiveAllReduceTest,tensorflow/tensorflow/python/distribute/cross_device_ops_test.py,488,class, -2646,aggregate_gradients_using_nccl,tensorflow/tensorflow/python/distribute/cross_device_utils.py,42,function,Aggregate gradients using nccl allreduce. -2647,aggregate_gradients_using_hierarchical_copy,tensorflow/tensorflow/python/distribute/cross_device_utils.py,56,function,"Aggregate gradients using hierarchical copies. +2350,aggregate_gradients_using_nccl,tensorflow/tensorflow/python/distribute/cross_device_utils.py,42,function,Aggregate gradients using nccl allreduce. +2351,aggregate_gradients_using_hierarchical_copy,tensorflow/tensorflow/python/distribute/cross_device_utils.py,56,function,"Aggregate gradients using hierarchical copies. Args: avail_devices: available GPU devices. @@ -13506,7 +15993,7 @@ Returns: The list of (aggregated_gradient, variable), where the gradient has been summed across all replicas and the variable is chosen from the first replica." -2648,aggregate_single_gradient_using_copy,tensorflow/tensorflow/python/distribute/cross_device_utils.py,138,function,"Calculate the average gradient for a shared variable across all replicas. +2352,aggregate_single_gradient_using_copy,tensorflow/tensorflow/python/distribute/cross_device_utils.py,138,function,"Calculate the average gradient for a shared variable across all replicas. Note that this function provides a synchronization point across all replicas. @@ -13523,7 +16010,7 @@ Returns: gradient has been averaged across all replicas. The variable is chosen from the first replica. The has_nan_or_inf indicates the grads has nan or inf." -2649,group_device_names,tensorflow/tensorflow/python/distribute/cross_device_utils.py,173,function,"Group device names into groups of group_size. +2353,group_device_names,tensorflow/tensorflow/python/distribute/cross_device_utils.py,173,function,"Group device names into groups of group_size. Args: devices: a list of canonical device strings. @@ -13536,7 +16023,7 @@ Returns: Raises: ValueError: if group_size > len(devices)" -2650,split_grads_by_size,tensorflow/tensorflow/python/distribute/cross_device_utils.py,200,function,"Break gradients into two sets according to tensor size. +2354,split_grads_by_size,tensorflow/tensorflow/python/distribute/cross_device_utils.py,200,function,"Break gradients into two sets according to tensor size. Args: threshold_size: int size cutoff for small vs large tensor. @@ -13548,7 +16035,7 @@ Returns: elements. large_grads: Subset of device_grads where shape is > threshold_size elements." -2651,CollectiveKeys,tensorflow/tensorflow/python/distribute/cross_device_utils.py,241,class,"Class that manages collective keys. +2355,CollectiveKeys,tensorflow/tensorflow/python/distribute/cross_device_utils.py,241,class,"Class that manages collective keys. We need to manage three different keys for collective: @@ -13562,7 +16049,16 @@ tensors on different devices in a device group that need to be all-reduced. ""Graph key"": an integer key that is unique key graph. This is used to support multiple graphs per client session. It must be non-zero and set in the `config` argument of each call to `session.run`." -2652,build_collective_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,321,function,"Build a subgraph that does one full all-reduce, using the collective Op. +2356,get_group_key,tensorflow/tensorflow/python/distribute/cross_device_utils.py,284,method,"Returns a group key for the set of devices. + +Args: + devices: list of strings naming devices in a collective group. + +Returns: + int key uniquely identifying the set of device names." +2357,get_op_instance_key,tensorflow/tensorflow/python/distribute/cross_device_utils.py,308,method,Returns a new instance key for use in defining a collective op. +2358,get_variable_instance_key,tensorflow/tensorflow/python/distribute/cross_device_utils.py,314,method,Returns a new instance key for use in creating a Variable. +2359,build_collective_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,321,function,"Build a subgraph that does one full all-reduce, using the collective Op. If called in eager mode, it's required to supply a list of async executors for each input Tensor. @@ -13588,7 +16084,7 @@ Returns: Raises: ValueError: There must be at least two tensors over all the workers." -2653,build_collective_gather,tensorflow/tensorflow/python/distribute/cross_device_utils.py,391,function,"Build a subgraph that does one full all-gather, using the collective Op. +2360,build_collective_gather,tensorflow/tensorflow/python/distribute/cross_device_utils.py,391,function,"Build a subgraph that does one full all-gather, using the collective Op. This method must be called in graph mode or inside a tf.function. @@ -13607,7 +16103,7 @@ Args: Returns: An array of final tensors, one per device, computed by the full gather." -2654,build_collective_gather_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,442,function,"Build a subgraph that all-gathers IndexedSlices using the collective Op. +2361,build_collective_gather_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,442,function,"Build a subgraph that all-gathers IndexedSlices using the collective Op. This method must be called in graph mode or inside a tf.function. @@ -13631,8 +16127,8 @@ Returns: Raises: ValueError: if control_inputs is not None and doesn't match the length and devices of inputs." -2655,sum_grad_and_var_all_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,549,function,Apply all-reduce algorithm over specified gradient tensors. -2656,sum_gradients_all_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,590,function,"Apply all-reduce algorithm over specified gradient tensors. +2362,sum_grad_and_var_all_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,549,function,Apply all-reduce algorithm over specified gradient tensors. +2363,sum_gradients_all_reduce,tensorflow/tensorflow/python/distribute/cross_device_utils.py,590,function,"Apply all-reduce algorithm over specified gradient tensors. Args: dev_prefixes: list of prefix strings to use to generate PS device names. @@ -13644,7 +16140,7 @@ Args: Returns: list of reduced tensors" -2657,extract_ranges,tensorflow/tensorflow/python/distribute/cross_device_utils.py,632,function,"Extract consecutive ranges and singles from index_list. +2364,extract_ranges,tensorflow/tensorflow/python/distribute/cross_device_utils.py,632,function,"Extract consecutive ranges and singles from index_list. Args: index_list: List of monotone increasing non-negative integers. @@ -13656,7 +16152,7 @@ Returns: (ranges, singles) where ranges is a list of [first, last] pairs of consecutive elements in index_list, and singles is all of the other elements, in original order." -2658,pack_range,tensorflow/tensorflow/python/distribute/cross_device_utils.py,672,function,"Form the concatenation of a specified range of gradient tensors. +2365,pack_range,tensorflow/tensorflow/python/distribute/cross_device_utils.py,672,function,"Form the concatenation of a specified range of gradient tensors. Args: key: Value under which to store meta-data in packing that will be used @@ -13668,7 +16164,7 @@ Args: Returns: A tensor that is the concatenation of all the specified small tensors." -2659,unpack_grad_tuple,tensorflow/tensorflow/python/distribute/cross_device_utils.py,704,function,"Unpack a previously packed collection of gradient tensors. +2366,unpack_grad_tuple,tensorflow/tensorflow/python/distribute/cross_device_utils.py,704,function,"Unpack a previously packed collection of gradient tensors. Args: gv: A (grad, var) pair to be unpacked. @@ -13678,7 +16174,7 @@ Returns: A list of (grad, var) pairs corresponding to the values that were originally packed into gv, maybe following subsequent operations like reduction." -2660,pack_small_tensors,tensorflow/tensorflow/python/distribute/cross_device_utils.py,727,function,"Concatenate small gradient tensors together for reduction. +2367,pack_small_tensors,tensorflow/tensorflow/python/distribute/cross_device_utils.py,727,function,"Concatenate small gradient tensors together for reduction. Args: replica_grads: List of lists of (gradient, variable) tuples. @@ -13703,7 +16199,7 @@ because it isn't used during all-reduce. Requires: Every gv_list in replicas must have isomorphic structure including identical tensor sizes and types." -2661,unpack_small_tensors,tensorflow/tensorflow/python/distribute/cross_device_utils.py,783,function,"Undo the structure alterations to replica_grads done by pack_small_tensors. +2368,unpack_small_tensors,tensorflow/tensorflow/python/distribute/cross_device_utils.py,783,function,"Undo the structure alterations to replica_grads done by pack_small_tensors. Args: replica_grads: List of List of (grad, var) tuples. @@ -13714,12 +16210,12 @@ Returns: new_replica_grads: identical to replica_grads except that concatenations of small tensors have been split apart and returned to their original positions, paired with their original variables." -2662,aggregate_tensors_or_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,815,function,Aggregate tensors using `accumulation_fn` and IndexedSlices via concat. -2663,divide_by_n_tensors_or_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,823,function, -2664,copy_tensor_or_indexed_slices_to_device,tensorflow/tensorflow/python/distribute/cross_device_utils.py,832,function, -2665,contains_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,844,function,Check whether the value is `IndexedSlices` or contains `IndexedSlices`. -2666,is_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,856,function, -2667,split_by_sparsity,tensorflow/tensorflow/python/distribute/cross_device_utils.py,863,function,"Split values into dense and sparse values. +2369,aggregate_tensors_or_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,815,function,Aggregate tensors using `accumulation_fn` and IndexedSlices via concat. +2370,divide_by_n_tensors_or_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,823,function, +2371,copy_tensor_or_indexed_slices_to_device,tensorflow/tensorflow/python/distribute/cross_device_utils.py,832,function, +2372,contains_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,844,function,Check whether the value is `IndexedSlices` or contains `IndexedSlices`. +2373,is_indexed_slices,tensorflow/tensorflow/python/distribute/cross_device_utils.py,856,function, +2374,split_by_sparsity,tensorflow/tensorflow/python/distribute/cross_device_utils.py,863,function,"Split values into dense and sparse values. Args: values: a list of tensors or `PerReplica`s. @@ -13728,7 +16224,7 @@ Returns: Four lists: a list of dense values, a list of their indices in `values` and a list of sparse values, a list of their indices in `values`." -2668,stitch_values,tensorflow/tensorflow/python/distribute/cross_device_utils.py,888,function,"Stitch values together according to their indices. +2375,stitch_values,tensorflow/tensorflow/python/distribute/cross_device_utils.py,888,function,"Stitch values together according to their indices. Args: values_and_indices_list: a list of tuples of values and indices indicating @@ -13736,14 +16232,14 @@ Args: Returns: a stitched list of values." -2669,per_replica_num_elements,tensorflow/tensorflow/python/distribute/cross_device_utils.py,911,function,"Returns the static number of elements of one replica. +2376,per_replica_num_elements,tensorflow/tensorflow/python/distribute/cross_device_utils.py,911,function,"Returns the static number of elements of one replica. Args: per_replica: A PerReplica of Tensor or IndexedSlices. Returns: Number of elements. None if some replica has a different or unknown shape." -2670,pack_by_size,tensorflow/tensorflow/python/distribute/cross_device_utils.py,930,function,"Packs `per_replica_list` into chunks of `bytes_per_pack`. +2377,pack_by_size,tensorflow/tensorflow/python/distribute/cross_device_utils.py,930,function,"Packs `per_replica_list` into chunks of `bytes_per_pack`. The method preserves the original order of `per_replica_list`. The packing is best effort, each pack could have more or less bytes than `bytes_per_pack`. @@ -13758,27 +16254,27 @@ Args: Returns: A list of packs of PerReplica. All values are packed into one pack if `bytes_per_pack` is zero or any of the value has unknown shape." -2671,_control_input,tensorflow/tensorflow/python/distribute/cross_device_utils.py,972,function,"Returns the `idx`-th item in control_inputs to be used in ops.control_dependencies. +2378,get_dataset_from_tensor_slices,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,34,function, +2379,AssertFlattenedMixin,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,42,class,Mixin for specialized asserts. +2380,assert_equal_flattened,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,45,method,"Asserts that flattened results are equal. -This is a helper function for building collective ops. +Due to the number of replicas in the strategy, the output may have a +different structure and needs to be flattened for comparison. Args: - devices: a list of device strings the collective run on. - control_inputs: a list or None. - idx: the index into `inputs` and `control_inputs`. + expected_results: The results expected as a result of a computation. + actual_results: The actual results of a computation." +2381,get_dataset_from_tensor_slices,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,43,function, +2382,AssertFlattenedMixin,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,51,class,Mixin for specialized asserts. +2383,assert_equal_flattened,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,54,method,"Asserts that flattened results are equal. -Returns: - A one item list of the `idx`-th element of `control_inputs`, or an empty - list if `control_inputs` is None." -2672,IndexedSlicesUtilsTest,tensorflow/tensorflow/python/distribute/cross_device_utils_test.py,36,class, -2673,PackBySizeTest,tensorflow/tensorflow/python/distribute/cross_device_utils_test.py,142,class, -2674,get_dataset_from_tensor_slices,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,34,function, -2675,AssertFlattenedMixin,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,42,class,Mixin for specialized asserts. -2676,GradientTapeTest,tensorflow/tensorflow/python/distribute/custom_training_loop_gradient_test.py,65,class, -2677,get_dataset_from_tensor_slices,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,43,function, -2678,AssertFlattenedMixin,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,51,class,Mixin for specialized asserts. -2679,InputIterationTest,tensorflow/tensorflow/python/distribute/custom_training_loop_input_test.py,74,class, -2680,canonicalize,tensorflow/tensorflow/python/distribute/device_util.py,27,function,"Canonicalize device string. +Due to the number of replicas in the strategy, the output may have a +different structure and needs to be flattened for comparison. + +Args: + expected_results: The results expected as a result of a computation. + actual_results: The actual results of a computation." +2384,canonicalize,tensorflow/tensorflow/python/distribute/device_util.py,27,function,"Canonicalize device string. If d has missing components, the rest would be deduced from the `default` argument or from '/replica:0/task:0/device:CPU:0'. For example: @@ -13797,14 +16293,11 @@ Args: Returns: a canonicalized device string." -2681,resolve,tensorflow/tensorflow/python/distribute/device_util.py,79,function,Canonicalize `d` with current device as default. -2682,_FakeNodeDef,tensorflow/tensorflow/python/distribute/device_util.py,84,class,A fake NodeDef for _FakeOperation. -2683,_FakeOperation,tensorflow/tensorflow/python/distribute/device_util.py,94,class,A fake Operation object to pass to device functions. -2684,current,tensorflow/tensorflow/python/distribute/device_util.py,110,function,Return a string (not canonicalized) for the current device. -2685,get_host_for_device,tensorflow/tensorflow/python/distribute/device_util.py,122,function,Returns the corresponding host device for the given device. -2686,local_devices_from_num_gpus,tensorflow/tensorflow/python/distribute/device_util.py,130,function,Returns device strings for local GPUs or CPU. -2687,DeviceUtilTest,tensorflow/tensorflow/python/distribute/device_util_test.py,33,class, -2688,DistributeConfig,tensorflow/tensorflow/python/distribute/distribute_config.py,24,class,"A config tuple for distribution strategies. +2385,resolve,tensorflow/tensorflow/python/distribute/device_util.py,79,function,Canonicalize `d` with current device as default. +2386,current,tensorflow/tensorflow/python/distribute/device_util.py,110,function,Return a string (not canonicalized) for the current device. +2387,get_host_for_device,tensorflow/tensorflow/python/distribute/device_util.py,122,function,Returns the corresponding host device for the given device. +2388,local_devices_from_num_gpus,tensorflow/tensorflow/python/distribute/device_util.py,130,function,Returns device strings for local GPUs or CPU. +2389,DistributeConfig,tensorflow/tensorflow/python/distribute/distribute_config.py,24,class,"A config tuple for distribution strategies. Attributes: train_distribute: a `DistributionStrategy` object for training. @@ -13814,27 +16307,8 @@ Attributes: the cluster configurations. If this is given, the `train_and_evaluate` method will be running as a standalone client which connects to the cluster for training." -2689,_TaskType,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,40,class, -2690,CoordinatorMode,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,50,class,Specify how distribute coordinator runs. -2691,_Barrier,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,64,class,A reusable barrier class for worker synchronization. -2692,_get_num_workers,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,95,function,Gets number of workers including chief. -2693,_WorkerContext,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,103,class,"The worker context class. - -This context object provides configuration information for each task. One -context manager with a worker context object will be created per -invocation to the `worker_fn` where `get_current_worker_context` can be called -to access the worker context object." -2694,_run_single_worker,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,326,function,Runs a single worker by calling `worker_fn` under context. -2695,_split_cluster_for_evaluator,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,363,function,Split the cluster for evaluator since it needn't talk to other tasks. -2696,_run_std_server,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,385,function,Runs a standard server. -2697,_run_between_graph_client,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,454,function,Runs a standalone client for between-graph replication. -2698,_run_in_graph_client,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,497,function,Runs a standalone client for in-graph replication. -2699,_configure_session_config_for_std_servers,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,529,function,"Call strategy's `configure` to mutate the session_config. - -The session_config is currently needed as default config for a TensorFlow -server. In the future, we should be able to remove this method and only pass -the session config to a client session." -2700,run_standard_tensorflow_server,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,555,function,"Starts a standard TensorFlow server. +2390,CoordinatorMode,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,50,class,Specify how distribute coordinator runs. +2391,run_standard_tensorflow_server,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,555,function,"Starts a standard TensorFlow server. This method parses configurations from ""TF_CONFIG"" environment variable and starts a TensorFlow server. The ""TF_CONFIG"" is typically a json string and @@ -13867,7 +16341,7 @@ Returns: Raises: ValueError: if the ""TF_CONFIG"" environment is not complete." -2701,run_distribute_coordinator,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,631,function,"Runs the coordinator for distributed TensorFlow. +2392,run_distribute_coordinator,tensorflow/tensorflow/python/distribute/distribute_coordinator.py,631,function,"Runs the coordinator for distributed TensorFlow. This function runs a split coordinator for distributed TensorFlow in its default mode, i.e the STANDALONE_CLIENT mode. Given a `cluster_spec` @@ -13977,21 +16451,19 @@ Returns: In the client job, return the value returned by `worker_fn` if it is in-graph replication or INDEPENDENT_WORKER mode; return None otherwise." -2702,get_current_worker_context,tensorflow/tensorflow/python/distribute/distribute_coordinator_context.py,26,function,Returns the current task context. -2703,_bytes_to_str,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,70,function, -2704,_strip_protocol,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,77,function, -2705,MockExtended,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,85,class, -2706,MockStrategy,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,98,class, -2707,MockServer,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,141,class, -2708,DistributeCoordinatorTestBase,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,163,class, -2709,DistributeCoordinatorTestStandaloneMode,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,429,class, -2710,DistributeCoordinatorTestIndependentWorkerMode,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,596,class, -2711,StrategyConfigureTest,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,830,class, -2712,RunStandardTensorflowServerTest,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,916,class, -2713,new_init,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,954,function, -2714,get_update_replica_id,tensorflow/tensorflow/python/distribute/distribute_lib.py,242,function,Get the current device if in a `tf.distribute.Strategy.update()` call. -2715,UpdateContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,250,class,Context manager when you are in `update()` or `update_non_slot()`. -2716,get_loss_reduction,tensorflow/tensorflow/python/distribute/distribute_lib.py,273,function,"`tf.distribute.ReduceOp` corresponding to the last loss reduction. +2393,get_current_worker_context,tensorflow/tensorflow/python/distribute/distribute_coordinator_context.py,26,function,Returns the current task context. +2394,MockExtended,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,85,class, +2395,MockStrategy,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,98,class, +2396,configure,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,108,method, +2397,MockServer,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,141,class, +2398,start,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,147,method, +2399,join,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,150,method, +2400,joined,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,155,method, +2401,started,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,159,method, +2402,new_init,tensorflow/tensorflow/python/distribute/distribute_coordinator_test.py,954,function, +2403,get_update_replica_id,tensorflow/tensorflow/python/distribute/distribute_lib.py,242,function,Get the current device if in a `tf.distribute.Strategy.update()` call. +2404,UpdateContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,250,class,Context manager when you are in `update()` or `update_non_slot()`. +2405,get_loss_reduction,tensorflow/tensorflow/python/distribute/distribute_lib.py,273,function,"`tf.distribute.ReduceOp` corresponding to the last loss reduction. This is used to decide whether loss should be scaled in optimizer (used only for estimator + v1 optimizer use case). @@ -13999,22 +16471,15 @@ for estimator + v1 optimizer use case). Returns: `tf.distribute.ReduceOp` corresponding to the last loss reduction for estimator and v1 optimizer use case. `tf.distribute.ReduceOp.SUM` otherwise." -2717,_require_cross_replica_or_default_context_extended,tensorflow/tensorflow/python/distribute/distribute_lib.py,298,function,Verify in cross-replica context. -2718,_wrong_strategy_scope,tensorflow/tensorflow/python/distribute/distribute_lib.py,315,function, -2719,require_replica_context,tensorflow/tensorflow/python/distribute/distribute_lib.py,327,function,Verify in `replica_ctx` replica context. -2720,_require_strategy_scope_strategy,tensorflow/tensorflow/python/distribute/distribute_lib.py,342,function,Verify in a `strategy.scope()` in this thread. -2721,_require_strategy_scope_extended,tensorflow/tensorflow/python/distribute/distribute_lib.py,349,function,Verify in a `distribution_strategy.scope()` in this thread. -2722,_CurrentDistributionContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,363,class,"Context manager setting the current `tf.distribute.Strategy`. - -Also: overrides the variable creator and optionally the current device." -2723,InputReplicationMode,tensorflow/tensorflow/python/distribute/distribute_lib.py,434,class,"Replication mode for input function. +2406,require_replica_context,tensorflow/tensorflow/python/distribute/distribute_lib.py,327,function,Verify in `replica_ctx` replica context. +2407,InputReplicationMode,tensorflow/tensorflow/python/distribute/distribute_lib.py,434,class,"Replication mode for input function. * `PER_WORKER`: The input function will be called on each worker independently, creating as many input pipelines as number of workers. Replicas will dequeue from the local Dataset on their worker. `tf.distribute.Strategy` doesn't manage any state sharing between such separate input pipelines." -2724,InputContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,447,class,"A class wrapping information needed by an input function. +2408,InputContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,447,class,"A class wrapping information needed by an input function. This is a context class that is passed to the user's input function and contains information about the compute replicas and input pipelines. The @@ -14023,7 +16488,22 @@ size from the desired global batch size for each replica. The input pipeline information can be used to return a different subset of the input in each replica (for e.g. shard the input pipeline, use a different input source etc)." -2725,ValueContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,520,class,"A class wrapping information needed by a distribute function. +2409,num_replicas_in_sync,tensorflow/tensorflow/python/distribute/distribute_lib.py,480,method,Returns the number of compute replicas in sync. +2410,input_pipeline_id,tensorflow/tensorflow/python/distribute/distribute_lib.py,485,method,Returns the input pipeline ID. +2411,num_input_pipelines,tensorflow/tensorflow/python/distribute/distribute_lib.py,490,method,Returns the number of input pipelines. +2412,get_per_replica_batch_size,tensorflow/tensorflow/python/distribute/distribute_lib.py,494,method,"Returns the per-replica batch size. + +Args: + global_batch_size: the global batch size which should be divisible by + `num_replicas_in_sync`. + +Returns: + the per-replica batch size. + +Raises: + ValueError: if `global_batch_size` not divisible by + `num_replicas_in_sync`." +2413,ValueContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,520,class,"A class wrapping information needed by a distribute function. This is a context class that is passed to the `value_fn` in `strategy.experimental_distribute_values_from_function` and contains @@ -14053,7 +16533,9 @@ Example usage: >>> local_result = strategy.experimental_local_results(distributed_values) >>> local_result (2, 2)" -2726,RunOptions,tensorflow/tensorflow/python/distribute/distribute_lib.py,586,class,"Run options for `strategy.run`. +2414,num_replicas_in_sync,tensorflow/tensorflow/python/distribute/distribute_lib.py,570,method,Returns the number of compute replicas in sync. +2415,replica_id_in_sync_group,tensorflow/tensorflow/python/distribute/distribute_lib.py,575,method,Returns the replica ID. +2416,RunOptions,tensorflow/tensorflow/python/distribute/distribute_lib.py,586,class,"Run options for `strategy.run`. This can be used to hold some strategy specific configs. @@ -14067,7 +16549,7 @@ Attributes: bucketize inputs passed into `run` if the input shape is dynamic. This is a performance optimization to reduce XLA recompilation, which should not have impact on correctness." -2727,InputOptions,tensorflow/tensorflow/python/distribute/distribute_lib.py,616,class,"Run options for `experimental_distribute_dataset(s_from_function)`. +2417,InputOptions,tensorflow/tensorflow/python/distribute/distribute_lib.py,616,class,"Run options for `experimental_distribute_dataset(s_from_function)`. This can be used to hold some strategy specific configs. @@ -14091,7 +16573,7 @@ Attributes: elements will be prefetched to accelerator device memory. When False, dataset elements are prefetched to host device memory. Must be False when using TPUEmbedding API." -2728,StrategyBase,tensorflow/tensorflow/python/distribute/distribute_lib.py,657,class,"A state & compute distribution policy on a list of devices. +2418,StrategyBase,tensorflow/tensorflow/python/distribute/distribute_lib.py,657,class,"A state & compute distribution policy on a list of devices. See [the guide](https://www.tensorflow.org/guide/distributed_training) for overview and examples. See `tf.distribute.StrategyExtended` and @@ -14178,8 +16660,798 @@ for a more detailed example. Note: `tf.distribute.Strategy` currently does not support TensorFlow's partitioned variables (where a single variable is split across multiple devices) at this time." -2729,Strategy,tensorflow/tensorflow/python/distribute/distribute_lib.py,1584,class, -2730,StrategyV1,tensorflow/tensorflow/python/distribute/distribute_lib.py,1828,class,"A list of devices with a state & compute distribution policy. +2419,extended,tensorflow/tensorflow/python/distribute/distribute_lib.py,779,method,`tf.distribute.StrategyExtended` with additional methods. +2420,scope,tensorflow/tensorflow/python/distribute/distribute_lib.py,798,method,"Context manager to make the strategy current and distribute variables. + +This method returns a context manager, and is used as follows: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> # Variable created inside scope: +>>> with strategy.scope(): +... mirrored_variable = tf.Variable(1.) +>>> mirrored_variable +MirroredVariable:{ + 0: , + 1: +} +>>> # Variable created outside scope: +>>> regular_variable = tf.Variable(1.) +>>> regular_variable + + +_What happens when Strategy.scope is entered?_ + +* `strategy` is installed in the global context as the ""current"" strategy. + Inside this scope, `tf.distribute.get_strategy()` will now return this + strategy. Outside this scope, it returns the default no-op strategy. +* Entering the scope also enters the ""cross-replica context"". See + `tf.distribute.StrategyExtended` for an explanation on cross-replica and + replica contexts. +* Variable creation inside `scope` is intercepted by the strategy. Each + strategy defines how it wants to affect the variable creation. Sync + strategies like `MirroredStrategy`, `TPUStrategy` and + `MultiWorkerMiroredStrategy` create variables replicated on each replica, + whereas `ParameterServerStrategy` creates variables on the parameter + servers. This is done using a custom `tf.variable_creator_scope`. +* In some strategies, a default device scope may also be entered: in + `MultiWorkerMiroredStrategy`, a default device scope of ""/CPU:0"" is + entered on each worker. + +Note: Entering a scope does not automatically distribute a computation, except + in the case of high level training framework like keras `model.fit`. If + you're not using `model.fit`, you + need to use `strategy.run` API to explicitly distribute that computation. + See an example in the [custom training loop tutorial](https://www.tensorflow.org/tutorials/distribute/custom_training). + + +_What should be in scope and what should be outside?_ + +There are a number of requirements on what needs to happen inside the scope. +However, in places where we have information about which strategy is in use, +we often enter the scope for the user, so they don't have to do it +explicitly (i.e. calling those either inside or outside the scope is OK). + +* Anything that creates variables that should be distributed variables + must be in `strategy.scope`. This can be either by directly putting it in + scope, or relying on another API like `strategy.run` or `model.fit` to + enter it for you. Any variable that is created outside scope will not be + distributed and may have performance implications. Common things that + create variables in TF: models, optimizers, metrics. These should always + be created inside the scope. Another source of variable creation can be + a checkpoint restore - when variables are created lazily. Note that any + variable created inside a strategy captures the strategy information. So + reading and writing to these variables outside the `strategy.scope` can + also work seamlessly, without the user having to enter the scope. +* Some strategy APIs (such as `strategy.run` and `strategy.reduce`) which + require to be in a strategy's scope, enter the scope for you + automatically, which means when using those APIs you don't need to + enter the scope yourself. +* When a `tf.keras.Model` is created inside a `strategy.scope`, we capture + this information. When high level training frameworks methods such as + `model.compile`, `model.fit` etc are then called + on this model, we automatically enter the scope, as well as use this + strategy to distribute the training etc. See + detailed example in [distributed keras tutorial](https://www.tensorflow.org/tutorials/distribute/keras). + Note that simply calling the `model(..)` is not impacted - only high + level training framework APIs are. `model.compile`, `model.fit`, + `model.evaluate`, `model.predict` and `model.save` can all be called + inside or outside the scope. +* The following can be either inside or outside the scope: + ** Creating the input datasets + ** Defining `tf.function`s that represent your training step + ** Saving APIs such as `tf.saved_model.save`. Loading creates variables, + so that should go inside the scope if you want to train the model in a + distributed way. + ** Checkpoint saving. As mentioned above - `checkpoint.restore` may + sometimes need to be inside scope if it creates variables. + +Returns: + A context manager." +2421,colocate_vars_with,tensorflow/tensorflow/python/distribute/distribute_lib.py,890,method,DEPRECATED: use extended.colocate_vars_with() instead. +2422,make_dataset_iterator,tensorflow/tensorflow/python/distribute/distribute_lib.py,895,method,DEPRECATED TF 1.x ONLY. +2423,make_input_fn_iterator,tensorflow/tensorflow/python/distribute/distribute_lib.py,900,method,DEPRECATED TF 1.x ONLY. +2424,experimental_make_numpy_dataset,tensorflow/tensorflow/python/distribute/distribute_lib.py,913,method,"Makes a `tf.data.Dataset` from a numpy array. + +This avoids adding `numpy_input` as a large constant in the graph, +and copies the data to the machine or machines that will be processing +the input. + +Note that you will likely need to use `experimental_distribute_dataset` +with the returned dataset to further distribute it with the strategy. + +Example: + +>>> strategy = tf.distribute.MirroredStrategy() +>>> numpy_input = np.ones([10], dtype=np.float32) +>>> dataset = strategy.experimental_make_numpy_dataset(numpy_input) +>>> dataset + +>>> dataset = dataset.batch(2) +>>> dist_dataset = strategy.experimental_distribute_dataset(dataset) + +Args: + numpy_input: a nest of NumPy input arrays that will be converted into a + dataset. Note that the NumPy arrays are stacked, as that is normal + `tf.data.Dataset` behavior. + +Returns: + A `tf.data.Dataset` representing `numpy_input`." +2425,experimental_run,tensorflow/tensorflow/python/distribute/distribute_lib.py,945,method,DEPRECATED TF 1.x ONLY. +2426,experimental_distribute_dataset,tensorflow/tensorflow/python/distribute/distribute_lib.py,951,method,"Creates `tf.distribute.DistributedDataset` from `tf.data.Dataset`. + +The returned `tf.distribute.DistributedDataset` can be iterated over +similar to regular datasets. +NOTE: The user cannot add any more transformations to a +`tf.distribute.DistributedDataset`. You can only create an iterator or +examine the `tf.TypeSpec` of the data generated by it. See API docs of +`tf.distribute.DistributedDataset` to learn more. + +The following is an example: + +>>> global_batch_size = 2 +>>> # Passing the devices is optional. +... strategy = tf.distribute.MirroredStrategy(devices=[""GPU:0"", ""GPU:1""]) +>>> # Create a dataset +... dataset = tf.data.Dataset.range(4).batch(global_batch_size) +>>> # Distribute that dataset +... dist_dataset = strategy.experimental_distribute_dataset(dataset) +>>> @tf.function +... def replica_fn(input): +... return input*2 +>>> result = [] +>>> # Iterate over the `tf.distribute.DistributedDataset` +... for x in dist_dataset: +... # process dataset elements +... result.append(strategy.run(replica_fn, args=(x,))) +>>> print(result) +[PerReplica:{ + 0: , + 1: +}, PerReplica:{ + 0: , + 1: +}] + + +Three key actions happending under the hood of this method are batching, +sharding, and prefetching. + +In the code snippet above, `dataset` is batched by `global_batch_size`, and +calling `experimental_distribute_dataset` on it rebatches `dataset` to a +new batch size that is equal to the global batch size divided by the number +of replicas in sync. We iterate through it using a Pythonic for loop. +`x` is a `tf.distribute.DistributedValues` containing data for all replicas, +and each replica gets data of the new batch size. +`tf.distribute.Strategy.run` will take care of feeding the right per-replica +data in `x` to the right `replica_fn` executed on each replica. + +Sharding contains autosharding across multiple workers and within every +worker. First, in multi-worker distributed training (i.e. when you use +`tf.distribute.experimental.MultiWorkerMirroredStrategy` +or `tf.distribute.TPUStrategy`), autosharding a dataset over a set of +workers means that each worker is assigned a subset of the entire dataset +(if the right `tf.data.experimental.AutoShardPolicy` is set). This is to +ensure that at each step, a global batch size of non-overlapping dataset +elements will be processed by each worker. Autosharding has a couple of +different options that can be specified using +`tf.data.experimental.DistributeOptions`. Then, sharding within each worker +means the method will split the data among all the worker devices (if more +than one a present). This will happen regardless of multi-worker +autosharding. + +Note: for autosharding across multiple workers, the default mode is +`tf.data.experimental.AutoShardPolicy.AUTO`. This mode +will attempt to shard the input dataset by files if the dataset is +being created out of reader datasets (e.g. `tf.data.TFRecordDataset`, +`tf.data.TextLineDataset`, etc.) or otherwise shard the dataset by data, +where each of the workers will read the entire dataset and only process the +shard assigned to it. However, if you have less than one input file per +worker, we suggest that you disable dataset autosharding across workers by +setting the `tf.data.experimental.DistributeOptions.auto_shard_policy` to be +`tf.data.experimental.AutoShardPolicy.OFF`. + +By default, this method adds a prefetch transformation at the end of the +user provided `tf.data.Dataset` instance. The argument to the prefetch +transformation which is `buffer_size` is equal to the number of replicas in +sync. + +If the above batch splitting and dataset sharding logic is undesirable, +please use +`tf.distribute.Strategy.experimental_distribute_datasets_from_function` +instead, which does not do any automatic batching or sharding for you. + +Note: If you are using TPUStrategy, the order in which the data is processed +by the workers when using +`tf.distribute.Strategy.experimental_distribute_dataset` or +`tf.distribute.Strategy.experimental_distribute_datasets_from_function` is +not guaranteed. This is typically required if you are using +`tf.distribute` to scale prediction. You can however insert an index for +each element in the batch and order outputs accordingly. Refer to [this +snippet](https://www.tensorflow.org/tutorials/distribute/input#caveats) +for an example of how to order outputs. + +Note: Stateful dataset transformations are currently not supported with +`tf.distribute.experimental_distribute_dataset` or +`tf.distribute.experimental_distribute_datasets_from_function`. Any stateful +ops that the dataset may have are currently ignored. For example, if your +dataset has a `map_fn` that uses `tf.random.uniform` to rotate an image, +then you have a dataset graph that depends on state (i.e the random seed) on +the local machine where the python process is being executed. + +For a tutorial on more usage and properties of this method, refer to the +[tutorial on distributed input](https://www.tensorflow.org/tutorials/distribute/input#tfdistributestrategyexperimental_distribute_dataset). +If you are interested in last partial batch handling, read [this section](https://www.tensorflow.org/tutorials/distribute/input#partial_batches). + +Args: + dataset: `tf.data.Dataset` that will be sharded across all replicas using + the rules stated above. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. + +Returns: + A `tf.distribute.DistributedDataset`." +2427,experimental_distribute_datasets_from_function,tensorflow/tensorflow/python/distribute/distribute_lib.py,1070,method,"Distributes `tf.data.Dataset` instances created by calls to `dataset_fn`. + +The argument `dataset_fn` that users pass in is an input function that has a +`tf.distribute.InputContext` argument and returns a `tf.data.Dataset` +instance. It is expected that the returned dataset from `dataset_fn` is +already batched by per-replica batch size (i.e. global batch size divided by +the number of replicas in sync) and sharded. +`tf.distribute.Strategy.experimental_distribute_datasets_from_function` does +not batch or shard the `tf.data.Dataset` instance +returned from the input function. `dataset_fn` will be called on the CPU +device of each of the workers and each generates a dataset where every +replica on that worker will dequeue one batch of inputs (i.e. if a worker +has two replicas, two batches will be dequeued from the `Dataset` every +step). + +This method can be used for several purposes. First, it allows you to +specify your own batching and sharding logic. (In contrast, +`tf.distribute.experimental_distribute_dataset` does batching and sharding +for you.)For example, where +`experimental_distribute_dataset` is unable to shard the input files, this +method might be used to manually shard the dataset (avoiding the slow +fallback behavior in `experimental_distribute_dataset`). In cases where the +dataset is infinite, this sharding can be done by creating dataset replicas +that differ only in their random seed. + +The `dataset_fn` should take an `tf.distribute.InputContext` instance where +information about batching and input replication can be accessed. + +You can use `element_spec` property of the +`tf.distribute.DistributedDataset` returned by this API to query the +`tf.TypeSpec` of the elements returned by the iterator. This can be used to +set the `input_signature` property of a `tf.function`. Follow +`tf.distribute.DistributedDataset.element_spec` to see an example. + +IMPORTANT: The `tf.data.Dataset` returned by `dataset_fn` should have a +per-replica batch size, unlike `experimental_distribute_dataset`, which uses +the global batch size. This may be computed using +`input_context.get_per_replica_batch_size`. + +Note: If you are using TPUStrategy, the order in which the data is processed +by the workers when using +`tf.distribute.Strategy.experimental_distribute_dataset` or +`tf.distribute.Strategy.experimental_distribute_datasets_from_function` is +not guaranteed. This is typically required if you are using +`tf.distribute` to scale prediction. You can however insert an index for +each element in the batch and order outputs accordingly. Refer to [this +snippet](https://www.tensorflow.org/tutorials/distribute/input#caveats) +for an example of how to order outputs. + +Note: Stateful dataset transformations are currently not supported with +`tf.distribute.experimental_distribute_dataset` or +`tf.distribute.experimental_distribute_datasets_from_function`. Any stateful +ops that the dataset may have are currently ignored. For example, if your +dataset has a `map_fn` that uses `tf.random.uniform` to rotate an image, +then you have a dataset graph that depends on state (i.e the random seed) on +the local machine where the python process is being executed. + +For a tutorial on more usage and properties of this method, refer to the +[tutorial on distributed input](https://www.tensorflow.org/tutorials/distribute/input#tfdistributestrategyexperimental_distribute_datasets_from_function). +If you are interested in last partial batch handling, read [this section](https://www.tensorflow.org/tutorials/distribute/input#partial_batches). + +Args: + dataset_fn: A function taking a `tf.distribute.InputContext` instance and + returning a `tf.data.Dataset`. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. + +Returns: + A `tf.distribute.DistributedDataset`." +2428,run,tensorflow/tensorflow/python/distribute/distribute_lib.py,1147,method,"Run `fn` on each replica, with the given arguments. + +Executes ops specified by `fn` on each replica. If `args` or `kwargs` have +`tf.distribute.DistributedValues`, such as those produced by a +`tf.distribute.DistributedDataset` from +`tf.distribute.Strategy.experimental_distribute_dataset` or +`tf.distribute.Strategy.experimental_distribute_datasets_from_function`, +when `fn` is executed on a particular replica, it will be executed with the +component of `tf.distribute.DistributedValues` that correspond to that +replica. + +`fn` may call `tf.distribute.get_replica_context()` to access members such +as `all_reduce`. + +All arguments in `args` or `kwargs` should either be nest of tensors or +`tf.distribute.DistributedValues` containing tensors or composite tensors. + +IMPORTANT: Depending on the implementation of `tf.distribute.Strategy` and +whether eager execution is enabled, `fn` may be called one or more times. If +`fn` is annotated with `tf.function` or `tf.distribute.Strategy.run` is +called inside a `tf.function`, eager execution is disabled and `fn` is +called once (or once per replica, if you are using MirroredStrategy) to +generate a Tensorflow graph, which will then be reused for execution with +new inputs. Otherwise, if eager execution is enabled, `fn` will be called +every step just like regular python code. + +Example usage: + +1. Constant tensor input. + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> tensor_input = tf.constant(3.0) +>>> @tf.function +... def replica_fn(input): +... return input*2.0 +>>> result = strategy.run(replica_fn, args=(tensor_input,)) +>>> result +PerReplica:{ + 0: , + 1: +} + +2. DistributedValues input. + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> @tf.function +... def run(): +... def value_fn(value_context): +... return value_context.num_replicas_in_sync +... distributed_values = ( +... strategy.experimental_distribute_values_from_function( +... value_fn)) +... def replica_fn2(input): +... return input*2 +... return strategy.run(replica_fn2, args=(distributed_values,)) +>>> result = run() +>>> result + + +Args: + fn: The function to run. The output must be a `tf.nest` of `Tensor`s. + args: (Optional) Positional arguments to `fn`. + kwargs: (Optional) Keyword arguments to `fn`. + options: (Optional) An instance of `tf.distribute.RunOptions` specifying + the options to run `fn`. + +Returns: + Merged return value of `fn` across replicas. The structure of the return + value is the same as the return value from `fn`. Each element in the + structure can either be `tf.distribute.DistributedValues`, `Tensor` + objects, or `Tensor`s (for example, if running on a single replica)." +2429,reduce,tensorflow/tensorflow/python/distribute/distribute_lib.py,1233,method,"Reduce `value` across replicas and return result on current device. + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> def step_fn(): +... i = tf.distribute.get_replica_context().replica_id_in_sync_group +... return tf.identity(i) +>>> +>>> per_replica_result = strategy.run(step_fn) +>>> total = strategy.reduce(""SUM"", per_replica_result, axis=None) +>>> total + + +To see how this would look with multiple replicas, consider the same +example with MirroredStrategy with 2 GPUs: + +```python +strategy = tf.distribute.MirroredStrategy(devices=[""GPU:0"", ""GPU:1""]) +def step_fn(): + i = tf.distribute.get_replica_context().replica_id_in_sync_group + return tf.identity(i) + +per_replica_result = strategy.run(step_fn) +# Check devices on which per replica result is: +strategy.experimental_local_results(per_replica_result)[0].device +# /job:localhost/replica:0/task:0/device:GPU:0 +strategy.experimental_local_results(per_replica_result)[1].device +# /job:localhost/replica:0/task:0/device:GPU:1 + +total = strategy.reduce(""SUM"", per_replica_result, axis=None) +# Check device on which reduced result is: +total.device +# /job:localhost/replica:0/task:0/device:CPU:0 + +``` + +This API is typically used for aggregating the results returned from +different replicas, for reporting etc. For example, loss computed from +different replicas can be averaged using this API before printing. + +Note: The result is copied to the ""current"" device - which would typically +be the CPU of the worker on which the program is running. For `TPUStrategy`, +it is the first TPU host. For multi client `MultiWorkerMirroredStrategy`, +this is CPU of each worker. + +There are a number of different tf.distribute APIs for reducing values +across replicas: +* `tf.distribute.ReplicaContext.all_reduce`: This differs from +`Strategy.reduce` in that it is for replica context and does +not copy the results to the host device. `all_reduce` should be typically +used for reductions inside the training step such as gradients. +* `tf.distribute.StrategyExtended.reduce_to` and +`tf.distribute.StrategyExtended.batch_reduce_to`: These APIs are more +advanced versions of `Strategy.reduce` as they allow customizing the +destination of the result. They are also called in cross replica context. + +_What should axis be?_ + +Given a per-replica value returned by `run`, say a +per-example loss, the batch will be divided across all the replicas. This +function allows you to aggregate across replicas and optionally also across +batch elements by specifying the axis parameter accordingly. + +For example, if you have a global batch size of 8 and 2 +replicas, values for examples `[0, 1, 2, 3]` will be on replica 0 and +`[4, 5, 6, 7]` will be on replica 1. With `axis=None`, `reduce` will +aggregate only across replicas, returning `[0+4, 1+5, 2+6, 3+7]`. +This is useful when each replica is computing a scalar or some other value +that doesn't have a ""batch"" dimension (like a gradient or loss). +``` +strategy.reduce(""sum"", per_replica_result, axis=None) +``` + +Sometimes, you will want to aggregate across both the global batch _and_ +all replicas. You can get this behavior by specifying the batch +dimension as the `axis`, typically `axis=0`. In this case it would return a +scalar `0+1+2+3+4+5+6+7`. +``` +strategy.reduce(""sum"", per_replica_result, axis=0) +``` + +If there is a last partial batch, you will need to specify an axis so +that the resulting shape is consistent across replicas. So if the last +batch has size 6 and it is divided into [0, 1, 2, 3] and [4, 5], you +would get a shape mismatch unless you specify `axis=0`. If you specify +`tf.distribute.ReduceOp.MEAN`, using `axis=0` will use the correct +denominator of 6. Contrast this with computing `reduce_mean` to get a +scalar value on each replica and this function to average those means, +which will weigh some values `1/8` and others `1/4`. + +Args: + reduce_op: a `tf.distribute.ReduceOp` value specifying how values should + be combined. Allows using string representation of the enum such as + ""SUM"", ""MEAN"". + value: a `tf.distribute.DistributedValues` instance, e.g. returned by + `Strategy.run`, to be combined into a single tensor. It can also be a + regular tensor when used with `OneDeviceStrategy` or default strategy. + axis: specifies the dimension to reduce along within each + replica's tensor. Should typically be set to the batch dimension, or + `None` to only reduce across replicas (e.g. if the tensor has no batch + dimension). + +Returns: + A `Tensor`." +2430,unwrap,tensorflow/tensorflow/python/distribute/distribute_lib.py,1433,method,"Returns the list of all local per-replica values contained in `value`. + +DEPRECATED: Please use `experimental_local_results` instead. + +Note: This only returns values on the workers initiated by this client. +When using a `tf.distribute.Strategy` like +`tf.distribute.experimental.MultiWorkerMirroredStrategy`, each worker +will be its own client, and this function will only return values +computed on that worker. + +Args: + value: A value returned by `experimental_run()`, + `extended.call_for_each_replica()`, or a variable created in `scope`. + +Returns: + A tuple of values contained in `value`. If `value` represents a single + value, this returns `(value,).`" +2431,experimental_local_results,tensorflow/tensorflow/python/distribute/distribute_lib.py,1454,method,"Returns the list of all local per-replica values contained in `value`. + +Note: This only returns values on the worker initiated by this client. +When using a `tf.distribute.Strategy` like +`tf.distribute.experimental.MultiWorkerMirroredStrategy`, each worker +will be its own client, and this function will only return values +computed on that worker. + +Args: + value: A value returned by `experimental_run()`, `run()`, + `extended.call_for_each_replica()`, or a variable created in `scope`. + +Returns: + A tuple of values contained in `value`. If `value` represents a single + value, this returns `(value,).`" +2432,group,tensorflow/tensorflow/python/distribute/distribute_lib.py,1474,method,Shortcut for `tf.group(self.experimental_local_results(value))`. +2433,num_replicas_in_sync,tensorflow/tensorflow/python/distribute/distribute_lib.py,1479,method,Returns number of replicas over which gradients are aggregated. +2434,configure,tensorflow/tensorflow/python/distribute/distribute_lib.py,1484,method,"DEPRECATED: use `update_config_proto` instead. + +Configures the strategy class. + +DEPRECATED: This method's functionality has been split into the strategy +constructor and `update_config_proto`. In the future, we will allow passing +cluster and config_proto to the constructor to configure the strategy. And +`update_config_proto` can be used to update the config_proto based on the +specific strategy." +2435,update_config_proto,tensorflow/tensorflow/python/distribute/distribute_lib.py,1504,method,DEPRECATED TF 1.x ONLY. +2436,cluster_resolver,tensorflow/tensorflow/python/distribute/distribute_lib.py,1524,method,"Returns the cluster resolver associated with this strategy. + +In general, when using a multi-worker `tf.distribute` strategy such as +`tf.distribute.experimental.MultiWorkerMirroredStrategy` or +`tf.distribute.TPUStrategy()`, there is a +`tf.distribute.cluster_resolver.ClusterResolver` associated with the +strategy used, and such an instance is returned by this property. + +Strategies that intend to have an associated +`tf.distribute.cluster_resolver.ClusterResolver` must set the +relevant attribute, or override this property; otherwise, `None` is returned +by default. Those strategies should also provide information regarding what +is returned by this property. + +Single-worker strategies usually do not have a +`tf.distribute.cluster_resolver.ClusterResolver`, and in those cases this +property will return `None`. + +The `tf.distribute.cluster_resolver.ClusterResolver` may be useful when the +user needs to access information such as the cluster spec, task type or task +id. For example, + +```python + +os.environ['TF_CONFIG'] = json.dumps({ + 'cluster': { + 'worker': [""localhost:12345"", ""localhost:23456""], + 'ps': [""localhost:34567""] + }, + 'task': {'type': 'worker', 'index': 0} +}) + +# This implicitly uses TF_CONFIG for the cluster and current task info. +strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy() + +... + +if strategy.cluster_resolver.task_type == 'worker': + # Perform something that's only applicable on workers. Since we set this + # as a worker above, this block will run on this particular instance. +elif strategy.cluster_resolver.task_type == 'ps': + # Perform something that's only applicable on parameter servers. Since we + # set this as a worker above, this block will not run on this particular + # instance. +``` + +For more information, please see +`tf.distribute.cluster_resolver.ClusterResolver`'s API docstring. + +Returns: + The cluster resolver associated with this strategy. Returns `None` if a + cluster resolver is not applicable or available in this strategy." +2437,mean_reduce_helper,tensorflow/tensorflow/python/distribute/distribute_lib.py,1372,method,Computes the numerator and denominator on each replica. +2438,reduce_sum,tensorflow/tensorflow/python/distribute/distribute_lib.py,1346,method, +2439,mean_reduce_fn,tensorflow/tensorflow/python/distribute/distribute_lib.py,1417,method, +2440,reduce_sum_fn,tensorflow/tensorflow/python/distribute/distribute_lib.py,1356,method, +2441,Strategy,tensorflow/tensorflow/python/distribute/distribute_lib.py,1584,class, +2442,experimental_assign_to_logical_device,tensorflow/tensorflow/python/distribute/distribute_lib.py,1588,method,"Adds annotation that `tensor` will be assigned to a logical device. + +NOTE: This API is only supported in TPUStrategy for now. +This adds an annotation to `tensor` specifying that operations on +`tensor` will be invoked on logical core device id `logical_device_id`. +When model parallelism is used, the default behavior is that all ops +are placed on zero-th logical device. + +```python + +# Initializing TPU system with 2 logical devices and 4 replicas. +resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +tf.config.experimental_connect_to_cluster(resolver) +topology = tf.tpu.experimental.initialize_tpu_system(resolver) +device_assignment = tf.tpu.experimental.DeviceAssignment.build( + topology, + computation_shape=[1, 1, 1, 2], + num_replicas=4) +strategy = tf.distribute.TPUStrategy( + resolver, experimental_device_assignment=device_assignment) +iterator = iter(inputs) + +@tf.function() +def step_fn(inputs): + output = tf.add(inputs, inputs) + + # Add operation will be executed on logical device 0. + output = strategy.experimental_assign_to_logical_device(output, 0) + return output + +strategy.run(step_fn, args=(next(iterator),)) +``` + +Args: + tensor: Input tensor to annotate. + logical_device_id: Id of the logical core to which the tensor will be + assigned. + +Raises: + ValueError: The logical device id presented is not consistent with total + number of partitions specified by the device assignment. + +Returns: + Annotated tensor with idential value as `tensor`." +2443,experimental_split_to_logical_devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,1637,method,"Adds annotation that `tensor` will be split across logical devices. + +NOTE: This API is only supported in TPUStrategy for now. +This adds an annotation to tensor `tensor` specifying that operations on +`tensor` will be be split among multiple logical devices. Tensor `tensor` +will be split across dimensions specified by `partition_dimensions`. +The dimensions of `tensor` must be divisible by corresponding value in +`partition_dimensions`. + +For example, for system with 8 logical devices, if `tensor` is an image +tensor with shape (batch_size, width, height, channel) and +`partition_dimensions` is [1, 2, 4, 1], then `tensor` will be split +2 in width dimension and 4 way in height dimension and the split +tensor values will be fed into 8 logical devices. + +```python +# Initializing TPU system with 8 logical devices and 1 replica. +resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +tf.config.experimental_connect_to_cluster(resolver) +topology = tf.tpu.experimental.initialize_tpu_system(resolver) +device_assignment = tf.tpu.experimental.DeviceAssignment.build( + topology, + computation_shape=[1, 2, 2, 2], + num_replicas=1) +strategy = tf.distribute.TPUStrategy( + resolver, experimental_device_assignment=device_assignment) + +iterator = iter(inputs) + +@tf.function() +def step_fn(inputs): + inputs = strategy.experimental_split_to_logical_devices( + inputs, [1, 2, 4, 1]) + + # model() function will be executed on 8 logical devices with `inputs` + # split 2 * 4 ways. + output = model(inputs) + return output + +strategy.run(step_fn, args=(next(iterator),)) +``` +Args: + tensor: Input tensor to annotate. + partition_dimensions: An unnested list of integers with the size equal to + rank of `tensor` specifying how `tensor` will be partitioned. The + product of all elements in `partition_dimensions` must be equal to the + total number of logical devices per replica. + +Raises: + ValueError: 1) If the size of partition_dimensions does not equal to rank + of `tensor` or 2) if product of elements of `partition_dimensions` does + not match the number of logical devices per replica defined by the + implementing DistributionStrategy's device specification or + 3) if a known size of `tensor` is not divisible by corresponding + value in `partition_dimensions`. + +Returns: + Annotated tensor with idential value as `tensor`." +2444,experimental_replicate_to_logical_devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,1700,method,"Adds annotation that `tensor` will be replicated to all logical devices. + +NOTE: This API is only supported in TPUStrategy for now. +This adds an annotation to tensor `tensor` specifying that operations on +`tensor` will be invoked on all logical devices. + +```python +# Initializing TPU system with 2 logical devices and 4 replicas. +resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +tf.config.experimental_connect_to_cluster(resolver) +topology = tf.tpu.experimental.initialize_tpu_system(resolver) +device_assignment = tf.tpu.experimental.DeviceAssignment.build( + topology, + computation_shape=[1, 1, 1, 2], + num_replicas=4) +strategy = tf.distribute.TPUStrategy( + resolver, experimental_device_assignment=device_assignment) + +iterator = iter(inputs) + +@tf.function() +def step_fn(inputs): + images, labels = inputs + images = strategy.experimental_split_to_logical_devices( + inputs, [1, 2, 4, 1]) + + # model() function will be executed on 8 logical devices with `inputs` + # split 2 * 4 ways. + output = model(inputs) + + # For loss calculation, all logical devices share the same logits + # and labels. + labels = strategy.experimental_replicate_to_logical_devices(labels) + output = strategy.experimental_replicate_to_logical_devices(output) + loss = loss_fn(labels, output) + + return loss + +strategy.run(step_fn, args=(next(iterator),)) +``` +Args: + tensor: Input tensor to annotate. + +Returns: + Annotated tensor with idential value as `tensor`." +2445,experimental_distribute_values_from_function,tensorflow/tensorflow/python/distribute/distribute_lib.py,1749,method,"Generates `tf.distribute.DistributedValues` from `value_fn`. + +This function is to generate `tf.distribute.DistributedValues` to pass +into `run`, `reduce`, or other methods that take +distributed values when not using datasets. + +Args: + value_fn: The function to run to generate values. It is called for + each replica with `tf.distribute.ValueContext` as the sole argument. It + must return a Tensor or a type that can be converted to a Tensor. +Returns: + A `tf.distribute.DistributedValues` containing a value for each replica. + +Example usage: + +1. Return constant value per replica: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> def value_fn(ctx): +... return tf.constant(1.) +>>> distributed_values = ( +... strategy.experimental_distribute_values_from_function( +... value_fn)) +>>> local_result = strategy.experimental_local_results(distributed_values) +>>> local_result +(, + ) + +2. Distribute values in array based on replica_id: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> array_value = np.array([3., 2., 1.]) +>>> def value_fn(ctx): +... return array_value[ctx.replica_id_in_sync_group] +>>> distributed_values = ( +... strategy.experimental_distribute_values_from_function( +... value_fn)) +>>> local_result = strategy.experimental_local_results(distributed_values) +>>> local_result +(3.0, 2.0) + +3. Specify values using num_replicas_in_sync: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> def value_fn(ctx): +... return ctx.num_replicas_in_sync +>>> distributed_values = ( +... strategy.experimental_distribute_values_from_function( +... value_fn)) +>>> local_result = strategy.experimental_local_results(distributed_values) +>>> local_result +(2, 2) + +4. Place values on devices and distribute: + +``` +strategy = tf.distribute.TPUStrategy() +worker_devices = strategy.extended.worker_devices +multiple_values = [] +for i in range(strategy.num_replicas_in_sync): + with tf.device(worker_devices[i]): + multiple_values.append(tf.constant(1.0)) + +def value_fn(ctx): + return multiple_values[ctx.replica_id_in_sync_group] + +distributed_values = strategy. + experimental_distribute_values_from_function( + value_fn) +```" +2446,StrategyV1,tensorflow/tensorflow/python/distribute/distribute_lib.py,1828,class,"A list of devices with a state & compute distribution policy. See [the guide](https://www.tensorflow.org/guide/distribute_strategy) for overview and examples. @@ -14187,7 +17459,134 @@ for overview and examples. Note: Not all `tf.distribute.Strategy` implementations currently support TensorFlow's partitioned variables (where a single variable is split across multiple devices) at this time." -2731,StrategyExtendedV2,tensorflow/tensorflow/python/distribute/distribute_lib.py,1999,class,"Additional APIs for algorithms that need to be distribution-aware. +2447,make_dataset_iterator,tensorflow/tensorflow/python/distribute/distribute_lib.py,1839,method,"Makes an iterator for input provided via `dataset`. + +DEPRECATED: This method is not available in TF 2.x. + +Data from the given dataset will be distributed evenly across all the +compute replicas. We will assume that the input dataset is batched by the +global batch size. With this assumption, we will make a best effort to +divide each batch across all the replicas (one or more workers). +If this effort fails, an error will be thrown, and the user should instead +use `make_input_fn_iterator` which provides more control to the user, and +does not try to divide a batch across replicas. + +The user could also use `make_input_fn_iterator` if they want to +customize which input is fed to which replica/worker etc. + +Args: + dataset: `tf.data.Dataset` that will be distributed evenly across all + replicas. + +Returns: + An `tf.distribute.InputIterator` which returns inputs for each step of the + computation. User should call `initialize` on the returned iterator." +2448,make_input_fn_iterator,tensorflow/tensorflow/python/distribute/distribute_lib.py,1865,method,"Returns an iterator split across replicas created from an input function. + +DEPRECATED: This method is not available in TF 2.x. + +The `input_fn` should take an `tf.distribute.InputContext` object where +information about batching and input sharding can be accessed: + +``` +def input_fn(input_context): + batch_size = input_context.get_per_replica_batch_size(global_batch_size) + d = tf.data.Dataset.from_tensors([[1.]]).repeat().batch(batch_size) + return d.shard(input_context.num_input_pipelines, + input_context.input_pipeline_id) +with strategy.scope(): + iterator = strategy.make_input_fn_iterator(input_fn) + replica_results = strategy.experimental_run(replica_fn, iterator) +``` + +The `tf.data.Dataset` returned by `input_fn` should have a per-replica +batch size, which may be computed using +`input_context.get_per_replica_batch_size`. + +Args: + input_fn: A function taking a `tf.distribute.InputContext` object and + returning a `tf.data.Dataset`. + replication_mode: an enum value of `tf.distribute.InputReplicationMode`. + Only `PER_WORKER` is supported currently, which means there will be + a single call to `input_fn` per worker. Replicas will dequeue from the + local `tf.data.Dataset` on their worker. + +Returns: + An iterator object that should first be `.initialize()`-ed. It may then + either be passed to `strategy.experimental_run()` or you can + `iterator.get_next()` to get the next value to pass to + `strategy.extended.call_for_each_replica()`." +2449,experimental_make_numpy_dataset,tensorflow/tensorflow/python/distribute/distribute_lib.py,1907,method,"Makes a tf.data.Dataset for input provided via a numpy array. + +This avoids adding `numpy_input` as a large constant in the graph, +and copies the data to the machine or machines that will be processing +the input. + +Note that you will likely need to use +tf.distribute.Strategy.experimental_distribute_dataset +with the returned dataset to further distribute it with the strategy. + +Example: +``` +numpy_input = np.ones([10], dtype=np.float32) +dataset = strategy.experimental_make_numpy_dataset(numpy_input) +dist_dataset = strategy.experimental_distribute_dataset(dataset) +``` + +Args: + numpy_input: A nest of NumPy input arrays that will be converted into a + dataset. Note that lists of Numpy arrays are stacked, as that is normal + `tf.data.Dataset` behavior. + session: (TensorFlow v1.x graph execution only) A session used for + initialization. + +Returns: + A `tf.data.Dataset` representing `numpy_input`." +2450,experimental_run,tensorflow/tensorflow/python/distribute/distribute_lib.py,1938,method,"Runs ops in `fn` on each replica, with inputs from `input_iterator`. + +DEPRECATED: This method is not available in TF 2.x. Please switch +to using `run` instead. + +When eager execution is enabled, executes ops specified by `fn` on each +replica. Otherwise, builds a graph to execute the ops on each replica. + +Each replica will take a single, different input from the inputs provided by +one `get_next` call on the input iterator. + +`fn` may call `tf.distribute.get_replica_context()` to access members such +as `replica_id_in_sync_group`. + +IMPORTANT: Depending on the `tf.distribute.Strategy` implementation being +used, and whether eager execution is enabled, `fn` may be called one or more +times (once for each replica). + +Args: + fn: The function to run. The inputs to the function must match the outputs + of `input_iterator.get_next()`. The output must be a `tf.nest` of + `Tensor`s. + input_iterator: (Optional) input iterator from which the inputs are taken. + +Returns: + Merged return value of `fn` across replicas. The structure of the return + value is the same as the return value from `fn`. Each element in the + structure can either be `PerReplica` (if the values are unsynchronized), + `Mirrored` (if the values are kept in sync), or `Tensor` (if running on a + single replica)." +2451,reduce,tensorflow/tensorflow/python/distribute/distribute_lib.py,1973,method, +2452,update_config_proto,tensorflow/tensorflow/python/distribute/distribute_lib.py,1978,method,"Returns a copy of `config_proto` modified for use with this strategy. + +DEPRECATED: This method is not available in TF 2.x. + +The updated config has something needed to run a strategy, e.g. +configuration to run collective ops, or device filters to improve +distributed training performance. + +Args: + config_proto: a `tf.ConfigProto` object. + +Returns: + The updated copy of the `config_proto`." +2453,StrategyExtendedV2,tensorflow/tensorflow/python/distribute/distribute_lib.py,1999,class,"Additional APIs for algorithms that need to be distribution-aware. Note: For most usage of `tf.distribute.Strategy`, there should be no need to call these methods, since TensorFlow libraries (such as optimizers) already @@ -14250,8 +17649,414 @@ before checkpointing, so at the time of restoring, the value is divided by the number of replicas and then assigned to each replica; if the `aggregation` type is `tf.VariableAggregation.MEAN`, the value is assigned to each replica directly." -2732,StrategyExtendedV1,tensorflow/tensorflow/python/distribute/distribute_lib.py,2618,class, -2733,ReplicaContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,2829,class,"A class with a collection of APIs that can be called in a replica context. +2454,variable_created_in_scope,tensorflow/tensorflow/python/distribute/distribute_lib.py,2139,method,"Tests whether `v` was created while this strategy scope was active. + +Variables created inside the strategy scope are ""owned"" by it: + +>>> strategy = tf.distribute.MirroredStrategy() +>>> with strategy.scope(): +... v = tf.Variable(1.) +>>> strategy.extended.variable_created_in_scope(v) +True + +Variables created outside the strategy are not owned by it: + +>>> strategy = tf.distribute.MirroredStrategy() +>>> v = tf.Variable(1.) +>>> strategy.extended.variable_created_in_scope(v) +False + +Args: + v: A `tf.Variable` instance. + +Returns: + True if `v` was created inside the scope, False if not." +2455,colocate_vars_with,tensorflow/tensorflow/python/distribute/distribute_lib.py,2165,method,"Scope that controls which devices variables will be created on. + +No operations should be added to the graph inside this scope, it +should only be used when creating variables (some implementations +work by changing variable creation, others work by using a +tf.compat.v1.colocate_with() scope). + +This may only be used inside `self.scope()`. + +Example usage: + +``` +with strategy.scope(): + var1 = tf.Variable(...) + with strategy.extended.colocate_vars_with(var1): + # var2 and var3 will be created on the same device(s) as var1 + var2 = tf.Variable(...) + var3 = tf.Variable(...) + + def fn(v1, v2, v3): + # operates on v1 from var1, v2 from var2, and v3 from var3 + + # `fn` runs on every device `var1` is on, `var2` and `var3` will be there + # too. + strategy.extended.update(var1, fn, args=(var2, var3)) +``` + +Args: + colocate_with_variable: A variable created in this strategy's `scope()`. + Variables created while in the returned context manager will be on the + same set of devices as `colocate_with_variable`. + +Returns: + A context manager." +2456,reduce_to,tensorflow/tensorflow/python/distribute/distribute_lib.py,2250,method,"Combine (via e.g. sum or mean) values across replicas. + +`reduce_to` aggregates `tf.distribute.DistributedValues` and distributed +variables. It supports both dense values and `tf.IndexedSlices`. + +This API currently can only be called in cross-replica context. Other +variants to reduce values across replicas are: +* `tf.distribute.StrategyExtended.batch_reduce_to`: the batch version of + this API. +* `tf.distribute.ReplicaContext.all_reduce`: the counterpart of this API + in replica context. It supports both batched and non-batched all-reduce. +* `tf.distribute.Strategy.reduce`: a more convenient method to reduce + to the host in cross-replica context. + +`destinations` specifies where to reduce the value to, e.g. ""GPU:0"". You can +also pass in a `Tensor`, and the destinations will be the device of that +tensor. For all-reduce, pass the same to `value` and `destinations`. + +It can be used in `tf.distribute.ReplicaContext.merge_call` to write code +that works for all `tf.distribute.Strategy`. + +>>> @tf.function +... def step_fn(var): +... +... def merge_fn(strategy, value, var): +... # All-reduce the value. Note that `value` here is a +... # `tf.distribute.DistributedValues`. +... reduced = strategy.extended.reduce_to(tf.distribute.ReduceOp.SUM, +... value, destinations=var) +... strategy.extended.update(var, lambda var, value: var.assign(value), +... args=(reduced,)) +... +... value = tf.identity(1.) +... tf.distribute.get_replica_context().merge_call(merge_fn, +... args=(value, var)) +>>> +>>> def run(strategy): +... with strategy.scope(): +... v = tf.Variable(0.) +... strategy.run(step_fn, args=(v,)) +... return v +>>> +>>> run(tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""])) +MirroredVariable:{ + 0: , + 1: +} +>>> run(tf.distribute.experimental.CentralStorageStrategy( +... compute_devices=[""GPU:0"", ""GPU:1""], parameter_device=""CPU:0"")) + +>>> run(tf.distribute.OneDeviceStrategy(""GPU:0"")) + + +Args: + reduce_op: a `tf.distribute.ReduceOp` or string. How to reduce the value. + value: a `tf.distribute.DistributedValue`, or a `tf.Tensor` like object. + destinations: a `tf.distribute.DistributedValue`, a `tf.Variable`, a + `tf.Tensor` alike object, or a device string. It specifies the devices + to reduce to. To perform an all-reduce, pass the same to `value` and + `destinations`. Note that if it's a `tf.Variable`, the value is reduced + to the devices of that variable, this method doesn't update the variable. + experimental_hints: a `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. See + `tf.distrbute.experimental.CollectiveHints` for details. + +Returns: + A tensor or value reduced to `destinations`." +2457,batch_reduce_to,tensorflow/tensorflow/python/distribute/distribute_lib.py,2333,method,"Combine multiple `reduce_to` calls into one for faster execution. + +Similar to `reduce_to`, but accepts a list of (value, destinations) pairs. +It's more efficient than reduce each value separately. + +This API currently can only be called in cross-replica context. Other +variants to reduce values across replicas are: +* `tf.distribute.StrategyExtended.reduce_to`: the non-batch version of + this API. +* `tf.distribute.ReplicaContext.all_reduce`: the counterpart of this API + in replica context. It supports both batched and non-batched all-reduce. +* `tf.distribute.Strategy.reduce`: a more convenient method to reduce + to the host in cross-replica context. + +See `reduce_to` for more information. + +>>> @tf.function +... def step_fn(var): +... +... def merge_fn(strategy, value, var): +... # All-reduce the value. Note that `value` here is a +... # `tf.distribute.DistributedValues`. +... reduced = strategy.extended.batch_reduce_to( +... tf.distribute.ReduceOp.SUM, [(value, var)])[0] +... strategy.extended.update(var, lambda var, value: var.assign(value), +... args=(reduced,)) +... +... value = tf.identity(1.) +... tf.distribute.get_replica_context().merge_call(merge_fn, +... args=(value, var)) +>>> +>>> def run(strategy): +... with strategy.scope(): +... v = tf.Variable(0.) +... strategy.run(step_fn, args=(v,)) +... return v +>>> +>>> run(tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""])) +MirroredVariable:{ + 0: , + 1: +} +>>> run(tf.distribute.experimental.CentralStorageStrategy( +... compute_devices=[""GPU:0"", ""GPU:1""], parameter_device=""CPU:0"")) + +>>> run(tf.distribute.OneDeviceStrategy(""GPU:0"")) + + +Args: + reduce_op: a `tf.distribute.ReduceOp`. How to reduce the value. + value_destination_pairs: a sequence of (value, destinations) pairs. See + `reduce_to()` for descriptions. + experimental_hints: a `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + A list of reduced values, one per pair in `value_destination_pairs`." +2458,update,tensorflow/tensorflow/python/distribute/distribute_lib.py,2412,method,"Run `fn` to update `var` using inputs mirrored to the same devices. + +`tf.distribute.StrategyExtended.update` takes a distributed variable `var` +to be updated, an update function `fn`, and `args` and `kwargs` for `fn`. It +applies `fn` to each component variable of `var` and passes corresponding +values from `args` and `kwargs`. Neither `args` nor `kwargs` may contain +per-replica values. If they contain mirrored values, they will be unwrapped +before calling `fn`. For example, `fn` can be `assign_add` and `args` can be +a mirrored DistributedValues where each component contains the value to be +added to this mirrored variable `var`. Calling `update` will call +`assign_add` on each component variable of `var` with the corresponding +tensor value on that device. + +Example usage: + +```python +strategy = tf.distribute.MirroredStrategy(['GPU:0', 'GPU:1']) # With 2 devices +with strategy.scope(): + v = tf.Variable(5.0, aggregation=tf.VariableAggregation.SUM) +def update_fn(v): + return v.assign(1.0) +result = strategy.extended.update(v, update_fn) +# result is +# Mirrored:{ +# 0: tf.Tensor(1.0, shape=(), dtype=float32), +# 1: tf.Tensor(1.0, shape=(), dtype=float32) +# } +``` + +If `var` is mirrored across multiple devices, then this method implements +logic as following: + +```python +results = {} +for device, v in var: + with tf.device(device): + # args and kwargs will be unwrapped if they are mirrored. + results[device] = fn(v, *args, **kwargs) +return merged(results) +``` + +Otherwise, this method returns `fn(var, *args, **kwargs)` colocated with +`var`. + +Args: + var: Variable, possibly mirrored to multiple devices, to operate on. + fn: Function to call. Should take the variable as the first argument. + args: Tuple or list. Additional positional arguments to pass to `fn()`. + kwargs: Dict with keyword arguments to pass to `fn()`. + group: Boolean. Defaults to True. If False, the return value will be + unwrapped. + +Returns: + By default, the merged return value of `fn` across all replicas. The + merged result has dependencies to make sure that if it is evaluated at + all, the side effects (updates) will happen on every replica. If instead + ""group=False"" is specified, this function will return a nest of lists + where each list has an element per replica, and the caller is responsible + for ensuring all elements are executed." +2459,update_non_slot,tensorflow/tensorflow/python/distribute/distribute_lib.py,2485,method,"Runs `fn(*args, **kwargs)` on `colocate_with` devices. + +Used to update non-slot variables. + +Args: + colocate_with: Devices returned by `non_slot_devices()`. + fn: Function to execute. + args: Tuple or list. Positional arguments to pass to `fn()`. + kwargs: Dict with keyword arguments to pass to `fn()`. + group: Boolean. Defaults to True. If False, the return value will be + unwrapped. + +Returns: + Return value of `fn`, possibly merged across devices." +2460,value_container,tensorflow/tensorflow/python/distribute/distribute_lib.py,2516,method,"Returns the container that this per-replica `value` belongs to. + +Args: + value: A value returned by `run()` or a variable created in `scope()`. + +Returns: + A container that `value` belongs to. + If value does not belong to any container (including the case of + container having been destroyed), returns the value itself. + `value in experimental_local_results(value_container(value))` will + always be true." +2461,experimental_require_static_shapes,tensorflow/tensorflow/python/distribute/distribute_lib.py,2544,method,Returns `True` if static shape is required; `False` otherwise. +2462,worker_devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,2554,method,"Returns the tuple of all devices used to for compute replica execution. + " +2463,parameter_devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,2561,method,Returns the tuple of all devices used to place variables. +2464,non_slot_devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,2567,method,"Device(s) for non-slot variables. + +This method returns non-slot devices where non-slot variables are placed. +Users can create non-slot variables on these devices by using a block: + +```python +with tf.distribute.StrategyExtended.colocate_vars_with(tf.distribute.StrategyExtended.non_slot_devices(...)): + ... +``` + +Args: + var_list: The list of variables being optimized, needed with the + default `tf.distribute.Strategy`. +Returns: + A sequence of devices for non-slot variables." +2465,creator_with_resource_vars,tensorflow/tensorflow/python/distribute/distribute_lib.py,2090,method,Variable creator to use in `_CurrentDistributionContext`. +2466,distributed_getter,tensorflow/tensorflow/python/distribute/distribute_lib.py,2117,method, +2467,create_colocated_variable,tensorflow/tensorflow/python/distribute/distribute_lib.py,2202,method, +2468,StrategyExtendedV1,tensorflow/tensorflow/python/distribute/distribute_lib.py,2618,class, +2469,experimental_make_numpy_dataset,tensorflow/tensorflow/python/distribute/distribute_lib.py,2622,method,"Makes a dataset for input provided via a numpy array. + +This avoids adding `numpy_input` as a large constant in the graph, +and copies the data to the machine or machines that will be processing +the input. + +Args: + numpy_input: A nest of NumPy input arrays that will be distributed evenly + across all replicas. Note that lists of Numpy arrays are stacked, as + that is normal `tf.data.Dataset` behavior. + session: (TensorFlow v1.x graph execution only) A session used for + initialization. + +Returns: + A `tf.data.Dataset` representing `numpy_input`." +2470,broadcast_to,tensorflow/tensorflow/python/distribute/distribute_lib.py,2645,method,"Mirror a tensor on one device to all worker devices. + +Args: + tensor: A Tensor value to broadcast. + destinations: A mirrored variable or device string specifying the + destination devices to copy `tensor` to. + +Returns: + A value mirrored to `destinations` devices." +2471,experimental_run_steps_on_iterator,tensorflow/tensorflow/python/distribute/distribute_lib.py,2665,method,"DEPRECATED: please use `run` instead. + +Run `fn` with input from `iterator` for `iterations` times. + +This method can be used to run a step function for training a number of +times using input from a dataset. + +Args: + fn: function to run using this distribution strategy. The function must + have the following signature: `def fn(context, inputs)`. `context` is an + instance of `MultiStepContext` that will be passed when `fn` is run. + `context` can be used to specify the outputs to be returned from `fn` + by calling `context.set_last_step_output`. It can also be used to + capture non tensor outputs by `context.set_non_tensor_output`. See + `MultiStepContext` documentation for more information. `inputs` will + have same type/structure as `iterator.get_next()`. Typically, `fn` + will use `call_for_each_replica` method of the strategy to distribute + the computation over multiple replicas. + iterator: Iterator of a dataset that represents the input for `fn`. The + caller is responsible for initializing the iterator as needed. + iterations: (Optional) Number of iterations that `fn` should be run. + Defaults to 1. + initial_loop_values: (Optional) Initial values to be passed into the + loop that runs `fn`. Defaults to `None`. # TODO(priyag): Remove + initial_loop_values argument when we have a mechanism to infer the + outputs of `fn`. + +Returns: + Returns the `MultiStepContext` object which has the following properties, + among other things: + - run_op: An op that runs `fn` `iterations` times. + - last_step_outputs: A dictionary containing tensors set using + `context.set_last_step_output`. Evaluating this returns the value of + the tensors after the last iteration. + - non_tensor_outputs: A dictionary containing anything that was set by + `fn` by calling `context.set_non_tensor_output`." +2472,call_for_each_replica,tensorflow/tensorflow/python/distribute/distribute_lib.py,2716,method,"Run `fn` once per replica. + +`fn` may call `tf.get_replica_context()` to access methods such as +`replica_id_in_sync_group` and `merge_call()`. + +`merge_call()` is used to communicate between the replicas and +re-enter the cross-replica context. All replicas pause their execution +having encountered a `merge_call()` call. After that the +`merge_fn`-function is executed. Its results are then unwrapped and +given back to each replica call. After that execution resumes until +`fn` is complete or encounters another `merge_call()`. Example: + +```python +# Called once in ""cross-replica"" context. +def merge_fn(distribution, three_plus_replica_id): + # sum the values across replicas + return sum(distribution.experimental_local_results(three_plus_replica_id)) + +# Called once per replica in `distribution`, in a ""replica"" context. +def fn(three): + replica_ctx = tf.get_replica_context() + v = three + replica_ctx.replica_id_in_sync_group + # Computes the sum of the `v` values across all replicas. + s = replica_ctx.merge_call(merge_fn, args=(v,)) + return s + v + +with distribution.scope(): + # in ""cross-replica"" context + ... + merged_results = distribution.run(fn, args=[3]) + # merged_results has the values from every replica execution of `fn`. + # This statement prints a list: + print(distribution.experimental_local_results(merged_results)) +``` + +Args: + fn: function to run (will be run once per replica). + args: Tuple or list with positional arguments for `fn`. + kwargs: Dict with keyword arguments for `fn`. + +Returns: + Merged return value of `fn` across all replicas." +2473,read_var,tensorflow/tensorflow/python/distribute/distribute_lib.py,2769,method,"Reads the value of a variable. + +Returns the aggregate value of a replica-local variable, or the +(read-only) value of any other variable. + +Args: + v: A variable allocated within the scope of this `tf.distribute.Strategy`. + +Returns: + A tensor representing the value of `v`, aggregated across replicas if + necessary." +2474,experimental_between_graph,tensorflow/tensorflow/python/distribute/distribute_lib.py,2785,method,"Whether the strategy uses between-graph replication or not. + +This is expected to return a constant value that will not be changed +throughout its life cycle." +2475,experimental_should_init,tensorflow/tensorflow/python/distribute/distribute_lib.py,2794,method,Whether initialization is needed. +2476,should_checkpoint,tensorflow/tensorflow/python/distribute/distribute_lib.py,2799,method,Whether checkpointing is needed. +2477,should_save_summary,tensorflow/tensorflow/python/distribute/distribute_lib.py,2804,method,Whether saving summaries is needed. +2478,ReplicaContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,2829,class,"A class with a collection of APIs that can be called in a replica context. You can use `tf.distribute.get_replica_context` to get an instance of `ReplicaContext`, which can only be called inside the function passed to @@ -14266,25 +18071,77 @@ PerReplica:{ 0: , 1: }" -2734,_batch_reduce_destination,tensorflow/tensorflow/python/distribute/distribute_lib.py,3017,function,Returns the destinations for batch all-reduce. -2735,_DefaultDistributionStrategyV1,tensorflow/tensorflow/python/distribute/distribute_lib.py,3032,class,Default `tf.distribute.Strategy` if none is explicitly selected. -2736,_DefaultDistributionStrategy,tensorflow/tensorflow/python/distribute/distribute_lib.py,3048,class,Default `tf.distribute.Strategy` if none is explicitly selected. -2737,_DefaultDistributionContext,tensorflow/tensorflow/python/distribute/distribute_lib.py,3064,class,Context manager setting the default `tf.distribute.Strategy`. -2738,_DefaultDistributionExtended,tensorflow/tensorflow/python/distribute/distribute_lib.py,3101,class,Implementation of _DefaultDistributionStrategy. -2739,_from_proto_fn,tensorflow/tensorflow/python/distribute/distribute_lib.py,3273,function, -2740,_TestReplicaContext,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,44,class, -2741,_get_test_variable,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,50,function, -2742,_test_input_fn,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,58,function, -2743,_TestStrategy,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,63,class, -2744,_TestExtended,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,69,class, -2745,_assert_in_default_state,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,131,function, -2746,_run_in_and_out_of_scope,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,140,function, -2747,TestStrategyTest,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,159,class, -2748,_TestStrategy2,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,440,class, -2749,_TestExtended2,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,446,class, -2750,DefaultDistributionStrategyTest,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,452,class, -2751,InputContextTest,tensorflow/tensorflow/python/distribute/distribute_lib_test.py,571,class, -2752,regroup,tensorflow/tensorflow/python/distribute/distribute_utils.py,32,function,"Makes a nest per-replica into a nest of PerReplica/Mirrored values. +2479,merge_call,tensorflow/tensorflow/python/distribute/distribute_lib.py,2874,method,"Merge args across replicas and run `merge_fn` in a cross-replica context. + +This allows communication and coordination when there are multiple calls +to the step_fn triggered by a call to `strategy.run(step_fn, ...)`. + +See `tf.distribute.Strategy.run` for an explanation. + +If not inside a distributed scope, this is equivalent to: + +``` +strategy = tf.distribute.get_strategy() +with cross-replica-context(strategy): + return merge_fn(strategy, *args, **kwargs) +``` + +Args: + merge_fn: Function that joins arguments from threads that are given as + PerReplica. It accepts `tf.distribute.Strategy` object as + the first argument. + args: List or tuple with positional per-thread arguments for `merge_fn`. + kwargs: Dict with keyword per-thread arguments for `merge_fn`. + +Returns: + The return value of `merge_fn`, except for `PerReplica` values which are + unpacked." +2480,num_replicas_in_sync,tensorflow/tensorflow/python/distribute/distribute_lib.py,2918,method,Returns number of replicas that are kept in sync. +2481,replica_id_in_sync_group,tensorflow/tensorflow/python/distribute/distribute_lib.py,2923,method,"Returns the id of the replica. + +This identifies the replica among all replicas that are kept in sync. The +value of the replica id can range from 0 to +`tf.distribute.ReplicaContext.num_replicas_in_sync` - 1. + +NOTE: This is not guaranteed to be the same ID as the XLA replica ID use +for low-level operations such as collective_permute." +2482,strategy,tensorflow/tensorflow/python/distribute/distribute_lib.py,2937,method,The current `tf.distribute.Strategy` object. +2483,devices,tensorflow/tensorflow/python/distribute/distribute_lib.py,2943,method,"Returns the devices this replica is to be executed on, as a tuple of strings. + +NOTE: For `tf.distribute.MirroredStrategy` and +`tf.distribute.experimental.MultiWorkerMirroredStrategy`, this returns a +nested +list of device strings, e.g, [[""GPU:0""]]." +2484,all_reduce,tensorflow/tensorflow/python/distribute/distribute_lib.py,2954,method,"All-reduces the given `value Tensor` nest across replicas. + +If `all_reduce` is called in any replica, it must be called in all replicas. +The nested structure and `Tensor` shapes must be identical in all replicas. + +IMPORTANT: The ordering of communications must be identical in all replicas. + +Example with two replicas: + Replica 0 `value`: {'a': 1, 'b': [40, 1]} + Replica 1 `value`: {'a': 3, 'b': [ 2, 98]} + + If `reduce_op` == `SUM`: + Result (on all replicas): {'a': 4, 'b': [42, 99]} + + If `reduce_op` == `MEAN`: + Result (on all replicas): {'a': 2, 'b': [21, 49.5]} + +Args: + reduce_op: Reduction type, an instance of `tf.distribute.ReduceOp` enum. + value: The nested structure of `Tensor`s to all-reduce. The structure must + be compatible with `tf.nest`. + experimental_hints: A `tf.distrbute.experimental.CollectiveHints`. Hints + to perform collective operations. + +Returns: + A `Tensor` nest with the reduced `value`s from each replica." +2485,replica_id_is_zero,tensorflow/tensorflow/python/distribute/distribute_lib.py,2858,method, +2486,batch_all_reduce,tensorflow/tensorflow/python/distribute/distribute_lib.py,2987,method, +2487,grad_wrapper,tensorflow/tensorflow/python/distribute/distribute_lib.py,2995,method, +2488,regroup,tensorflow/tensorflow/python/distribute/distribute_utils.py,32,function,"Makes a nest per-replica into a nest of PerReplica/Mirrored values. Args: values: Values to regroup @@ -14293,10 +18150,10 @@ Args: are the same except for DistributeVariable. Returns: Wrapped `values`." -2753,select_replica,tensorflow/tensorflow/python/distribute/distribute_utils.py,127,function,Specialize a nest of regular & per-replica values for one replica. -2754,select_replica_mirrored,tensorflow/tensorflow/python/distribute/distribute_utils.py,143,function,Specialize a nest of regular & mirrored values for one replica. -2755,update_regroup,tensorflow/tensorflow/python/distribute/distribute_utils.py,162,function,"Regroup for an update, with dependencies to ensure all updates execute." -2756,value_container,tensorflow/tensorflow/python/distribute/distribute_utils.py,195,function,"Returns the container that this per-replica `value` belongs to. +2489,select_replica,tensorflow/tensorflow/python/distribute/distribute_utils.py,127,function,Specialize a nest of regular & per-replica values for one replica. +2490,select_replica_mirrored,tensorflow/tensorflow/python/distribute/distribute_utils.py,143,function,Specialize a nest of regular & mirrored values for one replica. +2491,update_regroup,tensorflow/tensorflow/python/distribute/distribute_utils.py,162,function,"Regroup for an update, with dependencies to ensure all updates execute." +2492,value_container,tensorflow/tensorflow/python/distribute/distribute_utils.py,195,function,"Returns the container that this per-replica `value` belongs to. Args: val: A value returned by `call_for_each_replica()` or a variable created in @@ -14306,17 +18163,11 @@ Returns: A container that `value` belongs to. If value does not belong to any container (including the case of container having been destroyed), returns the value itself." -2757,is_distributed_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,217,function,Determine if a variable is ds variable or TPU mirrored variable. -2758,_validate_colocate_extended,tensorflow/tensorflow/python/distribute/distribute_utils.py,222,function, -2759,validate_colocate_distributed_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,231,function, -2760,validate_colocate,tensorflow/tensorflow/python/distribute/distribute_utils.py,239,function, -2761,create_mirrored_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,248,function, -2762,_nested_value,tensorflow/tensorflow/python/distribute/distribute_utils_test.py,38,function, -2763,RegroupAndSelectDeviceTest,tensorflow/tensorflow/python/distribute/distribute_utils_test.py,42,class, -2764,_get_base_dirpath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,56,function, -2765,_is_temp_dir,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,61,function, -2766,_get_temp_dir,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,65,function, -2767,write_dirpath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,74,function,"Returns the writing dir that should be used to save file distributedly. +2493,is_distributed_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,217,function,Determine if a variable is ds variable or TPU mirrored variable. +2494,validate_colocate_distributed_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,231,function, +2495,validate_colocate,tensorflow/tensorflow/python/distribute/distribute_utils.py,239,function, +2496,create_mirrored_variable,tensorflow/tensorflow/python/distribute/distribute_utils.py,248,function, +2497,write_dirpath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,74,function,"Returns the writing dir that should be used to save file distributedly. `dirpath` would be created if it doesn't exist. @@ -14326,12 +18177,12 @@ Args: Returns: The writing dir path that should be used to save with distribution." -2768,remove_temp_dirpath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,102,function,"Removes the temp path after writing is finished. +2498,remove_temp_dirpath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,102,function,"Removes the temp path after writing is finished. Args: dirpath: Original dirpath that would be used without distribution. strategy: The tf.distribute strategy object currently used." -2769,write_filepath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,125,function,"Returns the writing file path to be used to save file distributedly. +2499,write_filepath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,125,function,"Returns the writing file path to be used to save file distributedly. Directory to contain `filepath` would be created if it doesn't exist. @@ -14341,22 +18192,12 @@ Args: Returns: The writing filepath that should be used to save file with distribution." -2770,remove_temp_dir_with_filepath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,142,function,"Removes the temp path for file after writing is finished. +2500,remove_temp_dir_with_filepath,tensorflow/tensorflow/python/distribute/distributed_file_utils.py,142,function,"Removes the temp path for file after writing is finished. Args: filepath: Original filepath that would be used without distribution. strategy: The tf.distribute strategy object currently used." -2771,DistributedFileUtilsTest,tensorflow/tensorflow/python/distribute/distributed_file_utils_test.py,25,class, -2772,_ThreadMode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,41,class, -2773,_CrossReplicaThreadMode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,49,class, -2774,_InReplicaThreadMode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,55,class, -2775,_push_per_thread_mode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,61,function, -2776,_pop_per_thread_mode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,65,function, -2777,_DefaultReplicaThreadMode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,69,class,"Type of default value returned by `_get_per_thread_mode()`. - -Used when the thread-local stack is empty." -2778,_get_per_thread_mode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,80,function, -2779,get_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,92,function,"Returns the current `tf.distribute.ReplicaContext` or `None`. +2501,get_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,92,function,"Returns the current `tf.distribute.ReplicaContext` or `None`. Returns `None` if in a cross-replica context. @@ -14398,7 +18239,7 @@ Returns: * `get_replica_context()` returns non-`None`, or * `tf.distribute.is_cross_replica_context()` returns True." -2780,get_cross_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,139,function,"Returns the current tf.distribute.Strategy if in a cross-replica context. +2502,get_cross_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,139,function,"Returns the current tf.distribute.Strategy if in a cross-replica context. DEPRECATED: Please use `in_cross_replica_context()` and `get_strategy()` instead. @@ -14409,7 +18250,7 @@ Returns: Exactly one of `get_replica_context()` and `get_cross_replica_context()` will return `None` in a particular block." -2781,in_cross_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,156,function,"Returns `True` if in a cross-replica context. +2503,in_cross_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,156,function,"Returns `True` if in a cross-replica context. See `tf.distribute.get_replica_context` for details. @@ -14428,7 +18269,7 @@ Returns: `True` if in a cross-replica context (`get_replica_context()` returns `None`), or `False` if in a replica context (`get_replica_context()` returns non-`None`)." -2782,get_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,181,function,"Returns the current `tf.distribute.Strategy` object. +2504,get_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,181,function,"Returns the current `tf.distribute.Strategy` object. Typically only used in a cross-replica context: @@ -14442,7 +18283,7 @@ Returns: A `tf.distribute.Strategy` object. Inside a `with strategy.scope()` block, it returns `strategy`, otherwise it returns the default (single-replica) `tf.distribute.Strategy` object." -2783,has_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,201,function,"Return if there is a current non-default `tf.distribute.Strategy`. +2505,has_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,201,function,"Return if there is a current non-default `tf.distribute.Strategy`. ``` assert not tf.distribute.has_strategy() @@ -14452,8 +18293,8 @@ with strategy.scope(): Returns: True if inside a `with strategy.scope():`." -2784,get_strategy_and_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,216,function, -2785,experimental_set_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,222,function,"Set a `tf.distribute.Strategy` as current without `with strategy.scope()`. +2506,get_strategy_and_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,216,function, +2507,experimental_set_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,222,function,"Set a `tf.distribute.Strategy` as current without `with strategy.scope()`. ``` tf.distribute.experimental_set_strategy(strategy1) @@ -14486,18 +18327,10 @@ Args: Raises: RuntimeError: If called inside a `with strategy.scope():`." -2786,enter_or_assert_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,275,function, -2787,_assert_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,302,function, -2788,_get_default_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,313,function, -2789,_get_default_replica_context,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,332,function, -2790,_get_default_replica_mode,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,342,function, -2791,_count_ps,tensorflow/tensorflow/python/distribute/estimator_training.py,40,function,Counts the number of parameter servers in cluster_spec. -2792,_count_worker,tensorflow/tensorflow/python/distribute/estimator_training.py,49,function,Counts the number of workers (including chief) in cluster_spec. -2793,_get_global_id,tensorflow/tensorflow/python/distribute/estimator_training.py,59,function,Returns the global id of the given task type in a cluster. -2794,_init_run_config_from_worker_context,tensorflow/tensorflow/python/distribute/estimator_training.py,90,function,Initializes run config from distribute coordinator's worker context. -2795,init_run_config,tensorflow/tensorflow/python/distribute/estimator_training.py,127,function,Initializes RunConfig for distribution strategies. -2796,should_run_distribute_coordinator,tensorflow/tensorflow/python/distribute/estimator_training.py,181,function,Checks the config to see whether to run distribute coordinator. -2797,train_and_evaluate,tensorflow/tensorflow/python/distribute/estimator_training.py,203,function,"Run distribute coordinator for Estimator's `train_and_evaluate`. +2508,enter_or_assert_strategy,tensorflow/tensorflow/python/distribute/distribution_strategy_context.py,275,function, +2509,init_run_config,tensorflow/tensorflow/python/distribute/estimator_training.py,127,function,Initializes RunConfig for distribution strategies. +2510,should_run_distribute_coordinator,tensorflow/tensorflow/python/distribute/estimator_training.py,181,function,Checks the config to see whether to run distribute coordinator. +2511,train_and_evaluate,tensorflow/tensorflow/python/distribute/estimator_training.py,203,function,"Run distribute coordinator for Estimator's `train_and_evaluate`. Args: estimator: An `Estimator` instance to train and evaluate. @@ -14508,9 +18341,9 @@ Args: Raises: ValueError: if `distribute_coordinator_mode` is None in RunConfig." -2798,estimator_train,tensorflow/tensorflow/python/distribute/estimator_training.py,295,function,Run distribute coordinator for Estimator's `train` method. -2799,estimator_evaluate,tensorflow/tensorflow/python/distribute/estimator_training.py,344,function,Run distribute coordinator for Estimator's `evaluate` method. -2800,get_distributed_dataset,tensorflow/tensorflow/python/distribute/input_lib.py,61,function,"Returns a distributed dataset from the given tf.data.Dataset instance. +2512,estimator_train,tensorflow/tensorflow/python/distribute/estimator_training.py,295,function,Run distribute coordinator for Estimator's `train` method. +2513,estimator_evaluate,tensorflow/tensorflow/python/distribute/estimator_training.py,344,function,Run distribute coordinator for Estimator's `evaluate` method. +2514,get_distributed_dataset,tensorflow/tensorflow/python/distribute/input_lib.py,61,function,"Returns a distributed dataset from the given tf.data.Dataset instance. This is a common function that is used by all strategies to return a distributed dataset. The distributed dataset instance returned is different @@ -14533,7 +18366,7 @@ Args: Returns: A distributed dataset instance." -2801,get_distributed_datasets_from_function,tensorflow/tensorflow/python/distribute/input_lib.py,106,function,"Returns a distributed dataset from the given input function. +2515,get_distributed_datasets_from_function,tensorflow/tensorflow/python/distribute/input_lib.py,106,function,"Returns a distributed dataset from the given input function. This is a common function that is used by all strategies to return a distributed dataset. The distributed dataset instance returned is different @@ -14553,7 +18386,7 @@ Args: Returns: A distributed dataset instance." -2802,DistributedIteratorInterface,tensorflow/tensorflow/python/distribute/input_lib.py,146,class,"An iterator over `tf.distribute.DistributedDataset`. +2516,DistributedIteratorInterface,tensorflow/tensorflow/python/distribute/input_lib.py,146,class,"An iterator over `tf.distribute.DistributedDataset`. `tf.distribute.DistributedIterator` is the primary mechanism for enumerating elements of a `tf.distribute.DistributedDataset`. It supports the Python @@ -14566,7 +18399,81 @@ a `tf.distribute.DistributedDataset` or creating a python loop over a Visit the [tutorial](https://www.tensorflow.org/tutorials/distribute/input) on distributed input for more examples and caveats." -2803,DistributedDatasetInterface,tensorflow/tensorflow/python/distribute/input_lib.py,258,class,"Represents a dataset distributed among devices and machines. +2517,get_next,tensorflow/tensorflow/python/distribute/input_lib.py,163,method,"Returns the next input from the iterator for all replicas. + +Example use: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> dataset = tf.data.Dataset.range(100).batch(2) +>>> dist_dataset = strategy.experimental_distribute_dataset(dataset) +>>> dist_dataset_iterator = iter(dist_dataset) +>>> @tf.function +... def one_step(input): +... return input +>>> step_num = 5 +>>> for _ in range(step_num): +... strategy.run(one_step, args=(dist_dataset_iterator.get_next(),)) +>>> strategy.experimental_local_results(dist_dataset_iterator.get_next()) +(, + ) + +Returns: + A single `tf.Tensor` or a `tf.distribute.DistributedValues` which contains + the next input for all replicas. + +Raises: + `tf.errors.OutOfRangeError`: If the end of the iterator has been reached." +2518,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,193,method,"The type specification of an element of `tf.distribute.DistributedIterator`. + +Example usage: + +>>> global_batch_size = 16 +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> dataset = tf.data.Dataset.from_tensors(([1.],[2])).repeat(100).batch(global_batch_size) +>>> distributed_iterator = iter(strategy.experimental_distribute_dataset(dataset)) +>>> distributed_iterator.element_spec +(PerReplicaSpec(TensorSpec(shape=(None, 1), dtype=tf.float32, name=None), + TensorSpec(shape=(None, 1), dtype=tf.float32, name=None)), + PerReplicaSpec(TensorSpec(shape=(None, 1), dtype=tf.int32, name=None), + TensorSpec(shape=(None, 1), dtype=tf.int32, name=None))) + +Returns: + A nested structure of `tf.TypeSpec` objects matching the structure of an + element of this `tf.distribute.DistributedIterator`. This returned value + is typically a `tf.distribute.DistributedValues` object and specifies the + `tf.TensorSpec` of individual components." +2519,get_next_as_optional,tensorflow/tensorflow/python/distribute/input_lib.py,218,method,"Returns a `tf.experimental.Optional` that contains the next value for all replicas. + +If the `tf.distribute.DistributedIterator` has reached the end of the +sequence, the returned `tf.experimental.Optional` will have no value. + +Example usage: + +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> global_batch_size = 2 +>>> steps_per_loop = 2 +>>> dataset = tf.data.Dataset.range(10).batch(global_batch_size) +>>> distributed_iterator = iter( +... strategy.experimental_distribute_dataset(dataset)) +>>> def step_fn(x): +... # train the model with inputs +... return x +>>> @tf.function +... def train_fn(distributed_iterator): +... for _ in tf.range(steps_per_loop): +... optional_data = distributed_iterator.get_next_as_optional() +... if not optional_data.has_value(): +... break +... per_replica_results = strategy.run(step_fn, args=(optional_data.get_value(),)) +... tf.print(strategy.experimental_local_results(per_replica_results)) +>>> train_fn(distributed_iterator) +... # ([0 1], [2 3]) +... # ([4], []) + +Returns: + An `tf.experimental.Optional` object representing the next value from the + `tf.distribute.DistributedIterator` (if it has one) or no value." +2520,DistributedDatasetInterface,tensorflow/tensorflow/python/distribute/input_lib.py,258,class,"Represents a dataset distributed among devices and machines. A `tf.distribute.DistributedDataset` could be thought of as a ""distributed"" dataset. When you use `tf.distribute` API to scale training to multiple @@ -14710,43 +18617,87 @@ you can: Visit the [tutorial](https://www.tensorflow.org/tutorials/distribute/input) on distributed input for more examples and caveats." -2804,InputWorkers,tensorflow/tensorflow/python/distribute/input_lib.py,462,class,A 1-to-many mapping from input worker devices to compute devices. -2805,_get_next_as_optional,tensorflow/tensorflow/python/distribute/input_lib.py,502,function,Returns an empty dataset indicator and the next input from the iterator. -2806,_is_statically_shaped,tensorflow/tensorflow/python/distribute/input_lib.py,543,function,"Test if an iterator output is statically shaped. +2521,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,432,method,"The type specification of an element of this `tf.distribute.DistributedDataset`. -For sparse and ragged tensors this only tests the batch dimension. +Example usage: -Args: - tensor_class: a class from an iterator.output_classes list. - shape: a TensorShape from an iterator.output_shapes list. +>>> global_batch_size = 16 +>>> strategy = tf.distribute.MirroredStrategy([""GPU:0"", ""GPU:1""]) +>>> dataset = tf.data.Dataset.from_tensors(([1.],[2])).repeat(100).batch(global_batch_size) +>>> dist_dataset = strategy.experimental_distribute_dataset(dataset) +>>> dist_dataset.element_spec +(PerReplicaSpec(TensorSpec(shape=(None, 1), dtype=tf.float32, name=None), + TensorSpec(shape=(None, 1), dtype=tf.float32, name=None)), + PerReplicaSpec(TensorSpec(shape=(None, 1), dtype=tf.int32, name=None), + TensorSpec(shape=(None, 1), dtype=tf.int32, name=None))) Returns: - True if the shape is static, false otherwise." -2807,_get_static_shape,tensorflow/tensorflow/python/distribute/input_lib.py,567,function,Returns a boolean indicating if the input is fully defined. -2808,DistributedIteratorBase,tensorflow/tensorflow/python/distribute/input_lib.py,583,class,Common implementation for all input iterators. -2809,DistributedIteratorV1,tensorflow/tensorflow/python/distribute/input_lib.py,699,class,Input Iterator for a distributed dataset. -2810,DistributedIteratorSpec,tensorflow/tensorflow/python/distribute/input_lib.py,754,class,Type specification for `DistributedIterator`. -2811,DistributedIterator,tensorflow/tensorflow/python/distribute/input_lib.py,849,class,Input Iterator for a distributed dataset. -2812,_IterableInput,tensorflow/tensorflow/python/distribute/input_lib.py,895,class,Base class for iterable inputs for distribution strategies. -2813,DistributedDataset,tensorflow/tensorflow/python/distribute/input_lib.py,935,class,Distributed dataset that supports prefetching to multiple devices. -2814,DistributedDatasetV1,tensorflow/tensorflow/python/distribute/input_lib.py,1043,class,Distributed dataset that supports prefetching to multiple devices. -2815,DistributedDatasetsFromFunction,tensorflow/tensorflow/python/distribute/input_lib.py,1121,class,Inputs created from dataset function. -2816,DistributedDatasetsFromFunctionV1,tensorflow/tensorflow/python/distribute/input_lib.py,1187,class,Inputs created from dataset function. -2817,InputFunctionIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1229,class,Iterator created from input function. -2818,DatasetIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1278,class,Iterator created from input dataset. -2819,_dummy_tensor_fn,tensorflow/tensorflow/python/distribute/input_lib.py,1319,function,A function to create dummy tensors from `value_structure`. -2820,_recover_shape_fn,tensorflow/tensorflow/python/distribute/input_lib.py,1365,function,Recover the shape of `data` the same as shape of `value_structure`. -2821,_SingleWorkerDatasetIteratorBase,tensorflow/tensorflow/python/distribute/input_lib.py,1393,class,Iterator for a single `tf.data.Dataset`. -2822,_SingleWorkerDatasetIteratorSpec,tensorflow/tensorflow/python/distribute/input_lib.py,1491,class,Type specification for `_SingleWorkerOwnedDatasetIterator`. -2823,_SingleWorkerOwnedDatasetIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1533,class,Iterator for a DistributedDataset instance. -2824,_SingleWorkerDatasetIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1632,class,Iterator for a single DistributedDatasetV1 instance. -2825,_SingleWorkerCallableIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1670,class,Iterator for a single tensor-returning callable. -2826,_create_iterators_per_worker,tensorflow/tensorflow/python/distribute/input_lib.py,1703,function,Create a multidevice iterator on each of the workers. -2827,_create_datasets_per_worker_with_input_context,tensorflow/tensorflow/python/distribute/input_lib.py,1723,function,Create device datasets per worker given a dataset function. -2828,_get_batched_dataset,tensorflow/tensorflow/python/distribute/input_lib.py,1736,function,Get the batched dataset from `d`. -2829,_get_batched_dataset_attributes,tensorflow/tensorflow/python/distribute/input_lib.py,1754,function,"Get `batch_size`, `drop_remainder` of dataset." -2830,_get_dataset_attributes,tensorflow/tensorflow/python/distribute/input_lib.py,1777,function,Get the underlying attributes from the dataset object. -2831,MultiStepContext,tensorflow/tensorflow/python/distribute/input_lib.py,1798,class,"A context object that can be used to capture things when running steps. + A nested structure of `tf.TypeSpec` objects matching the structure of an + element of this `tf.distribute.DistributedDataset`. This returned value is + typically a `tf.distribute.DistributedValues` object and specifies the + `tf.TensorSpec` of individual components." +2522,reduce,tensorflow/tensorflow/python/distribute/input_lib.py,457,method, +2523,InputWorkers,tensorflow/tensorflow/python/distribute/input_lib.py,462,class,A 1-to-many mapping from input worker devices to compute devices. +2524,num_workers,tensorflow/tensorflow/python/distribute/input_lib.py,478,method, +2525,worker_devices,tensorflow/tensorflow/python/distribute/input_lib.py,482,method, +2526,compute_devices_for_worker,tensorflow/tensorflow/python/distribute/input_lib.py,485,method, +2527,serialize,tensorflow/tensorflow/python/distribute/input_lib.py,495,method, +2528,deserialize,tensorflow/tensorflow/python/distribute/input_lib.py,498,method, +2529,DistributedIteratorBase,tensorflow/tensorflow/python/distribute/input_lib.py,583,class,Common implementation for all input iterators. +2530,next,tensorflow/tensorflow/python/distribute/input_lib.py,612,method, +2531,get_next_as_optional,tensorflow/tensorflow/python/distribute/input_lib.py,624,method, +2532,get_next,tensorflow/tensorflow/python/distribute/input_lib.py,649,method,Returns the next input from the iterator for all replicas. +2533,return_none,tensorflow/tensorflow/python/distribute/input_lib.py,627,method, +2534,return_value,tensorflow/tensorflow/python/distribute/input_lib.py,630,method,Wraps the inputs for replicas in an `tf.experimental.Optional`. +2535,out_of_range_fn,tensorflow/tensorflow/python/distribute/input_lib.py,666,method,This function will throw an OutOfRange error. +2536,DistributedIteratorV1,tensorflow/tensorflow/python/distribute/input_lib.py,699,class,Input Iterator for a distributed dataset. +2537,initialize,tensorflow/tensorflow/python/distribute/input_lib.py,713,method,"Initialize underlying iterators. + +Returns: + A list of any initializer ops that should be run." +2538,initializer,tensorflow/tensorflow/python/distribute/input_lib.py,722,method,Returns a list of ops that initialize the iterator. +2539,output_classes,tensorflow/tensorflow/python/distribute/input_lib.py,728,method, +2540,output_shapes,tensorflow/tensorflow/python/distribute/input_lib.py,733,method, +2541,output_types,tensorflow/tensorflow/python/distribute/input_lib.py,738,method, +2542,get_iterator,tensorflow/tensorflow/python/distribute/input_lib.py,742,method, +2543,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,749,method,The type specification of an element of this iterator. +2544,DistributedIteratorSpec,tensorflow/tensorflow/python/distribute/input_lib.py,754,class,Type specification for `DistributedIterator`. +2545,value_type,tensorflow/tensorflow/python/distribute/input_lib.py,772,method, +2546,most_specific_compatible_type,tensorflow/tensorflow/python/distribute/input_lib.py,786,method,"Returns the most specific TypeSpec compatible with `self` and `other`. + +Args: + other: A `TypeSpec`. + +Raises: + ValueError: If there is no TypeSpec that is compatible with both `self` + and `other`." +2547,from_value,tensorflow/tensorflow/python/distribute/input_lib.py,836,method, +2548,DistributedIterator,tensorflow/tensorflow/python/distribute/input_lib.py,849,class,Input Iterator for a distributed dataset. +2549,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,885,method, +2550,DistributedDataset,tensorflow/tensorflow/python/distribute/input_lib.py,935,class,Distributed dataset that supports prefetching to multiple devices. +2551,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,1038,method,The type specification of an element of this dataset. +2552,DistributedDatasetV1,tensorflow/tensorflow/python/distribute/input_lib.py,1043,class,Distributed dataset that supports prefetching to multiple devices. +2553,make_one_shot_iterator,tensorflow/tensorflow/python/distribute/input_lib.py,1060,method,"Get a one time use iterator for DistributedDatasetV1. + +Note: This API is deprecated. Please use `for ... in dataset:` to iterate +over the dataset or `iter` to create an iterator. + +Returns: + A DistributedIteratorV1 instance." +2554,make_initializable_iterator,tensorflow/tensorflow/python/distribute/input_lib.py,1081,method,"Get an initializable iterator for DistributedDatasetV1. + +Note: This API is deprecated. Please use +`tf.compat.v1.data.make_initializable_iterator(dataset)` to create an +initializable iterator. + +Returns: + A DistributedIteratorV1 instance." +2555,DistributedDatasetsFromFunction,tensorflow/tensorflow/python/distribute/input_lib.py,1121,class,Inputs created from dataset function. +2556,element_spec,tensorflow/tensorflow/python/distribute/input_lib.py,1182,method,The type specification of an element of this dataset. +2557,DistributedDatasetsFromFunctionV1,tensorflow/tensorflow/python/distribute/input_lib.py,1187,class,Inputs created from dataset function. +2558,InputFunctionIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1229,class,Iterator created from input function. +2559,DatasetIterator,tensorflow/tensorflow/python/distribute/input_lib.py,1278,class,Iterator created from input dataset. +2560,MultiStepContext,tensorflow/tensorflow/python/distribute/input_lib.py,1798,class,"A context object that can be used to capture things when running steps. This context object is useful when running multiple steps at a time using the `experimental_run_steps_on_iterator` API. For e.g. it allows the user's step @@ -14754,26 +18705,39 @@ function to specify which outputs to emit at what frequency. Currently it supports capturing output from the last step, as well as capturing non tensor outputs. In the future it will be augmented to support other use cases such as output each N steps." -2832,_create_distributed_tensor_spec,tensorflow/tensorflow/python/distribute/input_lib.py,1900,function,"Create a `tf.TypeSpec` for a given strategy and input `tensor_spec`. +2561,last_step_outputs,tensorflow/tensorflow/python/distribute/input_lib.py,1820,method,"A dictionary consisting of outputs to be captured on last step. -Args: - strategy: The given `tf.distribute` strategy. - tensor_spec: `tf.TensorSpec` of a given value. The batch dimension of the - shape should be None if you have partial batches. +Keys in the dictionary are names of tensors to be captured, as specified +when `set_last_step_output` is called. +Values in the dictionary are the tensors themselves. If +`set_last_step_output` was called with a `reduce_op` for this output, +then the value is the reduced value. Returns: - A `tf.TypeSpec` that matches the values produced by a given strategy. This - can be a `tf.TensorSpec` or a `PerRelicaSpec`." -2833,_replace_per_replica_spec,tensorflow/tensorflow/python/distribute/input_lib.py,1928,function,"If `spec` is a `PerReplicaSpec`, then return its `i`th value_spec." -2834,DistributedIteratorTestBase,tensorflow/tensorflow/python/distribute/input_lib_test.py,59,class, -2835,DistributedIteratorSingleWorkerTest,tensorflow/tensorflow/python/distribute/input_lib_test.py,278,class, -2836,DistributedIteratorTensorTypeTest,tensorflow/tensorflow/python/distribute/input_lib_test.py,691,class,Tests for DistributedDataset with non-dense tensors. -2837,DistributedIteratorMultiWorkerTest,tensorflow/tensorflow/python/distribute/input_lib_test.py,864,class, -2838,DistributedIteratorTest,tensorflow/tensorflow/python/distribute/input_lib_type_spec_test.py,44,class, -2839,InputTypeSpecTest,tensorflow/tensorflow/python/distribute/input_lib_type_spec_test.py,154,class, -2840,RaggedTensorDistributedIteratorTest,tensorflow/tensorflow/python/distribute/input_lib_type_spec_test.py,252,class, -2841,_check_type_spec_structure,tensorflow/tensorflow/python/distribute/input_lib_type_spec_test.py,430,function,Verifies that `x` has the same structure as its `TypeSpec`. -2842,auto_shard_dataset,tensorflow/tensorflow/python/distribute/input_ops.py,30,function,"Shard the input pipeline by sharding the underlying list of files. + A dictionary with last step outputs." +2562,set_last_step_output,tensorflow/tensorflow/python/distribute/input_lib.py,1840,method,"Set `output` with `name` to be outputted from the last step. + +Args: + name: String, name to identify the output. Doesn't need to match tensor + name. + output: The tensors that should be outputted with `name`. See below for + actual types supported. + reduce_op: Reduction method to use to reduce outputs from multiple + replicas. Required if `set_last_step_output` is called in a replica + context. Optional in cross_replica_context. + When present, the outputs from all the replicas are reduced using the + current distribution strategy's `reduce` method. Hence, the type of + `output` must be what's supported by the corresponding `reduce` method. + For e.g. if using MirroredStrategy and reduction is set, output + must be a `PerReplica` value. + The reduce method is also recorded in a dictionary + `_last_step_outputs_reduce_ops` for later interpreting of the + outputs as already reduced or not." +2563,non_tensor_outputs,tensorflow/tensorflow/python/distribute/input_lib.py,1882,method,A dictionary consisting of any non tensor outputs to be captured. +2564,set_non_tensor_output,tensorflow/tensorflow/python/distribute/input_lib.py,1886,method,Set `output` with `name` to be captured as a non tensor output. +2565,merge_fn,tensorflow/tensorflow/python/distribute/input_lib.py,1870,method, +2566,merge_fn,tensorflow/tensorflow/python/distribute/input_lib.py,1891,method, +2567,auto_shard_dataset,tensorflow/tensorflow/python/distribute/input_ops.py,30,function,"Shard the input pipeline by sharding the underlying list of files. Args: dataset: A `tf.data.Dataset` instance, typically the result of a bunch of @@ -14787,43 +18751,19 @@ Returns: A modified `Dataset` obtained by updating the pipeline sharded by the files. The input dataset will be returned if we cannot automatically determine a good way to shard the input dataset." -2843,_clone_dataset,tensorflow/tensorflow/python/distribute/input_ops.py,56,function,Returns a cloned version of `dataset`. -2844,_get_op_def,tensorflow/tensorflow/python/distribute/input_ops.py,64,function, -2845,_clone_helper,tensorflow/tensorflow/python/distribute/input_ops.py,68,function,"Helper method that recursively clones `op_to_clone`. - -Args: - op_to_clone: The op we want to clone. - variant_tensor_ops: A list of ops that we have to clone along the way. - -Returns: - A dictionary mapping old_ops to new_ops created. Includes op_to_clone - as a key." -2846,AutoShardDatasetTest,tensorflow/tensorflow/python/distribute/input_ops_test.py,37,class, -2847,_TestDataset,tensorflow/tensorflow/python/distribute/input_ops_test.py,261,class, -2848,CloneDatasetTest,tensorflow/tensorflow/python/distribute/input_ops_test.py,274,class, -2849,_labeled_dataset_fn,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,32,function, -2850,_boolean_dataset_fn,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,43,function, -2851,_threshold_dataset_fn,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,56,function, -2852,_regression_dataset_fn,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,69,function, -2853,all_combinations,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,75,function, -2854,tpu_combinations,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,86,function, -2855,MetricsV1Test,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,97,class, -2856,_replica_id_tensor,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,42,function, -2857,_in_run,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,49,function, -2858,_outside_run_graph,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,54,function, -2859,MirroredFunctionStrategy,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,61,class,"Mirrors vars to distribute across multiple devices and machines. +2568,all_combinations,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,75,function, +2569,tpu_combinations,tensorflow/tensorflow/python/distribute/metrics_v1_test.py,86,function, +2570,MirroredFunctionStrategy,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,61,class,"Mirrors vars to distribute across multiple devices and machines. This strategy uses one replica per device and sync replication for its multi-GPU version. Unlike `tf.distribute.MirroredStrategy`, it creates a function for a single replica, and calls that function repeatedly instead of recording the operations for each replica separately." -2860,MirroredFunctionExtended,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,82,class,Implementation of MirroredFunctionStrategy. -2861,FnMergedValue,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,146,class, -2862,_wrap_tensors,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,152,function, -2863,_unwrap_tensors,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,158,function, -2864,MirroredFunctionReplicaContext,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,164,class,ReplicaContext used in MirroredFunctionStrategy. -2865,MirroredFunctionStrategyTest,tensorflow/tensorflow/python/distribute/mirrored_function_strategy_test.py,32,class, -2866,call_for_each_replica,tensorflow/tensorflow/python/distribute/mirrored_run.py,45,function,"Call `fn` on each worker devices(replica). +2571,MirroredFunctionExtended,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,82,class,Implementation of MirroredFunctionStrategy. +2572,FnMergedValue,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,146,class, +2573,MirroredFunctionReplicaContext,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,164,class,ReplicaContext used in MirroredFunctionStrategy. +2574,devices,tensorflow/tensorflow/python/distribute/mirrored_function_strategy.py,198,method, +2575,call_for_each_replica,tensorflow/tensorflow/python/distribute/mirrored_run.py,45,function,"Call `fn` on each worker devices(replica). It's highly recommended to wrap the call to this function inside a `tf.function`, otherwise the performance is poor. @@ -14836,65 +18776,9 @@ Args: Returns: Wrapped returned value of `fn` from all replicas." -2867,_enter_graph,tensorflow/tensorflow/python/distribute/mirrored_run.py,104,function,Context manager for selecting a graph and maybe eager mode. -2868,_cpu_device,tensorflow/tensorflow/python/distribute/mirrored_run.py,118,function, -2869,_RequestedStop,tensorflow/tensorflow/python/distribute/mirrored_run.py,124,class, -2870,_call_for_each_replica,tensorflow/tensorflow/python/distribute/mirrored_run.py,128,function,"Run `fn` in separate threads, once per replica/worker device. - -Args: - distribution: the DistributionStrategy object. - fn: function to run (will be run once per replica, each in its own thread). - args: positional arguments for `fn` - kwargs: keyword arguments for `fn`. - -Returns: - Merged return value of `fn` across all replicas. - -Raises: - RuntimeError: If fn() calls get_replica_context().merge_call() a different - number of times from the available devices." -2871,_MirroredReplicaThread,tensorflow/tensorflow/python/distribute/mirrored_run.py,242,class,A thread that runs() a function on a device. -2872,_MirroredReplicaContext,tensorflow/tensorflow/python/distribute/mirrored_run.py,361,class,ReplicaContext for synchronized replica. -2873,_is_device_list_single_worker,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,49,function,"Checks whether the devices list is for single or multi-worker. - -Args: - devices: a list of device strings or tf.config.LogicalDevice objects, for - either local or for remote devices. - -Returns: - a boolean indicating whether these device strings are for local or for - remote. - -Raises: - ValueError: if device strings are not consistent." -2874,_cluster_spec_to_device_list,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,82,function,Returns a device list given a cluster spec. -2875,_group_device_list,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,98,function,"Groups the devices list by task_type and task_id. - -Args: - devices: a list of device strings for remote devices. - -Returns: - a dict of list of device strings mapping from task_type to a list of devices - for the task_type in the ascending order of task_id." -2876,_is_gpu_device,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,127,function, -2877,_infer_num_gpus_per_worker,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,131,function,"Infers the number of GPUs on each worker. - -Currently to make multi-worker cross device ops work, we need all workers to -have the same number of GPUs. - -Args: - devices: a list of device strings, can be either local devices or remote - devices. - -Returns: - number of GPUs per worker. - -Raises: - ValueError if workers have different number of GPUs or GPU indices are not - consecutive and starting from 0." -2878,all_local_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,171,function, -2879,all_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,178,function, -2880,MirroredStrategy,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,188,class,"Synchronous training across multiple replicas on one machine. +2576,all_local_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,171,function, +2577,all_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,178,function, +2578,MirroredStrategy,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,188,class,"Synchronous training across multiple replicas on one machine. This strategy is typically used for training on one machine with multiple GPUs. For TPUs, use @@ -14973,38 +18857,26 @@ Args: set, `NcclAllReduce()` will be used by default. One would customize this if NCCL isn't available or if a special implementation that exploits the particular hardware is available." -2881,MirroredStrategyV1,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,279,class, -2882,MirroredExtended,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,292,class,Implementation of MirroredStrategy. -2883,MirroredTwoDeviceDistributionTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,74,class, -2884,one_device_combinations,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,278,function, -2885,MirroredOneDeviceDistributionTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,288,class, -2886,MirroredStrategyVariableCreatorStackTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,327,class, -2887,MirroredStrategyCallForEachReplicaTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,371,class, -2888,MirroredStrategyNameScopeTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,505,class, -2889,MirroredThreeDeviceDistributionTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,649,class, -2890,MirroredVariableUpdateTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,671,class, -2891,MirroredAndSyncOnReadVariableInitializerTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,917,class, -2892,SyncOnReadVariableAssignTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,961,class, -2893,MockModel,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1015,class, -2894,MirroredStrategyDefunTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1036,class, -2895,MultiWorkerMirroredStrategyTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1157,class, -2896,RemoteSingleWorkerMirroredStrategyGraph,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1256,class, -2897,MultiWorkerMirroredStrategyTestWithChief,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1279,class, -2898,MirroredVariableStopGradientTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1346,class, -2899,FunctionTest,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1370,class, -2900,_replica_id,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1427,function, -2901,_replica_id_as_int,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1434,function, -2902,_replica_id,tensorflow/tensorflow/python/distribute/mirrored_variable_test.py,43,function, -2903,_mimic_two_cpus,tensorflow/tensorflow/python/distribute/mirrored_variable_test.py,50,function, -2904,MirroredVariableCreationTest,tensorflow/tensorflow/python/distribute/mirrored_variable_test.py,72,class,"Base class that tests mirrored variable creator. - -Currently it assumes all strategy objects have two replicas." -2905,AssignMovingAveragesTest,tensorflow/tensorflow/python/distribute/moving_averages_test.py,53,class, -2906,ExponentialMovingAverageTest,tensorflow/tensorflow/python/distribute/moving_averages_test.py,188,class, -2907,Process,tensorflow/tensorflow/python/distribute/multi_process_lib.py,35,class,A process simulating a worker for testing multi-worker training. -2908,test_main,tensorflow/tensorflow/python/distribute/multi_process_lib.py,44,function,Main function to be called within `__main__` of a test file. -2909,initialized,tensorflow/tensorflow/python/distribute/multi_process_lib.py,50,function,Returns whether the module is initialized. -2910,MultiProcessRunner,tensorflow/tensorflow/python/distribute/multi_process_runner.py,101,class,"A utility class to start multiple processes to simulate a cluster. +2579,MirroredStrategyV1,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,279,class, +2580,MirroredExtended,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,292,class,Implementation of MirroredStrategy. +2581,read_var,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,687,method,Read the aggregate value of a replica-local variable. +2582,value_container,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,699,method, +2583,worker_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,707,method, +2584,worker_devices_by_replica,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,711,method, +2585,parameter_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,715,method, +2586,experimental_between_graph,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,719,method, +2587,experimental_should_init,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,723,method, +2588,should_checkpoint,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,727,method, +2589,should_save_summary,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,731,method, +2590,non_slot_devices,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,734,method, +2591,body,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,537,method,A wrapper around `fn` to create the while loop body. +2592,initial_value_fn,tensorflow/tensorflow/python/distribute/mirrored_strategy.py,416,method, +2593,one_device_combinations,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,278,function, +2594,MockModel,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1015,class, +2595,RemoteSingleWorkerMirroredStrategyGraph,tensorflow/tensorflow/python/distribute/mirrored_strategy_test.py,1256,class, +2596,Process,tensorflow/tensorflow/python/distribute/multi_process_lib.py,35,class,A process simulating a worker for testing multi-worker training. +2597,initialized,tensorflow/tensorflow/python/distribute/multi_process_lib.py,50,function,Returns whether the module is initialized. +2598,MultiProcessRunner,tensorflow/tensorflow/python/distribute/multi_process_runner.py,101,class,"A utility class to start multiple processes to simulate a cluster. We need to use multiple processes to simulate a cluster in TF 2.0 tests because TF 2.0 has some process-global data structures that have to be @@ -15017,26 +18889,149 @@ via `test_main` defined in this file. Using this runner in non-test binaries is not supported yet. This class is not thread-safe. Child processes will inherit TF2 behavior flag." -2911,_Process,tensorflow/tensorflow/python/distribute/multi_process_runner.py,595,class,A modified `multiprocessing.Process` that can set up environment variables. -2912,_ProcFunc,tensorflow/tensorflow/python/distribute/multi_process_runner.py,617,class,Represents a callable to run in a subprocess. -2913,MultiProcessPoolRunner,tensorflow/tensorflow/python/distribute/multi_process_runner.py,730,class,"A utility class to start a process pool to simulate a cluster. +2599,set_args,tensorflow/tensorflow/python/distribute/multi_process_runner.py,221,method, +2600,start,tensorflow/tensorflow/python/distribute/multi_process_runner.py,294,method,"Starts processes, one for each task in `cluster_spec`. + +Note that this is best effort by the applicable multiprocessing library, +and it may take up to seconds for a subprocess to be successfully started." +2601,start_in_process_as,tensorflow/tensorflow/python/distribute/multi_process_runner.py,317,method,"Start the processes, with the specified task run in main process. + +This is similar to `start()` except that the task with task_type +`as_task_type` and task_id `as_task_id` is run in the main process. +This method is particularly useful when debugging tool such as `pdb` is +needed in some specific task. Note that since this method is blocking until +that specific task exits, additional actions would need a thread to be +called: + +```python +def proc_func(): + # user code to be run + import pdb; pdb.set_trace() + +def follow_ups(): + time.sleep(5) + mpr.start_single_process( + task_type='evaluator', + task_id=0) + +mpr = multi_process_runner.MultiProcessRunner( + proc_func, + multi_worker_test_base.create_cluster_spec( + has_chief=True, num_workers=1)) +threading.Thread(target=follow_ups).start() +mpr.start_in_process_as(as_task_type='chief', as_task_id=0) +mpr.join() +``` + +Note that if `list_stdout=True`, the logs/stdout by task +run by the main process is not available in result.stdout. + +Args: + as_task_type: The task type to be run in the main process. + as_task_id: The task id to be run in the main process." +2602,start_single_process,tensorflow/tensorflow/python/distribute/multi_process_runner.py,365,method,"Starts a single process. + +This starts a process in the cluster with the task type, task id, and the +process function (`proc_func`). If process function is `None`, the function +provided at `__init__` will be used. If `cluster_spec` is `None`, the +cluster spec provided at `__init__` will be used. + +TODO(rchao): It is meant that all subprocesses will be updated with the new +cluster spec, but this has yet to be implemented. At this time only the +newly started subprocess picks up this updated cluster spec. + +Args: + task_type: The task type. + task_id: The task id. + cluster_spec: The cluster spec to be used on the newly started + process. If `None`, the cluster spec provided at `__init__` will be + used. + proc_func: The process function to be run on the newly started + process. If specified, specify `args` and `kwargs` as well. If `None`, + the function provided at `__init__` will be used. + args: Optional positional arguments to be supplied in `proc_func`. + kwargs: Optional keyword arguments to be supplied in `proc_func`." +2603,get_process_id,tensorflow/tensorflow/python/distribute/multi_process_runner.py,414,method,Returns the subprocess id given the task type and task id. +2604,get_process_exit_code,tensorflow/tensorflow/python/distribute/multi_process_runner.py,419,method,"Returns the subprocess exit code given the task type and task id. + +Args: + task_type: The task type. + task_id: The task id. + +Returns: + The subprocess exit code; `None` if the subprocess has not exited yet. + +Raises: + KeyError: If the corresponding subprocess is not found with `task_type` + and `task_id`." +2605,join,tensorflow/tensorflow/python/distribute/multi_process_runner.py,450,method,"Joins all the processes with timeout. + +If any of the subprocesses does not exit approximately after `timeout` +seconds has passed after `join` call, this raises a +`SubprocessTimeoutError`. + +Note: At timeout, it uses SIGTERM to terminate the subprocesses, in order to +log the stack traces of the subprocesses when they exit. However, this +results in timeout when the test runs with tsan (thread sanitizer); if tsan +is being run on the test targets that rely on timeout to assert information, +`MultiProcessRunner.terminate_all()` must be called after `join()`, before +the test exits, so the subprocesses are terminated with SIGKILL, and data +race is removed. + +Args: + timeout: if set and not all processes report status within roughly + `timeout` seconds, a `SubprocessTimeoutError` exception will be raised. + +Returns: + A MultiProcessRunnerResult object, which has two attributes, + `return_value` and `stdout`. `return_value` always contains the return + values from the subprocesses. If `list_stdout` argument is True at + `__init__`, `stdout` is available that contains a list of all messages + from subprocesses' stdout and stderr. + +Raises: + SubprocessTimeoutError: if not all processes report status approximately + within `timeout` seconds. When this is raised, a + `MultiProcessRunnerResult` object can be retrieved by + `SubprocessTimeoutError`'s mpr_result attribute, which has the same + structure as above 'Returns' section describes. + UnexpectedSubprocessExitError: If any of the subprocesses did not exit + properly (for example, they exit on SIGTERM or SIGKILL signal). When + this is raised, a `MultiProcessRunnerResult` object can be retrieved by + `UnexpectedSubprocessExitError`'s mpr_result attribute, which has the + same structure as above 'Returns' section describes. If `max_run_time` + is not `None`, it is expected that some subprocesses may be + force-killed when `max_run_time` is up, and this is raised in those + cases. + Exception: if there is an Exception propagated from any subprocess." +2606,terminate,tensorflow/tensorflow/python/distribute/multi_process_runner.py,547,method,Terminates the process with `task_type` and `task_id`. +2607,terminate_all,tensorflow/tensorflow/python/distribute/multi_process_runner.py,556,method,Terminates all subprocesses. +2608,get_manager,tensorflow/tensorflow/python/distribute/multi_process_runner.py,571,method,"Returns the multiprocessing manager object for concurrency tools. + +The manager object is useful as it controls a server process that holds +the python objects that can be shared across processes. This can be used +for parent-subprocess communication: + +```python +mpr = multi_process_runner.MultiProcessRunner(...) +manager = mpr.get_manager() +some_event_happening_in_subprocess = manager.Event() +mpr.set_args(args=(some_event_happening_in_subprocess,)) +mpr.start() +some_event_happening_in_subprocess.wait() +# Do something that only should after some event happens in subprocess. +``` + +Note that the user of multi_process_runner should not create additional +`multiprocessing.Manager()` objects; doing so can result in segfault in +some cases." +2609,handler,tensorflow/tensorflow/python/distribute/multi_process_runner.py,310,method, +2610,MultiProcessPoolRunner,tensorflow/tensorflow/python/distribute/multi_process_runner.py,730,class,"A utility class to start a process pool to simulate a cluster. It's similar to MultiProcessRunner, but uses a pool of processes to avoid the expensive initialization cost of Tensorflow." -2914,_pool_runner_worker,tensorflow/tensorflow/python/distribute/multi_process_runner.py,845,function,"Function that runs on the workers in a pool. - -It listens for callables to run and returns the result until `conn` is closed. -It captures the exceptions during executing the callable and return it through -`conn`. - -Args: - initializer: A callable to execute during startup. - conn: A multiprocessing.Connection object to listen for tasks and send - results." -2915,_run_contained,tensorflow/tensorflow/python/distribute/multi_process_runner.py,872,function,"Runs `proc_func` with `args` and `kwargs`. - -The function returns _ProcessStatusInfo which captures the return value and -the exception. +2611,shutdown,tensorflow/tensorflow/python/distribute/multi_process_runner.py,760,method,Shuts down the worker pool. +2612,run,tensorflow/tensorflow/python/distribute/multi_process_runner.py,802,method,"Runs `proc_func` with `args` and `kwargs` on all jobs. Args: proc_func: The function to be run. @@ -15044,19 +19039,18 @@ Args: kwargs: Optional keyword arguments to be supplied in `proc_func`. Returns: - a _ProcessStatusInfo." -2916,SubprocessTimeoutError,tensorflow/tensorflow/python/distribute/multi_process_runner.py,908,class,"An error that indicates there is at least one subprocess timing out. + A list of return values." +2613,SubprocessTimeoutError,tensorflow/tensorflow/python/distribute/multi_process_runner.py,908,class,"An error that indicates there is at least one subprocess timing out. When this is raised, a `MultiProcessRunnerResult` object can be retrieved by `SubprocessTimeoutError`'s mpr_result attribute. See `MultiProcessRunner.join()` for more information." -2917,UnexpectedSubprocessExitError,tensorflow/tensorflow/python/distribute/multi_process_runner.py,921,class,"An error indicating there is at least one subprocess with unexpected exit. +2614,UnexpectedSubprocessExitError,tensorflow/tensorflow/python/distribute/multi_process_runner.py,921,class,"An error indicating there is at least one subprocess with unexpected exit. When this is raised, a `MultiProcessRunnerResult` object can be retrieved by `UnexpectedSubprocessExitError`'s mpr_result attribute. See `MultiProcessRunner.join()` for more information." -2918,_set_tf_config,tensorflow/tensorflow/python/distribute/multi_process_runner.py,934,function,Set TF_CONFIG environment variable. -2919,run,tensorflow/tensorflow/python/distribute/multi_process_runner.py,948,function,"Runs functions in local child processes. +2615,run,tensorflow/tensorflow/python/distribute/multi_process_runner.py,948,function,"Runs functions in local child processes. It is a convenience method that creates a `MultiProcessRunner` object and invokes `start` and `join` method. Please see these methods for detailed @@ -15064,38 +19058,28 @@ documentations. Returns: A MultiProcessRunnerResult object returned from `MultiProcessRunner.join()`." -2920,barrier,tensorflow/tensorflow/python/distribute/multi_process_runner.py,985,function, -2921,test_main,tensorflow/tensorflow/python/distribute/multi_process_runner.py,994,function,Main function to be called within `__main__` of a test file. -2922,MultiProcessRunnerNoInitTest,tensorflow/tensorflow/python/distribute/multi_process_runner_no_init_test.py,26,class, -2923,proc_func_that_adds_task_type_in_return_data,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,36,function, -2924,proc_func_that_errors,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,40,function, -2925,proc_func_that_does_nothing,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,44,function, -2926,proc_func_that_adds_simple_return_data,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,48,function, -2927,proc_func_that_returns_args_and_kwargs,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,52,function, -2928,proc_func_with_barrier,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,56,function, -2929,proc_func_that_returns_pid,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,60,function, -2930,proc_func_that_sets_global,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,67,function, -2931,MultiProcessRunnerTest,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,74,class, -2932,MultiProcessPoolRunnerTest,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,392,class, -2933,MultiWorkerContinuousRunTest,tensorflow/tensorflow/python/distribute/multi_worker_continuous_run_test.py,47,class, -2934,pick_unused_port,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,64,function,Returns an unused and unassigned local port. -2935,_create_cluster,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,83,function,Creates and starts local servers and returns the cluster_spec dict. -2936,create_in_process_cluster,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,148,function,Create an in-process cluster that consists of only standard server. -2937,create_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,205,function,Create a cluster spec with tasks with unused local ports. -2938,skip_if_grpc_server_cant_be_started,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,233,function, -2939,MultiWorkerTestBase,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,245,class,Base class for testing multi node strategy and dataset. -2940,SingleWorkerTestBaseGraph,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,367,class,Base class for testing remote single worker strategy graph and dataset. -2941,SingleWorkerTestBaseEager,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,375,class,Base class for testing remote single worker strategy eager and dataset. -2942,DummySession,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,387,class, -2943,MockOsEnv,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,396,class,A class that allows per-thread TF_CONFIG. -2944,IndependentWorkerTestBase,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,442,class,Testing infra for independent workers. -2945,MultiWorkerMultiProcessTest,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,548,class,Testing infra for independent workers using multiple processes. -2946,get_tf_config_task,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,638,function, -2947,get_tf_config_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,642,function, -2948,get_task_type,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,646,function, -2949,get_task_index,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,650,function, -2950,is_chief,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,654,function, -2951,normalize_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_util.py,26,function,"Makes `cluster_spec` into a `ClusterSpec` object. +2616,barrier,tensorflow/tensorflow/python/distribute/multi_process_runner.py,985,function, +2617,proc_func_that_adds_task_type_in_return_data,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,36,function, +2618,proc_func_that_errors,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,40,function, +2619,proc_func_that_does_nothing,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,44,function, +2620,proc_func_that_adds_simple_return_data,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,48,function, +2621,proc_func_that_returns_args_and_kwargs,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,52,function, +2622,proc_func_with_barrier,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,56,function, +2623,proc_func_that_returns_pid,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,60,function, +2624,proc_func_that_sets_global,tensorflow/tensorflow/python/distribute/multi_process_runner_test.py,67,function, +2625,pick_unused_port,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,64,function,Returns an unused and unassigned local port. +2626,create_in_process_cluster,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,148,function,Create an in-process cluster that consists of only standard server. +2627,create_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,205,function,Create a cluster spec with tasks with unused local ports. +2628,skip_if_grpc_server_cant_be_started,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,233,function, +2629,DummySession,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,387,class, +2630,MockOsEnv,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,396,class,A class that allows per-thread TF_CONFIG. +2631,get,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,404,method, +2632,get_tf_config_task,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,638,function, +2633,get_tf_config_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,642,function, +2634,get_task_type,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,646,function, +2635,get_task_index,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,650,function, +2636,is_chief,tensorflow/tensorflow/python/distribute/multi_worker_test_base.py,654,function, +2637,normalize_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_util.py,26,function,"Makes `cluster_spec` into a `ClusterSpec` object. Args: cluster_spec: a dict, ClusterDef or ClusterSpec object specifying the @@ -15107,27 +19091,7 @@ Returns: Raises: ValueError: if `cluster_spec` is not a dict or a `ClusterSpec` or a `ClusterDef`." -2952,_validate_cluster_spec,tensorflow/tensorflow/python/distribute/multi_worker_util.py,50,function,"Validates `cluster_spec`. - -It checks: -0) None of `cluster_spec`, `task_type`, and `task_id` is `None`. -1) task type is one of ""chief"", ""worker"" or ""evaluator"". -2) whether there is such a task type as `task_type` in the `cluster_spec`. The - only exception is `evaluator`. In other words, it is still a valid - configuration when `task_type` is `evaluator` but it doesn't appear in - `cluster_spec`. This is to be compatible with `TF_CONFIG` in Estimator. -3) whether there is at most one ""chief"" job. -4) whether there is at most one ""evaluator"" job. -5) whether the `task_id` is smaller than the number of tasks for that - particular `task_type`. - -Args: - cluster_spec: a dict, `ClusterDef` or `ClusterSpec` object to be validated. - task_type: string indicating the type of the task. - task_id: task_id: the id of the `task_type` in this cluster. -Throws: - ValueError: if `cluster_spec` fails any check." -2953,is_chief,tensorflow/tensorflow/python/distribute/multi_worker_util.py,97,function,"Returns whether the given task is chief in the cluster. +2638,is_chief,tensorflow/tensorflow/python/distribute/multi_worker_util.py,97,function,"Returns whether the given task is chief in the cluster. Since there is at most one evaluator and the evaluator itself should be independent of the training cluster, the evaluator job is also a chief job on @@ -15148,7 +19112,7 @@ Returns: Raises: ValueError: if `task_type` is not in the `cluster_spec` or `task_id` exceeds the maximum id of the `task_type`." -2954,collective_leader,tensorflow/tensorflow/python/distribute/multi_worker_util.py,137,function,"Return the job name for the leader of for collective ops. +2639,collective_leader,tensorflow/tensorflow/python/distribute/multi_worker_util.py,137,function,"Return the job name for the leader of for collective ops. Args: cluster_spec: a dict, `ClusterDef` or `ClusterSpec` object specifying the @@ -15159,8 +19123,8 @@ Args: Returns: a string indicating the leader job name or empty string if no need to set leader job." -2955,worker_count,tensorflow/tensorflow/python/distribute/multi_worker_util.py,171,function,Returns the number of workers in the cluster. -2956,id_in_cluster,tensorflow/tensorflow/python/distribute/multi_worker_util.py,192,function,"Returns a unique id for the task in the `task_type`'s cluster. +2640,worker_count,tensorflow/tensorflow/python/distribute/multi_worker_util.py,171,function,Returns the number of workers in the cluster. +2641,id_in_cluster,tensorflow/tensorflow/python/distribute/multi_worker_util.py,192,function,"Returns a unique id for the task in the `task_type`'s cluster. It returns an id ranging from [0, `worker_count(task_type, task_id)`). @@ -15177,7 +19141,7 @@ Returns: Throws: ValueError: if `task_type` is not ""chief"", ""worker"" or ""evaluator""." -2957,should_save_checkpoint,tensorflow/tensorflow/python/distribute/multi_worker_util.py,230,function,"Returns whether the current worker should save checkpoints. +2642,should_save_checkpoint,tensorflow/tensorflow/python/distribute/multi_worker_util.py,230,function,"Returns whether the current worker should save checkpoints. In multi-worker training, if saving checkpoint is requested by user, or needed for fault-tolerance, the cluster should save checkpoint but not necessarily @@ -15188,7 +19152,7 @@ can be other files to save such as summary. Returns: Whether this particular worker in the cluster should save checkpoints." -2958,should_load_checkpoint,tensorflow/tensorflow/python/distribute/multi_worker_util.py,246,function,"Returns whether the current worker should load checkpoints. +2643,should_load_checkpoint,tensorflow/tensorflow/python/distribute/multi_worker_util.py,246,function,"Returns whether the current worker should load checkpoints. In multi-worker training, if loading checkpoint is requested by user, or needed for fault-tolerance, the cluster should load checkpoint but not @@ -15196,19 +19160,12 @@ necessarily every worker in the cluster should. Returns: Whether this particular worker in the cluster should load checkpoints." -2959,wait_for_other_workers,tensorflow/tensorflow/python/distribute/multi_worker_util.py,259,function,Waits for other workers to reach the same call to this method. -2960,has_worker_context,tensorflow/tensorflow/python/distribute/multi_worker_util.py,264,function,Returns whether a worker context has been entered. -2961,NormalizeClusterSpecTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,27,class, -2962,IsChiefTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,81,class, -2963,NumWorkersTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,114,class, -2964,IdInClusterTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,152,class, -2965,CollectiveLeaderTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,203,class, -2966,ClusterSpecValidationTest,tensorflow/tensorflow/python/distribute/multi_worker_util_test.py,241,class, -2967,init_var_from_numpy,tensorflow/tensorflow/python/distribute/numpy_dataset.py,32,function,Initialize `input_var` to `numpy_input` using `session` in graph mode. -2968,one_host_numpy_dataset,tensorflow/tensorflow/python/distribute/numpy_dataset.py,76,function,Create a dataset on `colocate_with` from `numpy_input`. -2969,SingleDevice,tensorflow/tensorflow/python/distribute/numpy_dataset.py,94,class,Used with `colocate_with` to create a non-mirrored variable. -2970,InitVarFromNumpyTest,tensorflow/tensorflow/python/distribute/numpy_dataset_test.py,29,class, -2971,OneDeviceStrategy,tensorflow/tensorflow/python/distribute/one_device_strategy.py,41,class,"A distribution strategy for running on a single device. +2644,wait_for_other_workers,tensorflow/tensorflow/python/distribute/multi_worker_util.py,259,function,Waits for other workers to reach the same call to this method. +2645,has_worker_context,tensorflow/tensorflow/python/distribute/multi_worker_util.py,264,function,Returns whether a worker context has been entered. +2646,init_var_from_numpy,tensorflow/tensorflow/python/distribute/numpy_dataset.py,32,function,Initialize `input_var` to `numpy_input` using `session` in graph mode. +2647,one_host_numpy_dataset,tensorflow/tensorflow/python/distribute/numpy_dataset.py,76,function,Create a dataset on `colocate_with` from `numpy_input`. +2648,SingleDevice,tensorflow/tensorflow/python/distribute/numpy_dataset.py,94,class,Used with `colocate_with` to create a non-mirrored variable. +2649,OneDeviceStrategy,tensorflow/tensorflow/python/distribute/one_device_strategy.py,41,class,"A distribution strategy for running on a single device. Using this strategy will place any variables created in its scope on the specified device. Input distributed through this strategy will be @@ -15236,21 +19193,190 @@ for i in range(10): result += strategy.run(step_fn, args=(i,)) print(result) # 90 ```" -2972,OneDeviceStrategyV1,tensorflow/tensorflow/python/distribute/one_device_strategy.py,241,class, -2973,OneDeviceExtended,tensorflow/tensorflow/python/distribute/one_device_strategy.py,255,class,Implementation of OneDeviceStrategy. -2974,_OneDeviceReplicaContext,tensorflow/tensorflow/python/distribute/one_device_strategy.py,458,class,ReplicaContext for OneDeviceStrategy. -2975,OneDeviceStrategyTest,tensorflow/tensorflow/python/distribute/one_device_strategy_test.py,39,class, -2976,OneDeviceStrategyOnRemoteWorkerTest,tensorflow/tensorflow/python/distribute/one_device_strategy_test.py,168,class, -2977,PackedDistributedVariable,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,28,class,"A variable which packs multiple variables distributed across devices. +2650,experimental_distribute_dataset,tensorflow/tensorflow/python/distribute/one_device_strategy.py,84,method,"Distributes a tf.data.Dataset instance provided via dataset. + +In this case, there is only one device, so this is only a thin wrapper +around the input dataset. It will, however, prefetch the input data to the +specified device. The returned distributed dataset can be iterated over +similar to how regular datasets can. + +NOTE: Currently, the user cannot add any more transformations to a +distributed dataset. + +Example: +``` +strategy = tf.distribute.OneDeviceStrategy() +dataset = tf.data.Dataset.range(10).batch(2) +dist_dataset = strategy.experimental_distribute_dataset(dataset) +for x in dist_dataset: + print(x) # [0, 1], [2, 3],... +``` +Args: + dataset: `tf.data.Dataset` to be prefetched to device. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. +Returns: + A ""distributed `Dataset`"" that the caller can iterate over." +2651,experimental_distribute_datasets_from_function,tensorflow/tensorflow/python/distribute/one_device_strategy.py,113,method,"Distributes `tf.data.Dataset` instances created by calls to `dataset_fn`. + +`dataset_fn` will be called once for each worker in the strategy. In this +case, we only have one worker and one device so `dataset_fn` is called +once. + +The `dataset_fn` should take an `tf.distribute.InputContext` instance where +information about batching and input replication can be accessed: + +``` +def dataset_fn(input_context): + batch_size = input_context.get_per_replica_batch_size(global_batch_size) + d = tf.data.Dataset.from_tensors([[1.]]).repeat().batch(batch_size) + return d.shard( + input_context.num_input_pipelines, input_context.input_pipeline_id) + +inputs = strategy.experimental_distribute_datasets_from_function(dataset_fn) + +for batch in inputs: + replica_results = strategy.run(replica_fn, args=(batch,)) +``` + +IMPORTANT: The `tf.data.Dataset` returned by `dataset_fn` should have a +per-replica batch size, unlike `experimental_distribute_dataset`, which uses +the global batch size. This may be computed using +`input_context.get_per_replica_batch_size`. + +Args: + dataset_fn: A function taking a `tf.distribute.InputContext` instance and + returning a `tf.data.Dataset`. + options: `tf.distribute.InputOptions` used to control options on how this + dataset is distributed. + +Returns: + A ""distributed `Dataset`"", which the caller can iterate over like regular + datasets." +2652,experimental_local_results,tensorflow/tensorflow/python/distribute/one_device_strategy.py,156,method,"Returns the list of all local per-replica values contained in `value`. + +In `OneDeviceStrategy`, the `value` is always expected to be a single +value, so the result is just the value in a tuple. + +Args: + value: A value returned by `experimental_run()`, `run()`, + `extended.call_for_each_replica()`, or a variable created in `scope`. + +Returns: + A tuple of values contained in `value`. If `value` represents a single + value, this returns `(value,).`" +2653,run,tensorflow/tensorflow/python/distribute/one_device_strategy.py,172,method,"Run `fn` on each replica, with the given arguments. + +In `OneDeviceStrategy`, `fn` is simply called within a device scope for the +given device, with the provided arguments. + +Args: + fn: The function to run. The output must be a `tf.nest` of `Tensor`s. + args: (Optional) Positional arguments to `fn`. + kwargs: (Optional) Keyword arguments to `fn`. + options: (Optional) An instance of `tf.distribute.RunOptions` specifying + the options to run `fn`. + +Returns: + Return value from running `fn`." +2654,reduce,tensorflow/tensorflow/python/distribute/one_device_strategy.py,190,method,"Reduce `value` across replicas. + +In `OneDeviceStrategy`, there is only one replica, so if axis=None, value +is simply returned. If axis is specified as something other than None, +such as axis=0, value is reduced along that axis and returned. + +Example: +``` +t = tf.range(10) + +result = strategy.reduce(tf.distribute.ReduceOp.SUM, t, axis=None).numpy() +# result: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + +result = strategy.reduce(tf.distribute.ReduceOp.SUM, t, axis=0).numpy() +# result: 45 +``` + +Args: + reduce_op: A `tf.distribute.ReduceOp` value specifying how values should + be combined. + value: A ""per replica"" value, e.g. returned by `run` to + be combined into a single tensor. + axis: Specifies the dimension to reduce along within each + replica's tensor. Should typically be set to the batch dimension, or + `None` to only reduce across replicas (e.g. if the tensor has no batch + dimension). + +Returns: + A `Tensor`." +2655,scope,tensorflow/tensorflow/python/distribute/one_device_strategy.py,223,method,"Returns a context manager selecting this Strategy as current. + +Inside a `with strategy.scope():` code block, this thread +will use a variable creator set by `strategy`, and will +enter its ""cross-replica context"". + +In `OneDeviceStrategy`, all variables created inside `strategy.scope()` +will be on `device` specified at strategy construction time. +See example in the docs for this class. + +Returns: + A context manager to use for creating variables with this strategy." +2656,OneDeviceStrategyV1,tensorflow/tensorflow/python/distribute/one_device_strategy.py,241,class, +2657,OneDeviceExtended,tensorflow/tensorflow/python/distribute/one_device_strategy.py,255,class,Implementation of OneDeviceStrategy. +2658,read_var,tensorflow/tensorflow/python/distribute/one_device_strategy.py,401,method,Read the aggregate value of a replica-local variable. +2659,value_container,tensorflow/tensorflow/python/distribute/one_device_strategy.py,408,method, +2660,worker_devices,tensorflow/tensorflow/python/distribute/one_device_strategy.py,420,method, +2661,parameter_devices,tensorflow/tensorflow/python/distribute/one_device_strategy.py,424,method, +2662,non_slot_devices,tensorflow/tensorflow/python/distribute/one_device_strategy.py,427,method, +2663,experimental_should_init,tensorflow/tensorflow/python/distribute/one_device_strategy.py,432,method, +2664,experimental_between_graph,tensorflow/tensorflow/python/distribute/one_device_strategy.py,436,method, +2665,should_checkpoint,tensorflow/tensorflow/python/distribute/one_device_strategy.py,440,method, +2666,should_save_summary,tensorflow/tensorflow/python/distribute/one_device_strategy.py,444,method, +2667,body,tensorflow/tensorflow/python/distribute/one_device_strategy.py,342,method,A wrapper around `fn` to create the while loop body. +2668,PackedDistributedVariable,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,28,class,"A variable which packs multiple variables distributed across devices. It's only supported when eager execution is enabled. For op-by-op execution, use an unpacked handle on the current device; for function execution, use the packed handle to reduce the overhead of function calls." -2978,PackedVarAndDevice,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,247,class,Holds a packed distributed variable and a device. -2979,_tensor_conversion_packed_var_and_device,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,341,function, -2980,PackedDistributedVariableTest,tensorflow/tensorflow/python/distribute/packed_distributed_variable_test.py,31,class, -2981,ParameterServerStrategy,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,52,class,"An asynchronous multi-worker parameter server tf.distribute strategy. +2669,devices,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,84,method, +2670,on_device,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,87,method, +2671,get_var_on_device,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,90,method, +2672,get_var_on_current_device,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,96,method, +2673,initial_value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,100,method,Returns the Tensor used as the initial value for the variable. +2674,handle,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,105,method, +2675,packed_handle,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,112,method, +2676,value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,121,method, +2677,is_initialized,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,124,method, +2678,assign_sub,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,151,method, +2679,assign_add,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,160,method, +2680,assign,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,169,method, +2681,scatter_sub,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,178,method, +2682,scatter_add,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,186,method, +2683,scatter_mul,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,194,method, +2684,scatter_div,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,202,method, +2685,scatter_min,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,210,method, +2686,scatter_max,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,218,method, +2687,scatter_update,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,226,method, +2688,PackedVarAndDevice,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,247,class,Holds a packed distributed variable and a device. +2689,var,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,257,method, +2690,value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,260,method, +2691,read_value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,264,method, +2692,initial_value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,269,method, +2693,initialized_value,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,272,method, +2694,device,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,277,method, +2695,handle,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,281,method, +2696,op,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,286,method, +2697,assign_sub,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,290,method, +2698,assign_add,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,294,method, +2699,assign,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,298,method, +2700,scatter_sub,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,302,method, +2701,scatter_add,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,306,method, +2702,scatter_mul,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,310,method, +2703,scatter_div,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,314,method, +2704,scatter_min,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,318,method, +2705,scatter_max,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,322,method, +2706,scatter_update,tensorflow/tensorflow/python/distribute/packed_distributed_variable.py,326,method, +2707,ParameterServerStrategy,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,52,class,"An asynchronous multi-worker parameter server tf.distribute strategy. This strategy requires two roles: workers and parameter servers. Variables and updates to those variables will be assigned to parameter servers and other @@ -15300,24 +19426,52 @@ run_config = tf.estimator.RunConfig( estimator = tf.estimator.Estimator(config=run_config) tf.estimator.train_and_evaluate(estimator,...) ```" -2982,ParameterServerStrategyV1,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,154,class, -2983,ParameterServerStrategyExtended,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,172,class,Implementation of ParameterServerStrategy and CentralStorageStrategy. -2984,_get_replica_id_integer,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,66,function, -2985,create_test_objects,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,73,function, -2986,ParameterServerStrategyTestBase,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,102,class, -2987,ParameterServerStrategyTest,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,568,class, -2988,ParameterServerStrategyWithChiefTest,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,823,class, -2989,CentralStorageStrategyTest,tensorflow/tensorflow/python/distribute/parameter_server_strategy_test.py,891,class, -2990,AggregatingVariable,tensorflow/tensorflow/python/distribute/ps_values.py,35,class,A wrapper around a variable that aggregates updates across replicas. -2991,_tensor_conversion_aggregate,tensorflow/tensorflow/python/distribute/ps_values.py,307,function, -2992,AggregatingVariableTest,tensorflow/tensorflow/python/distribute/ps_values_test.py,38,class, -2993,ReduceOp,tensorflow/tensorflow/python/distribute/reduce_util.py,28,class,"Indicates how a set of values should be reduced. +2708,experimental_distribute_dataset,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,125,method, +2709,experimental_distribute_datasets_from_function,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,131,method, +2710,run,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,138,method, +2711,scope,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,143,method, +2712,ParameterServerStrategyV1,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,154,class, +2713,ParameterServerStrategyExtended,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,172,class,Implementation of ParameterServerStrategy and CentralStorageStrategy. +2714,value_container,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,586,method, +2715,read_var,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,594,method, +2716,worker_devices,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,663,method, +2717,worker_devices_by_replica,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,667,method, +2718,parameter_devices,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,671,method, +2719,non_slot_devices,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,674,method, +2720,experimental_between_graph,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,678,method, +2721,experimental_should_init,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,683,method, +2722,should_checkpoint,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,687,method, +2723,should_save_summary,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,691,method, +2724,var_creator,tensorflow/tensorflow/python/distribute/parameter_server_strategy.py,450,method,Create an AggregatingVariable and fix up collections. +2725,AggregatingVariable,tensorflow/tensorflow/python/distribute/ps_values.py,35,class,A wrapper around a variable that aggregates updates across replicas. +2726,get,tensorflow/tensorflow/python/distribute/ps_values.py,46,method, +2727,distribute_strategy,tensorflow/tensorflow/python/distribute/ps_values.py,50,method, +2728,assign_sub,tensorflow/tensorflow/python/distribute/ps_values.py,100,method, +2729,assign_add,tensorflow/tensorflow/python/distribute/ps_values.py,104,method, +2730,assign,tensorflow/tensorflow/python/distribute/ps_values.py,108,method, +2731,initializer,tensorflow/tensorflow/python/distribute/ps_values.py,113,method, +2732,initialized_value,tensorflow/tensorflow/python/distribute/ps_values.py,116,method, +2733,initial_value,tensorflow/tensorflow/python/distribute/ps_values.py,120,method, +2734,op,tensorflow/tensorflow/python/distribute/ps_values.py,124,method, +2735,read_value,tensorflow/tensorflow/python/distribute/ps_values.py,127,method, +2736,eval,tensorflow/tensorflow/python/distribute/ps_values.py,130,method, +2737,graph,tensorflow/tensorflow/python/distribute/ps_values.py,134,method, +2738,device,tensorflow/tensorflow/python/distribute/ps_values.py,138,method, +2739,shape,tensorflow/tensorflow/python/distribute/ps_values.py,142,method, +2740,aggregation,tensorflow/tensorflow/python/distribute/ps_values.py,146,method, +2741,synchronization,tensorflow/tensorflow/python/distribute/ps_values.py,150,method, +2742,name,tensorflow/tensorflow/python/distribute/ps_values.py,154,method, +2743,trainable,tensorflow/tensorflow/python/distribute/ps_values.py,158,method, +2744,dtype,tensorflow/tensorflow/python/distribute/ps_values.py,162,method, +2745,merge_fn,tensorflow/tensorflow/python/distribute/ps_values.py,80,method, +2746,ReduceOp,tensorflow/tensorflow/python/distribute/reduce_util.py,28,class,"Indicates how a set of values should be reduced. * `SUM`: Add all the values. * `MEAN`: Take the arithmetic mean (""average"") of the values." -2994,get_gpus,tensorflow/tensorflow/python/distribute/remote_mirrored_strategy_eager_test.py,29,function, -2995,RemoteSingleWorkerMirroredStrategyEager,tensorflow/tensorflow/python/distribute/remote_mirrored_strategy_eager_test.py,48,class, -2996,ShardedVariable,tensorflow/tensorflow/python/distribute/sharded_variable.py,30,class,"A container for `Variables` that should be treated as shards. +2747,from_variable_aggregation,tensorflow/tensorflow/python/distribute/reduce_util.py,41,method, +2748,get_gpus,tensorflow/tensorflow/python/distribute/remote_mirrored_strategy_eager_test.py,29,function, +2749,RemoteSingleWorkerMirroredStrategyEager,tensorflow/tensorflow/python/distribute/remote_mirrored_strategy_eager_test.py,48,class, +2750,ShardedVariable,tensorflow/tensorflow/python/distribute/sharded_variable.py,30,class,"A container for `Variables` that should be treated as shards. Variables that are too large to fit on a single device (e.g., large embeddings) @@ -15362,10 +19516,11 @@ Sharding is only supported along the first dimension. 2.0 >>> tf.saved_model.save(model, export_dir='/tmp/saved_model', ... signatures=model.serve_fn)" -2997,_load_and_run,tensorflow/tensorflow/python/distribute/sharded_variable_test.py,42,function,Load a SavedModel into a TF 1.x-style graph and run `signature_key`. -2998,ShardedVariableTest,tensorflow/tensorflow/python/distribute/sharded_variable_test.py,63,class, -2999,_canonicalize_variable_name,tensorflow/tensorflow/python/distribute/shared_variable_creator.py,27,function, -3000,make_fn,tensorflow/tensorflow/python/distribute/shared_variable_creator.py,38,function,"Construct the variable creator function for device `device_id`. +2751,variables,tensorflow/tensorflow/python/distribute/sharded_variable.py,144,method,The list of `Variable`s that make up the shards of this object. +2752,name,tensorflow/tensorflow/python/distribute/sharded_variable.py,151,method,The name of this object. Used for checkpointing. +2753,dtype,tensorflow/tensorflow/python/distribute/sharded_variable.py,156,method,The dtype of all `Variable`s in this object. +2754,shape,tensorflow/tensorflow/python/distribute/sharded_variable.py,161,method,"The overall shape, combining all shards along axis `0`." +2755,make_fn,tensorflow/tensorflow/python/distribute/shared_variable_creator.py,38,function,"Construct the variable creator function for device `device_id`. Constructs custom variable creator functions for the given device. On first device (device_id == 0), it creates the variable using the @@ -15387,18 +19542,19 @@ Args: Returns: An appropriate creator function based on device_id." -3001,CanonicalizeVariableNameTest,tensorflow/tensorflow/python/distribute/shared_variable_creator_test.py,27,class, -3002,SharedVariableCreatorTest,tensorflow/tensorflow/python/distribute/shared_variable_creator_test.py,47,class, -3003,single_loss_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,32,function,Build a very simple network to use in tests and examples. -3004,minimize_loss_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,54,function,Example of non-distribution-aware legacy code. -3005,batchnorm_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,82,function,Example of non-distribution-aware legacy code with batch normalization. -3006,Step,tensorflow/tensorflow/python/distribute/step_fn.py,25,class,Interface for performing each step of a training algorithm. -3007,StandardInputStep,tensorflow/tensorflow/python/distribute/step_fn.py,45,class,"Step with a standard implementation of input handling. +2756,single_loss_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,32,function,Build a very simple network to use in tests and examples. +2757,minimize_loss_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,54,function,Example of non-distribution-aware legacy code. +2758,batchnorm_example,tensorflow/tensorflow/python/distribute/single_loss_example.py,82,function,Example of non-distribution-aware legacy code with batch normalization. +2759,Step,tensorflow/tensorflow/python/distribute/step_fn.py,25,class,Interface for performing each step of a training algorithm. +2760,distribution,tensorflow/tensorflow/python/distribute/step_fn.py,32,method, +2761,initialize,tensorflow/tensorflow/python/distribute/step_fn.py,35,method, +2762,StandardInputStep,tensorflow/tensorflow/python/distribute/step_fn.py,45,class,"Step with a standard implementation of input handling. Args: dataset_fn: a function that returns a tf.data Dataset that produces the input for the model." -3008,StandardSingleLossStep,tensorflow/tensorflow/python/distribute/step_fn.py,61,class,"A step function that implements a training step for a feed forward network. +2763,initialize,tensorflow/tensorflow/python/distribute/step_fn.py,57,method, +2764,StandardSingleLossStep,tensorflow/tensorflow/python/distribute/step_fn.py,61,class,"A step function that implements a training step for a feed forward network. An instance of this class is intended to be used as a callable: @@ -15422,46 +19578,25 @@ Args: `loss_fn`, among other things. optimizer: an optimizer that implements an update rule. distribution: a `DistributionStrategy` object." -3009,_get_tpu_strategy_creator,tensorflow/tensorflow/python/distribute/strategy_combinations.py,47,function, -3010,_get_multi_worker_mirrored_creator,tensorflow/tensorflow/python/distribute/strategy_combinations.py,95,function, -3011,_shutdown_at_exit,tensorflow/tensorflow/python/distribute/strategy_combinations.py,234,function, -3012,set_virtual_cpus_to_at_least,tensorflow/tensorflow/python/distribute/strategy_combinations.py,253,function,Create virtual CPU devices if they haven't yet been created. -3013,strategy_minus_tpu_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,332,function, -3014,tpu_strategy_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,337,function, -3015,all_strategy_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,341,function, -3016,all_strategy_minus_default_and_tpu_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,345,function, -3017,all_strategy_combinations_minus_default,tensorflow/tensorflow/python/distribute/strategy_combinations.py,354,function, -3018,VirtualDevicesTest,tensorflow/tensorflow/python/distribute/strategy_combinations_test.py,34,class, -3019,StrategyCombinationsTest,tensorflow/tensorflow/python/distribute/strategy_combinations_test.py,69,class, -3020,StrategyReduceTest,tensorflow/tensorflow/python/distribute/strategy_common_test.py,39,class, -3021,DistributedCollectiveAllReduceStrategyTest,tensorflow/tensorflow/python/distribute/strategy_common_test.py,80,class, -3022,StrategyClusterResolverTest,tensorflow/tensorflow/python/distribute/strategy_common_test.py,195,class, -3023,StrategyReduceTest,tensorflow/tensorflow/python/distribute/strategy_reduce_test.py,31,class, -3024,_TestException,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,58,class, -3025,_maybe_run_in_function,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,64,function, -3026,_raise_exception_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,73,function, -3027,_merge_raises_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,79,function, -3028,_call_raises_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,86,function, -3029,_merge_call_raises_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,93,function, -3030,_call_merge_raises_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,100,function, -3031,_merge_call_merge_raises_fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,108,function, -3032,_events_from_logdir,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,112,function,Reads summary events from log directory. -3033,create_variable_like_keras_layer,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,126,function,Utitlity for create variables that works like variable in keras layer. -3034,is_optimizer_v2_instance,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,134,function, -3035,DistributionTestBase,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,141,class,Some tests that should work with any DistributionStrategy. -3036,OneDeviceDistributionTestBase,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,484,class,Some tests that should work with any one-device DistributionStrategy. -3037,TwoDeviceDistributionTestBase,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,605,class,Some tests that should work with any two-device DistributionStrategy. -3038,RemoteSingleWorkerMirroredStrategyBase,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,721,class,Tests for a Remote single worker. -3039,_all_sum,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,796,function, -3040,_all_mean,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,801,function, -3041,skip_summary,tensorflow/tensorflow/python/distribute/summary_op_util.py,27,function,"Determines if summary should be skipped. +2765,step_fn,tensorflow/tensorflow/python/distribute/step_fn.py,97,method,Function to run one iteration with one input. +2766,set_virtual_cpus_to_at_least,tensorflow/tensorflow/python/distribute/strategy_combinations.py,253,function,Create virtual CPU devices if they haven't yet been created. +2767,strategy_minus_tpu_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,332,function, +2768,tpu_strategy_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,337,function, +2769,all_strategy_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,341,function, +2770,all_strategy_minus_default_and_tpu_combinations,tensorflow/tensorflow/python/distribute/strategy_combinations.py,345,function, +2771,all_strategy_combinations_minus_default,tensorflow/tensorflow/python/distribute/strategy_combinations.py,354,function, +2772,create_variable_like_keras_layer,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,126,function,Utitlity for create variables that works like variable in keras layer. +2773,is_optimizer_v2_instance,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,134,function, +2774,RemoteSingleWorkerMirroredStrategyBase,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,721,class,Tests for a Remote single worker. +2775,fn,tensorflow/tensorflow/python/distribute/strategy_test_lib.py,770,method, +2776,skip_summary,tensorflow/tensorflow/python/distribute/summary_op_util.py,27,function,"Determines if summary should be skipped. If using multiple replicas in distributed strategy, skip summaries on all replicas except the first one (replica_id=0). Returns: True if the summary is skipped; False otherwise." -3042,gather,tensorflow/tensorflow/python/distribute/test_util.py,33,function,"Gathers value from all workers. +2777,gather,tensorflow/tensorflow/python/distribute/test_util.py,33,function,"Gathers value from all workers. This is intended for tests before we implement an official all-gather API. @@ -15473,12 +19608,9 @@ Args: Returns: a (n+1)-dim `tf.Tensor`." -3043,_gather,tensorflow/tensorflow/python/distribute/test_util.py,50,function,Gathers a single value. -3044,GatherTest,tensorflow/tensorflow/python/distribute/test_util_test.py,40,class, -3045,TFFunctionTest,tensorflow/tensorflow/python/distribute/tf_function_test.py,39,class, -3046,maybe_init_scope,tensorflow/tensorflow/python/distribute/tpu_strategy.py,71,function, -3047,validate_run_function,tensorflow/tensorflow/python/distribute/tpu_strategy.py,79,function,Validate the function passed into strategy.run. -3048,TPUStrategyV2,tensorflow/tensorflow/python/distribute/tpu_strategy.py,105,class,"Synchronous training on TPUs and TPU Pods. +2778,maybe_init_scope,tensorflow/tensorflow/python/distribute/tpu_strategy.py,71,function, +2779,validate_run_function,tensorflow/tensorflow/python/distribute/tpu_strategy.py,79,function,Validate the function passed into strategy.run. +2780,TPUStrategyV2,tensorflow/tensorflow/python/distribute/tpu_strategy.py,105,class,"Synchronous training on TPUs and TPU Pods. To construct a TPUStrategy object, you need to run the initialization code as below: @@ -15569,7 +19701,53 @@ Then you can run a `tf.add` operation only on logical device 0. ... dataset_fn) >>> iterator = iter(dist_dataset) >>> strategy.run(step_fn, args=(next(iterator),))" -3049,TPUStrategy,tensorflow/tensorflow/python/distribute/tpu_strategy.py,284,class,"Synchronous training on TPUs and TPU Pods. +2781,run,tensorflow/tensorflow/python/distribute/tpu_strategy.py,225,method,"Run the computation defined by `fn` on each TPU replica. + +Executes ops specified by `fn` on each replica. If `args` or `kwargs` have +`tf.distribute.DistributedValues`, such as those produced by a +`tf.distribute.DistributedDataset` from +`tf.distribute.Strategy.experimental_distribute_dataset` or +`tf.distribute.Strategy.experimental_distribute_datasets_from_function`, +when `fn` is executed on a particular replica, it will be executed with the +component of `tf.distribute.DistributedValues` that correspond to that +replica. + +`fn` may call `tf.distribute.get_replica_context()` to access members such +as `all_reduce`. + +All arguments in `args` or `kwargs` should either be nest of tensors or +`tf.distribute.DistributedValues` containing tensors or composite tensors. + +Example usage: + +>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +>>> tf.config.experimental_connect_to_cluster(resolver) +>>> tf.tpu.experimental.initialize_tpu_system(resolver) +>>> strategy = tf.distribute.TPUStrategy(resolver) +>>> @tf.function +... def run(): +... def value_fn(value_context): +... return value_context.num_replicas_in_sync +... distributed_values = ( +... strategy.experimental_distribute_values_from_function(value_fn)) +... def replica_fn(input): +... return input * 2 +... return strategy.run(replica_fn, args=(distributed_values,)) +>>> result = run() + +Args: + fn: The function to run. The output must be a `tf.nest` of `Tensor`s. + args: (Optional) Positional arguments to `fn`. + kwargs: (Optional) Keyword arguments to `fn`. + options: (Optional) An instance of `tf.distribute.RunOptions` specifying + the options to run `fn`. + +Returns: + Merged return value of `fn` across replicas. The structure of the return + value is the same as the return value from `fn`. Each element in the + structure can either be `tf.distribute.DistributedValues`, `Tensor` + objects, or `Tensor`s (for example, if running on a single replica)." +2782,TPUStrategy,tensorflow/tensorflow/python/distribute/tpu_strategy.py,284,class,"Synchronous training on TPUs and TPU Pods. To construct a TPUStrategy object, you need to run the initialization code as below: @@ -15590,29 +19768,112 @@ TPUStrategy doesn't support pure eager execution, so please make sure the function passed into `strategy.run` is a `tf.function` or `strategy.run` is called inside a `tf.function` if eager behavior is enabled." -3050,TPUStrategyV1,tensorflow/tensorflow/python/distribute/tpu_strategy.py,362,class,TPU distribution strategy implementation. -3051,TPUExtended,tensorflow/tensorflow/python/distribute/tpu_strategy.py,462,class,Implementation of TPUStrategy. -3052,_TPUReplicaContext,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1200,class,Replication Context class for TPU Strategy. -3053,_set_last_step_outputs,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1228,function,Sets the last step outputs on the given context. -3054,get_tpu_cluster_resolver,tensorflow/tensorflow/python/distribute/tpu_strategy_compilation_test.py,36,function, -3055,get_tpu_strategy,tensorflow/tensorflow/python/distribute/tpu_strategy_compilation_test.py,45,function, -3056,TPUStrategyCompilationTest,tensorflow/tensorflow/python/distribute/tpu_strategy_compilation_test.py,55,class, -3057,get_tpu_cluster_resolver,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,70,function, -3058,get_tpu_strategy,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,79,function, -3059,TPUTest,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,89,class, -3060,TPUStrategyTest,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,146,class, -3061,TPUStrategyDataPrefetchTest,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,652,class, -3062,TPUStrategyDistributionTest,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,752,class, -3063,DeviceAssignmentTest,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,972,class, -3064,_maybe_enter_graph,tensorflow/tensorflow/python/distribute/tpu_values.py,39,function, -3065,_maybe_on_device,tensorflow/tensorflow/python/distribute/tpu_values.py,51,function, -3066,_make_raw_assign_fn,tensorflow/tensorflow/python/distribute/tpu_values.py,60,function, -3067,TPUVariableMixin,tensorflow/tensorflow/python/distribute/tpu_values.py,77,class,Mixin for TPU variables. -3068,enclosing_tpu_context,tensorflow/tensorflow/python/distribute/tpu_values.py,183,function,"Returns the TPUReplicateContext, which exists inside a tpu.rewrite()." -3069,TPUMirroredVariable,tensorflow/tensorflow/python/distribute/tpu_values.py,200,class,Holds a map from replica to TPU variables whose values are kept in sync. -3070,TPUSyncOnReadVariable,tensorflow/tensorflow/python/distribute/tpu_values.py,287,class,Holds a map from replica to variables whose values are reduced on save. -3071,_on_write_update_replica,tensorflow/tensorflow/python/distribute/values.py,45,function,Updates variables with ON_WRITE synchronization in replica context. -3072,DistributedValues,tensorflow/tensorflow/python/distribute/values.py,76,class,"Base class for representing distributed values. +2783,run,tensorflow/tensorflow/python/distribute/tpu_strategy.py,338,method,See base class. +2784,cluster_resolver,tensorflow/tensorflow/python/distribute/tpu_strategy.py,349,method,"Returns the cluster resolver associated with this strategy. + +`tf.distribute.experimental.TPUStrategy` provides the +associated `tf.distribute.cluster_resolver.ClusterResolver`. If the user +provides one in `__init__`, that instance is returned; if the user does +not, a default +`tf.distribute.cluster_resolver.TPUClusterResolver` is provided." +2785,TPUStrategyV1,tensorflow/tensorflow/python/distribute/tpu_strategy.py,362,class,TPU distribution strategy implementation. +2786,steps_per_run,tensorflow/tensorflow/python/distribute/tpu_strategy.py,396,method,DEPRECATED: use .extended.steps_per_run instead. +2787,run,tensorflow/tensorflow/python/distribute/tpu_strategy.py,403,method,"Run `fn` on each replica, with the given arguments. + +Executes ops specified by `fn` on each replica. If `args` or `kwargs` have +""per-replica"" values, such as those produced by a ""distributed `Dataset`"", +when `fn` is executed on a particular replica, it will be executed with the +component of those ""per-replica"" values that correspond to that replica. + +`fn` may call `tf.distribute.get_replica_context()` to access members such +as `all_reduce`. + +All arguments in `args` or `kwargs` should either be nest of tensors or +per-replica objects containing tensors or composite tensors. + +Users can pass strategy specific options to `options` argument. An example +to enable bucketizing dynamic shapes in `TPUStrategy.run` +is: + +>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +>>> tf.config.experimental_connect_to_cluster(resolver) +>>> tf.tpu.experimental.initialize_tpu_system(resolver) +>>> strategy = tf.distribute.experimental.TPUStrategy(resolver) + +>>> options = tf.distribute.RunOptions( +... experimental_bucketizing_dynamic_shape=True) + +>>> dataset = tf.data.Dataset.range( +... strategy.num_replicas_in_sync, output_type=dtypes.float32).batch( +... strategy.num_replicas_in_sync, drop_remainder=True) +>>> input_iterator = iter(strategy.experimental_distribute_dataset(dataset)) + +>>> @tf.function() +... def step_fn(inputs): +... output = tf.reduce_sum(inputs) +... return output + +>>> strategy.run(step_fn, args=(next(input_iterator),), options=options) + +Args: + fn: The function to run. The output must be a `tf.nest` of `Tensor`s. + args: (Optional) Positional arguments to `fn`. + kwargs: (Optional) Keyword arguments to `fn`. + options: (Optional) An instance of `tf.distribute.RunOptions` specifying + the options to run `fn`. + +Returns: + Merged return value of `fn` across replicas. The structure of the return + value is the same as the return value from `fn`. Each element in the + structure can either be ""per-replica"" `Tensor` objects or `Tensor`s + (for example, if running on a single replica)." +2788,TPUExtended,tensorflow/tensorflow/python/distribute/tpu_strategy.py,462,class,Implementation of TPUStrategy. +2789,experimental_logical_device,tensorflow/tensorflow/python/distribute/tpu_strategy.py,750,method,Places variables and ops on the specified logical device. +2790,read_var,tensorflow/tensorflow/python/distribute/tpu_strategy.py,969,method, +2791,value_container,tensorflow/tensorflow/python/distribute/tpu_strategy.py,979,method, +2792,num_hosts,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1005,method, +2793,num_replicas_per_host,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1013,method, +2794,experimental_between_graph,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1033,method, +2795,experimental_should_init,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1037,method, +2796,should_checkpoint,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1041,method, +2797,should_save_summary,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1045,method, +2798,worker_devices,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1049,method, +2799,parameter_devices,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1053,method, +2800,non_slot_devices,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1056,method, +2801,tpu_run,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1097,method, +2802,run_fn,tensorflow/tensorflow/python/distribute/tpu_strategy.py,658,method,Single step on the TPU device. +2803,rewrite_fn,tensorflow/tensorflow/python/distribute/tpu_strategy.py,677,method,The rewritten step fn running on TPU. +2804,tpu_function,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1107,method,TF Function used to replicate the user computation. +2805,async_wait,tensorflow/tensorflow/python/distribute/tpu_strategy.py,542,method, +2806,replicated_fn,tensorflow/tensorflow/python/distribute/tpu_strategy.py,1125,method,Wraps user function to provide replica ID and `Tensor` inputs. +2807,get_tpu_cluster_resolver,tensorflow/tensorflow/python/distribute/tpu_strategy_compilation_test.py,36,function, +2808,get_tpu_strategy,tensorflow/tensorflow/python/distribute/tpu_strategy_compilation_test.py,45,function, +2809,get_tpu_cluster_resolver,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,70,function, +2810,get_tpu_strategy,tensorflow/tensorflow/python/distribute/tpu_strategy_test.py,79,function, +2811,TPUVariableMixin,tensorflow/tensorflow/python/distribute/tpu_values.py,77,class,Mixin for TPU variables. +2812,get,tensorflow/tensorflow/python/distribute/tpu_values.py,97,method, +2813,handle,tensorflow/tensorflow/python/distribute/tpu_values.py,112,method,The handle by which this variable can be accessed. +2814,device,tensorflow/tensorflow/python/distribute/tpu_values.py,129,method, +2815,read_value,tensorflow/tensorflow/python/distribute/tpu_values.py,145,method, +2816,value,tensorflow/tensorflow/python/distribute/tpu_values.py,151,method, +2817,op,tensorflow/tensorflow/python/distribute/tpu_values.py,164,method, +2818,enclosing_tpu_context,tensorflow/tensorflow/python/distribute/tpu_values.py,183,function,"Returns the TPUReplicateContext, which exists inside a tpu.rewrite()." +2819,TPUMirroredVariable,tensorflow/tensorflow/python/distribute/tpu_values.py,200,class,Holds a map from replica to TPU variables whose values are kept in sync. +2820,assign_sub,tensorflow/tensorflow/python/distribute/tpu_values.py,203,method, +2821,assign_add,tensorflow/tensorflow/python/distribute/tpu_values.py,223,method, +2822,assign,tensorflow/tensorflow/python/distribute/tpu_values.py,243,method, +2823,scatter_sub,tensorflow/tensorflow/python/distribute/tpu_values.py,262,method, +2824,scatter_add,tensorflow/tensorflow/python/distribute/tpu_values.py,265,method, +2825,scatter_max,tensorflow/tensorflow/python/distribute/tpu_values.py,268,method, +2826,scatter_min,tensorflow/tensorflow/python/distribute/tpu_values.py,271,method, +2827,scatter_mul,tensorflow/tensorflow/python/distribute/tpu_values.py,274,method, +2828,scatter_div,tensorflow/tensorflow/python/distribute/tpu_values.py,277,method, +2829,scatter_update,tensorflow/tensorflow/python/distribute/tpu_values.py,280,method, +2830,TPUSyncOnReadVariable,tensorflow/tensorflow/python/distribute/tpu_values.py,287,class,Holds a map from replica to variables whose values are reduced on save. +2831,assign_sub,tensorflow/tensorflow/python/distribute/tpu_values.py,290,method, +2832,assign_add,tensorflow/tensorflow/python/distribute/tpu_values.py,298,method, +2833,assign,tensorflow/tensorflow/python/distribute/tpu_values.py,306,method, +2834,DistributedValues,tensorflow/tensorflow/python/distribute/values.py,76,class,"Base class for representing distributed values. A subclass instance of `tf.distribute.DistributedValues` is created when creating variables within a distribution strategy, iterating a @@ -15675,41 +19936,117 @@ Example usage: >>> per_replica_values (, )" -3073,DistributedDelegate,tensorflow/tensorflow/python/distribute/values.py,202,class,A map from device to values; acts as the same type as the values. -3074,PerReplica,tensorflow/tensorflow/python/distribute/values.py,361,class,Holds a map from replica to unsynchronized values. -3075,PerReplicaSpec,tensorflow/tensorflow/python/distribute/values.py,375,class,Type specification for a `PerReplica`. -3076,Mirrored,tensorflow/tensorflow/python/distribute/values.py,407,class,Holds a map from replica to values which are kept in sync. -3077,DistributedVarOp,tensorflow/tensorflow/python/distribute/values.py,421,class,A class that looks like `tf.Operation`. -3078,DistributedVariable,tensorflow/tensorflow/python/distribute/values.py,440,class,Holds a map from replica to variables. -3079,_DistributedVariableSaveable,tensorflow/tensorflow/python/distribute/values.py,874,class,Class for defining how to restore a DistributedVariable. -3080,_MirroredSaveable,tensorflow/tensorflow/python/distribute/values.py,893,class,Class for defining how to restore a MirroredVariable. -3081,MirroredVariable,tensorflow/tensorflow/python/distribute/values.py,915,class,Holds a map from replica to variables whose values are kept in sync. -3082,_SyncOnReadSaveable,tensorflow/tensorflow/python/distribute/values.py,980,class,Class for defining how to restore a SyncOnReadVariable. -3083,SyncOnReadVariable,tensorflow/tensorflow/python/distribute/values.py,1016,class,Holds a map from replica to variables whose values are reduced on save. -3084,_tensor_conversion_distributed_var,tensorflow/tensorflow/python/distribute/values.py,1131,function, -3085,_tensor_conversion_mirrored,tensorflow/tensorflow/python/distribute/values.py,1141,function, -3086,_tensor_conversion_mirrored_val,tensorflow/tensorflow/python/distribute/values.py,1150,function, -3087,_tensor_conversion_sync_on_read,tensorflow/tensorflow/python/distribute/values.py,1160,function, -3088,VariablePolicy,tensorflow/tensorflow/python/distribute/values.py,1168,class,"Policy defining synchronization and aggregation of a distributed variable. +2835,DistributedDelegate,tensorflow/tensorflow/python/distribute/values.py,202,class,A map from device to values; acts as the same type as the values. +2836,values,tensorflow/tensorflow/python/distribute/values.py,232,method,Returns the per replica values. +2837,PerReplica,tensorflow/tensorflow/python/distribute/values.py,361,class,Holds a map from replica to unsynchronized values. +2838,values,tensorflow/tensorflow/python/distribute/values.py,370,method,Returns the per replica values. +2839,PerReplicaSpec,tensorflow/tensorflow/python/distribute/values.py,375,class,Type specification for a `PerReplica`. +2840,Mirrored,tensorflow/tensorflow/python/distribute/values.py,407,class,Holds a map from replica to values which are kept in sync. +2841,DistributedVarOp,tensorflow/tensorflow/python/distribute/values.py,421,class,A class that looks like `tf.Operation`. +2842,DistributedVariable,tensorflow/tensorflow/python/distribute/values.py,440,class,Holds a map from replica to variables. +2843,is_initialized,tensorflow/tensorflow/python/distribute/values.py,480,method,"Identifies if all the component variables are initialized. + +Args: + name: Name of the final `logical_and` op. + +Returns: + The op that evaluates to True or False depending on if all the + component variables are initialized." +2844,initializer,tensorflow/tensorflow/python/distribute/values.py,504,method, +2845,initialized_value,tensorflow/tensorflow/python/distribute/values.py,514,method, +2846,initial_value,tensorflow/tensorflow/python/distribute/values.py,518,method, +2847,constraint,tensorflow/tensorflow/python/distribute/values.py,522,method, +2848,graph,tensorflow/tensorflow/python/distribute/values.py,526,method, +2849,name,tensorflow/tensorflow/python/distribute/values.py,543,method, +2850,dtype,tensorflow/tensorflow/python/distribute/values.py,547,method, +2851,shape,tensorflow/tensorflow/python/distribute/values.py,551,method, +2852,synchronization,tensorflow/tensorflow/python/distribute/values.py,555,method, +2853,aggregation,tensorflow/tensorflow/python/distribute/values.py,559,method, +2854,handle,tensorflow/tensorflow/python/distribute/values.py,569,method, +2855,eval,tensorflow/tensorflow/python/distribute/values.py,579,method, +2856,device,tensorflow/tensorflow/python/distribute/values.py,594,method, +2857,trainable,tensorflow/tensorflow/python/distribute/values.py,598,method, +2858,distribute_strategy,tensorflow/tensorflow/python/distribute/values.py,602,method, +2859,get_shape,tensorflow/tensorflow/python/distribute/values.py,605,method, +2860,to_proto,tensorflow/tensorflow/python/distribute/values.py,608,method, +2861,op,tensorflow/tensorflow/python/distribute/values.py,612,method, +2862,read_value,tensorflow/tensorflow/python/distribute/values.py,652,method, +2863,value,tensorflow/tensorflow/python/distribute/values.py,656,method, +2864,numpy,tensorflow/tensorflow/python/distribute/values.py,661,method, +2865,assign_sub,tensorflow/tensorflow/python/distribute/values.py,668,method, +2866,assign_add,tensorflow/tensorflow/python/distribute/values.py,679,method, +2867,assign,tensorflow/tensorflow/python/distribute/values.py,690,method, +2868,scatter_sub,tensorflow/tensorflow/python/distribute/values.py,701,method, +2869,scatter_add,tensorflow/tensorflow/python/distribute/values.py,708,method, +2870,scatter_mul,tensorflow/tensorflow/python/distribute/values.py,715,method, +2871,scatter_div,tensorflow/tensorflow/python/distribute/values.py,722,method, +2872,scatter_min,tensorflow/tensorflow/python/distribute/values.py,729,method, +2873,scatter_max,tensorflow/tensorflow/python/distribute/values.py,736,method, +2874,scatter_update,tensorflow/tensorflow/python/distribute/values.py,743,method, +2875,MirroredVariable,tensorflow/tensorflow/python/distribute/values.py,915,class,Holds a map from replica to variables whose values are kept in sync. +2876,scatter_min,tensorflow/tensorflow/python/distribute/values.py,921,method, +2877,scatter_max,tensorflow/tensorflow/python/distribute/values.py,928,method, +2878,scatter_update,tensorflow/tensorflow/python/distribute/values.py,935,method, +2879,SyncOnReadVariable,tensorflow/tensorflow/python/distribute/values.py,1016,class,Holds a map from replica to variables whose values are reduced on save. +2880,assign_sub,tensorflow/tensorflow/python/distribute/values.py,1024,method, +2881,assign_add,tensorflow/tensorflow/python/distribute/values.py,1033,method, +2882,assign,tensorflow/tensorflow/python/distribute/values.py,1042,method, +2883,scatter_sub,tensorflow/tensorflow/python/distribute/values.py,1056,method, +2884,scatter_add,tensorflow/tensorflow/python/distribute/values.py,1059,method, +2885,scatter_mul,tensorflow/tensorflow/python/distribute/values.py,1062,method, +2886,scatter_div,tensorflow/tensorflow/python/distribute/values.py,1065,method, +2887,scatter_min,tensorflow/tensorflow/python/distribute/values.py,1068,method, +2888,scatter_max,tensorflow/tensorflow/python/distribute/values.py,1071,method, +2889,scatter_update,tensorflow/tensorflow/python/distribute/values.py,1074,method, +2890,value,tensorflow/tensorflow/python/distribute/values.py,1077,method, +2891,VariablePolicy,tensorflow/tensorflow/python/distribute/values.py,1168,class,"Policy defining synchronization and aggregation of a distributed variable. Given `synchronization` and `aggregation` parameters set on a `tf.Variable` during variable creation within `tf.distribute` scope, `tf.distribute` creates an appropriate policy object and assigns it to the distributed variable. All variable operations are delegated to the respective policy object." -3089,OnReadPolicy,tensorflow/tensorflow/python/distribute/values.py,1201,class,"Policy defined for `tf.VariableSynchronization.ON_READ` synchronization. +2892,value,tensorflow/tensorflow/python/distribute/values.py,1180,method, +2893,OnReadPolicy,tensorflow/tensorflow/python/distribute/values.py,1201,class,"Policy defined for `tf.VariableSynchronization.ON_READ` synchronization. This policy is created when `synchronization` is set to `tf.VariableSynchronization.ON_READ` and `aggregation` is set to any of the values allowed by the `tf.VariableAggregation` enum such as `NONE`, `SUM`, `MEAN` or `ONLY_FIRST_REPLICA`when creating a `tf.Variable` in `tf.distribute` scope." -3090,AutoPolicy,tensorflow/tensorflow/python/distribute/values.py,1340,class,"Policy defined for `tf.VariableSynchronization.AUTO` synchronization. +2894,value,tensorflow/tensorflow/python/distribute/values.py,1214,method, +2895,assign_sub,tensorflow/tensorflow/python/distribute/values.py,1245,method,Subtracts a value from this variable. +2896,assign_add,tensorflow/tensorflow/python/distribute/values.py,1257,method,Adds a value to this variable. +2897,assign,tensorflow/tensorflow/python/distribute/values.py,1269,method, +2898,scatter_sub,tensorflow/tensorflow/python/distribute/values.py,1280,method, +2899,scatter_add,tensorflow/tensorflow/python/distribute/values.py,1284,method, +2900,scatter_mul,tensorflow/tensorflow/python/distribute/values.py,1288,method, +2901,scatter_div,tensorflow/tensorflow/python/distribute/values.py,1292,method, +2902,scatter_min,tensorflow/tensorflow/python/distribute/values.py,1296,method, +2903,scatter_max,tensorflow/tensorflow/python/distribute/values.py,1300,method, +2904,scatter_update,tensorflow/tensorflow/python/distribute/values.py,1304,method, +2905,get_saveable,tensorflow/tensorflow/python/distribute/values.py,1308,method,Create a saveable object for the given variable. +2906,get_restore_ops,tensorflow/tensorflow/python/distribute/values.py,1326,method,Restore the same value into all variables. +2907,tensor,tensorflow/tensorflow/python/distribute/values.py,1313,method, +2908,AutoPolicy,tensorflow/tensorflow/python/distribute/values.py,1340,class,"Policy defined for `tf.VariableSynchronization.AUTO` synchronization. This policy is created when `synchronization` is set to `tf.VariableSynchronization.AUTO` and `aggregation` is set to `tf.VariableAggregation.NONE` when creating a `tf.Variable` in `tf.distribute` scope." -3091,OnWritePolicy,tensorflow/tensorflow/python/distribute/values.py,1432,class,"Policy defined for `tf.VariableSynchronization.ON_WRITE` synchronization. +2909,value,tensorflow/tensorflow/python/distribute/values.py,1352,method, +2910,assign,tensorflow/tensorflow/python/distribute/values.py,1366,method, +2911,assign_add,tensorflow/tensorflow/python/distribute/values.py,1370,method, +2912,assign_sub,tensorflow/tensorflow/python/distribute/values.py,1375,method, +2913,scatter_sub,tensorflow/tensorflow/python/distribute/values.py,1380,method, +2914,scatter_add,tensorflow/tensorflow/python/distribute/values.py,1384,method, +2915,scatter_mul,tensorflow/tensorflow/python/distribute/values.py,1388,method, +2916,scatter_div,tensorflow/tensorflow/python/distribute/values.py,1392,method, +2917,scatter_min,tensorflow/tensorflow/python/distribute/values.py,1396,method, +2918,scatter_max,tensorflow/tensorflow/python/distribute/values.py,1404,method, +2919,scatter_update,tensorflow/tensorflow/python/distribute/values.py,1412,method, +2920,get_saveable,tensorflow/tensorflow/python/distribute/values.py,1421,method, +2921,get_restore_ops,tensorflow/tensorflow/python/distribute/values.py,1425,method, +2922,OnWritePolicy,tensorflow/tensorflow/python/distribute/values.py,1432,class,"Policy defined for `tf.VariableSynchronization.ON_WRITE` synchronization. This policy is created when the following `synchronization` and `aggregation` parameters are specified when creating a `tf.Variable` in @@ -15720,52 +20057,31 @@ values such as `SUM`, `MEAN` or `ONLY_FIRST_REPLICA`. * `synchronization` is equal to `tf.VariableSynchronization.ON_WRITE` and aggregation can be any of the following `tf.VariableAggregation` enum values such as `NONE`, `SUM`, `MEAN` or `ONLY_FIRST_REPLICA`." -3092,_is_mirrored,tensorflow/tensorflow/python/distribute/values.py,1453,function, -3093,_is_sync_on_read,tensorflow/tensorflow/python/distribute/values.py,1460,function, -3094,_in_update_replica,tensorflow/tensorflow/python/distribute/values.py,1467,function, -3095,DistributedValuesTest,tensorflow/tensorflow/python/distribute/values_test.py,67,class, -3096,DistributedDelegateTest,tensorflow/tensorflow/python/distribute/values_test.py,293,class, -3097,_device_str,tensorflow/tensorflow/python/distribute/values_test.py,366,function, -3098,_nested_value,tensorflow/tensorflow/python/distribute/values_test.py,370,function, -3099,_make_mirrored_val,tensorflow/tensorflow/python/distribute/values_test.py,374,function, -3100,_make_mirrored,tensorflow/tensorflow/python/distribute/values_test.py,383,function, -3101,mirrored_and_tpu_strategy_combinations,tensorflow/tensorflow/python/distribute/values_test.py,395,function, -3102,DistributedVariableTest,tensorflow/tensorflow/python/distribute/values_test.py,424,class, -3103,PackedDistributedVariableTest,tensorflow/tensorflow/python/distribute/values_test.py,594,class, -3104,MirroredVariableTest,tensorflow/tensorflow/python/distribute/values_test.py,633,class, -3105,_make_replica_local,tensorflow/tensorflow/python/distribute/values_test.py,1304,function, -3106,SyncOnReadVariablePropertiesTest,tensorflow/tensorflow/python/distribute/values_test.py,1324,class, -3107,strategy_and_run_tf_function_combinations,tensorflow/tensorflow/python/distribute/values_test.py,1358,function, -3108,SyncOnReadVariableTest,tensorflow/tensorflow/python/distribute/values_test.py,1375,class, -3109,SyncOnReadScatterReplicaTest,tensorflow/tensorflow/python/distribute/values_test.py,1907,class, -3110,MirroredTest,tensorflow/tensorflow/python/distribute/values_test.py,2036,class, -3111,PerReplicaTest,tensorflow/tensorflow/python/distribute/values_test.py,2053,class, -3112,_make_index_slices,tensorflow/tensorflow/python/distribute/values_test.py,2166,function, -3113,on_write_assign,tensorflow/tensorflow/python/distribute/values_util.py,31,function, -3114,on_write_assign_add,tensorflow/tensorflow/python/distribute/values_util.py,41,function, -3115,on_write_assign_sub,tensorflow/tensorflow/python/distribute/values_util.py,52,function, -3116,assign_on_each_device,tensorflow/tensorflow/python/distribute/values_util.py,63,function,Update the variable on each replica with the given assign_func and value. -3117,on_read_assign_sub_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,78,function, -3118,on_read_assign_add_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,90,function, -3119,on_read_assign_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,102,function,Return the value of the variable in cross replica context. -3120,scatter_sub,tensorflow/tensorflow/python/distribute/values_util.py,118,function, -3121,scatter_add,tensorflow/tensorflow/python/distribute/values_util.py,127,function, -3122,scatter_mul,tensorflow/tensorflow/python/distribute/values_util.py,136,function, -3123,scatter_div,tensorflow/tensorflow/python/distribute/values_util.py,145,function, -3124,scatter_min,tensorflow/tensorflow/python/distribute/values_util.py,154,function, -3125,scatter_max,tensorflow/tensorflow/python/distribute/values_util.py,163,function, -3126,scatter_update,tensorflow/tensorflow/python/distribute/values_util.py,172,function, -3127,get_current_replica_id_as_int,tensorflow/tensorflow/python/distribute/values_util.py,181,function,"Returns the current replica ID as an integer, or `None`." -3128,assign_on_device,tensorflow/tensorflow/python/distribute/values_util.py,193,function, -3129,assign_add_on_device,tensorflow/tensorflow/python/distribute/values_util.py,198,function, -3130,assign_sub_on_device,tensorflow/tensorflow/python/distribute/values_util.py,203,function, -3131,assert_replica_context,tensorflow/tensorflow/python/distribute/values_util.py,208,function, -3132,apply_aggregation,tensorflow/tensorflow/python/distribute/values_util.py,218,function, -3133,WarmStartingUtilWithDistributionStrategyTest,tensorflow/tensorflow/python/distribute/warm_starting_util_test.py,42,class, -3134,NormalizationTest,tensorflow/tensorflow/python/distribute/zero_batch_test.py,39,class, -3135,format_master_url,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,35,function, -3136,get_accelerator_devices,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,42,function,Returns accelerator devices given a master and a configuration. -3137,ClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,61,class,"Abstract class for all implementations of ClusterResolvers. +2923,mirrored_and_tpu_strategy_combinations,tensorflow/tensorflow/python/distribute/values_test.py,395,function, +2924,strategy_and_run_tf_function_combinations,tensorflow/tensorflow/python/distribute/values_test.py,1358,function, +2925,on_write_assign,tensorflow/tensorflow/python/distribute/values_util.py,31,function, +2926,on_write_assign_add,tensorflow/tensorflow/python/distribute/values_util.py,41,function, +2927,on_write_assign_sub,tensorflow/tensorflow/python/distribute/values_util.py,52,function, +2928,assign_on_each_device,tensorflow/tensorflow/python/distribute/values_util.py,63,function,Update the variable on each replica with the given assign_func and value. +2929,on_read_assign_sub_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,78,function, +2930,on_read_assign_add_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,90,function, +2931,on_read_assign_cross_replica,tensorflow/tensorflow/python/distribute/values_util.py,102,function,Return the value of the variable in cross replica context. +2932,scatter_sub,tensorflow/tensorflow/python/distribute/values_util.py,118,function, +2933,scatter_add,tensorflow/tensorflow/python/distribute/values_util.py,127,function, +2934,scatter_mul,tensorflow/tensorflow/python/distribute/values_util.py,136,function, +2935,scatter_div,tensorflow/tensorflow/python/distribute/values_util.py,145,function, +2936,scatter_min,tensorflow/tensorflow/python/distribute/values_util.py,154,function, +2937,scatter_max,tensorflow/tensorflow/python/distribute/values_util.py,163,function, +2938,scatter_update,tensorflow/tensorflow/python/distribute/values_util.py,172,function, +2939,get_current_replica_id_as_int,tensorflow/tensorflow/python/distribute/values_util.py,181,function,"Returns the current replica ID as an integer, or `None`." +2940,assign_on_device,tensorflow/tensorflow/python/distribute/values_util.py,193,function, +2941,assign_add_on_device,tensorflow/tensorflow/python/distribute/values_util.py,198,function, +2942,assign_sub_on_device,tensorflow/tensorflow/python/distribute/values_util.py,203,function, +2943,assert_replica_context,tensorflow/tensorflow/python/distribute/values_util.py,208,function, +2944,apply_aggregation,tensorflow/tensorflow/python/distribute/values_util.py,218,function, +2945,format_master_url,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,35,function, +2946,get_accelerator_devices,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,42,function,Returns accelerator devices given a master and a configuration. +2947,ClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,61,class,"Abstract class for all implementations of ClusterResolvers. This defines the skeleton for all implementations of ClusterResolvers. ClusterResolvers are a way for TensorFlow to communicate with various cluster @@ -15799,7 +20115,148 @@ branches according to task type and task id. - task_id is the ordinal index of the server within the task type. - rpc_layer is the protocol used by TensorFlow to communicate with other TensorFlow servers in a distributed environment." -3138,SimpleClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,293,class,"Simple implementation of ClusterResolver that accepts all attributes. +2948,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,99,method,"Retrieve the current state of the cluster and return a `tf.train.ClusterSpec`. + +Returns: + A `tf.train.ClusterSpec` representing the state of the cluster at the + moment this function is called. + +Implementors of this function must take care in ensuring that the +ClusterSpec returned is up-to-date at the time of calling this function. +This usually means retrieving the information from the underlying cluster +management system every time this function is invoked and reconstructing +a cluster_spec, rather than attempting to cache anything." +2949,master,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,115,method,"Retrieves the name or URL of the session master. + +Note: this is only useful for TensorFlow 1.x. + +Args: + task_type: (Optional) The type of the TensorFlow task of the master. + task_id: (Optional) The index of the TensorFlow task of the master. + rpc_layer: (Optional) The RPC protocol for the given cluster. + +Returns: + The name or URL of the session master. + +Implementors of this function must take care in ensuring that the master +returned is up-to-date at the time to calling this function. This usually +means retrieving the master every time this function is invoked." +2950,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,134,method,"Returns the number of accelerator cores per worker. + +This returns the number of accelerator cores (such as GPUs and TPUs) +available per worker. + +Optionally, we allow callers to specify the task_type, and task_id, for +if they want to target a specific TensorFlow task to query +the number of accelerators. This is to support heterogenous environments, +where the number of accelerators cores per host is different. + +Args: + task_type: (Optional) The type of the TensorFlow task of the machine we + want to query. + task_id: (Optional) The index of the TensorFlow task of the machine we + want to query. + config_proto: (Optional) Configuration for starting a new session to + query how many accelerator cores it has. + +Returns: + A map of accelerator types to number of cores." +2951,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,174,method,"Returns the current environment which TensorFlow is running in. + +There are two possible return values, ""google"" (when TensorFlow is running +in a Google-internal environment) or an empty string (when TensorFlow is +running elsewhere). + +If you are implementing a ClusterResolver that works in both the Google +environment and the open-source world (for instance, a TPU ClusterResolver +or similar), you will have to return the appropriate string depending on the +environment, which you will have to detect. + +Otherwise, if you are implementing a ClusterResolver that will only work +in open-source TensorFlow, you do not need to implement this property." +2952,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,192,method,"Returns the task type this `ClusterResolver` indicates. + +In TensorFlow distributed environment, each job may have an applicable +task type. Valid task types in TensorFlow include +'chief': a worker that is designated with more responsibility, +'worker': a regular worker for training/evaluation, +'ps': a parameter server, or +'evaluator': an evaluator that evaluates the checkpoints for metrics. + +See [Multi-worker configuration]( +https://www.tensorflow.org/tutorials/distribute/multi_worker_with_keras#multi-worker_configuration) +for more information about 'chief' and 'worker' task type, which are most +commonly used. + +Having access to such information is useful when user needs to run specific +code according to task types. For example, + +```python +cluster_spec = tf.train.ClusterSpec({ + ""ps"": [""localhost:2222"", ""localhost:2223""], + ""worker"": [""localhost:2224"", ""localhost:2225"", ""localhost:2226""] +}) + +# SimpleClusterResolver is used here for illustration; other cluster +# resolvers may be used for other source of task type/id. +simple_resolver = SimpleClusterResolver(cluster_spec, task_type=""worker"", + task_id=1) + +... + +if cluster_resolver.task_type == 'worker': + # Perform something that's only applicable on workers. This block + # will run on this particular instance since we've specified this task to + # be a worker in above cluster resolver. +elif cluster_resolver.task_type == 'ps': + # Perform something that's only applicable on parameter servers. This + # block will not run on this particular instance. +``` + +Returns `None` if such information is not available or is not applicable +in the current distributed environment, such as training with +`tf.distribute.experimental.TPUStrategy`. + +For more information, please see +`tf.distribute.cluster_resolver.ClusterResolver`'s class doc." +2953,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,242,method,"Returns the task id this `ClusterResolver` indicates. + +In TensorFlow distributed environment, each job may have an applicable +task id, which is the index of the instance within its task type. This is +useful when user needs to run specific code according to task index. For +example, + +```python +cluster_spec = tf.train.ClusterSpec({ + ""ps"": [""localhost:2222"", ""localhost:2223""], + ""worker"": [""localhost:2224"", ""localhost:2225"", ""localhost:2226""] +}) + +# SimpleClusterResolver is used here for illustration; other cluster +# resolvers may be used for other source of task type/id. +simple_resolver = SimpleClusterResolver(cluster_spec, task_type=""worker"", + task_id=0) + +... + +if cluster_resolver.task_type == 'worker' and cluster_resolver.task_id == 0: + # Perform something that's only applicable on 'worker' type, id 0. This + # block will run on this particular instance since we've specified this + # task to be a 'worker', id 0 in above cluster resolver. +else: + # Perform something that's only applicable on other ids. This block will + # not run on this particular instance. +``` + +Returns `None` if such information is not available or is not applicable +in the current distributed environment, such as training with +`tf.distribute.cluster_resolver.TPUClusterResolver`. + +For more information, please see +`tf.distribute.cluster_resolver.ClusterResolver`'s class docstring." +2954,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,282,method,Setter of `task_type` property. See `task_type` property doc. +2955,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,287,method,Setter of `task_id` property. See `task_type` property doc. +2956,SimpleClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,293,class,"Simple implementation of ClusterResolver that accepts all attributes. Please see the base class for documentation of arguments of its constructor. @@ -15827,7 +20284,39 @@ Usage example with `tf.distribute.Strategy`: strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy( cluster_resolver=cluster_resolver) ```" -3139,UnionClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,423,class,"Performs a union on underlying ClusterResolvers. +2957,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,345,method,Returns the ClusterSpec passed into the constructor. +2958,master,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,349,method,"Returns the master address to use when creating a session. + +Note: this is only useful for TensorFlow 1.x. + +Args: + task_type: (Optional) The type of the TensorFlow task of the master. + task_id: (Optional) The index of the TensorFlow task of the master. + rpc_layer: (Optional) The RPC used by distributed TensorFlow. + +Returns: + The name or URL of the session master. + +If a task_type and task_id is given, this will override the `master` +string passed into the initialization function." +2959,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,373,method, +2960,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,377,method, +2961,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,381,method, +2962,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,385,method, +2963,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,389,method, +2964,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,392,method,"Returns the number of accelerator cores per worker. + +The SimpleClusterResolver does not do automatic detection of accelerators, +and thus all arguments are unused and we simply return the value provided +in the constructor. + +Args: + task_type: Unused. + task_id: Unused. + config_proto: Unused." +2965,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,414,method, +2966,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,418,method, +2967,UnionClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,423,class,"Performs a union on underlying ClusterResolvers. This class performs a union given two or more existing ClusterResolvers. It merges the underlying ClusterResolvers, and returns one unified ClusterSpec @@ -15867,10 +20356,54 @@ instance: num_accelerators={""GPU"": 1}) cluster_resolver = UnionResolver(gpu_override, tf_config) ```" -3140,MockBaseClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,34,class, -3141,BaseClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,47,class, -3142,UnionClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,123,class, -3143,GCEClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,35,class,"ClusterResolver for Google Compute Engine. +2968,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,499,method,"Returns a union of all the ClusterSpecs from the ClusterResolvers. + +Returns: + A ClusterSpec containing host information merged from all the underlying + ClusterResolvers. + +Raises: + KeyError: If there are conflicting keys detected when merging two or + more dictionaries, this exception is raised. + +Note: If there are multiple ClusterResolvers exposing ClusterSpecs with the +same job name, we will merge the list/dict of workers. + +If *all* underlying ClusterSpecs expose the set of workers as lists, we will +concatenate the lists of workers, starting with the list of workers from +the first ClusterResolver passed into the constructor. + +If *any* of the ClusterSpecs expose the set of workers as a dict, we will +treat all the sets of workers as dicts (even if they are returned as lists) +and will only merge them into a dict if there is no conflicting keys. If +there is a conflicting key, we will raise a `KeyError`." +2969,master,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,573,method,"Returns the master address to use when creating a session. + +This usually returns the master from the first ClusterResolver passed in, +but you can override this by specifying the task_type and task_id. + +Note: this is only useful for TensorFlow 1.x. + +Args: + task_type: (Optional) The type of the TensorFlow task of the master. + task_id: (Optional) The index of the TensorFlow task of the master. + rpc_layer: (Optional) The RPC protocol for the given cluster. + +Returns: + The name or URL of the session master." +2970,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,596,method, +2971,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,600,method, +2972,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,604,method, +2973,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,608,method, +2974,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,612,method, +2975,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,615,method, +2976,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,623,method, +2977,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver.py,627,method, +2978,MockBaseClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,34,class, +2979,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,36,method, +2980,master,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,39,method, +2981,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/cluster_resolver_test.py,42,method, +2982,GCEClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,35,class,"ClusterResolver for Google Compute Engine. This is an implementation of cluster resolvers for the Google Compute Engine instance group platform. By specifying a project, zone, and instance group, @@ -15900,8 +20433,22 @@ Usage example with tf.distribute.Strategy: strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy( cluster_resolver=cluster_resolver) ```" -3144,GCEClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver_test.py,30,class, -3145,KubernetesClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver.py,35,class,"ClusterResolver for Kubernetes. +2983,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,129,method,"Returns a ClusterSpec object based on the latest instance group info. + +This returns a ClusterSpec object for use based on information from the +specified instance group. We will retrieve the information from the GCE APIs +every time this method is called. + +Returns: + A ClusterSpec containing host information retrieved from GCE." +2984,master,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,174,method, +2985,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,188,method, +2986,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,192,method, +2987,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,196,method, +2988,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,202,method, +2989,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,206,method, +2990,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/gce_cluster_resolver.py,210,method, +2991,KubernetesClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver.py,35,class,"ClusterResolver for Kubernetes. This is an implementation of cluster resolvers for Kubernetes. When given the the Kubernetes namespace and label selector for pods, we will retrieve the @@ -15932,43 +20479,47 @@ Usage example with tf.distribute.Strategy: strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy( cluster_resolver=cluster_resolver) ```" -3146,_mock_kubernetes_client,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver_test.py,28,function, -3147,_get_mock_pod_item,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver_test.py,35,function, -3148,_create_pod_list,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver_test.py,47,function, -3149,KubernetesClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver_test.py,51,class, -3150,expand_hostlist,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,31,function,"Create a list of hosts out of a SLURM hostlist. +2992,master,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver.py,121,method,"Returns the master address to use when creating a session. + +You must have set the task_type and task_id object properties before +calling this function, or pass in the `task_type` and `task_id` +parameters when using this function. If you do both, the function parameters +will override the object properties. + +Note: this is only useful for TensorFlow 1.x. + +Args: + task_type: (Optional) The type of the TensorFlow task of the master. + task_id: (Optional) The index of the TensorFlow task of the master. + rpc_layer: (Optional) The RPC protocol for the given cluster. + +Returns: + The name or URL of the session master." +2993,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/kubernetes_cluster_resolver.py,149,method,"Returns a ClusterSpec object based on the latest info from Kubernetes. + +We retrieve the information from the Kubernetes master every time this +method is called. + +Returns: + A ClusterSpec containing host information returned from Kubernetes. + +Raises: + RuntimeError: If any of the pods returned by the master is not in the + `Running` phase." +2994,expand_hostlist,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,31,function,"Create a list of hosts out of a SLURM hostlist. The order of nodes is preserved and no deduplication is done Input: 'n[1-2],m5,o[3-4,6,7-9]') Output: ['n1', 'n2', 'm5', 'o3', 'o4', 'o6', 'o7', 'o8', 'o9']" -3151,expand_tasks_per_node,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,89,function,"Expands the tasks per node expression from SLURM. +2995,expand_tasks_per_node,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,89,function,"Expands the tasks per node expression from SLURM. The order is preserved so it can be matched to the hostlist Input: '3(x2),2,1' Output: [3, 3, 2, 1]" -3152,_get_slurm_var,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,110,function,"Gets the SLURM variable from the environment. - -Args: - name: Name of the step variable - -Returns: - SLURM_ from os.environ -Raises: - RuntimeError if variable is not found" -3153,_get_num_slurm_tasks,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,129,function,"Returns the number of SLURM tasks of the current job step. - -Returns: - The number of tasks as an int" -3154,_get_num_nvidia_gpus,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,138,function,"Gets the number of NVIDIA GPUs by using CUDA_VISIBLE_DEVICES and nvidia-smi. - -Returns: - Number of GPUs available on the node -Raises: - RuntimeError if executing nvidia-smi failed" -3155,get_num_gpus,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,159,function,"Returns the number of GPUs visible on the current node. +2996,get_num_gpus,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,159,function,"Returns the number of GPUs visible on the current node. Currently only implemented for NVIDIA GPUs." -3156,SlurmClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,168,class,"ClusterResolver for system with Slurm workload manager. +2997,SlurmClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,168,class,"ClusterResolver for system with Slurm workload manager. This is an implementation of ClusterResolver for Slurm clusters. This allows the specification of jobs and task counts, number of tasks per node, number @@ -15976,11 +20527,42 @@ of GPUs on each node and number of GPUs for each task. It retrieves system attributes by Slurm environment variables, resolves allocated computing node names, constructs a cluster and returns a ClusterResolver object which can be used for distributed TensorFlow." -3157,SlurmClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver_test.py,32,class, -3158,format_master_url,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,35,function, -3159,_load_tf_config,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,42,function, -3160,_get_value_in_tfconfig,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,46,function, -3161,TFConfigClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,52,class,"Implementation of a ClusterResolver which reads the TF_CONFIG EnvVar. +2998,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,304,method,"Returns a ClusterSpec object based on the latest instance group info. + +This returns a ClusterSpec object for use based on information from the +specified initialization parameters and Slurm environment variables. The +cluster specification is resolved each time this function is called. The +resolver extract hostnames of nodes by scontrol and pack tasks in that +order until a node a has number of tasks that is equal to specification. +GPUs on nodes are allocated to tasks by specification through setting +CUDA_VISIBLE_DEVICES environment variable. + +Returns: + A ClusterSpec containing host information retrieved from Slurm's + environment variables." +2999,get_task_info,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,359,method,"Returns job name and task_id for the process which calls this. + +This returns the job name and task index for the process which calls this +function according to its rank and cluster specification. The job name and +task index are set after a cluster is constructed by cluster_spec otherwise +defaults to None. + +Returns: + A string specifying job name the process belongs to and an integer + specifying the task index the process belongs to in that job." +3000,master,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,373,method,"Returns the master string for connecting to a TensorFlow master. + +Args: + task_type: (Optional) Overrides the default auto-selected task type. + task_id: (Optional) Overrides the default auto-selected task index. + rpc_layer: (Optional) Overrides the default RPC protocol TensorFlow uses + to communicate across nodes. + +Returns: + A connection string for connecting to a TensorFlow master." +3001,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/slurm_cluster_resolver.py,395,method, +3002,format_master_url,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,35,function, +3003,TFConfigClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,52,class,"Implementation of a ClusterResolver which reads the TF_CONFIG EnvVar. This is an implementation of cluster resolvers when using TF_CONFIG to set information about the cluster. The cluster spec returned will be @@ -16009,9 +20591,38 @@ can use it with `tf.distribute.Strategy` as: strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy( cluster_resolver=TFConfigClusterResolver()) ```" -3162,TFConfigClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver_test.py,35,class, -3163,is_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,40,function, -3164,TPUClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,51,class,"Cluster Resolver for Google Cloud TPUs. +3004,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,106,method, +3005,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,114,method, +3006,task_type,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,122,method, +3007,task_id,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,126,method, +3008,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,130,method, +3009,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,134,method, +3010,rpc_layer,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,141,method, +3011,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,144,method, +3012,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,153,method,"Returns a ClusterSpec based on the TF_CONFIG environment variable. + +Returns: + A ClusterSpec with information from the TF_CONFIG environment variable." +3013,master,tensorflow/tensorflow/python/distribute/cluster_resolver/tfconfig_cluster_resolver.py,164,method,"Returns the master address to use when creating a TensorFlow session. + +Note: this is only useful for TensorFlow 1.x. + +Args: + task_type: (String, optional) Overrides and sets the task_type of the + master. + task_id: (Integer, optional) Overrides and sets the task id of the + master. + rpc_layer: (String, optional) Overrides and sets the protocol over which + TensorFlow nodes communicate with each other. + +Returns: + The address of the master. + +Raises: + RuntimeError: If the task_type or task_id is not specified and the + `TF_CONFIG` environment variable does not contain a task section." +3014,is_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,40,function, +3015,TPUClusterResolver,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,51,class,"Cluster Resolver for Google Cloud TPUs. This is an implementation of cluster resolvers for the Google Cloud TPU service. @@ -16023,28 +20634,135 @@ Google internal It can be passed into `tf.distribute.TPUStrategy` to support TF2 training on Cloud TPUs." -3165,MockRequestClass,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,47,class, -3166,MockNodeClass,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,60,class, -3167,mock_request_compute_metadata,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,69,function, -3168,mock_is_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,80,function, -3169,mock_is_not_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,84,function, -3170,mock_running_in_gce_urlopen,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,88,function, -3171,mock_not_running_in_gce_urlopen,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,95,function, -3172,TPUClusterResolverTest,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,101,class, -3173,SaveAndLoadForServingTest,tensorflow/tensorflow/python/distribute/integration_test/saved_model_test.py,50,class, -3174,SaveAndLoadForTrainingTest,tensorflow/tensorflow/python/distribute/integration_test/saved_model_test.py,304,class, -3175,ParallelDevice,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,42,class,A device which executes operations in parallel. -3176,_collective_reduce,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,50,function, -3177,_collective_sum,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,68,function, -3178,_Dense,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,73,class, -3179,_VirtualDeviceTestCase,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,90,class, -3180,ParallelDeviceTests,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,112,class, -3181,LayerTests,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device_test.py,257,class, -3182,_read_component,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,33,function,Read one component of a parallel variable and discard the rest. -3183,_ParallelDeviceSaveable,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,45,class,Saves and restores a parallel variable. -3184,VariableWithFixedCheckpointing,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,86,class,Overrides checkpointing behavior to save like a partitioned variable. -3185,_variable_creator,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,110,function, -3186,independent_buffers,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,117,function,"Context manager which saves parallel buffers independently. +3016,connect,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,67,method,"Initializes TPU and returns a TPUClusterResolver. + +This API will connect to remote TPU cluster and initialize the TPU +hardwares. Example usage: + +>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver.connect( +... tpu='') + +It can be viewed as convenient wrapper of the following code: + +>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +>>> tf.config.experimental_connect_to_cluster(resolver) +>>> tf.tpu.experimental.initialize_tpu_system(resolver) + +Args: + tpu: A string corresponding to the TPU to use. It can be the TPU name or + TPU worker gRPC address. If not set, it will try automatically resolve + the TPU address on Cloud TPUs. + zone: Zone where the TPUs are located. If omitted or empty, we will assume + that the zone of the TPU is the same as the zone of the GCE VM, which we + will try to discover from the GCE metadata service. + project: Name of the GCP project containing Cloud TPUs. If omitted or + empty, we will try to discover the project name of the GCE VM from the + GCE metadata service. + +Returns: + An instance of TPUClusterResolver object. + +Raises: + NotFoundError: If no TPU devices found in eager mode." +3017,master,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,215,method,"Get the Master string to be used for the session. + +In the normal case, this returns the grpc path (grpc://1.2.3.4:8470) of +first instance in the ClusterSpec returned by the cluster_spec function. + +If a non-TPU name is used when constructing a TPUClusterResolver, that will +be returned instead (e.g. If the tpus argument's value when constructing +this TPUClusterResolver was 'grpc://10.240.1.2:8470', +'grpc://10.240.1.2:8470' will be returned). + +Args: + task_type: (Optional, string) The type of the TensorFlow task of the + master. + task_id: (Optional, integer) The index of the TensorFlow task of the + master. + rpc_layer: (Optional, string) The RPC protocol TensorFlow should use to + communicate with TPUs. + +Returns: + string, the connection string to use when creating a session. + +Raises: + ValueError: If none of the TPUs specified exists." +3018,get_master,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,256,method, +3019,get_job_name,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,259,method, +3020,get_tpu_system_metadata,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,262,method,"Returns the metadata of the TPU system. + +Users can call this method to get some facts of the TPU system, like +total number of cores, number of TPU workers and the devices. E.g. +```python + +resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') +tpu_system_medata = resolver.get_tpu_system_metadata() +num_hosts = tpu_system_medata.num_hosts +``` + +Returns: + A `tf.tpu.experimental.TPUSystemMetadata` object." +3021,cluster_spec,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,287,method,"Returns a ClusterSpec object based on the latest TPU information. + +We retrieve the information from the GCE APIs every time this method is +called. + +Returns: + A ClusterSpec containing host information returned from Cloud TPUs, + or None. + +Raises: + RuntimeError: If the provided TPU is not healthy." +3022,num_accelerators,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,323,method,"Returns the number of TPU cores per worker. + +Connects to the master and list all the devices present in the master, +and counts them up. Also verifies that the device counts per host in the +cluster is the same before returning the number of TPU cores per host. + +Args: + task_type: Unused. + task_id: Unused. + config_proto: Used to create a connection to a TPU master in order to + retrieve the system metadata. + +Raises: + RuntimeError: If we cannot talk to a TPU worker after retrying or if the + number of TPU devices per host is different." +3023,environment,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py,368,method,Returns the current environment which TensorFlow is running in. +3024,MockRequestClass,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,47,class, +3025,execute,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,53,method, +3026,MockNodeClass,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,60,class, +3027,get,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,65,method, +3028,mock_request_compute_metadata,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,69,function, +3029,mock_is_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,80,function, +3030,mock_is_not_running_in_gce,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,84,function, +3031,mock_running_in_gce_urlopen,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,88,function, +3032,mock_not_running_in_gce_urlopen,tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver_test.py,95,function, +3033,ParallelDevice,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,42,class,A device which executes operations in parallel. +3034,pack,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,70,method,"Create a tensor on the parallel device from a sequence of tensors. + +Args: + tensors: A flat list of tensors, one per device in `self.components`. + +Returns: + A single tensor placed on `self.name`." +3035,unpack,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,82,method,"Unpack a parallel tensor into its components. + +Args: + parallel_tensor: A tensor placed on `self.name`. + +Returns: + A flat list of tensors, one per `self.components`." +3036,device_ids,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,96,method,"A parallel tensor with scalar integers numbering component devices. + +Each device ID is placed on its corresponding device, in the same order as +the `components` constructor argument. + +Returns: + A parallel tensor containing 0 on the first device, 1 on the second, etc." +3037,scope,tensorflow/tensorflow/python/distribute/parallel_device/parallel_device.py,112,method,"Runs ops in parallel, makes variables which save independent buffers." +3038,VariableWithFixedCheckpointing,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,86,class,Overrides checkpointing behavior to save like a partitioned variable. +3039,independent_buffers,tensorflow/tensorflow/python/distribute/parallel_device/saving.py,117,function,"Context manager which saves parallel buffers independently. Creates a ParallelDevice-aware variable subclass which saves buffers for each device separately. @@ -16054,7 +20772,7 @@ Args: Yields: Nothing." -3187,to_dlpack,tensorflow/tensorflow/python/dlpack/dlpack.py,27,function,"Returns the dlpack capsule representing the tensor. +3040,to_dlpack,tensorflow/tensorflow/python/dlpack/dlpack.py,27,function,"Returns the dlpack capsule representing the tensor. This operation ensures the underlying data memory is ready when returns. @@ -16070,7 +20788,7 @@ Args: Returns: A PyCapsule named as dltensor, which shares the underlying memory to other framework. This PyCapsule can be consumed only once." -3188,from_dlpack,tensorflow/tensorflow/python/dlpack/dlpack.py,49,function,"Returns the Tensorflow eager tensor. +3041,from_dlpack,tensorflow/tensorflow/python/dlpack/dlpack.py,49,function,"Returns the Tensorflow eager tensor. The returned tensor uses the memory shared by dlpack capsules from other framework. @@ -16085,30 +20803,10 @@ Args: Returns: A Tensorflow eager tensor" -3189,FormatShapeAndDtype,tensorflow/tensorflow/python/dlpack/dlpack_test.py,40,function, -3190,GetNamedTestParameters,tensorflow/tensorflow/python/dlpack/dlpack_test.py,44,function, -3191,DLPackTest,tensorflow/tensorflow/python/dlpack/dlpack_test.py,56,class, -3192,op_attr_type,tensorflow/tensorflow/python/eager/backprop.py,75,function, -3193,make_attr,tensorflow/tensorflow/python/eager/backprop.py,86,function, -3194,_MockOp,tensorflow/tensorflow/python/eager/backprop.py,106,class,Pretends to be a tf.Operation for the gradient functions. -3195,_gradient_function,tensorflow/tensorflow/python/eager/backprop.py,132,function,"Calls the gradient function of the op. - -Args: - op_name: the name of the op to be differentiated. - attr_tuple: the attrs, as a tuple. - num_inputs: the number of inputs to the op. - inputs: inputs to the original operation. - outputs: outputs to the original operation. - out_grads: gradients of the operation wrt its outputs. - skip_input_indices: a tuple that is passed to the gradient function, - indicating which inputs to skip calculating the gradient for - forward_pass_name_scope: the namescope of the op in the forward pass. - -Returns: - The gradients with respect to the inputs of the function, as a list." -3196,_must_record_gradient,tensorflow/tensorflow/python/eager/backprop.py,170,function, -3197,_record_gradient,tensorflow/tensorflow/python/eager/backprop.py,174,function, -3198,implicit_val_and_grad,tensorflow/tensorflow/python/eager/backprop.py,183,function,"Returns a function which differentiates f with respect to variables. +3042,FormatShapeAndDtype,tensorflow/tensorflow/python/dlpack/dlpack_test.py,40,function, +3043,op_attr_type,tensorflow/tensorflow/python/eager/backprop.py,75,function, +3044,make_attr,tensorflow/tensorflow/python/eager/backprop.py,86,function, +3045,implicit_val_and_grad,tensorflow/tensorflow/python/eager/backprop.py,183,function,"Returns a function which differentiates f with respect to variables. The wrapped function returns the value and the gradient of f when called with the same arguments. The gradient is with respect to all trainable TFE @@ -16151,7 +20849,7 @@ Returns: Raises: ValueError: if `f` returns None." -3199,implicit_grad,tensorflow/tensorflow/python/eager/backprop.py,262,function,"Returns a function which differentiates f with respect to variables. +3046,implicit_grad,tensorflow/tensorflow/python/eager/backprop.py,262,function,"Returns a function which differentiates f with respect to variables. The wrapped function returns the gradient of f when called with the same arguments. The gradient is with respect to all trainable TFE variables @@ -16188,8 +20886,7 @@ Args: Returns: A function which, when called, returns a list of (gradient, variable) pairs." -3200,_get_arg_spec,tensorflow/tensorflow/python/eager/backprop.py,311,function,The positions of the parameters of f to be differentiated in param_args. -3201,gradients_function,tensorflow/tensorflow/python/eager/backprop.py,340,function,"Returns a function which differentiates f with respect to params. +3047,gradients_function,tensorflow/tensorflow/python/eager/backprop.py,340,function,"Returns a function which differentiates f with respect to params. Example: ```python @@ -16250,26 +20947,7 @@ Returns: Raises: ValueError: if the params are not all strings or all integers." -3202,_ensure_unique_tensor_objects,tensorflow/tensorflow/python/eager/backprop.py,413,function,"Make each of the parameter_positions in args a unique ops.Tensor object. - -Ensure that each parameter is treated independently. -For example: - -def f(x, y): return x * y -g = gradients_function(f) -one = tf.constant(1.) - -g(one, one) should return [1., 1.] -(even though the two arguments are the same Tensor object). - -Args: - parameter_positions: List of indices into args defining the arguments to - differentiate against. - args: A list of arguments to the function to be differentiated. - -Returns: - args, possibly edited in-place." -3203,val_and_grad_function,tensorflow/tensorflow/python/eager/backprop.py,445,function,"Returns a function that computes f and its derivative w.r.t. params. +3048,val_and_grad_function,tensorflow/tensorflow/python/eager/backprop.py,445,function,"Returns a function that computes f and its derivative w.r.t. params. Example: ```python @@ -16322,7 +21000,7 @@ Returns: Raises: ValueError: if the params are not all strings or all integers." -3204,make_vjp,tensorflow/tensorflow/python/eager/backprop.py,513,function,"Returns a function that computes f and its vjp w.r.t. +3049,make_vjp,tensorflow/tensorflow/python/eager/backprop.py,513,function,"Returns a function that computes f and its vjp w.r.t. params. @@ -16355,22 +21033,9 @@ Returns: Raises: ValueError: if `f` returns None." -3205,flatten_nested_indexed_slices,tensorflow/tensorflow/python/eager/backprop.py,589,function, -3206,aggregate_indexed_slices_gradients,tensorflow/tensorflow/python/eager/backprop.py,601,function,Aggregates gradients containing `IndexedSlices`s. -3207,_aggregate_grads,tensorflow/tensorflow/python/eager/backprop.py,628,function,"Aggregate gradients from multiple sources. - -Args: - gradients: A list of 'Tensor' or 'IndexedSlices' gradients. - -Returns: - If 'gradients' only has 'Tensor', returns an aggregated 'Tensor'. - Otherwise returns an aggregated 'IndexedSlices'." -3208,_num_elements,tensorflow/tensorflow/python/eager/backprop.py,650,function,The number of elements in the `grad` tensor. -3209,_fast_fill,tensorflow/tensorflow/python/eager/backprop.py,663,function, -3210,_zeros,tensorflow/tensorflow/python/eager/backprop.py,669,function,Helper to return (possibly cached) zero tensors in eager mode. -3211,_ones,tensorflow/tensorflow/python/eager/backprop.py,697,function, -3212,_handle_or_self,tensorflow/tensorflow/python/eager/backprop.py,726,function,Unwrap resource variable/ndarray to return tensors. -3213,GradientTape,tensorflow/tensorflow/python/eager/backprop.py,736,class,"Record operations for automatic differentiation. +3050,flatten_nested_indexed_slices,tensorflow/tensorflow/python/eager/backprop.py,589,function, +3051,aggregate_indexed_slices_gradients,tensorflow/tensorflow/python/eager/backprop.py,601,function,Aggregates gradients containing `IndexedSlices`s. +3052,GradientTape,tensorflow/tensorflow/python/eager/backprop.py,736,class,"Record operations for automatic differentiation. Operations are recorded if they are executed within this context manager and at least one of their inputs is being ""watched"". @@ -16463,29 +21128,411 @@ with tf.GradientTape(watch_accessed_variables=False) as tape: ``` Note that only tensors with real or complex dtypes are differentiable." -3214,BackpropTest,tensorflow/tensorflow/python/eager/backprop_test.py,57,class, -3215,JacobianTest,tensorflow/tensorflow/python/eager/backprop_test.py,1605,class, -3216,BatchJacobianTest,tensorflow/tensorflow/python/eager/backprop_test.py,1703,class, -3217,AggregateIndexedSlicesGradientsTest,tensorflow/tensorflow/python/eager/backprop_test.py,1801,class, -3218,IsTrainable,tensorflow/tensorflow/python/eager/backprop_util.py,25,function, -3219,c_tfe_py_fastpath_execute,tensorflow/tensorflow/python/eager/benchmarks_test.py,74,function, -3220,run_benchmark,tensorflow/tensorflow/python/eager/benchmarks_test.py,95,function, -3221,MicroBenchmarks,tensorflow/tensorflow/python/eager/benchmarks_test.py,112,class, -3222,MicroBenchmarksBase,tensorflow/tensorflow/python/eager/benchmarks_test_base.py,32,class,"Run and report benchmark results. +3053,watch,tensorflow/tensorflow/python/eager/backprop.py,894,method,"Ensures that `tensor` is being traced by this tape. + +Args: + tensor: a Tensor or list of Tensors. + +Raises: + ValueError: if it encounters something that is not a tensor." +3054,stop_recording,tensorflow/tensorflow/python/eager/backprop.py,920,method,"Temporarily stops recording operations on this tape. + +Operations executed while this context manager is active will not be +recorded on the tape. This is useful for reducing the memory used by tracing +all computations. + +For example: + +>>> x = tf.constant(4.0) +>>> with tf.GradientTape() as tape: +... with tape.stop_recording(): +... y = x ** 2 +>>> dy_dx = tape.gradient(y, x) +>>> print(dy_dx) +None + +Yields: + None +Raises: + RuntimeError: if the tape is not currently recording." +3055,reset,tensorflow/tensorflow/python/eager/backprop.py,951,method,"Clears all information stored in this tape. + +Equivalent to exiting and reentering the tape context manager with a new +tape. For example, the two following code blocks are equivalent: + +``` +with tf.GradientTape() as t: + loss = loss_fn() +with tf.GradientTape() as t: + loss += other_loss_fn() +t.gradient(loss, ...) # Only differentiates other_loss_fn, not loss_fn + + +# The following is equivalent to the above +with tf.GradientTape() as t: + loss = loss_fn() + t.reset() + loss += other_loss_fn() +t.gradient(loss, ...) # Only differentiates other_loss_fn, not loss_fn +``` + +This is useful if you don't want to exit the context manager for the tape, +or can't because the desired reset point is inside a control flow construct: + +``` +with tf.GradientTape() as t: + loss = ... + if loss > k: + t.reset() +```" +3056,watched_variables,tensorflow/tensorflow/python/eager/backprop.py,987,method,Returns variables watched by this tape in order of construction. +3057,gradient,tensorflow/tensorflow/python/eager/backprop.py,993,method,"Computes the gradient using operations recorded in context of this tape. + +Args: + target: a list or nested structure of Tensors or Variables to be + differentiated. + sources: a list or nested structure of Tensors or Variables. `target` + will be differentiated against elements in `sources`. + output_gradients: a list of gradients, one for each element of + target. Defaults to None. + unconnected_gradients: a value which can either hold 'none' or 'zero' and + alters the value which will be returned if the target and sources are + unconnected. The possible values and effects are detailed in + 'UnconnectedGradients' and it defaults to 'none'. + +Returns: + a list or nested structure of Tensors (or IndexedSlices, or None), + one for each element in `sources`. Returned structure is the same as + the structure of `sources`. + +Raises: + RuntimeError: if called inside the context of the tape, or if called more + than once on a non-persistent tape. + ValueError: if the target is a variable or if unconnected gradients is + called with an unknown value." +3058,jacobian,tensorflow/tensorflow/python/eager/backprop.py,1096,method,"Computes the jacobian using operations recorded in context of this tape. + +See[wikipedia article](http://en.wikipedia.org/wiki/jacobian_matrix_and_determinant) +for the definition of a Jacobian. + +Example usage: + +```python +with tf.GradientTape() as g: + x = tf.constant([1.0, 2.0]) + g.watch(x) + y = x * x +jacobian = g.jacobian(y, x) +# jacobian value is [[2., 0.], [0., 4.]] +``` + +Args: + target: Tensor to be differentiated. + sources: a list or nested structure of Tensors or Variables. `target` + will be differentiated against elements in `sources`. + unconnected_gradients: a value which can either hold 'none' or 'zero' and + alters the value which will be returned if the target and sources are + unconnected. The possible values and effects are detailed in + 'UnconnectedGradients' and it defaults to 'none'. + parallel_iterations: A knob to control how many iterations are dispatched + in parallel. This knob can be used to control the total memory usage. + experimental_use_pfor: If true, vectorizes the jacobian computation. Else + falls back to a sequential while_loop. Vectorization can sometimes fail + or lead to excessive memory usage. This option can be used to disable + vectorization in such cases. + +Returns: + A list or nested structure of Tensors (or None), one for each element in + `sources`. Returned structure is the same as the structure of `sources`. + Note if any gradient is sparse (IndexedSlices), jacobian function + currently makes it dense and returns a Tensor instead. This may change in + the future. + + +Raises: + RuntimeError: If called on a non-persistent tape with eager execution + enabled and without enabling experimental_use_pfor. + ValueError: If vectorization of jacobian computation fails." +3059,batch_jacobian,tensorflow/tensorflow/python/eager/backprop.py,1206,method,"Computes and stacks per-example jacobians. + +See [wikipedia article](http://en.wikipedia.org/wiki/jacobian_matrix_and_determinant) +for the definition of a Jacobian. This function is essentially an efficient +implementation of the following: + +`tf.stack([self.jacobian(y[i], x[i]) for i in range(x.shape[0])])`. + +Note that compared to `GradientTape.jacobian` which computes gradient of +each output value w.r.t each input value, this function is useful when +`target[i,...]` is independent of `source[j,...]` for `j != i`. This +assumption allows more efficient computation as compared to +`GradientTape.jacobian`. The output, as well as intermediate activations, +are lower dimensional and avoid a bunch of redundant zeros which would +result in the jacobian computation given the independence assumption. + +Example usage: + +```python +with tf.GradientTape() as g: + x = tf.constant([[1., 2.], [3., 4.]], dtype=tf.float32) + g.watch(x) + y = x * x +batch_jacobian = g.batch_jacobian(y, x) +# batch_jacobian is [[[2, 0], [0, 4]], [[6, 0], [0, 8]]] +``` + +Args: + target: A tensor with rank 2 or higher and with shape [b, y1, ..., y_n]. + `target[i,...]` should only depend on `source[i,...]`. + source: A tensor with rank 2 or higher and with shape [b, x1, ..., x_m]. + unconnected_gradients: a value which can either hold 'none' or 'zero' and + alters the value which will be returned if the target and sources are + unconnected. The possible values and effects are detailed in + 'UnconnectedGradients' and it defaults to 'none'. + parallel_iterations: A knob to control how many iterations are dispatched + in parallel. This knob can be used to control the total memory usage. + experimental_use_pfor: If true, uses pfor for computing the Jacobian. Else + uses a tf.while_loop. + +Returns: + A tensor `t` with shape [b, y_1, ..., y_n, x1, ..., x_m] where `t[i, ...]` + is the jacobian of `target[i, ...]` w.r.t. `source[i, ...]`, i.e. stacked + per-example jacobians. + +Raises: + RuntimeError: If called on a non-persistent tape with eager execution + enabled and without enabling experimental_use_pfor. + ValueError: If vectorization of jacobian computation fails or if first + dimension of `target` and `source` do not match." +3060,loop_fn,tensorflow/tensorflow/python/eager/backprop.py,1159,method, +3061,loop_fn,tensorflow/tensorflow/python/eager/backprop.py,1297,method, +3062,IsTrainable,tensorflow/tensorflow/python/eager/backprop_util.py,25,function, +3063,c_tfe_py_fastpath_execute,tensorflow/tensorflow/python/eager/benchmarks_test.py,74,function, +3064,run_benchmark,tensorflow/tensorflow/python/eager/benchmarks_test.py,95,function, +3065,MicroBenchmarks,tensorflow/tensorflow/python/eager/benchmarks_test.py,112,class, +3066,benchmark_create_np_array,tensorflow/tensorflow/python/eager/benchmarks_test.py,155,method, +3067,benchmark_create_float_constant,tensorflow/tensorflow/python/eager/benchmarks_test.py,189,method, +3068,benchmark_create_float_constant_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,192,method, +3069,benchmark_create_int32_constant,tensorflow/tensorflow/python/eager/benchmarks_test.py,195,method, +3070,benchmark_create_int32_constant_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,201,method, +3071,benchmark_add_float_scalars,tensorflow/tensorflow/python/eager/benchmarks_test.py,225,method, +3072,benchmark_add_int32_scalars,tensorflow/tensorflow/python/eager/benchmarks_test.py,228,method, +3073,benchmark_add_float_scalar_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,231,method, +3074,benchmark_add_float_scalar_tensor_overloaded_operator,tensorflow/tensorflow/python/eager/benchmarks_test.py,236,method, +3075,benchmark_add_int32_scalar_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,241,method, +3076,benchmark_add_float_dense_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,246,method, +3077,benchmark_add_int32_dense_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,251,method, +3078,benchmark_create_float_tensor_from_list_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,257,method, +3079,benchmark_create_float_tensor_from_np_array_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,261,method, +3080,benchmark_create_int32_tensor_from_list_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,267,method, +3081,benchmark_create_int32_tensor_from_np_array_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,271,method, +3082,benchmark_create_float_tensor_from_list_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,276,method, +3083,benchmark_create_float_tensor_from_np_array_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,282,method, +3084,benchmark_create_int32_tensor_from_list_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,290,method, +3085,benchmark_create_int32_tensor_from_np_array_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,297,method, +3086,benchmark_index_tensor_with_literal,tensorflow/tensorflow/python/eager/benchmarks_test.py,305,method, +3087,benchmark_index_tensor_with_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,310,method, +3088,benchmark_index_tensor_with_np_array,tensorflow/tensorflow/python/eager/benchmarks_test.py,315,method, +3089,benchmark_np_multiply,tensorflow/tensorflow/python/eager/benchmarks_test.py,337,method, +3090,benchmark_tf_multiply_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,340,method, +3091,benchmark_tf_multiply_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,346,method, +3092,benchmark_tf_multiply_op_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,353,method, +3093,benchmark_tf_multiply_op_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,359,method, +3094,benchmark_tf_conv2d_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,366,method, +3095,benchmark_tf_conv2d_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,373,method, +3096,benchmark_tf_identity,tensorflow/tensorflow/python/eager/benchmarks_test.py,381,method, +3097,benchmark_slowpath_tf_identity,tensorflow/tensorflow/python/eager/benchmarks_test.py,386,method, +3098,benchmark_tfe_py_execute_identity,tensorflow/tensorflow/python/eager/benchmarks_test.py,389,method, +3099,benchmark_tf_gradient_function_identity,tensorflow/tensorflow/python/eager/benchmarks_test.py,401,method, +3100,benchmark_tf_gradient_forward_identity,tensorflow/tensorflow/python/eager/benchmarks_test.py,409,method, +3101,benchmark_tf_gradient_tape_push_pop,tensorflow/tensorflow/python/eager/benchmarks_test.py,416,method, +3102,benchmark_tf_gradient_function_no_op,tensorflow/tensorflow/python/eager/benchmarks_test.py,425,method, +3103,benchmark_np_matmul_2_by_2,tensorflow/tensorflow/python/eager/benchmarks_test.py,535,method, +3104,benchmark_tf_matmul_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,539,method, +3105,benchmark_tf_matmul_2_by_2_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,546,method, +3106,benchmark_gen_math_ops_matmul_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,555,method, +3107,benchmark_tfe_py_fastpath_execute_matmul_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,561,method, +3108,benchmark_tfe_py_execute_matmul_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,567,method, +3109,benchmark_defun_matmul_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,573,method, +3110,benchmark_defun_matmul_2_by_2_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,580,method, +3111,benchmark_defun_matmul_forward_backward_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,589,method, +3112,benchmark_defun_matmul_forward_backward_2_by_2_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,596,method, +3113,benchmark_tf_matmul_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,606,method, +3114,benchmark_tf_matmul_2_by_2_GPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,615,method, +3115,benchmark_gen_math_ops_matmul_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,627,method, +3116,benchmark_tfe_py_execute_matmul_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,636,method, +3117,benchmark_defun_matmul_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,645,method, +3118,benchmark_defun_args_matmul_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,654,method, +3119,benchmark_defun_matmul_2_by_2_GPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,662,method, +3120,benchmark_nested_defun_matmul_2_by_2,tensorflow/tensorflow/python/eager/benchmarks_test.py,673,method, +3121,benchmark_np_matmul_100_by_784,tensorflow/tensorflow/python/eager/benchmarks_test.py,679,method, +3122,benchmark_tf_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,685,method, +3123,benchmark_tf_matmul_100_by_784_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,692,method, +3124,benchmark_gen_math_ops_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,701,method, +3125,benchmark_tfe_py_fastpath_execute_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,707,method, +3126,benchmark_tfe_py_execute_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,714,method, +3127,benchmark_defun_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,720,method, +3128,benchmark_tf_matmul_100_by_784_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,727,method, +3129,benchmark_tf_matmul_100_by_784_GPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,736,method, +3130,benchmark_gen_math_ops_matmul_100_by_784_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,748,method, +3131,benchmark_tfe_py_execute_matmul_100_by_784_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,757,method, +3132,benchmark_defun_matmul_100_by_784_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,766,method, +3133,benchmark_nested_defun_matmul_100_by_784_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,775,method, +3134,benchmark_forwardprop_matmul_256_by_2096_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,847,method, +3135,benchmark_forwardprop_in_defun_matmul_256_by_2096_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,850,method, +3136,benchmark_forwardprop_in_defun_of_defun_matmul_256_by_2096_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,853,method, +3137,benchmark_forwardprop_of_defun_matmul_256_by_2096_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,856,method, +3138,benchmark_forwardprop_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,859,method, +3139,benchmark_forwardprop_in_defun_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,862,method, +3140,benchmark_forwardprop_in_defun_of_defun_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,865,method, +3141,benchmark_forwardprop_of_defun_matmul_100_by_784_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,868,method, +3142,benchmark_tf_reduce_logsumexp_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,887,method, +3143,benchmark_tf_reduce_logsumexp_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,891,method, +3144,benchmark_tf_reduce_logsumexp_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,895,method, +3145,benchmark_tf_reduce_logsumexp_GPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,899,method, +3146,benchmark_tf_reduce_logsumexp_CPU_defunc,tensorflow/tensorflow/python/eager/benchmarks_test.py,904,method, +3147,benchmark_tf_reduce_logsumexp_CPU_async_defun,tensorflow/tensorflow/python/eager/benchmarks_test.py,908,method, +3148,benchmark_tf_reduce_logsumexp_GPU_defun,tensorflow/tensorflow/python/eager/benchmarks_test.py,913,method, +3149,benchmark_tf_reduce_logsumexp_GPU_async_defun,tensorflow/tensorflow/python/eager/benchmarks_test.py,917,method, +3150,benchmark_tf_reduce_logsumexp_GPU_defun_compile,tensorflow/tensorflow/python/eager/benchmarks_test.py,922,method, +3151,benchmark_tf_reduce_logsumexp_GPU_async_defun_compile,tensorflow/tensorflow/python/eager/benchmarks_test.py,927,method, +3152,benchmark_tf_tensordot_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,939,method, +3153,benchmark_tf_tensordot_CPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,943,method, +3154,benchmark_tf_tensordot_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,947,method, +3155,benchmark_tf_tensordot_GPU_async,tensorflow/tensorflow/python/eager/benchmarks_test.py,951,method, +3156,benchmark_tf_zeros_2_by_2_float32_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,960,method, +3157,benchmark_tf_zeros_2_by_2_bool_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,964,method, +3158,benchmark_tf_zeros_2_by_2_string_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,968,method, +3159,benchmark_tf_zeros_2_by_2_float32_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,972,method, +3160,benchmark_tf_zeros_2_by_2_bool_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,976,method, +3161,benchmark_tf_zeros_30_by_30_float32_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,980,method, +3162,benchmark_tf_zeros_30_by_30_bool_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,984,method, +3163,benchmark_tf_zeros_30_by_30_string_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,988,method, +3164,benchmark_tf_zeros_30_by_30_float32_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,992,method, +3165,benchmark_tf_zeros_30_by_30_bool_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,996,method, +3166,benchmark_tf_zeros_100_by_100_float32_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1000,method, +3167,benchmark_tf_zeros_100_by_100_bool_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1004,method, +3168,benchmark_tf_zeros_100_by_100_string_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1008,method, +3169,benchmark_tf_zeros_100_by_100_float32_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1012,method, +3170,benchmark_tf_zeros_100_by_100_bool_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1016,method, +3171,benchmark_tf_zeros_like_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1024,method, +3172,benchmark_tf_zeros_like_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1027,method, +3173,benchmark_tf_zeros_like_variable_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1030,method, +3174,benchmark_tf_zeros_like_variable_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1034,method, +3175,benchmark_tf_random_uniform_2_by_2_integer_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1049,method, +3176,benchmark_tf_random_uniform_2_by_2_integer_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1052,method, +3177,benchmark_tf_random_uniform_2_by_2_float_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1055,method, +3178,benchmark_tf_random_uniform_2_by_2_float_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1058,method, +3179,benchmark_tf_random_uniform_2_by_2_default_setting_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1062,method, +3180,benchmark_tf_random_uniform_2_by_2_default_setting_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1067,method, +3181,benchmark_tf_dropout_scalar_rate_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1088,method, +3182,benchmark_tf_dropout_scalar_rate_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1091,method, +3183,benchmark_tf_dropout_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1094,method, +3184,benchmark_tf_dropout_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1097,method, +3185,benchmark_tf_transpose_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1109,method, +3186,benchmark_tf_transpose_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1115,method, +3187,benchmark_tf_transpose_variable_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1120,method, +3188,benchmark_tf_transpose_variable_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1126,method, +3189,benchmark_defun_without_signature,tensorflow/tensorflow/python/eager/benchmarks_test.py,1131,method, +3190,benchmark_defun_without_signature_and_with_kwargs,tensorflow/tensorflow/python/eager/benchmarks_test.py,1142,method, +3191,benchmark_defun_with_signature,tensorflow/tensorflow/python/eager/benchmarks_test.py,1154,method, +3192,benchmark_defun_with_signature_and_kwargs,tensorflow/tensorflow/python/eager/benchmarks_test.py,1166,method, +3193,benchmark_matmul_read_variable_op_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1179,method, +3194,benchmark_matmul_read_variable_op_with_tape_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1184,method, +3195,benchmark_read_variable_op_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1190,method, +3196,benchmark_read_variable_op_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1196,method, +3197,benchmark_read_variable_op_with_tape_2_by_2_CPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1203,method, +3198,benchmark_read_variable_op_with_tape_2_by_2_GPU,tensorflow/tensorflow/python/eager/benchmarks_test.py,1210,method, +3199,benchmarkScan,tensorflow/tensorflow/python/eager/benchmarks_test.py,1218,method, +3200,benchmarkScanDefun,tensorflow/tensorflow/python/eager/benchmarks_test.py,1227,method, +3201,benchmark_fastpath_conversion_type_inference,tensorflow/tensorflow/python/eager/benchmarks_test.py,1237,method, +3202,benchmark_convert_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1245,method, +3203,benchmark_convert_python_int,tensorflow/tensorflow/python/eager/benchmarks_test.py,1269,method, +3204,benchmark_convert_python_int_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,1272,method, +3205,benchmark_convert_python_float,tensorflow/tensorflow/python/eager/benchmarks_test.py,1275,method, +3206,benchmark_convert_python_float_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,1278,method, +3207,benchmark_convert_numpy_int,tensorflow/tensorflow/python/eager/benchmarks_test.py,1281,method, +3208,benchmark_convert_numpy_int_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,1284,method, +3209,benchmark_convert_numpy_float,tensorflow/tensorflow/python/eager/benchmarks_test.py,1287,method, +3210,benchmark_convert_numpy_float_uncached,tensorflow/tensorflow/python/eager/benchmarks_test.py,1290,method, +3211,benchmark_convert_3x_list_to_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1294,method, +3212,benchmark_convert_3x_array_to_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1299,method, +3213,benchmark_constant_40x2_list_to_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1303,method, +3214,benchmark_constant_40x2_array_to_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1308,method, +3215,benchmark_constant_40x_list_of_2x_arrays_to_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1312,method, +3216,benchmark_constant_20x20x20_double_list_to_float32_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1316,method, +3217,benchmark_constant_20x20x20_double_list_to_float64_tensor,tensorflow/tensorflow/python/eager/benchmarks_test.py,1320,method, +3218,benchmark_list_of_zeros_to_np_array,tensorflow/tensorflow/python/eager/benchmarks_test.py,1324,method, +3219,benchmarkFunctionWithFiveResourceInputs,tensorflow/tensorflow/python/eager/benchmarks_test.py,1341,method, +3220,benchmarkFunctionWithFiveHundredResourceInputs,tensorflow/tensorflow/python/eager/benchmarks_test.py,1344,method, +3221,benchmarkTenThousandResourceReadsInCondInInnerFunc,tensorflow/tensorflow/python/eager/benchmarks_test.py,1379,method, +3222,benchmarkHundredResourceReadsInCondInInnerFunc,tensorflow/tensorflow/python/eager/benchmarks_test.py,1383,method, +3223,benchmarkTenResourceReadsInCondInInnerFunc,tensorflow/tensorflow/python/eager/benchmarks_test.py,1387,method, +3224,benchmark_tf_name_scope,tensorflow/tensorflow/python/eager/benchmarks_test.py,1390,method, +3225,benchmark_tf_nest_map_structure,tensorflow/tensorflow/python/eager/benchmarks_test.py,1398,method, +3226,benchmark_tf_nest_pack_sequence_as,tensorflow/tensorflow/python/eager/benchmarks_test.py,1406,method, +3227,benchmark_tf_nn_convolution_overhead,tensorflow/tensorflow/python/eager/benchmarks_test.py,1415,method, +3228,benchmark_tf_tensor_shape_creation_overhead,tensorflow/tensorflow/python/eager/benchmarks_test.py,1424,method, +3229,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,165,method, +3230,cached_func,tensorflow/tensorflow/python/eager/benchmarks_test.py,174,method, +3231,uncached_func,tensorflow/tensorflow/python/eager/benchmarks_test.py,177,method, +3232,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,208,method, +3233,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,217,method, +3234,f,tensorflow/tensorflow/python/eager/benchmarks_test.py,395,method, +3235,f,tensorflow/tensorflow/python/eager/benchmarks_test.py,418,method, +3236,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,443,method, +3237,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,451,method, +3238,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,465,method, +3239,defun_matmul,tensorflow/tensorflow/python/eager/benchmarks_test.py,482,method, +3240,outer,tensorflow/tensorflow/python/eager/benchmarks_test.py,492,method, +3241,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,508,method, +3242,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1133,method, +3243,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1144,method, +3244,cache_computation,tensorflow/tensorflow/python/eager/benchmarks_test.py,1150,method, +3245,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1156,method, +3246,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1168,method, +3247,signature_computation,tensorflow/tensorflow/python/eager/benchmarks_test.py,1175,method, +3248,scan,tensorflow/tensorflow/python/eager/benchmarks_test.py,1221,method, +3249,scan,tensorflow/tensorflow/python/eager/benchmarks_test.py,1231,method, +3250,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1240,method, +3251,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1248,method, +3252,cached_func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1257,method, +3253,uncached_func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1260,method, +3254,add_all,tensorflow/tensorflow/python/eager/benchmarks_test.py,1332,method, +3255,benchmark_fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1354,method, +3256,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1392,method, +3257,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1401,method, +3258,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1410,method, +3259,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1419,method, +3260,fn,tensorflow/tensorflow/python/eager/benchmarks_test.py,1432,method, +3261,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,785,method, +3262,compiled_function,tensorflow/tensorflow/python/eager/benchmarks_test.py,798,method, +3263,compiled_function,tensorflow/tensorflow/python/eager/benchmarks_test.py,817,method, +3264,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,837,method, +3265,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1044,method, +3266,func,tensorflow/tensorflow/python/eager/benchmarks_test.py,1082,method, +3267,fn_with_many_reads,tensorflow/tensorflow/python/eager/benchmarks_test.py,1357,method, +3268,fn_with_many_reads_inner,tensorflow/tensorflow/python/eager/benchmarks_test.py,1360,method, +3269,then_branch,tensorflow/tensorflow/python/eager/benchmarks_test.py,1362,method, +3270,else_branch,tensorflow/tensorflow/python/eager/benchmarks_test.py,1365,method, +3271,MicroBenchmarksBase,tensorflow/tensorflow/python/eager/benchmarks_test_base.py,32,class,"Run and report benchmark results. The first run is without any profilng. Second run is with xprof and python trace. Third run is with xprof without python trace. Note: xprof runs are with fewer iterations." -3223,CancellationManager,tensorflow/tensorflow/python/eager/cancellation.py,24,class,A mechanism for cancelling blocking computation. -3224,CancellationTest,tensorflow/tensorflow/python/eager/cancellation_test.py,24,class, -3225,_EagerTensorCache,tensorflow/tensorflow/python/eager/context.py,80,class,Simple cache which evicts items based on length in a FIFO manner. -3226,FunctionCallOptions,tensorflow/tensorflow/python/eager/context.py,106,class,"Options applied at call sites of eager functions. +3272,run_with_xprof,tensorflow/tensorflow/python/eager/benchmarks_test_base.py,40,method, +3273,run_report,tensorflow/tensorflow/python/eager/benchmarks_test_base.py,53,method,Run and report benchmark results. +3274,CancellationManager,tensorflow/tensorflow/python/eager/cancellation.py,24,class,A mechanism for cancelling blocking computation. +3275,is_cancelled,tensorflow/tensorflow/python/eager/cancellation.py,33,method,Returns `True` if `CancellationManager.start_cancel` has been called. +3276,start_cancel,tensorflow/tensorflow/python/eager/cancellation.py,37,method,Cancels blocking operations that have been registered with this object. +3277,get_cancelable_function,tensorflow/tensorflow/python/eager/cancellation.py,41,method, +3278,FunctionCallOptions,tensorflow/tensorflow/python/eager/context.py,106,class,"Options applied at call sites of eager functions. Eager functions are functions decorated with tf.contrib.eager.defun." -3227,_TensorCaches,tensorflow/tensorflow/python/eager/context.py,165,class,Thread local tensor caches. -3228,_ThreadLocalData,tensorflow/tensorflow/python/eager/context.py,188,class,Thread local storage for the eager context. -3229,_ContextSwitchStack,tensorflow/tensorflow/python/eager/context.py,210,class,A thread-local stack of context switches. -3230,LogicalDevice,tensorflow/tensorflow/python/eager/context.py,252,class,"Abstraction for a logical device initialized by the runtime. +3279,executor_type,tensorflow/tensorflow/python/eager/context.py,132,method, +3280,executor_type,tensorflow/tensorflow/python/eager/context.py,136,method, +3281,config_proto_serialized,tensorflow/tensorflow/python/eager/context.py,140,method, +3282,config_proto_serialized,tensorflow/tensorflow/python/eager/context.py,144,method, +3283,LogicalDevice,tensorflow/tensorflow/python/eager/context.py,252,class,"Abstraction for a logical device initialized by the runtime. A `tf.config.LogicalDevice` corresponds to an initialized logical device on a `tf.config.PhysicalDevice` or a remote device visible to the cluster. Tensors @@ -16496,7 +21543,7 @@ Fields: name: The fully qualified name of the device. Can be used for Op or function placement. device_type: String declaring the type of device such as ""CPU"" or ""GPU""." -3231,LogicalDeviceConfiguration,tensorflow/tensorflow/python/eager/context.py,271,class,"Configuration class for a logical devices. +3284,LogicalDeviceConfiguration,tensorflow/tensorflow/python/eager/context.py,271,class,"Configuration class for a logical devices. The class specifies the parameters to configure a `tf.config.PhysicalDevice` as it is initialized to a `tf.config.LogicalDevice` during runtime @@ -16512,7 +21559,7 @@ Fields: Lower values have higher priorities and 0 is the default. Within a physical GPU, the GPU scheduler will prioritize ops on virtual devices with higher priority. Currently only supported for Nvidia GPUs." -3232,PhysicalDevice,tensorflow/tensorflow/python/eager/context.py,298,class,"Abstraction for a locally visible physical device. +3285,PhysicalDevice,tensorflow/tensorflow/python/eager/context.py,298,class,"Abstraction for a locally visible physical device. TensorFlow can utilize various devices such as the CPU or multiple GPUs for computation. Before initializing a local device for use, the user can @@ -16530,24 +21577,289 @@ environment. Fields: name: Unique identifier for device. device_type: String declaring the type of device such as ""CPU"" or ""GPU""." -3233,_AtomicCounter,tensorflow/tensorflow/python/eager/context.py,322,class,A simple atomic counter. -3234,_TensorCacheDeleter,tensorflow/tensorflow/python/eager/context.py,340,class,Deletes tensor caches for a given context. -3235,is_tfrt_enabled,tensorflow/tensorflow/python/eager/context.py,358,function, -3236,Context,tensorflow/tensorflow/python/eager/context.py,370,class,Environment in which eager operations execute. -3237,_EagerDeviceContext,tensorflow/tensorflow/python/eager/context.py,1755,class,Context-manager forcing placement of ops and Tensors on a device. -3238,_set_context_locked,tensorflow/tensorflow/python/eager/context.py,1814,function, -3239,_set_context,tensorflow/tensorflow/python/eager/context.py,1820,function, -3240,_create_context,tensorflow/tensorflow/python/eager/context.py,1825,function, -3241,_reset_context,tensorflow/tensorflow/python/eager/context.py,1832,function,"Clears and re-initializes the singleton context. +3286,is_tfrt_enabled,tensorflow/tensorflow/python/eager/context.py,358,function, +3287,Context,tensorflow/tensorflow/python/eager/context.py,370,class,Environment in which eager operations execute. +3288,ensure_initialized,tensorflow/tensorflow/python/eager/context.py,524,method,Initialize handle and devices if not already done so. +3289,get_server_def,tensorflow/tensorflow/python/eager/context.py,572,method, +3290,set_server_def,tensorflow/tensorflow/python/eager/context.py,575,method,"Allow setting a server_def on the context. -Should only be used for testing." -3242,context,tensorflow/tensorflow/python/eager/context.py,1846,function,Returns a singleton context object. -3243,context_safe,tensorflow/tensorflow/python/eager/context.py,1853,function,Returns current context (or None if one hasn't been initialized). -3244,ensure_initialized,tensorflow/tensorflow/python/eager/context.py,1858,function,Initialize the context. -3245,set_global_seed,tensorflow/tensorflow/python/eager/context.py,1863,function,Sets the eager mode seed. -3246,global_seed,tensorflow/tensorflow/python/eager/context.py,1868,function,Returns the eager mode seed. -3247,internal_operation_seed,tensorflow/tensorflow/python/eager/context.py,1873,function,Returns the operation seed generated based on global seed. -3248,executing_eagerly,tensorflow/tensorflow/python/eager/context.py,1879,function,"Checks whether the current thread has eager execution enabled. +When a server def is replaced, it effectively clears a bunch of caches +within the context. If you attempt to use a tensor object that was pointing +to a tensor on the remote device, it will raise an error. + +Args: + server_def: A tensorflow::ServerDef proto. + Enables execution on remote devices. + keep_alive_secs: Num. seconds after which the remote end will hang up. + As long as the client is still alive, the server state for the context + will be kept alive. If the client is killed (or there is some failure), + the server will clean up its context keep_alive_secs after the final RPC + it receives. + +Raises: + ValueError: if server_def is None." +3291,update_server_def,tensorflow/tensorflow/python/eager/context.py,608,method,"Update a server_def on the context. + +Args: + server_def: A tensorflow::ServerDef proto. Enables execution on remote + devices. + keep_alive_secs: Num. seconds after which the remote end will hang up. As + long as the client is still alive, the server state for the context will + be kept alive. If the client is killed (or there is some failure), the + server will clean up its context keep_alive_secs after the final RPC it + receives. + +Raises: + ValueError: if server_def is None." +3292,check_alive,tensorflow/tensorflow/python/eager/context.py,636,method,"Checks whether a remote worker is alive or not. + +Args: + worker_name: a string representing the remote worker. It must be a fully + specified name like ""/job:worker/replica:0/task:0"". + +Returns: + a boolean indicating whether the remote worker is alive or not. + +Raises: + ValueError: if context is not initialized." +3293,sync_executors,tensorflow/tensorflow/python/eager/context.py,655,method,"Sync both local executors and the ones on remote workers. + +In async execution mode, local function calls can return before the +coresponding remote op/function execution requests are completed. Calling +this method creates a synchronization barrier for remote executors. It only +returns when all remote pending nodes are finished, potentially with errors +if any remote executors are in error state. + +Raises: + ValueError: if context is not initialized." +3294,clear_executor_errors,tensorflow/tensorflow/python/eager/context.py,672,method,"Clear errors in both local executors and remote workers. + +After receiving errors from remote workers, additional requests on the fly +could further taint the status on the remote workers due to the async nature +of remote execution. Calling this method block on waiting for all pending +nodes in remote executors to finish and clear their error statuses. + +Raises: + ValueError: if context is not initialized." +3295,enable_collective_ops,tensorflow/tensorflow/python/eager/context.py,688,method,"Enable distributed collective ops with an appropriate server_def. + +Args: + server_def: A tensorflow::ServerDef proto. Enables execution on remote + devices. + +Raises: + ValueError: if server_def is None. + RuntimeError: if this method is not called at program startup." +3296,configure_collective_ops,tensorflow/tensorflow/python/eager/context.py,716,method,"Configure collective ops. + + Collective group leader is necessary for collective ops to run, other + configurations are mainly for the purpose of performance. + +Args: + collective_leader: a device string for collective leader, e.g. + ""/job:worker/replica:0/task:0""; empty string means local execution of + collective ops. + scoped_allocator_enabled_ops: a tuple or a list of op names for scoped + allocator to run with. + use_nccl_communication: whether to use nccl communication for collective + ops. + device_filters: a tuple or a list of device strings. If set, corresponding + task can only see the devices filtered by these device filters. + +Raises: + RuntimeError: if this method is not called at program startup." +3297,abort_collective_ops,tensorflow/tensorflow/python/eager/context.py,759,method,"Abort the collective ops. + +This is intended to be used when a peer failure is detected, which allows +the user to handle the case instead of hanging. This aborts all on-going +collectives. After all subsequent collectives error immediately. The only +way to recovery now is to restart the program. + +Args: + code: a `tf.errors` error code. + message: a string. The error message." +3298,executing_eagerly,tensorflow/tensorflow/python/eager/context.py,816,method,Returns True if current thread has eager executing enabled. +3299,ones_rank_cache,tensorflow/tensorflow/python/eager/context.py,820,method,Per-device cache for scalars. +3300,zeros_cache,tensorflow/tensorflow/python/eager/context.py,824,method,Per-device cache for scalars. +3301,scope_name,tensorflow/tensorflow/python/eager/context.py,829,method,Returns scope name for the current thread. +3302,scope_name,tensorflow/tensorflow/python/eager/context.py,834,method,Sets scope name for the current thread. +3303,device_name,tensorflow/tensorflow/python/eager/context.py,839,method,Returns the device name for the current thread. +3304,device_spec,tensorflow/tensorflow/python/eager/context.py,844,method,Returns the device spec for the current thread. +3305,device,tensorflow/tensorflow/python/eager/context.py,852,method,"Context-manager to force placement of operations and Tensors on a device. + +Args: + name: Name of the device or None to get default placement. + +Returns: + Context manager that forces device placement. + +Raises: + ValueError: If name is not a string or is an invalid device name. + RuntimeError: If device scopes are not properly nested." +3306,devices,tensorflow/tensorflow/python/eager/context.py,871,method,List of the names of devices available to execute operations. +3307,host_address_space,tensorflow/tensorflow/python/eager/context.py,875,method, +3308,execution_mode,tensorflow/tensorflow/python/eager/context.py,884,method,Gets execution mode for current thread. +3309,execution_mode,tensorflow/tensorflow/python/eager/context.py,889,method,Sets execution mode for current thread. +3310,is_async,tensorflow/tensorflow/python/eager/context.py,910,method, +3311,executor,tensorflow/tensorflow/python/eager/context.py,917,method, +3312,executor,tensorflow/tensorflow/python/eager/context.py,923,method, +3313,config,tensorflow/tensorflow/python/eager/context.py,928,method,Return the ConfigProto with all runtime deltas applied. +3314,function_call_options,tensorflow/tensorflow/python/eager/context.py,1082,method,"Returns function call options for current thread. + +Note that the returned object is still referenced by the eager context. + +Returns: the FunctionCallOptions for current thread." +3315,function_call_options,tensorflow/tensorflow/python/eager/context.py,1101,method,Returns function call options for current thread. +3316,num_gpus,tensorflow/tensorflow/python/eager/context.py,1105,method,The number of GPUs available to execute operations. +3317,add_function,tensorflow/tensorflow/python/eager/context.py,1110,method,"Add a function definition to the context. + +Once added, the function (identified by its name) can be executed like any +other operation. + +Args: + fn: A wrapped TF_Function (returned from TF_GraphToFunction_wrapper)." +3318,add_function_def,tensorflow/tensorflow/python/eager/context.py,1122,method,"Add a function definition to the context. + +Once added, the function (identified by its name) can be executed like any +other operation. + +Args: + fdef: A FunctionDef protocol buffer message." +3319,get_function_def,tensorflow/tensorflow/python/eager/context.py,1136,method,"Get a function definition from the context. + +Args: + name: function signature name. + +Returns: + The requested FunctionDef. + +Raises: + tf.errors.NotFoundError: if name is not the name of a registered function." +3320,register_custom_device,tensorflow/tensorflow/python/eager/context.py,1156,method,Calls TFE_RegisterCustomDevice. See the non-member function. +3321,pack_eager_tensors,tensorflow/tensorflow/python/eager/context.py,1163,method,"Pack multiple `EagerTensor`s of the same dtype and shape. + +Args: + tensors: a list of EagerTensors to pack. + +Returns: + A packed EagerTensor." +3322,remove_function,tensorflow/tensorflow/python/eager/context.py,1179,method,"Remove a function from the context. + +Once removed, the function cannot be executed anymore. + +Args: + name: function signature name." +3323,has_function,tensorflow/tensorflow/python/eager/context.py,1190,method,Check if a function `name` is registered. +3324,add_op_callback,tensorflow/tensorflow/python/eager/context.py,1195,method,"Add a post-op callback to the context. + +A post-op callback is invoked immediately after an eager operation or +function has finished execution or after a op has been added to a graph, +providing access to the op's type, name input and output tensors. Multiple +op callbacks can be added, in which case the callbacks will be invoked in +the order in which they are added. + +Args: + callback: a callable of the signature + `f(op_type, inputs, attrs, outputs, op_name=None, graph=None)`. + See doc strings in `op_callbacks.py` for details on the function + signature and its semantics." +3325,remove_op_callback,tensorflow/tensorflow/python/eager/context.py,1213,method,"Remove an already-registered op callback. + +Args: + callback: The op callback to be removed. + +Raises: + KeyError: If `callback` is not already registered." +3326,op_callbacks,tensorflow/tensorflow/python/eager/context.py,1230,method, +3327,invoking_op_callbacks,tensorflow/tensorflow/python/eager/context.py,1234,method, +3328,invoking_op_callbacks,tensorflow/tensorflow/python/eager/context.py,1238,method, +3329,list_physical_devices,tensorflow/tensorflow/python/eager/context.py,1270,method,"List local devices visible to the system. + +This API allows a client to query the devices before they have been +initialized by the eager runtime. Additionally a user can filter by device +type, to get only CPUs or GPUs. + +Args: + device_type: Optional device type to limit results to + +Returns: + List of PhysicalDevice objects." +3330,get_device_details,tensorflow/tensorflow/python/eager/context.py,1290,method,"Returns details about a physical devices. + +Args: + device: A `tf.config.PhysicalDevice` returned by + `tf.config.list_physical_devices` or `tf.config.get_visible_devices`. + +Returns: + A dict with string keys." +3331,list_logical_devices,tensorflow/tensorflow/python/eager/context.py,1367,method,Return logical devices. +3332,get_visible_devices,tensorflow/tensorflow/python/eager/context.py,1375,method,Get the list of visible devices. +3333,set_visible_devices,tensorflow/tensorflow/python/eager/context.py,1386,method,Set the list of visible devices. +3334,get_memory_growth,tensorflow/tensorflow/python/eager/context.py,1416,method,Get if memory growth is enabled for a PhysicalDevice. +3335,set_memory_growth,tensorflow/tensorflow/python/eager/context.py,1425,method,Set if memory growth should be enabled for a PhysicalDevice. +3336,get_logical_device_configuration,tensorflow/tensorflow/python/eager/context.py,1448,method,Get the virtual device configuration for a PhysicalDevice. +3337,set_logical_device_configuration,tensorflow/tensorflow/python/eager/context.py,1457,method,Set the virtual device configuration for a PhysicalDevice. +3338,enable_mlir_bridge,tensorflow/tensorflow/python/eager/context.py,1491,method, +3339,enable_mlir_graph_optimization,tensorflow/tensorflow/python/eager/context.py,1495,method, +3340,enable_mlir_bridge,tensorflow/tensorflow/python/eager/context.py,1499,method, +3341,enable_mlir_graph_optimization,tensorflow/tensorflow/python/eager/context.py,1504,method, +3342,optimizer_jit,tensorflow/tensorflow/python/eager/context.py,1509,method, +3343,optimizer_jit,tensorflow/tensorflow/python/eager/context.py,1515,method, +3344,get_optimizer_experimental_options,tensorflow/tensorflow/python/eager/context.py,1520,method,"Get experimental options for the optimizer. + +Returns: + Dictionary of current option values" +3345,set_optimizer_experimental_options,tensorflow/tensorflow/python/eager/context.py,1558,method,"Set experimental options for the optimizer. + +Args: + options: Dictionary of options to modify" +3346,intra_op_parallelism_threads,tensorflow/tensorflow/python/eager/context.py,1569,method, +3347,intra_op_parallelism_threads,tensorflow/tensorflow/python/eager/context.py,1573,method, +3348,inter_op_parallelism_threads,tensorflow/tensorflow/python/eager/context.py,1584,method, +3349,inter_op_parallelism_threads,tensorflow/tensorflow/python/eager/context.py,1588,method, +3350,soft_device_placement,tensorflow/tensorflow/python/eager/context.py,1599,method, +3351,soft_device_placement,tensorflow/tensorflow/python/eager/context.py,1603,method, +3352,log_device_placement,tensorflow/tensorflow/python/eager/context.py,1611,method, +3353,log_device_placement,tensorflow/tensorflow/python/eager/context.py,1615,method, +3354,device_policy,tensorflow/tensorflow/python/eager/context.py,1623,method, +3355,device_policy,tensorflow/tensorflow/python/eager/context.py,1631,method, +3356,mirroring_policy,tensorflow/tensorflow/python/eager/context.py,1644,method, +3357,mirroring_policy,tensorflow/tensorflow/python/eager/context.py,1652,method, +3358,lazy_remote_inputs_copy,tensorflow/tensorflow/python/eager/context.py,1665,method, +3359,lazy_remote_inputs_copy,tensorflow/tensorflow/python/eager/context.py,1669,method,Sets whether to copy remote inputs lazily for functions. +3360,use_tfrt,tensorflow/tensorflow/python/eager/context.py,1681,method, +3361,use_tfrt,tensorflow/tensorflow/python/eager/context.py,1685,method,Sets whether to use TFRT. +3362,enable_run_metadata,tensorflow/tensorflow/python/eager/context.py,1695,method,"Enables tracing of op execution via RunMetadata. + +To retrieve the accumulated metadata call context.export_run_metadata() +and to stop tracing call context.disable_run_metadata()." +3363,disable_run_metadata,tensorflow/tensorflow/python/eager/context.py,1704,method,Disables tracing of op execution via RunMetadata. +3364,enable_graph_collection,tensorflow/tensorflow/python/eager/context.py,1710,method,"Enables graph collection of executed functions. + +To retrieve the accumulated graphs call context.export_run_metadata() +and to stop collecting graphs call context.disable_graph_collection()." +3365,disable_graph_collection,tensorflow/tensorflow/python/eager/context.py,1719,method,Disables graph collection of executed functions. +3366,export_run_metadata,tensorflow/tensorflow/python/eager/context.py,1725,method,"Returns a RunMetadata proto with accumulated information. + +The returned protocol buffer contains information since the most recent call +to either enable_run_metadata or export_run_metadata. + +Returns: + A RunMetadata protocol buffer. Or None if not enabled." +3367,context_switches,tensorflow/tensorflow/python/eager/context.py,1744,method,Returns a stack of context switches. +3368,start_step,tensorflow/tensorflow/python/eager/context.py,1748,method, +3369,end_step,tensorflow/tensorflow/python/eager/context.py,1751,method, +3370,rewriter_toggle,tensorflow/tensorflow/python/eager/context.py,959,method, +3371,rewriter_bool,tensorflow/tensorflow/python/eager/context.py,969,method, +3372,rewriter_toggle,tensorflow/tensorflow/python/eager/context.py,1529,method, +3373,rewriter_bool,tensorflow/tensorflow/python/eager/context.py,1534,method, +3374,context,tensorflow/tensorflow/python/eager/context.py,1846,function,Returns a singleton context object. +3375,context_safe,tensorflow/tensorflow/python/eager/context.py,1853,function,Returns current context (or None if one hasn't been initialized). +3376,ensure_initialized,tensorflow/tensorflow/python/eager/context.py,1858,function,Initialize the context. +3377,set_global_seed,tensorflow/tensorflow/python/eager/context.py,1863,function,Sets the eager mode seed. +3378,global_seed,tensorflow/tensorflow/python/eager/context.py,1868,function,Returns the eager mode seed. +3379,internal_operation_seed,tensorflow/tensorflow/python/eager/context.py,1873,function,Returns the operation seed generated based on global seed. +3380,executing_eagerly,tensorflow/tensorflow/python/eager/context.py,1879,function,"Checks whether the current thread has eager execution enabled. Eager execution is enabled by default and this API returns `True` in most of cases. However, this API might return `False` in the following use @@ -16598,7 +21910,7 @@ False Returns: `True` if the current thread has eager execution enabled." -3249,executing_eagerly_v1,tensorflow/tensorflow/python/eager/context.py,1940,function,"Checks whether the current thread has eager execution enabled. +3381,executing_eagerly_v1,tensorflow/tensorflow/python/eager/context.py,1940,function,"Checks whether the current thread has eager execution enabled. Eager execution is typically enabled via `tf.compat.v1.enable_eager_execution`, but may also be enabled within the @@ -16655,8 +21967,8 @@ False Returns: `True` if the current thread has eager execution enabled." -3250,in_eager_mode,tensorflow/tensorflow/python/eager/context.py,2002,function,Use executing_eagerly() instead. This function will be removed. -3251,shared_name,tensorflow/tensorflow/python/eager/context.py,2007,function,"Returns the anonymous shared name GUID if no shared name is specified. +3382,in_eager_mode,tensorflow/tensorflow/python/eager/context.py,2002,function,Use executing_eagerly() instead. This function will be removed. +3383,shared_name,tensorflow/tensorflow/python/eager/context.py,2007,function,"Returns the anonymous shared name GUID if no shared name is specified. In eager mode we need to use a unique shared name to avoid spurious sharing issues. The runtime generates a unique name on our behalf when the reserved @@ -16667,10 +21979,10 @@ Args: Returns: Eager compatible shared name." -3252,graph_mode,tensorflow/tensorflow/python/eager/context.py,2028,function,Context-manager to disable eager execution for the current thread. -3253,eager_mode,tensorflow/tensorflow/python/eager/context.py,2033,function,Context-manager to enable eager execution for the current thread. -3254,scope_name,tensorflow/tensorflow/python/eager/context.py,2038,function,Name of the current scope. -3255,device,tensorflow/tensorflow/python/eager/context.py,2043,function,"Context-manager to force placement of operations and Tensors on a device. +3384,graph_mode,tensorflow/tensorflow/python/eager/context.py,2028,function,Context-manager to disable eager execution for the current thread. +3385,eager_mode,tensorflow/tensorflow/python/eager/context.py,2033,function,Context-manager to enable eager execution for the current thread. +3386,scope_name,tensorflow/tensorflow/python/eager/context.py,2038,function,Name of the current scope. +3387,device,tensorflow/tensorflow/python/eager/context.py,2043,function,"Context-manager to force placement of operations and Tensors on a device. Example: ```python @@ -16688,19 +22000,19 @@ Args: Returns: Context manager for setting the device." -3256,get_log_device_placement,tensorflow/tensorflow/python/eager/context.py,2068,function,"Get if device placements are logged. +3388,get_log_device_placement,tensorflow/tensorflow/python/eager/context.py,2068,function,"Get if device placements are logged. Returns: If device placements are logged." -3257,set_log_device_placement,tensorflow/tensorflow/python/eager/context.py,2078,function,"Set if device placements should be logged. +3389,set_log_device_placement,tensorflow/tensorflow/python/eager/context.py,2078,function,"Set if device placements should be logged. Args: enabled: Whether to enabled device placement logging." -3258,device_policy,tensorflow/tensorflow/python/eager/context.py,2088,function,Context manager for setting device placement policy for current thread. -3259,mirroring_policy,tensorflow/tensorflow/python/eager/context.py,2100,function,Context manager for setting mirroring policy for current thread. -3260,set_execution_mode,tensorflow/tensorflow/python/eager/context.py,2111,function,Sets execution mode for the current thread. -3261,execution_mode,tensorflow/tensorflow/python/eager/context.py,2118,function,Context manager for setting execution mode for current thread. -3262,executor_scope,tensorflow/tensorflow/python/eager/context.py,2136,function,"Context manager for changing executor for current thread. +3390,device_policy,tensorflow/tensorflow/python/eager/context.py,2088,function,Context manager for setting device placement policy for current thread. +3391,mirroring_policy,tensorflow/tensorflow/python/eager/context.py,2100,function,Context manager for setting mirroring policy for current thread. +3392,set_execution_mode,tensorflow/tensorflow/python/eager/context.py,2111,function,Sets execution mode for the current thread. +3393,execution_mode,tensorflow/tensorflow/python/eager/context.py,2118,function,Context manager for setting execution mode for current thread. +3394,executor_scope,tensorflow/tensorflow/python/eager/context.py,2136,function,"Context manager for changing executor for current thread. Args: e: A Executor to execute eager ops under this scope. Setting it to None will @@ -16708,7 +22020,7 @@ Args: Yields: Context manager for setting the executor for current thread." -3263,function_executor_type,tensorflow/tensorflow/python/eager/context.py,2157,function,"Context manager for setting the executor of eager defined functions. +3395,function_executor_type,tensorflow/tensorflow/python/eager/context.py,2157,function,"Context manager for setting the executor of eager defined functions. Eager defined functions are functions decorated by tf.contrib.eager.defun. @@ -16718,29 +22030,29 @@ Args: Yields: Context manager for setting the executor of eager defined functions." -3264,is_async,tensorflow/tensorflow/python/eager/context.py,2178,function,Returns true if current thread is in async mode. -3265,num_gpus,tensorflow/tensorflow/python/eager/context.py,2183,function,"Get the number of available GPU devices. +3396,is_async,tensorflow/tensorflow/python/eager/context.py,2178,function,Returns true if current thread is in async mode. +3397,num_gpus,tensorflow/tensorflow/python/eager/context.py,2183,function,"Get the number of available GPU devices. Returns: The number of available GPU devices." -3266,enable_run_metadata,tensorflow/tensorflow/python/eager/context.py,2192,function,"Enables tracing of op execution via RunMetadata. +3398,enable_run_metadata,tensorflow/tensorflow/python/eager/context.py,2192,function,"Enables tracing of op execution via RunMetadata. To retrieve the accumulated metadata call context.export_run_metadata() and to stop tracing call context.disable_run_metadata()." -3267,disable_run_metadata,tensorflow/tensorflow/python/eager/context.py,2201,function,Disables tracing of op execution via RunMetadata. -3268,enable_graph_collection,tensorflow/tensorflow/python/eager/context.py,2206,function,"Enables graph collection of executed functions. +3399,disable_run_metadata,tensorflow/tensorflow/python/eager/context.py,2201,function,Disables tracing of op execution via RunMetadata. +3400,enable_graph_collection,tensorflow/tensorflow/python/eager/context.py,2206,function,"Enables graph collection of executed functions. To retrieve the accumulated graphs call context.export_run_metadata() and to stop collecting graphs call context.disable_graph_collection()." -3269,disable_graph_collection,tensorflow/tensorflow/python/eager/context.py,2215,function,Disables graph collection of executed functions. -3270,export_run_metadata,tensorflow/tensorflow/python/eager/context.py,2220,function,"Returns a RunMetadata proto with accumulated information. +3401,disable_graph_collection,tensorflow/tensorflow/python/eager/context.py,2215,function,Disables graph collection of executed functions. +3402,export_run_metadata,tensorflow/tensorflow/python/eager/context.py,2220,function,"Returns a RunMetadata proto with accumulated information. The returned protocol buffer contains information since the most recent call to either enable_run_metadata or export_run_metadata. Returns: A RunMetadata protocol buffer." -3271,collect_graphs,tensorflow/tensorflow/python/eager/context.py,2233,function,"Collects a flat list of pre- or post-optimization graphs. +3403,collect_graphs,tensorflow/tensorflow/python/eager/context.py,2233,function,"Collects a flat list of pre- or post-optimization graphs. The collected graphs include device placements, which can be useful for testing. @@ -16763,11 +22075,11 @@ Args: optimized: whether to collect optimized graphs or non-optimized graphs Yields: A list of GraphDefs, populated when the context manager exits." -3272,get_server_def,tensorflow/tensorflow/python/eager/context.py,2273,function, -3273,set_server_def,tensorflow/tensorflow/python/eager/context.py,2277,function, -3274,update_server_def,tensorflow/tensorflow/python/eager/context.py,2281,function, -3275,check_alive,tensorflow/tensorflow/python/eager/context.py,2285,function, -3276,async_scope,tensorflow/tensorflow/python/eager/context.py,2291,function,"Context manager for grouping async operations. +3404,get_server_def,tensorflow/tensorflow/python/eager/context.py,2273,function, +3405,set_server_def,tensorflow/tensorflow/python/eager/context.py,2277,function, +3406,update_server_def,tensorflow/tensorflow/python/eager/context.py,2281,function, +3407,check_alive,tensorflow/tensorflow/python/eager/context.py,2285,function, +3408,async_scope,tensorflow/tensorflow/python/eager/context.py,2291,function,"Context manager for grouping async operations. Ops/function calls inside the scope can return before finishing the actual execution. When exiting the async scope, a synchronization barrier will be @@ -16793,14 +22105,14 @@ logging.info('loss =', loss.numpy()) Yields: Context manager for grouping async operations." -3277,async_wait,tensorflow/tensorflow/python/eager/context.py,2337,function,"Sync all async operations and raise any errors during execution. +3409,async_wait,tensorflow/tensorflow/python/eager/context.py,2337,function,"Sync all async operations and raise any errors during execution. In async execution mode, an op/function call can return before finishing the actual execution. Calling this method creates a synchronization barrier for all async op and function execution. It only returns when all pending nodes are finished, potentially raising exceptions if async execution results in an error state." -3278,async_clear_error,tensorflow/tensorflow/python/eager/context.py,2350,function,"Clear pending operations and error statuses in async execution. +3410,async_clear_error,tensorflow/tensorflow/python/eager/context.py,2350,function,"Clear pending operations and error statuses in async execution. In async execution mode, an error in op/function execution can lead to errors in subsequent ops/functions that are scheduled but not yet executed. Calling @@ -16818,10 +22130,10 @@ while True: break logging.info('loss =', loss.numpy()) ```" -3279,add_function,tensorflow/tensorflow/python/eager/context.py,2373,function,Add a function definition to the context. -3280,remove_function,tensorflow/tensorflow/python/eager/context.py,2378,function,Remove a function from the context. -3281,get_function_def,tensorflow/tensorflow/python/eager/context.py,2383,function, -3282,register_custom_device,tensorflow/tensorflow/python/eager/context.py,2387,function,"Calls TFE_RegisterCustomDevice to register a custom device with Python. +3411,add_function,tensorflow/tensorflow/python/eager/context.py,2373,function,Add a function definition to the context. +3412,remove_function,tensorflow/tensorflow/python/eager/context.py,2378,function,Remove a function from the context. +3413,get_function_def,tensorflow/tensorflow/python/eager/context.py,2383,function, +3414,register_custom_device,tensorflow/tensorflow/python/eager/context.py,2387,function,"Calls TFE_RegisterCustomDevice to register a custom device with Python. Enables using C extensions specifying a custom device from Python. See the experimental eager C API in tensorflow/c/eager/c_api_experimental.h for @@ -16841,40 +22153,20 @@ Args: struct with the initial state of the custom device (the void* device_info argument to TFE_RegisterCustomDevice). This method takes ownership of the memory and clears the capsule destructor." -3283,_tmp_in_graph_mode,tensorflow/tensorflow/python/eager/context.py,2417,function, -3284,ContextTest,tensorflow/tensorflow/python/eager/context_test.py,32,class, -3285,_status_to_exception,tensorflow/tensorflow/python/eager/core.py,28,function, -3286,_NotOkStatusException,tensorflow/tensorflow/python/eager/core.py,36,class,Exception class to handle not ok Status. -3287,_FallbackException,tensorflow/tensorflow/python/eager/core.py,52,class,"Exception class to handle fallback from the fastpath. - -The fastpath that we refer to here is the one implemented to reduce per-op -overheads (TFE_Py_FastPathExecute_C). If the conditions for executing the op -on the fastpath are not met, we fallback to a safer (and more complete) -slowpath, and this Exception is raised to signal that transition." -3288,_SymbolicException,tensorflow/tensorflow/python/eager/core.py,63,class,"Exception class to handle use of symbolic tensors when executing eagerly. - -`keras.Input()` creates symbolic tensors (in a FuncGraph managed by the -Keras backend) while in eager execution. This exception is used to -identify this case (raised in `convert_to_tensor` cause generated functions -for ops to construct graphs instead of executing the kernel)." -3289,execute,tensorflow/tensorflow/python/eager/core_test.py,51,function, -3290,truncated_normal,tensorflow/tensorflow/python/eager/core_test.py,56,function, -3291,current_device,tensorflow/tensorflow/python/eager/core_test.py,65,function, -3292,configure_virtual_cpus,tensorflow/tensorflow/python/eager/core_test.py,69,function, -3293,TFETest,tensorflow/tensorflow/python/eager/core_test.py,78,class, -3294,SendRecvTest,tensorflow/tensorflow/python/eager/core_test.py,1037,class, -3295,EagerTensorCacheTest,tensorflow/tensorflow/python/eager/core_test.py,1098,class, -3296,CustomDeviceTest,tensorflow/tensorflow/python/eager/custom_device_test.py,28,class, -3297,_CallCounter,tensorflow/tensorflow/python/eager/def_function.py,54,class,Class keeping track of how many recent calls triggered tracing. -3298,_FrequentTracingDetector,tensorflow/tensorflow/python/eager/def_function.py,86,class,Class for frequent retracing detection and warning. -3299,UnliftedInitializerVariable,tensorflow/tensorflow/python/eager/def_function.py,130,class,"Variable which does not lift its initializer out of function context. +3415,execute,tensorflow/tensorflow/python/eager/core_test.py,51,function, +3416,truncated_normal,tensorflow/tensorflow/python/eager/core_test.py,56,function, +3417,current_device,tensorflow/tensorflow/python/eager/core_test.py,65,function, +3418,configure_virtual_cpus,tensorflow/tensorflow/python/eager/core_test.py,69,function, +3419,UnliftedInitializerVariable,tensorflow/tensorflow/python/eager/def_function.py,130,class,"Variable which does not lift its initializer out of function context. Instances of this variable, when created, build a graph which runs their initializer inside a tf.cond(is_initialized) block. This can only be created inside a defun called from (eventually) eager mode. That is, non-function-building graphs are not supported." -3300,experimental_run_functions_eagerly,tensorflow/tensorflow/python/eager/def_function.py,318,function,"Enables / disables eager execution of `tf.function`s. +3420,assign_fn,tensorflow/tensorflow/python/eager/def_function.py,287,method, +3421,not_assign_fn,tensorflow/tensorflow/python/eager/def_function.py,295,method, +3422,experimental_run_functions_eagerly,tensorflow/tensorflow/python/eager/def_function.py,318,function,"Enables / disables eager execution of `tf.function`s. Calling `tf.config.experimental_run_functions_eagerly(True)` will make all invocations of `tf.function` run eagerly instead of running as a traced graph @@ -16918,7 +22210,7 @@ executed as a compiled Tensorflow Graph. Args: run_eagerly: Boolean. Whether to run functions eagerly." -3301,run_functions_eagerly,tensorflow/tensorflow/python/eager/def_function.py,368,function,"Enables / disables eager execution of `tf.function`s. +3423,run_functions_eagerly,tensorflow/tensorflow/python/eager/def_function.py,368,function,"Enables / disables eager execution of `tf.function`s. Calling `tf.config.run_functions_eagerly(True)` will make all invocations of `tf.function` run eagerly instead of running as a traced graph @@ -16962,16 +22254,120 @@ executed as a compiled Tensorflow Graph. Args: run_eagerly: Boolean. Whether to run functions eagerly." -3302,experimental_functions_run_eagerly,tensorflow/tensorflow/python/eager/def_function.py,422,function,Returns the value of the `experimental_run_functions_eagerly` setting. -3303,functions_run_eagerly,tensorflow/tensorflow/python/eager/def_function.py,428,function,Returns the value of the `run_functions_eagerly` setting. -3304,FunctionDeleter,tensorflow/tensorflow/python/eager/def_function.py,433,class, -3305,Function,tensorflow/tensorflow/python/eager/def_function.py,448,class,"Wrapper class for the graph functions defined for a Python function. +3424,experimental_functions_run_eagerly,tensorflow/tensorflow/python/eager/def_function.py,422,function,Returns the value of the `experimental_run_functions_eagerly` setting. +3425,functions_run_eagerly,tensorflow/tensorflow/python/eager/def_function.py,428,function,Returns the value of the `run_functions_eagerly` setting. +3426,FunctionDeleter,tensorflow/tensorflow/python/eager/def_function.py,433,class, +3427,Function,tensorflow/tensorflow/python/eager/def_function.py,448,class,"Wrapper class for the graph functions defined for a Python function. See the documentation for `tf.function` for more information on the semantics of defined functions. `Function` is thread-compatible." -3306,function,tensorflow/tensorflow/python/eager/def_function.py,1216,function,"Compiles a function into a callable TensorFlow graph. +3428,python_function,tensorflow/tensorflow/python/eager/def_function.py,923,method,The python function wrapped in this tf.function. +3429,input_signature,tensorflow/tensorflow/python/eager/def_function.py,928,method, +3430,function_spec,tensorflow/tensorflow/python/eager/def_function.py,932,method, +3431,pretty_printed_concrete_signatures,tensorflow/tensorflow/python/eager/def_function.py,935,method, +3432,get_initialization_function,tensorflow/tensorflow/python/eager/def_function.py,983,method,"Returns a `ConcreteFunction` which initializes this function's variables. + +Requires that this function hasn't been accessed yet through either calling +it or calling get_concrete_function. Fails if we cannot build an initializer +function which does not depend on the concrete values of the inputs to this +function. + +Note that running this function will overwrite any values currently assigned +to variables, for example restores from a checkpoint. + +Args: + *args: arguments to the underlying python callable. + **kwargs: keyword arguments to the python callable. + +Returns: + A `ConcreteFunction` object which initializes the variables of this + function. + +Raises: + RuntimeError: if called after the variables have been initialized." +3433,get_concrete_function,tensorflow/tensorflow/python/eager/def_function.py,1107,method,"Returns a `ConcreteFunction` specialized to inputs and execution context. + +If this `Function` was created with an `input_signature`, `args` and +`kwargs` may be omitted. With an input signature there is only one +concrete function associated with this `Function`. + +If there is no fixed `input_signature` associated with this +`Function`, positional and keyword arguments to `get_concrete_function` +follow the same rules as input signature specification, with `tf.TensorSpec` +objects describing `tf.Tensor`s which will be passed to the concrete +function. + +Each `tf.Tensor` argument to the concrete function must have a unique name, +either because it is the only one associated with a named argument of the +Python function or because an explicit `name=` was passed to its +`tf.TensorSpec` object. These names become the argument names for the +concrete function. + +Arguments to the concrete function may always be specified as keyword +arguments, naming the Tensor input. Positional arguments may be used instead +when each preceding argument to the Python function is a Tensor. + +```python +@tf.function +def f(x): + return x + +f_concrete = f.get_concrete_function(tf.TensorSpec([], tf.float64)) +f_concrete(tf.constant(1.)) +f_concrete(x=tf.constant(1.)) +``` + +Nested structures containing Tensors may be specified when retrieving +concrete functions. Structures with multiple Tensors are expanded into +multiple arguments of the concrete function. Since multiple concrete +function arguments are associated with one argument to the original +function, these Tensors must be named explicitly. Tensors in nested +structures may not be passed using positional arguments when calling the +concrete function. + +```python +f_concrete2 = f.get_concrete_function( + (tf.TensorSpec(None, tf.float64, name=""first""), + tf.TensorSpec([], tf.float32, name=""second""))) +# Keyword arguments are required when identifying Tensors in nested +# structures. +f_concrete2(first=tf.constant([1.]), second=tf.constant(0.)) +``` + +Functions with fixed input signatures have only one concrete function +associated with them, which can be retrieved without specifying any +arguments. As before Tensors must have unique names, either inferred from +the argument names in the original Python function or specified +explicitly. + +```python +@tf.function(input_signature=(tf.TensorSpec(None, tf.float32))) +def f_sig(y): + return y + +f_sig_concrete = f.get_concrete_function() +f_sig_concrete(tf.constant(1.)) +f_sig_concrete(y=tf.constant(1.)) +``` + +Args: + *args: inputs to specialize on. + **kwargs: inputs to specialize on. + +Returns: + A TensorFlow function which takes exactly one `tf.Tensor` per argument. + +Raises: + ValueError: if this object has not yet been called on concrete values." +3434,wrapped_fn,tensorflow/tensorflow/python/eager/def_function.py,597,method,Wraps `self._python_function` in a variable creator scope. +3435,variable_capturing_scope,tensorflow/tensorflow/python/eager/def_function.py,696,method,Creates UnliftedInitializerVariables and saves references to them. +3436,invalid_creator_scope,tensorflow/tensorflow/python/eager/def_function.py,714,method,Disables variable creation. +3437,fn_with_cond,tensorflow/tensorflow/python/eager/def_function.py,864,method,Conditionally runs initialization if it's needed. +3438,initialize_variables,tensorflow/tensorflow/python/eager/def_function.py,952,method, +3439,initialize_variables,tensorflow/tensorflow/python/eager/def_function.py,1017,method, +3440,function,tensorflow/tensorflow/python/eager/def_function.py,1216,function,"Compiles a function into a callable TensorFlow graph. `tf.function` constructs a callable that executes a TensorFlow graph (`tf.Graph`) created by trace-compiling the TensorFlow operations in `func`, @@ -17214,19 +22610,8 @@ Returns: Raises: ValueError when attempting to use experimental_compile, but XLA support is not enabled." -3307,undecorated_function,tensorflow/tensorflow/python/eager/def_function_test.py,52,function, -3308,_HasDecoratedMethod,tensorflow/tensorflow/python/eager/def_function_test.py,56,class, -3309,DefFunctionTest,tensorflow/tensorflow/python/eager/def_function_test.py,63,class, -3310,DefFunctionCpuOnlyTest,tensorflow/tensorflow/python/eager/def_function_test_cpu_only.py,29,class,"Test that experimental_compile=True correctly throws an exception if XLA is not available. - -This test should only be run without `--config=cuda`, as that implicitly links -in XLA JIT." -3311,DefFunctionTest,tensorflow/tensorflow/python/eager/def_function_xla_jit_test.py,39,class, -3312,DefFunctionTests,tensorflow/tensorflow/python/eager/def_function_xla_test.py,27,class, -3313,SoftDevicePlacementTest,tensorflow/tensorflow/python/eager/device_placement_test.py,36,class, -3314,HardDevicePlacementTest,tensorflow/tensorflow/python/eager/device_placement_test.py,113,class, -3315,ClusterPlacementTest,tensorflow/tensorflow/python/eager/device_placement_test.py,151,class, -3316,quick_execute,tensorflow/tensorflow/python/eager/execute.py,33,function,"Execute a TensorFlow operation. +3441,undecorated_function,tensorflow/tensorflow/python/eager/def_function_test.py,52,function, +3442,quick_execute,tensorflow/tensorflow/python/eager/execute.py,33,function,"Execute a TensorFlow operation. Args: op_name: Name of the TensorFlow operation (see REGISTER_OP in C++ code) to @@ -17246,7 +22631,7 @@ Returns: Raises: An exception on error." -3317,execute_with_cancellation,tensorflow/tensorflow/python/eager/execute.py,80,function,"Execute a TensorFlow operation. +3443,execute_with_cancellation,tensorflow/tensorflow/python/eager/execute.py,80,function,"Execute a TensorFlow operation. Args: op_name: Name of the TensorFlow operation (see REGISTER_OP in C++ code) to @@ -17267,20 +22652,20 @@ Returns: Raises: An exception on error." -3318,execute_with_callbacks,tensorflow/tensorflow/python/eager/execute.py,136,function,Monkey-patch to execute to enable execution callbacks. -3319,must_record_gradient,tensorflow/tensorflow/python/eager/execute.py,148,function,Import backprop if you want gradients recorded. -3320,record_gradient,tensorflow/tensorflow/python/eager/execute.py,153,function,Import backprop if you want gradients recorded. -3321,make_float,tensorflow/tensorflow/python/eager/execute.py,159,function, -3322,make_int,tensorflow/tensorflow/python/eager/execute.py,166,function, -3323,make_str,tensorflow/tensorflow/python/eager/execute.py,177,function, -3324,make_bool,tensorflow/tensorflow/python/eager/execute.py,184,function, -3325,make_type,tensorflow/tensorflow/python/eager/execute.py,191,function, -3326,make_shape,tensorflow/tensorflow/python/eager/execute.py,201,function,Convert v into a list. -3327,make_tensor,tensorflow/tensorflow/python/eager/execute.py,223,function,Ensure v is a TensorProto. -3328,args_to_matching_eager,tensorflow/tensorflow/python/eager/execute.py,236,function,Convert sequence `l` to eager same-type Tensors. -3329,convert_to_mixed_eager_tensors,tensorflow/tensorflow/python/eager/execute.py,294,function, -3330,args_to_mixed_eager_tensors,tensorflow/tensorflow/python/eager/execute.py,300,function,Converts a list of same-length lists of values to eager tensors. -3331,Executor,tensorflow/tensorflow/python/eager/executor.py,24,class,"A class for handling eager execution. +3444,execute_with_callbacks,tensorflow/tensorflow/python/eager/execute.py,136,function,Monkey-patch to execute to enable execution callbacks. +3445,must_record_gradient,tensorflow/tensorflow/python/eager/execute.py,148,function,Import backprop if you want gradients recorded. +3446,record_gradient,tensorflow/tensorflow/python/eager/execute.py,153,function,Import backprop if you want gradients recorded. +3447,make_float,tensorflow/tensorflow/python/eager/execute.py,159,function, +3448,make_int,tensorflow/tensorflow/python/eager/execute.py,166,function, +3449,make_str,tensorflow/tensorflow/python/eager/execute.py,177,function, +3450,make_bool,tensorflow/tensorflow/python/eager/execute.py,184,function, +3451,make_type,tensorflow/tensorflow/python/eager/execute.py,191,function, +3452,make_shape,tensorflow/tensorflow/python/eager/execute.py,201,function,Convert v into a list. +3453,make_tensor,tensorflow/tensorflow/python/eager/execute.py,223,function,Ensure v is a TensorProto. +3454,args_to_matching_eager,tensorflow/tensorflow/python/eager/execute.py,236,function,Convert sequence `l` to eager same-type Tensors. +3455,convert_to_mixed_eager_tensors,tensorflow/tensorflow/python/eager/execute.py,294,function, +3456,args_to_mixed_eager_tensors,tensorflow/tensorflow/python/eager/execute.py,300,function,Converts a list of same-length lists of values to eager tensors. +3457,Executor,tensorflow/tensorflow/python/eager/executor.py,24,class,"A class for handling eager execution. The default behavior for asynchronous execution is to serialize all ops on a single thread. Having different `Executor` objects in different threads @@ -17296,45 +22681,12 @@ a.start() b = threading.Thread(target=thread_function) b.start() ```" -3332,new_executor,tensorflow/tensorflow/python/eager/executor.py,76,function, -3333,_identity_jvp,tensorflow/tensorflow/python/eager/forwardprop.py,46,function, -3334,_read_variable_jvp,tensorflow/tensorflow/python/eager/forwardprop.py,57,function, -3335,_jvp_helper,tensorflow/tensorflow/python/eager/forwardprop.py,73,function,"Computes a Jacobian-vector product for an op. - -Note that this function would be wasteful if executed eagerly. It runs the -backward gradient function and throws away the result just to record its -operations on a GradientTape. These unused ops are pruned away when this -function is traced. - -Args: - op_name: A string, the type of operation being executed. - attr_tuple: Attributes of the operation. - inputs: A flat list of input Tensors to the operation. - outputs: A flat list of output Tensors from the operation. - tangents: A flat list of Tensors, same shape as `inputs`. - -Returns: - A flat list of tangents corresponding to `outputs`." -3336,_jvp_helper_wrapper,tensorflow/tensorflow/python/eager/forwardprop.py,145,function,"Computes a batch of Jacobian-vector product for an op. - -Args: - op_name: A string, the type of operation being executed. - attr_tuple: Attributes of the operation. - inputs: A flat list of input Tensors to the operation. - outputs: A flat list of output Tensors from the operation. - tangents: A flat list of Tensors, compatible with shape `[None] + - input_shape`. - use_batch: A bool, True to vetorize over batch of tangents of shape `[None] - + input_shape`. - -Returns: - A flat list of tangents compatible with `outputs` - or `[None] + output_shape`. - -Raises: - ValueError: if tangent shapes are not compatible with input shapes." -3337,_jvp_dispatch,tensorflow/tensorflow/python/eager/forwardprop.py,201,function,Determine which forwardprop function to call. -3338,ForwardAccumulator,tensorflow/tensorflow/python/eager/forwardprop.py,221,class,"Computes Jacobian-vector products (""JVP""s) using forward-mode autodiff. +3458,is_async,tensorflow/tensorflow/python/eager/executor.py,61,method, +3459,handle,tensorflow/tensorflow/python/eager/executor.py,64,method, +3460,wait,tensorflow/tensorflow/python/eager/executor.py,67,method,Waits for ops dispatched in this executor to finish. +3461,clear_error,tensorflow/tensorflow/python/eager/executor.py,71,method,Clears errors raised in this executor during execution. +3462,new_executor,tensorflow/tensorflow/python/eager/executor.py,76,function, +3463,ForwardAccumulator,tensorflow/tensorflow/python/eager/forwardprop.py,221,class,"Computes Jacobian-vector products (""JVP""s) using forward-mode autodiff. Compare to `tf.GradientTape` which computes vector-Jacobian products (""VJP""s) using reverse-mode autodiff (backprop). Reverse mode is more attractive when @@ -17439,40 +22791,24 @@ JVPs: >>> acc.jvp(backward) # forward-over-backward Hessian-vector product " -3339,_jvp,tensorflow/tensorflow/python/eager/forwardprop_test.py,62,function,Compute the jacobian of `f` at `primals` multiplied by `tangents`. -3340,_jacfwd,tensorflow/tensorflow/python/eager/forwardprop_test.py,70,function,Compute the jacobian of `f` at `primals` using forward-mode autodiff. -3341,_jvp_batch,tensorflow/tensorflow/python/eager/forwardprop_test.py,93,function, -3342,_jvp_batch_matmul,tensorflow/tensorflow/python/eager/forwardprop_test.py,100,function,Compute the jacobian of `f` at `primals` multiplied by `tangents`. -3343,_grad,tensorflow/tensorflow/python/eager/forwardprop_test.py,113,function,Return a function which computes the gradient of `f`. -3344,_gradfwd,tensorflow/tensorflow/python/eager/forwardprop_test.py,128,function,Return a function which computes the gradient of `f` in forward mode. -3345,_hvp,tensorflow/tensorflow/python/eager/forwardprop_test.py,144,function,Compute a forward-over-back Hessian-vector product. -3346,_vectorize_parameters,tensorflow/tensorflow/python/eager/forwardprop_test.py,154,function,"Loop over `params`, providing a one-hot mask to `f` for each." -3347,_forward_over_back_hessian,tensorflow/tensorflow/python/eager/forwardprop_test.py,172,function,"Computes the full Hessian matrix for the scalar-valued f(*params). +3464,jvp,tensorflow/tensorflow/python/eager/forwardprop.py,411,method,"Fetches the Jacobian-vector product computed for `primals`. + +Note that this method performs no computation, and simply looks up a JVP +that was already computed (unlike backprop using a `tf.GradientTape`, where +the computation happens on the call to `tape.gradient`). Args: - f: A function taking `params` and returning a scalar. - params: A possibly nested structure of tensors. - use_pfor: If true, uses `tf.vectorized_map` calls instead of looping. - dtype: Required if `use_pfor=False`. A possibly nested structure of dtypes - (e.g. `tf.float32`) matching the structure of `f`'s returns. + primals: A watched Tensor or structure of Tensors to fetch the JVPs for. + unconnected_gradients: A value which can either hold 'none' or 'zero' and + alters the value which will be returned if no JVP was computed for + `primals`. The possible values and effects are detailed in + 'tf.UnconnectedGradients' and it defaults to 'none'. Returns: - A possibly nested structure of matrix slices corresponding to `params`. Each - slice has shape [P, p_s] where `p_s` is the number of parameters (`tf.size`) - in the corresponding element of `params` and `P` is the total number of - parameters (`sum_s(p_s)`). The full matrix can be obtained by concatenating - along the second axis." -3348,_test_gradients,tensorflow/tensorflow/python/eager/forwardprop_test.py,194,function,"Tests forward/backward jacobians of `f`'s [0, `order`)-order gradients." -3349,ForwardpropTest,tensorflow/tensorflow/python/eager/forwardprop_test.py,223,class, -3350,_has_loop,tensorflow/tensorflow/python/eager/forwardprop_test.py,918,function, -3351,_has_cond,tensorflow/tensorflow/python/eager/forwardprop_test.py,926,function, -3352,_fprop_while,tensorflow/tensorflow/python/eager/forwardprop_test.py,935,function, -3353,_fprop_cond,tensorflow/tensorflow/python/eager/forwardprop_test.py,944,function, -3354,ControlFlowTests,tensorflow/tensorflow/python/eager/forwardprop_test.py,953,class, -3355,HessianTests,tensorflow/tensorflow/python/eager/forwardprop_test.py,984,class, -3356,JacobianTests,tensorflow/tensorflow/python/eager/forwardprop_test.py,1012,class, -3357,TangentInfo,tensorflow/tensorflow/python/eager/forwardprop_util.py,30,class,Packed forward accumulator state. The return value of `pack_tangents`. -3358,pack_tangents,tensorflow/tensorflow/python/eager/forwardprop_util.py,42,function,"Packs forward accumulator state into a TangentInfo tuple. + Tensors with the same shapes and dtypes as `primals`, or None if no JVP + is available." +3465,TangentInfo,tensorflow/tensorflow/python/eager/forwardprop_util.py,30,class,Packed forward accumulator state. The return value of `pack_tangents`. +3466,pack_tangents,tensorflow/tensorflow/python/eager/forwardprop_util.py,42,function,"Packs forward accumulator state into a TangentInfo tuple. Args: tensors: A flat list of Tensors to pack forward accumulator state for. @@ -17485,7 +22821,7 @@ Returns: array. tangents: A flat list of Tensors. Best interpreted as a sequence to be appended to `tensors`." -3359,push_forwardprop_state,tensorflow/tensorflow/python/eager/forwardprop_util.py,61,function,"Temporarily push or pop transient state for accumulators in the active set. +3467,push_forwardprop_state,tensorflow/tensorflow/python/eager/forwardprop_util.py,61,function,"Temporarily push or pop transient state for accumulators in the active set. Allows an accumulator which is currently processing an operation to temporarily reset its state. This is useful when building forwardprop versions @@ -17496,35 +22832,9 @@ own jvp computations. Yields: None (used for its side effect)." -3360,_make_input_signature_hashable,tensorflow/tensorflow/python/eager/function.py,97,function,"Rewrite input signature to be hashable. - -We replace nested variables in the input signature with TensorSpec in order to -be hashable. - -Args: - elem: Input signature element - -Returns: - A hashable object for the requested input signature" -3361,_type_spec_for,tensorflow/tensorflow/python/eager/function.py,160,function,"Returns a TypeSpec for `x`, or `None` if `x` doesn't have a TensorSpec." -3362,_is_type_subset,tensorflow/tensorflow/python/eager/function.py,172,function,Returns true if TypeSpec `b` is a subset of type `a` (or if a is None.) -3363,_shape_relaxed_type_for_composite_tensor,tensorflow/tensorflow/python/eager/function.py,180,function,Returns a shape-relaxed TypeSpec for x (if composite) or x (if not). -3364,common_shape,tensorflow/tensorflow/python/eager/function.py,189,function,Find a `TensorShape` that is compatible with both `x` and `y`. -3365,is_same_structure,tensorflow/tensorflow/python/eager/function.py,214,function,"Check two structures for equality, optionally of types and of values." -3366,_parse_func_attrs,tensorflow/tensorflow/python/eager/function.py,232,function,"Convert the keyword arguments into function_def attributes. - -Currently only support primitive types: bool, int, float and string. - -Args: - attributes: the dictionary of attributes. -Returns: - A dict of attributes where the key is the name of attribute and the value - is the AttrValue proto. -Raises: - ValueError: If the kwargs contains unallowlisted name or unsupported value - types." -3367,_InterpolateFunctionError,tensorflow/tensorflow/python/eager/function.py,265,class,Context Manager that interpolates the exception from 'top_level_func'. -3368,add_function_callback,tensorflow/tensorflow/python/eager/function.py,309,function,"Add a callback function for Function creation. +3468,common_shape,tensorflow/tensorflow/python/eager/function.py,189,function,Find a `TensorShape` that is compatible with both `x` and `y`. +3469,is_same_structure,tensorflow/tensorflow/python/eager/function.py,214,function,"Check two structures for equality, optionally of types and of values." +3470,add_function_callback,tensorflow/tensorflow/python/eager/function.py,309,function,"Add a callback function for Function creation. The callback function has the signature: @@ -17540,51 +22850,119 @@ After a callback is added, it can be removed with the Args: function_callback: The callback to add." -3369,remove_function_callback,tensorflow/tensorflow/python/eager/function.py,330,function,"Remove an already-added function callback. +3471,remove_function_callback,tensorflow/tensorflow/python/eager/function.py,330,function,"Remove an already-added function callback. See the doc string of `add_function_callback()` for more information. Args: function_callback: The callback to remove." -3370,clear_function_callbacks,tensorflow/tensorflow/python/eager/function.py,341,function,"Clear all function callbacks, if any have been regisered." -3371,_forward_name,tensorflow/tensorflow/python/eager/function.py,351,function,The name of a generated forward defun named n. -3372,_backward_name,tensorflow/tensorflow/python/eager/function.py,356,function,The name of a generated backward defun named n. -3373,_inference_name,tensorflow/tensorflow/python/eager/function.py,361,function,The name of a forward-but-no-gradient defun named n. -3374,_enclosing_xla_context,tensorflow/tensorflow/python/eager/function.py,366,function,"Returns the XLAControlFlowContext, which exists inside a tpu.rewrite()." -3375,_EagerDefinedFunctionDeleter,tensorflow/tensorflow/python/eager/function.py,383,class,Unregister function from eager context. -3376,_EagerDefinedFunction,tensorflow/tensorflow/python/eager/function.py,410,class,"Callable with the interface of `framework.function._DefinedFunction`. - -`_EagerDefinedFunction` encapsulates a function definition and its properties, -and it provides a method for calling the encapsulated function. Some Ops -take functions as attributes, which have type `func`; an instance of this -class may be provided as the value of these `func` attributes." -3377,_DelayedRewriteGradientFunctions,tensorflow/tensorflow/python/eager/function.py,601,class,Caches forward/backward functions with a delayed forward rewrite. -3378,_TapeGradientFunctions,tensorflow/tensorflow/python/eager/function.py,843,class,"Caches forward and backward functions compatible with eager gradients. - -In contrast to the delayed-rewrite approach in -`_DelayedRewriteGradientFunctions` which only works with delayed execution, -the forward function generated by this class has a fixed set of outputs which -may be preserved by a tape in order to compute gradients later. - -This class is abstract; its child classes differ in how many side outputs of -the forward function their backward function accepts gradients for, which -determines whether higher-order tape gradients are possible." -3379,_FirstOrderTapeGradientFunctions,tensorflow/tensorflow/python/eager/function.py,1309,class,Caches tape-friendly functions for first-order gradients. -3380,_HigherOrderTapeGradientFunctions,tensorflow/tensorflow/python/eager/function.py,1351,class,Caches tape-friendly functions for higher-order gradients. -3381,_ForwardBackwardCall,tensorflow/tensorflow/python/eager/function.py,1417,class,Holds the state of a function call between execution and recording. -3382,ConcreteFunction,tensorflow/tensorflow/python/eager/function.py,1464,class,"Callable object encapsulating a function definition and its gradient. +3472,clear_function_callbacks,tensorflow/tensorflow/python/eager/function.py,341,function,"Clear all function callbacks, if any have been regisered." +3473,ConcreteFunction,tensorflow/tensorflow/python/eager/function.py,1464,class,"Callable object encapsulating a function definition and its gradient. `ConcreteFunction` is a callable that encapsulates a function definition and is differentiable under `tf.GradientTape` objects." -3383,_deterministic_dict_values,tensorflow/tensorflow/python/eager/function.py,2319,function, -3384,FunctionSpec,tensorflow/tensorflow/python/eager/function.py,2323,class,Specification of how to bind arguments to a function. -3385,_as_ndarray,tensorflow/tensorflow/python/eager/function.py,2704,function,"Converts value to an ndarray, assumes _is_ndarray(value)." -3386,_is_ndarray,tensorflow/tensorflow/python/eager/function.py,2710,function,Tests whether the given value is an ndarray (and not a TF tensor/var). -3387,_convert_numpy_inputs,tensorflow/tensorflow/python/eager/function.py,2724,function,Convert numpy array inputs to tensors. -3388,_convert_inputs_to_signature,tensorflow/tensorflow/python/eager/function.py,2750,function,Convert inputs to pass into a function with an explicit signature. -3389,FunctionCache,tensorflow/tensorflow/python/eager/function.py,2802,class,"A lightweight container for cached functions. +3474,variables,tensorflow/tensorflow/python/eager/function.py,1606,method,Sequence of variables for this function. +3475,trainable_variables,tensorflow/tensorflow/python/eager/function.py,1611,method,Sequence of trainable variables for this function. +3476,name,tensorflow/tensorflow/python/eager/function.py,1970,method,`ConcreteFunction` name. +3477,graph,tensorflow/tensorflow/python/eager/function.py,1975,method,Returns the graph from which this function was constructed. +3478,inputs,tensorflow/tensorflow/python/eager/function.py,1980,method,Returns tensors in `self.graph` corresponding to arguments. +3479,structured_input_signature,tensorflow/tensorflow/python/eager/function.py,1985,method,"Returns structured signature for this concrete function. + +Returns: + A tuple `(args, kwargs)`, where: + + * `args` is a tuple that specifies the expected type or value each for + positional argument. + * `kwargs` is a dictionary that specifies the expected type or value + for each keyword-only argument. + + The type or value for each argument is specified using one of the + following: + + * A `tf.TypeSpec`, indicating that a Tensor or other TensorFlow-native + value is expected. + * A Python value, such as an integer, indicating that an equal value + is expected. + * A nested structure of `tf.TypeSpec`s and Python values, indicating + that a corresponding nested structure is expected." +3480,outputs,tensorflow/tensorflow/python/eager/function.py,2009,method,Returns tensors in `self.graph` corresponding to returned tensors. +3481,structured_outputs,tensorflow/tensorflow/python/eager/function.py,2014,method,Returns outputs in `self.graph` as returned by the original function. +3482,captured_inputs,tensorflow/tensorflow/python/eager/function.py,2019,method,"Returns external Tensors captured by this function. + +self.__call__(*args) passes `args + self.captured_inputs` to the function." +3483,function_def,tensorflow/tensorflow/python/eager/function.py,2029,method,Returns a `FunctionDef` object representing this function. +3484,output_shapes,tensorflow/tensorflow/python/eager/function.py,2034,method,The function's output shapes. +3485,output_dtypes,tensorflow/tensorflow/python/eager/function.py,2043,method, +3486,add_to_graph,tensorflow/tensorflow/python/eager/function.py,2051,method,"Registers the function, adds it to the graph g or default graph. + +Args: + g: If specified, registers the function with this graph. Defaults to the + current context (either the default graph or the eager context)." +3487,add_gradient_functions_to_graph,tensorflow/tensorflow/python/eager/function.py,2067,method,Add forward/backward functions to graph `g` or the current context. +3488,pretty_printed_signature,tensorflow/tensorflow/python/eager/function.py,2246,method,Returns a string summarizing the signature of this concrete function. +3489,cancellable_call,tensorflow/tensorflow/python/eager/function.py,1963,method, +3490,pretty_print_spec,tensorflow/tensorflow/python/eager/function.py,2251,method,Returns a string describing the spec for a single argument. +3491,FunctionSpec,tensorflow/tensorflow/python/eager/function.py,2323,class,Specification of how to bind arguments to a function. +3492,from_function_and_signature,tensorflow/tensorflow/python/eager/function.py,2327,method,"Create a FunctionSpec instance given a python function and signature. + +Args: + python_function: a function to inspect + input_signature: a signature of the function (None, if variable) + is_pure: if True all input arguments (including variables and constants) + will be converted to tensors and no variable changes allowed. + experimental_follow_type_hints: see `tf.function` + +Returns: + instance of FunctionSpec" +3493,fullargspec,tensorflow/tensorflow/python/eager/function.py,2486,method, +3494,is_method,tensorflow/tensorflow/python/eager/function.py,2490,method, +3495,args_to_indices,tensorflow/tensorflow/python/eager/function.py,2494,method, +3496,kwargs_to_include,tensorflow/tensorflow/python/eager/function.py,2498,method, +3497,input_signature,tensorflow/tensorflow/python/eager/function.py,2502,method, +3498,flat_input_signature,tensorflow/tensorflow/python/eager/function.py,2506,method, +3499,is_pure,tensorflow/tensorflow/python/eager/function.py,2510,method, +3500,arg_names,tensorflow/tensorflow/python/eager/function.py,2514,method, +3501,vararg_name,tensorflow/tensorflow/python/eager/function.py,2518,method, +3502,varkw_name,tensorflow/tensorflow/python/eager/function.py,2522,method, +3503,signature_summary,tensorflow/tensorflow/python/eager/function.py,2525,method,"Returns a string summarizing this function's signature. + +Args: + default_values: If true, then include default values in the signature. + +Returns: + A `string`." +3504,canonicalize_function_inputs,tensorflow/tensorflow/python/eager/function.py,2589,method,"Canonicalizes `args` and `kwargs`. + +Canonicalize the inputs to the Python function using a `FunctionSpec` +instance. In particular, we parse the varags and kwargs that the +original function was called with into a tuple corresponding to the +Python function's positional (named) arguments and a dictionary +corresponding to its kwargs. Missing default arguments are added. + +If this `FunctionSpec` has an input signature, then it is used to convert +arguments to tensors; otherwise, any inputs containing numpy arrays are +converted to tensors. + +Additionally, any inputs containing numpy arrays are converted to Tensors. + +Args: + *args: The varargs this object was called with. + **kwargs: The keyword args this function was called with. + +Returns: + A canonicalized ordering of the inputs representened by a tuple in the + form (args, kwargs). Here: `args` is a full list of bound arguments, and + `kwargs` contains only true keyword arguments, as opposed to named + arguments called in a keyword-like fashion. + +Raises: + ValueError: If a keyword in `kwargs` cannot be matched with a positional + argument when an input signature is specified, or when the inputs + do not conform to the input signature." +3505,FunctionCache,tensorflow/tensorflow/python/eager/function.py,2802,class,"A lightweight container for cached functions. " -3390,Function,tensorflow/tensorflow/python/eager/function.py,2836,class,"Wrapper class for the graph functions defined for a Python function. +3506,all_values,tensorflow/tensorflow/python/eager/function.py,2831,method,A set of all `ConcreteFunction` instances held by this cache. +3507,Function,tensorflow/tensorflow/python/eager/function.py,2836,class,"Wrapper class for the graph functions defined for a Python function. See the documentation for `defun` for more information on the semantics of defined functions. @@ -17595,7 +22973,16 @@ invoke the base `python_function` themselves, external synchronization is necessary. In addition, Function is not reentrant, so recursive functions need to call the wrapped function, not the wrapper." -3391,register,tensorflow/tensorflow/python/eager/function.py,3328,function,"Register a specialization of a `Function` into the graph. +3508,python_function,tensorflow/tensorflow/python/eager/function.py,2925,method,Returns the wrapped Python function. +3509,function_spec,tensorflow/tensorflow/python/eager/function.py,2930,method, +3510,input_signature,tensorflow/tensorflow/python/eager/function.py,2934,method,Returns the input signature. +3511,flat_input_signature,tensorflow/tensorflow/python/eager/function.py,2939,method,Returns the flattened input signature. +3512,get_concrete_function,tensorflow/tensorflow/python/eager/function.py,3023,method,"Returns a `ConcreteFunction` specialized to inputs and execution context. + +Args: + *args: inputs to specialize on. + **kwargs: inputs to specialize on." +3513,register,tensorflow/tensorflow/python/eager/function.py,3328,function,"Register a specialization of a `Function` into the graph. This won't actually call the function with the inputs, and only put the function definition into graph. Register function with different input param @@ -17611,8 +22998,8 @@ Returns: Raises: ValueError: When the input function is not a defun wrapped python function." -3392,validate_signature,tensorflow/tensorflow/python/eager/function.py,3355,function, -3393,defun,tensorflow/tensorflow/python/eager/function.py,3363,function,"Compiles a Python function into a callable TensorFlow graph. +3514,validate_signature,tensorflow/tensorflow/python/eager/function.py,3355,function, +3515,defun,tensorflow/tensorflow/python/eager/function.py,3363,function,"Compiles a Python function into a callable TensorFlow graph. `defun` (short for ""define function"") compiles a Python function composed of TensorFlow operations into a callable that executes a `tf.Graph` @@ -17940,7 +23327,7 @@ Returns: Raises: TypeError: If `input_signature` is neither `None` nor a sequence of `tf.contrib.eager.TensorSpec` objects." -3394,defun_with_attributes,tensorflow/tensorflow/python/eager/function.py,3705,function,"Compiles a Python function into a callable TensorFlow graph. +3516,defun_with_attributes,tensorflow/tensorflow/python/eager/function.py,3705,function,"Compiles a Python function into a callable TensorFlow graph. This function supports adding extra function attributes. See detailed documentation in defun(). Currently this is not exposed in public API since we @@ -17966,50 +23353,15 @@ Args: Returns: Same as the return value of defun, with attributes added to the function in graph." -3395,TfMethodTarget,tensorflow/tensorflow/python/eager/function.py,3784,class,Binding target for methods replaced by function and defun. -3396,class_method_to_instance_method,tensorflow/tensorflow/python/eager/function.py,3813,function,Constructs a new `Function` with `self` bound. -3397,_FunctionGarbageCollector,tensorflow/tensorflow/python/eager/function.py,3870,class,Cleans up cycles when a defun goes out of scope. -3398,ConcreteFunctionGarbageCollector,tensorflow/tensorflow/python/eager/function.py,3889,class,Cleans up reference cycles when a `ConcreteFunction` goes out of scope. -3399,_Marker,tensorflow/tensorflow/python/eager/function.py,3910,class,Markers used to pretty-print nested args in function signatures. -3400,_structure_summary,tensorflow/tensorflow/python/eager/function.py,3922,function,Displays a summary of the nesting structure of the given value. -3401,_contains_type_spec,tensorflow/tensorflow/python/eager/function.py,3935,function, -3402,ArgumentNamingTests,tensorflow/tensorflow/python/eager/function_argument_naming_test.py,38,class,Tests for recognizable export signatures from concrete functions. -3403,DefunCollectionTest,tensorflow/tensorflow/python/eager/function_defun_collection_test.py,33,class, -3404,FunctionGradientsTest,tensorflow/tensorflow/python/eager/function_gradients_test.py,52,class, -3405,total_function_cache,tensorflow/tensorflow/python/eager/function_test.py,93,function, -3406,_example_indexed_slices_with_dense_shape,tensorflow/tensorflow/python/eager/function_test.py,100,function, -3407,_example_indexed_slices_without_dense_shape,tensorflow/tensorflow/python/eager/function_test.py,106,function, -3408,_spec_for_value,tensorflow/tensorflow/python/eager/function_test.py,111,function,Returns the (nested) TypeSpec for a value. -3409,FunctionTest,tensorflow/tensorflow/python/eager/function_test.py,121,class, -3410,MultiDeviceTest,tensorflow/tensorflow/python/eager/function_test.py,4224,class, -3411,_SubscriptUseTracker,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,110,class,"Track uses of composite names, excluding certain names when subscripted." -3412,_FunctionCallsTracker,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,148,class,Tracks any function calls made with a given first argument name. -3413,_live_tensors,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,183,function,"Returns the indices of the used inputs. - -Note: This currently only handles direct index accesses e.g. op.inputs[1]. -If the function has slicing or list comprehension on attr_name then returns -_ALL. This ensure that this is correct even if inefficient. - -Args: - f: A grad function, taking the op as first argument. - attr_name: op attr to track. ""inputs"" or ""outputs"". - -Returns: - Either one of: - * set of integers representing individual indices of inputs used - * the value _ALL, if indices are used but cannot be determined which - * empty set, if no inputs are used" -3414,_get_num_inputs_outputs,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,264,function,"Returns (num_inputs, num_outputs). - -Args: - op_type: String. The type of the Operation. Used to lookup the op in the - registry. - -Returns: - (num_inputs, num_outputs), for either num_inputs or num_outputs if the value - can't be statically inferred from the OpDef alone or of the OpDef lookup - fails, -1 is returned." -3415,get_entries,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,293,function,"Returns the dict of entries. +3517,TfMethodTarget,tensorflow/tensorflow/python/eager/function.py,3784,class,Binding target for methods replaced by function and defun. +3518,target,tensorflow/tensorflow/python/eager/function.py,3794,method, +3519,target_class,tensorflow/tensorflow/python/eager/function.py,3798,method, +3520,call,tensorflow/tensorflow/python/eager/function.py,3806,method, +3521,class_method_to_instance_method,tensorflow/tensorflow/python/eager/function.py,3813,function,Constructs a new `Function` with `self` bound. +3522,ConcreteFunctionGarbageCollector,tensorflow/tensorflow/python/eager/function.py,3889,class,Cleans up reference cycles when a `ConcreteFunction` goes out of scope. +3523,release,tensorflow/tensorflow/python/eager/function.py,3897,method,Call off the FuncGraph deletion. +3524,total_function_cache,tensorflow/tensorflow/python/eager/function_test.py,93,function, +3525,get_entries,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,293,function,"Returns the dict of entries. Each entry is of the form {op_name, {true|false, indices}} @@ -18023,13 +23375,10 @@ Args: Returns: A dict from op_type to formatted entry in the dict." -3416,get_function,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,338,function,Generates lookup function with given name and lookup table entries. -3417,get_contents,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,363,function,Returns contents for the generated file. -3418,main,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,374,function, -3419,GradientInputOutputExclusionsTest,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions_test.py,29,class, -3420,graph_placeholder,tensorflow/tensorflow/python/eager/graph_only_ops.py,29,function,"Graph-only version of tf.compat.v1.placeholder(), for internal use only." -3421,GraphOnlyOpsTest,tensorflow/tensorflow/python/eager/graph_only_ops_test.py,30,class, -3422,imperative_grad,tensorflow/tensorflow/python/eager/imperative_grad.py,33,function,"Computes gradients from the imperatively defined tape on top of the stack. +3526,get_function,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,338,function,Generates lookup function with given name and lookup table entries. +3527,get_contents,tensorflow/tensorflow/python/eager/gradient_input_output_exclusions.py,363,function,Returns contents for the generated file. +3528,graph_placeholder,tensorflow/tensorflow/python/eager/graph_only_ops.py,29,function,"Graph-only version of tf.compat.v1.placeholder(), for internal use only." +3529,imperative_grad,tensorflow/tensorflow/python/eager/imperative_grad.py,33,function,"Computes gradients from the imperatively defined tape on top of the stack. Works by filtering the tape, computing how many downstream usages are of each tensor and entry, and repeatedly applying backward functions until we have @@ -18054,52 +23403,7 @@ Returns: Raises: ValueError: if the arguments are invalid. RuntimeError: if something goes wrong." -3423,_as_operation,tensorflow/tensorflow/python/eager/lift_to_graph.py,36,function, -3424,_constant_inputs,tensorflow/tensorflow/python/eager/lift_to_graph.py,42,function, -3425,_copy_non_source,tensorflow/tensorflow/python/eager/lift_to_graph.py,62,function,"Copy an op directly to a given graph. - -Generally `op`'s inputs should already have been copied. If this is not the -case, for example with v1 while_loops, then `_copy_non_source` inserts -placeholders for the unavailable Tensors and returns a list of required -mutations. - -Args: - op: The op to be copied. - graph: The destination graph. - op_map: A dict mapping ops and tensors in the old graph to the new one. - base_graph: The graph we're copying from, for any necessary functions. -Returns: - A tuple of (required_inputs, required_control_inputs): - required_inputs: - A list of `_InputMutation` tuples containing inputs to `copied_op` which - must be updated once `old_graph_tensor` has been copied. - required_control_inputs: - A list of `_ControlMutation` tuples containing control inputs to - `copied_op` which must be added once `old_graph_op` has been copied." -3426,_copy_source,tensorflow/tensorflow/python/eager/lift_to_graph.py,145,function,"Create a source in a graph based on a Tensor from a different graph. - -This function creates a placeholder analog of `s` in a graph with the -following behavior: - -1) If s is a captured Tensor or Variable and handle_captures is set to True, - simply capture it in the new graph as well. - -2) If s is a PlaceholderWithDefault whose default is a constant, preserve - said default in the new graph. - -3) When applicable, copy resource variable metadata from `s` to the newly - created placeholder. - -Args: - s: The source of interest. - graph: The destination graph. - op_map: A dict mapping ops and tensors in the old graph to the new one. - handle_captures: A boolean indicating whether to re-capture s in the new - graph or simply create a vanilla placeholder. - inverse_captures: A dict mapping s back to the Tensor or Variable that it - captures. - base_graph: The graph being copied from." -3427,lift_to_graph,tensorflow/tensorflow/python/eager/lift_to_graph.py,205,function,"Copies the tensor and all its inputs recursively to the outer graph. +3530,lift_to_graph,tensorflow/tensorflow/python/eager/lift_to_graph.py,205,function,"Copies the tensor and all its inputs recursively to the outer graph. Args: tensors: The Tensors to lift. @@ -18122,62 +23426,93 @@ Returns: Raises: UnliftableError: If a placeholder blocks lifting." -3428,LiftToGraphTest,tensorflow/tensorflow/python/eager/lift_to_graph_test.py,32,class, -3429,Metric,tensorflow/tensorflow/python/eager/monitoring.py,104,class,The base class of metric. -3430,CounterCell,tensorflow/tensorflow/python/eager/monitoring.py,147,class,CounterCell stores each value of a Counter. -3431,Counter,tensorflow/tensorflow/python/eager/monitoring.py,173,class,"A stateful class for updating a cumulative integer metric. +3531,Metric,tensorflow/tensorflow/python/eager/monitoring.py,104,class,The base class of metric. +3532,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,138,method,Retrieves the cell. +3533,CounterCell,tensorflow/tensorflow/python/eager/monitoring.py,147,class,CounterCell stores each value of a Counter. +3534,increase_by,tensorflow/tensorflow/python/eager/monitoring.py,160,method,"Atomically increments the value. + +Args: + value: non-negative value." +3535,value,tensorflow/tensorflow/python/eager/monitoring.py,168,method,Retrieves the current value. +3536,Counter,tensorflow/tensorflow/python/eager/monitoring.py,173,class,"A stateful class for updating a cumulative integer metric. This class encapsulates a set of values (or a single value for a label-less metric). Each value is identified by a tuple of labels. The class allows the user to increment each value." -3432,IntGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,199,class,A single integer value stored in an `IntGauge`. -3433,IntGauge,tensorflow/tensorflow/python/eager/monitoring.py,225,class,"A stateful class for updating a gauge-like integer metric. +3537,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,194,method,Retrieves the cell. +3538,IntGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,199,class,A single integer value stored in an `IntGauge`. +3539,set,tensorflow/tensorflow/python/eager/monitoring.py,212,method,"Atomically set the value. + +Args: + value: integer value." +3540,value,tensorflow/tensorflow/python/eager/monitoring.py,220,method,Retrieves the current value. +3541,IntGauge,tensorflow/tensorflow/python/eager/monitoring.py,225,class,"A stateful class for updating a gauge-like integer metric. This class encapsulates a set of integer values (or a single value for a label-less metric). Each value is identified by a tuple of labels. The class allows the user to set each value." -3434,StringGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,251,class,A single string value stored in an `StringGauge`. -3435,StringGauge,tensorflow/tensorflow/python/eager/monitoring.py,280,class,"A stateful class for updating a gauge-like string metric. +3542,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,246,method,Retrieves the cell. +3543,StringGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,251,class,A single string value stored in an `StringGauge`. +3544,set,tensorflow/tensorflow/python/eager/monitoring.py,264,method,"Atomically set the value. + +Args: + value: string value." +3545,value,tensorflow/tensorflow/python/eager/monitoring.py,272,method,Retrieves the current value. +3546,StringGauge,tensorflow/tensorflow/python/eager/monitoring.py,280,class,"A stateful class for updating a gauge-like string metric. This class encapsulates a set of string values (or a single value for a label-less metric). Each value is identified by a tuple of labels. The class allows the user to set each value." -3436,BoolGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,306,class,A single boolean value stored in an `BoolGauge`. -3437,BoolGauge,tensorflow/tensorflow/python/eager/monitoring.py,332,class,"A stateful class for updating a gauge-like bool metric. +3547,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,301,method,Retrieves the cell. +3548,BoolGaugeCell,tensorflow/tensorflow/python/eager/monitoring.py,306,class,A single boolean value stored in an `BoolGauge`. +3549,set,tensorflow/tensorflow/python/eager/monitoring.py,319,method,"Atomically set the value. + +Args: + value: bool value." +3550,value,tensorflow/tensorflow/python/eager/monitoring.py,327,method,Retrieves the current value. +3551,BoolGauge,tensorflow/tensorflow/python/eager/monitoring.py,332,class,"A stateful class for updating a gauge-like bool metric. This class encapsulates a set of boolean values (or a single value for a label-less metric). Each value is identified by a tuple of labels. The class allows the user to set each value." -3438,SamplerCell,tensorflow/tensorflow/python/eager/monitoring.py,358,class,SamplerCell stores each value of a Sampler. -3439,Buckets,tensorflow/tensorflow/python/eager/monitoring.py,393,class,Bucketing strategies for the samplers. -3440,ExponentialBuckets,tensorflow/tensorflow/python/eager/monitoring.py,410,class,"Exponential bucketing strategy. +3552,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,353,method,Retrieves the cell. +3553,SamplerCell,tensorflow/tensorflow/python/eager/monitoring.py,358,class,SamplerCell stores each value of a Sampler. +3554,add,tensorflow/tensorflow/python/eager/monitoring.py,371,method,"Atomically add a sample. + +Args: + value: float value." +3555,value,tensorflow/tensorflow/python/eager/monitoring.py,379,method,"Retrieves the current distribution of samples. + +Returns: + A HistogramProto describing the distribution of samples." +3556,Buckets,tensorflow/tensorflow/python/eager/monitoring.py,393,class,Bucketing strategies for the samplers. +3557,ExponentialBuckets,tensorflow/tensorflow/python/eager/monitoring.py,410,class,"Exponential bucketing strategy. Sets up buckets of the form: [-DBL_MAX, ..., scale * growth^i, scale * growth_factor^(i + 1), ..., DBL_MAX]." -3441,Sampler,tensorflow/tensorflow/python/eager/monitoring.py,433,class,"A stateful class for updating a cumulative histogram metric. +3558,Sampler,tensorflow/tensorflow/python/eager/monitoring.py,433,class,"A stateful class for updating a cumulative histogram metric. This class encapsulates a set of histograms (or a single histogram for a label-less metric) configured with a list of increasing bucket boundaries. Each histogram is identified by a tuple of labels. The class allows the user to add a sample to each histogram value." -3442,MonitoredTimer,tensorflow/tensorflow/python/eager/monitoring.py,461,class,A context manager to measure the walltime and increment a Counter cell. -3443,monitored_timer,tensorflow/tensorflow/python/eager/monitoring.py,484,function,"A function decorator for adding MonitoredTimer support. +3559,get_cell,tensorflow/tensorflow/python/eager/monitoring.py,456,method,Retrieves the cell. +3560,MonitoredTimer,tensorflow/tensorflow/python/eager/monitoring.py,461,class,A context manager to measure the walltime and increment a Counter cell. +3561,monitored_timer,tensorflow/tensorflow/python/eager/monitoring.py,484,function,"A function decorator for adding MonitoredTimer support. Arguments: cell: the cell associated with the time metric that will be inremented. Returns: A decorator that measure the function runtime and increment the specified counter cell." -3444,MonitoringTest,tensorflow/tensorflow/python/eager/monitoring_test.py,29,class, -3445,OpsTest,tensorflow/tensorflow/python/eager/ops_test.py,46,class, -3446,ProfilerAlreadyRunningError,tensorflow/tensorflow/python/eager/profiler.py,58,class, -3447,ProfilerNotRunningError,tensorflow/tensorflow/python/eager/profiler.py,62,class, -3448,start,tensorflow/tensorflow/python/eager/profiler.py,67,function,"Start profiling. +3562,ProfilerAlreadyRunningError,tensorflow/tensorflow/python/eager/profiler.py,58,class, +3563,ProfilerNotRunningError,tensorflow/tensorflow/python/eager/profiler.py,62,class, +3564,start,tensorflow/tensorflow/python/eager/profiler.py,67,function,"Start profiling. Raises: ProfilerAlreadyRunningError: If another profiling session is running." -3449,stop,tensorflow/tensorflow/python/eager/profiler.py,90,function,"Stop current profiling session and return its result. +3565,stop,tensorflow/tensorflow/python/eager/profiler.py,90,function,"Stop current profiling session and return its result. Returns: A binary string of tensorflow.tpu.Trace. User can write the string @@ -18185,19 +23520,19 @@ Returns: Raises: ProfilerNotRunningError: If there is no active profiling session." -3450,maybe_create_event_file,tensorflow/tensorflow/python/eager/profiler.py,118,function,"Create an empty event file if not already exists. +3566,maybe_create_event_file,tensorflow/tensorflow/python/eager/profiler.py,118,function,"Create an empty event file if not already exists. This event file indicates that we have a plugins/profile/ directory in the current logdir. Args: logdir: log directory." -3451,save,tensorflow/tensorflow/python/eager/profiler.py,140,function,"Save profile result to TensorBoard logdir. +3567,save,tensorflow/tensorflow/python/eager/profiler.py,140,function,"Save profile result to TensorBoard logdir. Args: logdir: log directory read by TensorBoard. result: profiling result returned by stop()." -3452,start_profiler_server,tensorflow/tensorflow/python/eager/profiler.py,157,function,"Start a profiler grpc server that listens to given port. +3568,start_profiler_server,tensorflow/tensorflow/python/eager/profiler.py,157,function,"Start a profiler grpc server that listens to given port. The profiler server will keep the program running even the training finishes. Please shutdown the server with CTRL-C. It can be used in both eager mode and @@ -18208,14 +23543,14 @@ file following https://cloud.google.com/tpu/docs/cloud-tpu-tools#capture_trace Args: port: port profiler server listens to." -3453,Profiler,tensorflow/tensorflow/python/eager/profiler.py,176,class,"Context-manager eager profiler api. +3569,Profiler,tensorflow/tensorflow/python/eager/profiler.py,176,class,"Context-manager eager profiler api. Example usage: ```python with Profiler(""/path/to/logdir""): # do some work ```" -3454,start_tracing,tensorflow/tensorflow/python/eager/profiler_client.py,26,function,"Sends grpc requests to profiler server to perform on-demand profiling. +3570,start_tracing,tensorflow/tensorflow/python/eager/profiler_client.py,26,function,"Sends grpc requests to profiler server to perform on-demand profiling. This method will block caller thread until receives tracing result. @@ -18231,7 +23566,7 @@ Args: Raises: UnavailableError: If no trace event is collected." -3455,monitor,tensorflow/tensorflow/python/eager/profiler_client.py,54,function,"Sends grpc requests to profiler server to perform on-demand monitoring. +3571,monitor,tensorflow/tensorflow/python/eager/profiler_client.py,54,function,"Sends grpc requests to profiler server to perform on-demand monitoring. This method will block caller thread until receives monitoring result. @@ -18244,10 +23579,7 @@ Args: Returns: A string of monitoring output." -3456,ProfilerClientTest,tensorflow/tensorflow/python/eager/profiler_client_test.py,27,class, -3457,ProfilerTest,tensorflow/tensorflow/python/eager/profiler_test.py,33,class, -3458,Tests,tensorflow/tensorflow/python/eager/pywrap_tfe_test.py,44,class, -3459,connect_to_remote_host,tensorflow/tensorflow/python/eager/remote.py,42,function,"Connects to a single machine to enable remote execution on it. +3572,connect_to_remote_host,tensorflow/tensorflow/python/eager/remote.py,42,function,"Connects to a single machine to enable remote execution on it. Will make devices on the remote host available to use. Note that calling this more than once will work, but will invalidate any tensor handles on the old @@ -18273,7 +23605,7 @@ Args: Raises: ValueError: if remote_host is None." -3460,connect_to_cluster,tensorflow/tensorflow/python/eager/remote.py,81,function,"Connects to the given cluster. +3573,connect_to_cluster,tensorflow/tensorflow/python/eager/remote.py,81,function,"Connects to the given cluster. Will make devices on the cluster available to use. Note that calling this more than once will work, but will invalidate any tensor handles on the old remote @@ -18321,26 +23653,32 @@ Args: cluster_device_filters: an instance of `tf.train.experimental/ClusterDeviceFilters` that specify device filters to the remote tasks in cluster." -3461,_strip_prefix,tensorflow/tensorflow/python/eager/remote.py,222,function, -3462,run_benchmark,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,45,function, -3463,Foo,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,62,class, -3464,RemoteWorkerMicroBenchmarks,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,78,class, -3465,RemoteCloudTPUTest,tensorflow/tensorflow/python/eager/remote_cloud_tpu_test.py,56,class,Test that we can connect to a real Cloud TPU. -3466,get_server_def,tensorflow/tensorflow/python/eager/remote_cluster_test.py,46,function,Returns a server def with a single job + multiple tasks. -3467,DynamicClusterTest,tensorflow/tensorflow/python/eager/remote_cluster_test.py,66,class, -3468,get_server_def,tensorflow/tensorflow/python/eager/remote_execution_test.py,46,function,Returns a server def with a single job + multiple tasks. -3469,RemoteExecutionTest,tensorflow/tensorflow/python/eager/remote_execution_test.py,66,class, -3470,RemoteExecutionWithoutLazyRemoteInputsCopyTest,tensorflow/tensorflow/python/eager/remote_execution_test.py,236,class, -3471,SingleWorkerTest,tensorflow/tensorflow/python/eager/remote_test.py,49,class, -3472,RemoteAsyncTest,tensorflow/tensorflow/python/eager/remote_test.py,196,class, -3473,MultiWorkersTest,tensorflow/tensorflow/python/eager/remote_test.py,284,class, -3474,MultiJobsTest,tensorflow/tensorflow/python/eager/remote_test.py,480,class, -3475,_strip_prefix,tensorflow/tensorflow/python/eager/remote_test.py,617,function, -3476,Tape,tensorflow/tensorflow/python/eager/tape.py,35,class,Represents a gradient propagation trace. -3477,push_new_tape,tensorflow/tensorflow/python/eager/tape.py,47,function,Pushes a new tape onto the tape stack. -3478,push_tape,tensorflow/tensorflow/python/eager/tape.py,53,function,Pushes an existing tape onto the tape stack. -3479,watch,tensorflow/tensorflow/python/eager/tape.py,58,function,Marks this tensor to be watched by the given tape. -3480,VariableWatcher,tensorflow/tensorflow/python/eager/tape.py,63,class,"A scope that tracks all trainable variable accesses within it. +3574,run_benchmark,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,45,function, +3575,Foo,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,62,class, +3576,RemoteWorkerMicroBenchmarks,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,78,class, +3577,benchmark_send_mirroring_off,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,95,method, +3578,benchmark_send_mirroring_on,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,115,method, +3579,benchmark_worker_mirroring_off,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,135,method, +3580,benchmark_worker_mirroring_on,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,157,method, +3581,benchmark_create_vars_inside_function,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,179,method, +3582,remote_func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,101,method, +3583,func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,104,method, +3584,remote_func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,121,method, +3585,func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,124,method, +3586,remote_func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,143,method, +3587,func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,146,method, +3588,remote_func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,165,method, +3589,func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,168,method, +3590,func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,182,method, +3591,remote_func,tensorflow/tensorflow/python/eager/remote_benchmarks_test.py,187,method, +3592,get_server_def,tensorflow/tensorflow/python/eager/remote_cluster_test.py,46,function,Returns a server def with a single job + multiple tasks. +3593,get_server_def,tensorflow/tensorflow/python/eager/remote_execution_test.py,46,function,Returns a server def with a single job + multiple tasks. +3594,Tape,tensorflow/tensorflow/python/eager/tape.py,35,class,Represents a gradient propagation trace. +3595,watched_variables,tensorflow/tensorflow/python/eager/tape.py,43,method, +3596,push_new_tape,tensorflow/tensorflow/python/eager/tape.py,47,function,Pushes a new tape onto the tape stack. +3597,push_tape,tensorflow/tensorflow/python/eager/tape.py,53,function,Pushes an existing tape onto the tape stack. +3598,watch,tensorflow/tensorflow/python/eager/tape.py,58,function,Marks this tensor to be watched by the given tape. +3599,VariableWatcher,tensorflow/tensorflow/python/eager/tape.py,63,class,"A scope that tracks all trainable variable accesses within it. This explicitly ignores variables that are not marked as trainable. @@ -18351,20 +23689,21 @@ with VariableWatcher() as variable_watcher: var.assign_add(1.0) assert variable_watcher.watched_variables == [var]" -3481,watch_variable,tensorflow/tensorflow/python/eager/tape.py,95,function,Marks this variable to be watched by the given tape. -3482,variable_accessed,tensorflow/tensorflow/python/eager/tape.py,108,function,"Notifies all tapes in the stack that a variable has been accessed. +3600,watched_variables,tensorflow/tensorflow/python/eager/tape.py,89,method,Returns a tuple of variables accessed under this scope. +3601,watch_variable,tensorflow/tensorflow/python/eager/tape.py,95,function,Marks this variable to be watched by the given tape. +3602,variable_accessed,tensorflow/tensorflow/python/eager/tape.py,108,function,"Notifies all tapes in the stack that a variable has been accessed. Args: variable: variable to be watched." -3483,variables_accessed,tensorflow/tensorflow/python/eager/tape.py,125,function,"Notifies all tapes in the stack that variables have been accessed. +3603,variables_accessed,tensorflow/tensorflow/python/eager/tape.py,125,function,"Notifies all tapes in the stack that variables have been accessed. Only trainable variables are marked as accessed. Args: variables: iterable of variables to mark as accessed." -3484,pop_tape,tensorflow/tensorflow/python/eager/tape.py,149,function,Pops the given tape in the stack. -3485,stop_recording,tensorflow/tensorflow/python/eager/tape.py,155,function,Stop all gradient recording (backprop and forwardprop). -3486,should_record_backprop,tensorflow/tensorflow/python/eager/tape.py,167,function,"Returns true if any tape in the stack watches any of these tensors. +3604,pop_tape,tensorflow/tensorflow/python/eager/tape.py,149,function,Pops the given tape in the stack. +3605,stop_recording,tensorflow/tensorflow/python/eager/tape.py,155,function,Stop all gradient recording (backprop and forwardprop). +3606,should_record_backprop,tensorflow/tensorflow/python/eager/tape.py,167,function,"Returns true if any tape in the stack watches any of these tensors. Only takes GradientTapes into account, not forward accumulators. @@ -18373,9 +23712,9 @@ Args: Returns: Boolean, whether any tape watches any of `tensors`." -3487,record_operation,tensorflow/tensorflow/python/eager/tape.py,181,function,Records the operation on all tapes in the stack. -3488,record_operation_backprop_only,tensorflow/tensorflow/python/eager/tape.py,189,function,Records the operation on all backward tapes in the stack. -3489,record_operation_forwardprop_only,tensorflow/tensorflow/python/eager/tape.py,197,function,"Records the operation on all forward accumulators in the stack. +3607,record_operation,tensorflow/tensorflow/python/eager/tape.py,181,function,Records the operation on all tapes in the stack. +3608,record_operation_backprop_only,tensorflow/tensorflow/python/eager/tape.py,189,function,Records the operation on all backward tapes in the stack. +3609,record_operation_forwardprop_only,tensorflow/tensorflow/python/eager/tape.py,197,function,"Records the operation on all forward accumulators in the stack. Args: op_type: a string for the operation type, used in the backprop code @@ -18388,44 +23727,39 @@ Args: forwardprop_output_indices: indicates any output_tensors which contain JVPs. Typically these will have come from TFE_Py_PackForwardGradients. May be None or an empty sequence if there are no JVP outputs from the operation." -3490,delete_trace,tensorflow/tensorflow/python/eager/tape.py,219,function,Deletes traces for this Tensor from all tapes in the stack. -3491,could_possibly_record,tensorflow/tensorflow/python/eager/tape.py,224,function,Returns True if any tape is active. -3492,two_outputs,tensorflow/tensorflow/python/eager/tape_test.py,39,function, -3493,gradient_is_constant,tensorflow/tensorflow/python/eager/tape_test.py,55,function, -3494,TapeTest,tensorflow/tensorflow/python/eager/tape_test.py,64,class, -3495,VariableWatcherTest,tensorflow/tensorflow/python/eager/tape_test.py,171,class, -3496,_create_tensor,tensorflow/tensorflow/python/eager/tensor_test.py,44,function, -3497,TFETensorTest,tensorflow/tensorflow/python/eager/tensor_test.py,57,class, -3498,TFETensorUtilTest,tensorflow/tensorflow/python/eager/tensor_test.py,435,class, -3499,main,tensorflow/tensorflow/python/eager/test.py,27,function, -3500,VariableHolder,tensorflow/tensorflow/python/eager/wrap_function.py,46,class,Holds variables for a python function. -3501,_get_element_from_tensor_info,tensorflow/tensorflow/python/eager/wrap_function.py,98,function,Simplified copy of the deprecated `get_tensor_from_tensor_info`. -3502,_lift_single_variable,tensorflow/tensorflow/python/eager/wrap_function.py,123,function,Lifts `old_variable` out of the `FuncGraph` `graph`. -3503,_lift_unlifted_variables,tensorflow/tensorflow/python/eager/wrap_function.py,146,function,"Finds resource variables and lifts them into the outer context. +3610,delete_trace,tensorflow/tensorflow/python/eager/tape.py,219,function,Deletes traces for this Tensor from all tapes in the stack. +3611,could_possibly_record,tensorflow/tensorflow/python/eager/tape.py,224,function,Returns True if any tape is active. +3612,two_outputs,tensorflow/tensorflow/python/eager/tape_test.py,39,function, +3613,gradient_is_constant,tensorflow/tensorflow/python/eager/tape_test.py,55,function, +3614,VariableHolder,tensorflow/tensorflow/python/eager/wrap_function.py,46,class,Holds variables for a python function. +3615,variables,tensorflow/tensorflow/python/eager/wrap_function.py,56,method, +3616,variable_creator_scope,tensorflow/tensorflow/python/eager/wrap_function.py,59,method,Creates variables & adds them to collections to match legacy code. +3617,call_with_variable_creator_scope,tensorflow/tensorflow/python/eager/wrap_function.py,89,method, +3618,wrapped,tensorflow/tensorflow/python/eager/wrap_function.py,91,method, +3619,WrappedFunction,tensorflow/tensorflow/python/eager/wrap_function.py,220,class,Wraps a tf V1 piece of code in a function. +3620,prune,tensorflow/tensorflow/python/eager/wrap_function.py,249,method,"Extract a subgraph of this function's underlying graph. -When we import a GraphDef inside a wrap_function, no Python graph building -code runs. This means we get VarHandleOps which create variable resources, -but no corresponding Python objects. Leaving them like this works but gives -the user no way to interact with or modify the variables outside the graph. - -This method searches for variables and lifts them out as regular variable -objects when possible, indicating to the FuncGraph that they are captures. +Wraps the subgraph in a new `WrappedFunction` object. Args: - graph: The FuncGraph to lift variables from. - variable_holder: A VariableHolder to record the lifted variables in." -3504,WrappedFunction,tensorflow/tensorflow/python/eager/wrap_function.py,220,class,Wraps a tf V1 piece of code in a function. -3505,_filter_returned_ops,tensorflow/tensorflow/python/eager/wrap_function.py,382,function,"Filtering out any ops returned by function. - -Args: - fn: a function + feeds: Input tensors to the subgraph to extract, as `Tensor` objects. + fetches: Possibly-nested Python data structure containing information + about outputs of the target subgraph. Each entry can either be a + `Tensor` object (for data outputs), an `Operation` object (for control + outputs), or a `TensorInfo` proto. Any additional shape/dtype + information provided in a `TensorInfo` and not present in the original + graph will be added to the returned subgraph. + name: (optional) Name to give to the underlying `FuncGraph` of the + returned object. If no name is provided, the graph's name will be + `""pruned""`. + input_signature: (optional) possibly-nested Python data structure + containing `TensorSpec` objects, with which to populate the returned + functions's `FuncGraph`'s `structured_input_signature` field. Returns: - A tuple of ( - Wrapped function that returns `None` in place of any ops, - dict that maps the index in the flat output structure to the returned op - )" -3506,WrappedGraph,tensorflow/tensorflow/python/eager/wrap_function.py,409,class,"Class for wrapping multiple TF 1.X functions in a single graph. + A new `WrappedFunction` object containing a copy of the portion of this + object's graph that goes from `feeds` to `fetches`." +3621,WrappedGraph,tensorflow/tensorflow/python/eager/wrap_function.py,409,class,"Class for wrapping multiple TF 1.X functions in a single graph. Maintains a dictionary mapping names to wrapped functions. See `tf.compat.v1.wrap_function` to learn more about wrapping V1 functions. @@ -18462,7 +23796,55 @@ increment_var(tf.constant(5)) assert g.variables[0].numpy() == 5 ```" -3507,wrap_function,tensorflow/tensorflow/python/eager/wrap_function.py,560,function,"Wraps the TF 1.x function fn into a graph function. +3622,functions,tensorflow/tensorflow/python/eager/wrap_function.py,463,method, +3623,variables,tensorflow/tensorflow/python/eager/wrap_function.py,467,method, +3624,wrap_function,tensorflow/tensorflow/python/eager/wrap_function.py,470,method,"Wraps a TF 1.X function and returns an eager-compatible function. + +All functions wrapped in the same `WrappedGraph` will have access to the +same graph (`tf.compat.v1.get_default_graph` to get the graph object +within a function, or `WrappedGraph.graph` to get the graph outside a +function). Variables created within the function will be added to the +`variables` list. + +Function inputs: All inputs to the function must be tensors (nested ok), +with their shapes and dtypes defined in the `signature` argument. + +Function outputs: + + * The 1.X function may return tensors, variables, and ops. The wrapped + eager-compatible function will always return tensors in the same nested + structure. + * Variables are replaced with a tensor containing the latest read values. + * Returned ops are executed, and replaced with None. + * The order of op execution and variable reads in the return is + nondeterministic. For example: + + ``` + def update_var(x): + v = tf.Variable(0) + op = tf.compat.v1.assign(v, x).op + return v, op + + g = WrappedGraph() + fn = g.wrap_function(update_var) + read_value, _ = fn(tf.constant(3)) + print(read_value.numpy()) # could be 0 or 3 + print(g.variables[0].numpy()) # always 3 + ``` + +To ensure that ops in the function are executed (e.g. ops added to the +`tf.GraphKeys.UPDATE_OPS` collection), include them in the function returns. + +Args: + fn: a 1.X tensorflow function. + signature: a possibly nested sequence of `TensorSpecs` specifying the + shapes and dtypes of the arguments. + name: an optional string name for the function. The function will be saved + with key `name` in the `functions` dictionary. + +Returns: + An eager-compatible function." +3625,wrap_function,tensorflow/tensorflow/python/eager/wrap_function.py,560,function,"Wraps the TF 1.x function fn into a graph function. The python function `fn` will be called once with symbolic arguments specified in the `signature`, traced, and turned into a graph function. Any variables @@ -18516,7 +23898,7 @@ Args: Returns: the wrapped graph function." -3508,function_from_graph_def,tensorflow/tensorflow/python/eager/wrap_function.py,633,function,"Creates a ConcreteFunction from a GraphDef. +3626,function_from_graph_def,tensorflow/tensorflow/python/eager/wrap_function.py,633,function,"Creates a ConcreteFunction from a GraphDef. Args: graph_def: A GraphDef to make a function out of. @@ -18527,36 +23909,15 @@ Args: Returns: A ConcreteFunction." -3509,WrapFunctionTest,tensorflow/tensorflow/python/eager/wrap_function_test.py,45,class, -3510,WrappedGraphTest,tensorflow/tensorflow/python/eager/wrap_function_test.py,398,class, -3511,_forward_over_back_hvp,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,33,function, -3512,_back_over_forward_hvp,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,44,function, -3513,_tf_gradients_forward_over_back_hvp,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,55,function, -3514,_back_over_back_hvp,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,67,function, -3515,HVPTest,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,78,class, -3516,HVPBenchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,108,class, -3517,_IdentityBlock,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,34,class,"_IdentityBlock is the block that has no conv layer at shortcut. - -Args: - kernel_size: the kernel size of middle conv layer at main path - filters: list of integers, the filters of 3 conv layer at main path - stage: integer, current stage label, used for generating layer names - block: 'a','b'..., current block label, used for generating layer names - data_format: data_format for the input ('channels_first' or - 'channels_last')." -3518,_ConvBlock,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,89,class,"_ConvBlock is the block that has a conv layer at shortcut. - -Args: - kernel_size: the kernel size of middle conv layer at main path - filters: list of integers, the filters of 3 conv layer at main path - stage: integer, current stage label, used for generating layer names - block: 'a','b'..., current block label, used for generating layer names - data_format: data_format for the input ('channels_first' or - 'channels_last'). - strides: strides for the convolution. Note that from stage 3, the first - conv layer at main path is with strides=(2,2), and the shortcut should - have strides=(2,2) as well." -3519,ResNet50,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,168,class,"Instantiates the ResNet50 architecture. +3627,HVPBenchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,108,class, +3628,benchmark_forward_over_backward_hvp_eager,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,144,method, +3629,benchmark_forward_over_backward_hvp_function,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,149,method, +3630,benchmark_tf_gradients_forward_over_backward_hvp_function,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,154,method, +3631,benchmark_backward_over_backward_hvp_eager,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,159,method, +3632,benchmark_backward_over_backward_hvp_function,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,164,method, +3633,benchmark_backward_over_forward_hvp_eager,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,169,method, +3634,benchmark_backward_over_forward_hvp_function,tensorflow/tensorflow/python/eager/benchmarks/resnet50/hvp_test.py,174,method, +3635,ResNet50,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,168,class,"Instantiates the ResNet50 architecture. Args: data_format: format for the image. Either 'channels_first' or @@ -18585,21 +23946,28 @@ Args: Raises: ValueError: in case of invalid argument for data_format." -3520,data_format,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,29,function, -3521,image_shape,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,33,function, -3522,random_batch,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,39,function, -3523,ResNet50GraphTest,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,49,class, -3524,ResNet50Benchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,69,class, -3525,compute_gradients,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,37,function, -3526,apply_gradients,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,54,function, -3527,_events_from_file,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,58,function,"Returns all events in a single event file. +3636,call,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,297,method,"Call the ResNet50 model. Args: - filepath: Path to the event file. + inputs: Images to compute features for. + training: Whether model is in training phase. + intermediates_dict: `None` or dictionary. If not None, accumulate feature + maps from intermediate blocks into the dictionary. + """" Returns: - A list of all tf.compat.v1.Event protos in the event file." -3528,events_from_logdir,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,76,function,"Returns all events in the single eventfile in logdir. + Tensor with featuremap." +3637,conv_block,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,220,method, +3638,id_block,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50.py,229,method, +3639,data_format,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,29,function, +3640,image_shape,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,33,function, +3641,random_batch,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,39,function, +3642,ResNet50Benchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,69,class, +3643,benchmark_graph_apply,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,79,method, +3644,benchmark_graph_train,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py,102,method, +3645,compute_gradients,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,37,function, +3646,apply_gradients,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,54,function, +3647,events_from_logdir,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,76,function,"Returns all events in the single eventfile in logdir. Args: logdir: The directory in which the single event file is sought. @@ -18609,19 +23977,25 @@ Returns: Raises: AssertionError: If logdir does not contain exactly one file." -3529,ResNet50Test,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,94,class, -3530,MockIterator,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,260,class, -3531,ResNet50Benchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,269,class, -3532,device_and_data_format,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,26,function, -3533,random_batch,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,32,function,Create synthetic resnet50 images and labels for testing. -3534,report,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,50,function, -3535,MemoryTest,tensorflow/tensorflow/python/eager/memory_tests/memory_test.py,40,class, -3536,_instance_count_by_class,tensorflow/tensorflow/python/eager/memory_tests/memory_test_util.py,36,function, -3537,assert_no_leak,tensorflow/tensorflow/python/eager/memory_tests/memory_test_util.py,48,function,Assert memory usage doesn't increase beyond given threshold for f. -3538,memory_profiler_is_available,tensorflow/tensorflow/python/eager/memory_tests/memory_test_util.py,78,function, -3539,RemoteWorkerMemoryTest,tensorflow/tensorflow/python/eager/memory_tests/remote_memory_test.py,31,class, -3540,_internal_input_layer,tensorflow/tensorflow/python/feature_column/feature_column.py,171,function,See input_layer. `scope` is a name or variable scope to use. -3541,input_layer,tensorflow/tensorflow/python/feature_column/feature_column.py,234,function,"Returns a dense `Tensor` as input layer based on given `feature_columns`. +3648,MockIterator,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,260,class, +3649,next,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,265,method, +3650,ResNet50Benchmarks,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,269,class, +3651,benchmark_eager_apply_sync,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,331,method, +3652,benchmark_eager_apply_async,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,336,method, +3653,benchmark_eager_apply_with_defun,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,344,method, +3654,benchmark_eager_train_sync,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,392,method, +3655,benchmark_eager_train_async,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,397,method, +3656,benchmark_eager_train_with_defun,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,405,method, +3657,benchmark_eager_train_datasets,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,410,method, +3658,benchmark_eager_train_datasets_with_defun,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,424,method, +3659,make_iterator,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,412,method, +3660,make_iterator,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test.py,426,method, +3661,device_and_data_format,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,26,function, +3662,random_batch,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,32,function,Create synthetic resnet50 images and labels for testing. +3663,report,tensorflow/tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py,50,function, +3664,assert_no_leak,tensorflow/tensorflow/python/eager/memory_tests/memory_test_util.py,48,function,Assert memory usage doesn't increase beyond given threshold for f. +3665,memory_profiler_is_available,tensorflow/tensorflow/python/eager/memory_tests/memory_test_util.py,78,function, +3666,input_layer,tensorflow/tensorflow/python/feature_column/feature_column.py,234,function,"Returns a dense `Tensor` as input layer based on given `feature_columns`. Generally a single example in training data is described with FeatureColumns. At the first layer of the model, this column oriented data should be converted @@ -18676,8 +24050,15 @@ Returns: Raises: ValueError: if an item in `feature_columns` is not a `_DenseColumn`." -3542,InputLayer,tensorflow/tensorflow/python/feature_column/feature_column.py,309,class,An object-oriented version of `input_layer` that reuses variables. -3543,linear_model,tensorflow/tensorflow/python/feature_column/feature_column.py,369,function,"Returns a linear prediction `Tensor` based on given `feature_columns`. +3667,InputLayer,tensorflow/tensorflow/python/feature_column/feature_column.py,309,class,An object-oriented version of `input_layer` that reuses variables. +3668,name,tensorflow/tensorflow/python/feature_column/feature_column.py,340,method, +3669,non_trainable_variables,tensorflow/tensorflow/python/feature_column/feature_column.py,344,method, +3670,non_trainable_weights,tensorflow/tensorflow/python/feature_column/feature_column.py,348,method, +3671,trainable_variables,tensorflow/tensorflow/python/feature_column/feature_column.py,352,method, +3672,trainable_weights,tensorflow/tensorflow/python/feature_column/feature_column.py,356,method, +3673,variables,tensorflow/tensorflow/python/feature_column/feature_column.py,360,method, +3674,weights,tensorflow/tensorflow/python/feature_column/feature_column.py,364,method, +3675,linear_model,tensorflow/tensorflow/python/feature_column/feature_column.py,369,function,"Returns a linear prediction `Tensor` based on given `feature_columns`. This function generates a weighted sum based on output dimension `units`. Weighted sum refers to logits in classification problems. It refers to the @@ -18791,55 +24172,7 @@ Returns: Raises: ValueError: if an item in `feature_columns` is neither a `_DenseColumn` nor `_CategoricalColumn`." -3544,_add_to_collections,tensorflow/tensorflow/python/feature_column/feature_column.py,506,function,"Adds a var to the list of weight_collections provided. - -Handles the case for partitioned and non-partitioned variables. - -Args: - var: A variable or Partitioned Variable. - weight_collections: List of collections to add variable to." -3545,_FCLinearWrapper,tensorflow/tensorflow/python/feature_column/feature_column.py,528,class,"Wraps a _FeatureColumn in a layer for use in a linear model. - -See `linear_model` above." -3546,_BiasLayer,tensorflow/tensorflow/python/feature_column/feature_column.py,579,class,"A layer for the bias term. - " -3547,_get_expanded_variable_list,tensorflow/tensorflow/python/feature_column/feature_column.py,606,function, -3548,_strip_leading_slashes,tensorflow/tensorflow/python/feature_column/feature_column.py,614,function, -3549,_LinearModel,tensorflow/tensorflow/python/feature_column/feature_column.py,618,class,"Creates a linear model using feature columns. - -See `linear_model` for details." -3550,_transform_features,tensorflow/tensorflow/python/feature_column/feature_column.py,716,function,"Returns transformed features based on features columns passed in. - -Please note that most probably you would not need to use this function. Please -check `input_layer` and `linear_model` to see whether they will -satisfy your use case or not. - -Example: - -```python -# Define features and transformations -crosses_a_x_b = crossed_column( - columns=[""sparse_feature_a"", ""sparse_feature_b""], hash_bucket_size=10000) -price_buckets = bucketized_column( - source_column=numeric_column(""price""), boundaries=[...]) - -columns = [crosses_a_x_b, price_buckets] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -transformed = transform_features(features=features, feature_columns=columns) - -assertCountEqual(columns, transformed.keys()) -``` - -Args: - features: A mapping from key to tensors. `_FeatureColumn`s look up via these - keys. For example `numeric_column('price')` will look at 'price' key in - this dict. Values can be a `SparseTensor` or a `Tensor` depends on - corresponding `_FeatureColumn`. - feature_columns: An iterable containing all the `_FeatureColumn`s. - -Returns: - A `dict` mapping `_FeatureColumn` to `Tensor` and `SparseTensor` values." -3551,make_parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column.py,761,function,"Creates parsing spec dictionary from input feature_columns. +3676,make_parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column.py,761,function,"Creates parsing spec dictionary from input feature_columns. The returned dictionary can be used as arg 'features' in `tf.io.parse_example`. @@ -18882,844 +24215,65 @@ Returns: Raises: ValueError: If any of the given `feature_columns` is not a `_FeatureColumn` instance." -3552,_embedding_column,tensorflow/tensorflow/python/feature_column/feature_column.py,822,function,"`_DenseColumn` that converts from sparse, categorical input. - -Use this when your inputs are sparse, but you want to convert them to a dense -representation (e.g., to feed to a DNN). - -Inputs must be a `_CategoricalColumn` created by any of the -`categorical_column_*` function. Here is an example of using -`embedding_column` with `DNNClassifier`: - -```python -video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) -columns = [embedding_column(video_id, 9),...] - -estimator = tf.estimator.DNNClassifier(feature_columns=columns, ...) - -label_column = ... -def input_fn(): - features = tf.io.parse_example( - ..., features=make_parse_example_spec(columns + [label_column])) - labels = features.pop(label_column.name) - return features, labels - -estimator.train(input_fn=input_fn, steps=100) -``` - -Here is an example using `embedding_column` with model_fn: - -```python -def model_fn(features, ...): - video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) - columns = [embedding_column(video_id, 9),...] - dense_tensor = input_layer(features, columns) - # Form DNN layers, calculate loss, and return EstimatorSpec. - ... -``` - -Args: - categorical_column: A `_CategoricalColumn` created by a - `categorical_column_with_*` function. This column produces the sparse IDs - that are inputs to the embedding lookup. - dimension: An integer specifying dimension of the embedding, must be > 0. - combiner: A string specifying how to reduce if there are multiple entries - in a single row. Currently 'mean', 'sqrtn' and 'sum' are supported, with - 'mean' the default. 'sqrtn' often achieves good accuracy, in particular - with bag-of-words columns. Each of this can be thought as example level - normalizations on the column. For more information, see - `tf.embedding_lookup_sparse`. - initializer: A variable initializer function to be used in embedding - variable initialization. If not specified, defaults to - `tf.compat.v1.truncated_normal_initializer` with mean `0.0` and - standard deviation `1/sqrt(dimension)`. - ckpt_to_load_from: String representing checkpoint name/pattern from which to - restore column weights. Required if `tensor_name_in_ckpt` is not `None`. - tensor_name_in_ckpt: Name of the `Tensor` in `ckpt_to_load_from` from - which to restore the column weights. Required if `ckpt_to_load_from` is - not `None`. - max_norm: If not `None`, embedding values are l2-normalized to this value. - trainable: Whether or not the embedding is trainable. Default is True. - use_safe_embedding_lookup: If true, uses safe_embedding_lookup_sparse - instead of embedding_lookup_sparse. safe_embedding_lookup_sparse ensures - there are no empty rows and all weights and ids are positive at the - expense of extra compute cost. This only applies to rank 2 (NxM) shaped - input tensors. Defaults to true, consider turning off if the above checks - are not needed. Note that having empty rows will not trigger any error - though the output result might be 0 or omitted. - -Returns: - `_DenseColumn` that converts from sparse input. - -Raises: - ValueError: if `dimension` not > 0. - ValueError: if exactly one of `ckpt_to_load_from` and `tensor_name_in_ckpt` - is specified. - ValueError: if `initializer` is specified and is not callable. - RuntimeError: If eager execution is enabled." -3553,_numeric_column,tensorflow/tensorflow/python/feature_column/feature_column.py,946,function,"Represents real valued or numerical features. - -Example: - -```python -price = numeric_column('price') -columns = [price, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) - -# or -bucketized_price = bucketized_column(price, boundaries=[...]) -columns = [bucketized_price, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -Args: - key: A unique string identifying the input feature. It is used as the - column name and the dictionary key for feature parsing configs, feature - `Tensor` objects, and feature columns. - shape: An iterable of integers specifies the shape of the `Tensor`. An - integer can be given which means a single dimension `Tensor` with given - width. The `Tensor` representing the column will have the shape of - [batch_size] + `shape`. - default_value: A single value compatible with `dtype` or an iterable of - values compatible with `dtype` which the column takes on during - `tf.Example` parsing if data is missing. A default value of `None` will - cause `tf.io.parse_example` to fail if an example does not contain this - column. If a single value is provided, the same value will be applied as - the default value for every item. If an iterable of values is provided, - the shape of the `default_value` should be equal to the given `shape`. - dtype: defines the type of values. Default value is `tf.float32`. Must be a - non-quantized, real integer or floating point type. - normalizer_fn: If not `None`, a function that can be used to normalize the - value of the tensor after `default_value` is applied for parsing. - Normalizer function takes the input `Tensor` as its argument, and returns - the output `Tensor`. (e.g. lambda x: (x - 3.0) / 4.2). Please note that - even though the most common use case of this function is normalization, it - can be used for any kind of Tensorflow transformations. - -Returns: - A `_NumericColumn`. - -Raises: - TypeError: if any dimension in shape is not an int - ValueError: if any dimension in shape is not a positive integer - TypeError: if `default_value` is an iterable but not compatible with `shape` - TypeError: if `default_value` is not compatible with `dtype`. - ValueError: if `dtype` is not convertible to `tf.float32`." -3554,_bucketized_column,tensorflow/tensorflow/python/feature_column/feature_column.py,1022,function,"Represents discretized dense input. - -Buckets include the left boundary, and exclude the right boundary. Namely, -`boundaries=[0., 1., 2.]` generates buckets `(-inf, 0.)`, `[0., 1.)`, -`[1., 2.)`, and `[2., +inf)`. - -For example, if the inputs are - -```python -boundaries = [0, 10, 100] -input tensor = [[-5, 10000] - [150, 10] - [5, 100]] -``` - -then the output will be - -```python -output = [[0, 3] - [3, 2] - [1, 3]] -``` - -Example: - -```python -price = numeric_column('price') -bucketized_price = bucketized_column(price, boundaries=[...]) -columns = [bucketized_price, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) - -# or -columns = [bucketized_price, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) -``` - -A `bucketized_column` can also be crossed with another categorical column -using `crossed_column`: - -```python -price = numeric_column('price') -# bucketized_column converts numerical feature to a categorical one. -bucketized_price = bucketized_column(price, boundaries=[...]) -# 'keywords' is a string feature. -price_x_keywords = crossed_column([bucketized_price, 'keywords'], 50K) -columns = [price_x_keywords, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -Args: - source_column: A one-dimensional dense column which is generated with - `numeric_column`. - boundaries: A sorted list or tuple of floats specifying the boundaries. - -Returns: - A `_BucketizedColumn`. - -Raises: - ValueError: If `source_column` is not a numeric column, or if it is not - one-dimensional. - ValueError: If `boundaries` is not a sorted list or tuple." -3555,_categorical_column_with_hash_bucket,tensorflow/tensorflow/python/feature_column/feature_column.py,1105,function,"Represents sparse feature where ids are set by hashing. - -Use this when your sparse features are in string or integer format, and you -want to distribute your inputs into a finite number of buckets by hashing. -output_id = Hash(input_feature_string) % bucket_size for string type input. -For int type input, the value is converted to its string representation first -and then hashed by the same formula. - -For input dictionary `features`, `features[key]` is either `Tensor` or -`SparseTensor`. If `Tensor`, missing values can be represented by `-1` for int -and `''` for string, which will be dropped by this feature column. - -Example: - -```python -keywords = categorical_column_with_hash_bucket(""keywords"", 10K) -columns = [keywords, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) - -# or -keywords_embedded = embedding_column(keywords, 16) -columns = [keywords_embedded, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) -``` - -Args: - key: A unique string identifying the input feature. It is used as the - column name and the dictionary key for feature parsing configs, feature - `Tensor` objects, and feature columns. - hash_bucket_size: An int > 1. The number of buckets. - dtype: The type of features. Only string and integer types are supported. - -Returns: - A `_HashedCategoricalColumn`. - -Raises: - ValueError: `hash_bucket_size` is not greater than 1. - ValueError: `dtype` is neither string nor integer." -3556,_categorical_column_with_vocabulary_file,tensorflow/tensorflow/python/feature_column/feature_column.py,1163,function,"A `_CategoricalColumn` with a vocabulary file. - -Use this when your inputs are in string or integer format, and you have a -vocabulary file that maps each value to an integer ID. By default, -out-of-vocabulary values are ignored. Use either (but not both) of -`num_oov_buckets` and `default_value` to specify how to include -out-of-vocabulary values. - -For input dictionary `features`, `features[key]` is either `Tensor` or -`SparseTensor`. If `Tensor`, missing values can be represented by `-1` for int -and `''` for string, which will be dropped by this feature column. - -Example with `num_oov_buckets`: -File '/us/states.txt' contains 50 lines, each with a 2-character U.S. state -abbreviation. All inputs with values in that file are assigned an ID 0-49, -corresponding to its line number. All other values are hashed and assigned an -ID 50-54. - -```python -states = categorical_column_with_vocabulary_file( - key='states', vocabulary_file='/us/states.txt', vocabulary_size=50, - num_oov_buckets=5) -columns = [states, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -Example with `default_value`: -File '/us/states.txt' contains 51 lines - the first line is 'XX', and the -other 50 each have a 2-character U.S. state abbreviation. Both a literal 'XX' -in input, and other values missing from the file, will be assigned ID 0. All -others are assigned the corresponding line number 1-50. - -```python -states = categorical_column_with_vocabulary_file( - key='states', vocabulary_file='/us/states.txt', vocabulary_size=51, - default_value=0) -columns = [states, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction, _, _ = linear_model(features, columns) -``` - -And to make an embedding with either: - -```python -columns = [embedding_column(states, 3),...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) -``` - -Args: - key: A unique string identifying the input feature. It is used as the - column name and the dictionary key for feature parsing configs, feature - `Tensor` objects, and feature columns. - vocabulary_file: The vocabulary file name. - vocabulary_size: Number of the elements in the vocabulary. This must be no - greater than length of `vocabulary_file`, if less than length, later - values are ignored. If None, it is set to the length of `vocabulary_file`. - num_oov_buckets: Non-negative integer, the number of out-of-vocabulary - buckets. All out-of-vocabulary inputs will be assigned IDs in the range - `[vocabulary_size, vocabulary_size+num_oov_buckets)` based on a hash of - the input value. A positive `num_oov_buckets` can not be specified with - `default_value`. - default_value: The integer ID value to return for out-of-vocabulary feature - values, defaults to `-1`. This can not be specified with a positive - `num_oov_buckets`. - dtype: The type of features. Only string and integer types are supported. - -Returns: - A `_CategoricalColumn` with a vocabulary file. - -Raises: - ValueError: `vocabulary_file` is missing or cannot be opened. - ValueError: `vocabulary_size` is missing or < 1. - ValueError: `num_oov_buckets` is a negative integer. - ValueError: `num_oov_buckets` and `default_value` are both specified. - ValueError: `dtype` is neither string nor integer." -3557,_categorical_column_with_vocabulary_list,tensorflow/tensorflow/python/feature_column/feature_column.py,1282,function,"A `_CategoricalColumn` with in-memory vocabulary. - -Use this when your inputs are in string or integer format, and you have an -in-memory vocabulary mapping each value to an integer ID. By default, -out-of-vocabulary values are ignored. Use either (but not both) of -`num_oov_buckets` and `default_value` to specify how to include -out-of-vocabulary values. - -For input dictionary `features`, `features[key]` is either `Tensor` or -`SparseTensor`. If `Tensor`, missing values can be represented by `-1` for int -and `''` for string, which will be dropped by this feature column. - -Example with `num_oov_buckets`: -In the following example, each input in `vocabulary_list` is assigned an ID -0-3 corresponding to its index (e.g., input 'B' produces output 2). All other -inputs are hashed and assigned an ID 4-5. - -```python -colors = categorical_column_with_vocabulary_list( - key='colors', vocabulary_list=('R', 'G', 'B', 'Y'), - num_oov_buckets=2) -columns = [colors, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction, _, _ = linear_model(features, columns) -``` - -Example with `default_value`: -In the following example, each input in `vocabulary_list` is assigned an ID -0-4 corresponding to its index (e.g., input 'B' produces output 3). All other -inputs are assigned `default_value` 0. - - -```python -colors = categorical_column_with_vocabulary_list( - key='colors', vocabulary_list=('X', 'R', 'G', 'B', 'Y'), default_value=0) -columns = [colors, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction, _, _ = linear_model(features, columns) -``` - -And to make an embedding with either: - -```python -columns = [embedding_column(colors, 3),...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) -``` - -Args: - key: A unique string identifying the input feature. It is used as the - column name and the dictionary key for feature parsing configs, feature - `Tensor` objects, and feature columns. - vocabulary_list: An ordered iterable defining the vocabulary. Each feature - is mapped to the index of its value (if present) in `vocabulary_list`. - Must be castable to `dtype`. - dtype: The type of features. Only string and integer types are supported. - If `None`, it will be inferred from `vocabulary_list`. - default_value: The integer ID value to return for out-of-vocabulary feature - values, defaults to `-1`. This can not be specified with a positive - `num_oov_buckets`. - num_oov_buckets: Non-negative integer, the number of out-of-vocabulary - buckets. All out-of-vocabulary inputs will be assigned IDs in the range - `[len(vocabulary_list), len(vocabulary_list)+num_oov_buckets)` based on a - hash of the input value. A positive `num_oov_buckets` can not be specified - with `default_value`. - -Returns: - A `_CategoricalColumn` with in-memory vocabulary. - -Raises: - ValueError: if `vocabulary_list` is empty, or contains duplicate keys. - ValueError: `num_oov_buckets` is a negative integer. - ValueError: `num_oov_buckets` and `default_value` are both specified. - ValueError: if `dtype` is not integer or string." -3558,_categorical_column_with_identity,tensorflow/tensorflow/python/feature_column/feature_column.py,1395,function,"A `_CategoricalColumn` that returns identity values. - -Use this when your inputs are integers in the range `[0, num_buckets)`, and -you want to use the input value itself as the categorical ID. Values outside -this range will result in `default_value` if specified, otherwise it will -fail. - -Typically, this is used for contiguous ranges of integer indexes, but -it doesn't have to be. This might be inefficient, however, if many of IDs -are unused. Consider `categorical_column_with_hash_bucket` in that case. - -For input dictionary `features`, `features[key]` is either `Tensor` or -`SparseTensor`. If `Tensor`, missing values can be represented by `-1` for int -and `''` for string, which will be dropped by this feature column. - -In the following examples, each input in the range `[0, 1000000)` is assigned -the same value. All other inputs are assigned `default_value` 0. Note that a -literal 0 in inputs will result in the same default ID. - -Linear model: - -```python -video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) -columns = [video_id, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction, _, _ = linear_model(features, columns) -``` - -Embedding for a DNN model: - -```python -columns = [embedding_column(video_id, 9),...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) -``` - -Args: - key: A unique string identifying the input feature. It is used as the - column name and the dictionary key for feature parsing configs, feature - `Tensor` objects, and feature columns. - num_buckets: Range of inputs and outputs is `[0, num_buckets)`. - default_value: If set, values outside of range `[0, num_buckets)` will - be replaced with this value. If not set, values >= num_buckets will - cause a failure while values < 0 will be dropped. - -Returns: - A `_CategoricalColumn` that returns identity values. - -Raises: - ValueError: if `num_buckets` is less than one. - ValueError: if `default_value` is not in range `[0, num_buckets)`." -3559,_indicator_column,tensorflow/tensorflow/python/feature_column/feature_column.py,1462,function,"Represents multi-hot representation of given categorical column. - -- For DNN model, `indicator_column` can be used to wrap any - `categorical_column_*` (e.g., to feed to DNN). Consider to Use - `embedding_column` if the number of buckets/unique(values) are large. - -- For Wide (aka linear) model, `indicator_column` is the internal - representation for categorical column when passing categorical column - directly (as any element in feature_columns) to `linear_model`. See - `linear_model` for details. - -```python -name = indicator_column(categorical_column_with_vocabulary_list( - 'name', ['bob', 'george', 'wanda']) -columns = [name, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -dense_tensor = input_layer(features, columns) - -dense_tensor == [[1, 0, 0]] # If ""name"" bytes_list is [""bob""] -dense_tensor == [[1, 0, 1]] # If ""name"" bytes_list is [""bob"", ""wanda""] -dense_tensor == [[2, 0, 0]] # If ""name"" bytes_list is [""bob"", ""bob""] -``` - -Args: - categorical_column: A `_CategoricalColumn` which is created by - `categorical_column_with_*` or `crossed_column` functions. - -Returns: - An `_IndicatorColumn`." -3560,_weighted_categorical_column,tensorflow/tensorflow/python/feature_column/feature_column.py,1496,function,"Applies weight values to a `_CategoricalColumn`. - -Use this when each of your sparse inputs has both an ID and a value. For -example, if you're representing text documents as a collection of word -frequencies, you can provide 2 parallel sparse input features ('terms' and -'frequencies' below). - -Example: - -Input `tf.Example` objects: - -```proto -[ - features { - feature { - key: ""terms"" - value {bytes_list {value: ""very"" value: ""model""}} - } - feature { - key: ""frequencies"" - value {float_list {value: 0.3 value: 0.1}} - } - }, - features { - feature { - key: ""terms"" - value {bytes_list {value: ""when"" value: ""course"" value: ""human""}} - } - feature { - key: ""frequencies"" - value {float_list {value: 0.4 value: 0.1 value: 0.2}} - } - } -] -``` - -```python -categorical_column = categorical_column_with_hash_bucket( - column_name='terms', hash_bucket_size=1000) -weighted_column = weighted_categorical_column( - categorical_column=categorical_column, weight_feature_key='frequencies') -columns = [weighted_column, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction, _, _ = linear_model(features, columns) -``` - -This assumes the input dictionary contains a `SparseTensor` for key -'terms', and a `SparseTensor` for key 'frequencies'. These 2 tensors must have -the same indices and dense shape. - -Args: - categorical_column: A `_CategoricalColumn` created by - `categorical_column_with_*` functions. - weight_feature_key: String key for weight values. - dtype: Type of weights, such as `tf.float32`. Only float and integer weights - are supported. - -Returns: - A `_CategoricalColumn` composed of two sparse features: one represents id, - the other represents weight (value) of the id feature in that example. - -Raises: - ValueError: if `dtype` is not convertible to float." -3561,_crossed_column,tensorflow/tensorflow/python/feature_column/feature_column.py,1571,function,"Returns a column for performing crosses of categorical features. - -Crossed features will be hashed according to `hash_bucket_size`. Conceptually, -the transformation can be thought of as: - Hash(cartesian product of features) % `hash_bucket_size` - -For example, if the input features are: - -* SparseTensor referred by first key: - - ```python - shape = [2, 2] - { - [0, 0]: ""a"" - [1, 0]: ""b"" - [1, 1]: ""c"" - } - ``` - -* SparseTensor referred by second key: - - ```python - shape = [2, 1] - { - [0, 0]: ""d"" - [1, 0]: ""e"" - } - ``` - -then crossed feature will look like: - -```python - shape = [2, 2] -{ - [0, 0]: Hash64(""d"", Hash64(""a"")) % hash_bucket_size - [1, 0]: Hash64(""e"", Hash64(""b"")) % hash_bucket_size - [1, 1]: Hash64(""e"", Hash64(""c"")) % hash_bucket_size -} -``` - -Here is an example to create a linear model with crosses of string features: - -```python -keywords_x_doc_terms = crossed_column(['keywords', 'doc_terms'], 50K) -columns = [keywords_x_doc_terms, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -You could also use vocabulary lookup before crossing: - -```python -keywords = categorical_column_with_vocabulary_file( - 'keywords', '/path/to/vocabulary/file', vocabulary_size=1K) -keywords_x_doc_terms = crossed_column([keywords, 'doc_terms'], 50K) -columns = [keywords_x_doc_terms, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -If an input feature is of numeric type, you can use -`categorical_column_with_identity`, or `bucketized_column`, as in the example: - -```python -# vertical_id is an integer categorical feature. -vertical_id = categorical_column_with_identity('vertical_id', 10K) -price = numeric_column('price') -# bucketized_column converts numerical feature to a categorical one. -bucketized_price = bucketized_column(price, boundaries=[...]) -vertical_id_x_price = crossed_column([vertical_id, bucketized_price], 50K) -columns = [vertical_id_x_price, ...] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -linear_prediction = linear_model(features, columns) -``` - -To use crossed column in DNN model, you need to add it in an embedding column -as in this example: - -```python -vertical_id_x_price = crossed_column([vertical_id, bucketized_price], 50K) -vertical_id_x_price_embedded = embedding_column(vertical_id_x_price, 10) -dense_tensor = input_layer(features, [vertical_id_x_price_embedded, ...]) -``` - -Args: - keys: An iterable identifying the features to be crossed. Each element can - be either: - * string: Will use the corresponding feature which must be of string type. - * `_CategoricalColumn`: Will use the transformed tensor produced by this - column. Does not support hashed categorical column. - hash_bucket_size: An int > 1. The number of buckets. - hash_key: Specify the hash_key that will be used by the `FingerprintCat64` - function to combine the crosses fingerprints on SparseCrossOp (optional). - -Returns: - A `_CrossedColumn`. - -Raises: - ValueError: If `len(keys) < 2`. - ValueError: If any of the keys is neither a string nor `_CategoricalColumn`. - ValueError: If any of the keys is `_HashedCategoricalColumn`. - ValueError: If `hash_bucket_size < 1`." -3562,_EmbeddingColumnLayer,tensorflow/tensorflow/python/feature_column/feature_column.py,1699,class,A layer that stores all the state required for a embedding column. -3563,_FeatureColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,1754,class,"Represents a feature column abstraction. - -WARNING: Do not subclass this layer unless you know what you are doing: -the API is subject to future changes. - -To distinguish the concept of a feature family and a specific binary feature -within a family, we refer to a feature family like ""country"" as a feature -column. Following is an example feature in a `tf.Example` format: - {key: ""country"", value: [ ""US"" ]} -In this example the value of feature is ""US"" and ""country"" refers to the -column of the feature. - -This class is an abstract class. User should not create instances of this." -3564,_DenseColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,1896,class,"Represents a column which can be represented as `Tensor`. - -WARNING: Do not subclass this layer unless you know what you are doing: -the API is subject to future changes. - -Some examples of this type are: numeric_column, embedding_column, -indicator_column." -3565,_create_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column.py,1937,function,Creates a weighted sum for a dense/categorical column for linear_model. -3566,_create_dense_column_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column.py,1964,function,Create a weighted sum of a dense column for linear_model. -3567,_CategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,1990,class,"Represents a categorical feature. - -WARNING: Do not subclass this layer unless you know what you are doing: -the API is subject to future changes. - -A categorical feature typically handled with a `tf.sparse.SparseTensor` of -IDs." -3568,_create_categorical_column_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column.py,2036,function,"Create a weighted sum of a categorical column for linear_model. - -Note to maintainer: As implementation details, the weighted sum is -implemented via embedding_lookup_sparse toward efficiency. Mathematically, -they are the same. - -To be specific, conceptually, categorical column can be treated as multi-hot -vector. Say: - -```python - x = [0 0 1] # categorical column input - w = [a b c] # weights -``` -The weighted sum is `c` in this case, which is same as `w[2]`. - -Another example is - -```python - x = [0 1 1] # categorical column input - w = [a b c] # weights -``` -The weighted sum is `b + c` in this case, which is same as `w[2] + w[3]`. - -For both cases, we can implement weighted sum via embedding_lookup with -sparse_combiner = ""sum""." -3569,_SequenceDenseColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2100,class,Represents dense sequence data. -3570,_LazyBuilder,tensorflow/tensorflow/python/feature_column/feature_column.py,2113,class,"Handles caching of transformations while building the model. - -`_FeatureColumn` specifies how to digest an input column to the network. Some -feature columns require data transformations. This class caches those -transformations. - -Some features may be used in more than one place. For example, one can use a -bucketized feature by itself and a cross with it. In that case we -should create only one bucketization op instead of creating ops for each -feature column separately. To handle re-use of transformed columns, -`_LazyBuilder` caches all previously transformed columns. - -Example: -We're trying to use the following `_FeatureColumn`s: - -```python -bucketized_age = fc.bucketized_column(fc.numeric_column(""age""), ...) -keywords = fc.categorical_column_with_hash_buckets(""keywords"", ...) -age_X_keywords = fc.crossed_column([bucketized_age, ""keywords""]) -... = linear_model(features, - [bucketized_age, keywords, age_X_keywords] -``` - -If we transform each column independently, then we'll get duplication of -bucketization (one for cross, one for bucketization itself). -The `_LazyBuilder` eliminates this duplication." -3571,_shape_offsets,tensorflow/tensorflow/python/feature_column/feature_column.py,2249,function,Returns moving offset for each dimension given shape. -3572,_to_sparse_input_and_drop_ignore_values,tensorflow/tensorflow/python/feature_column/feature_column.py,2262,function,"Converts a `Tensor` to a `SparseTensor`, dropping ignore_value cells. - -If `input_tensor` is already a `SparseTensor`, just return it. - -Args: - input_tensor: A string or integer `Tensor`. - ignore_value: Entries in `dense_tensor` equal to this value will be - absent from the resulting `SparseTensor`. If `None`, default value of - `dense_tensor`'s dtype will be used ('' for `str`, -1 for `int`). - -Returns: - A `SparseTensor` with the same shape as `input_tensor`. - -Raises: - ValueError: when `input_tensor`'s rank is `None`." -3573,_normalize_feature_columns,tensorflow/tensorflow/python/feature_column/feature_column.py,2306,function,"Normalizes the `feature_columns` input. - -This method converts the `feature_columns` to list type as best as it can. In -addition, verifies the type and other parts of feature_columns, required by -downstream library. - -Args: - feature_columns: The raw feature columns, usually passed by users. - -Returns: - The normalized feature column list. - -Raises: - ValueError: for any invalid inputs, such as empty, duplicated names, etc." -3574,_NumericColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2351,class,see `numeric_column`. -3575,_BucketizedColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2406,class,See `bucketized_column`. -3576,_EmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2476,class,See `embedding_column`. -3577,_get_graph_for_variable,tensorflow/tensorflow/python/feature_column/feature_column.py,2604,function, -3578,_SharedEmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2611,class,See `embedding_column`. -3579,_check_shape,tensorflow/tensorflow/python/feature_column/feature_column.py,2753,function,"Returns shape if it's valid, raises error otherwise." -3580,_HashedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2769,class,see `categorical_column_with_hash_bucket`. -3581,_VocabularyFileCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2818,class,See `categorical_column_with_vocabulary_file`. -3582,_VocabularyListCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2871,class,See `categorical_column_with_vocabulary_list`. -3583,_IdentityCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2922,class,See `categorical_column_with_identity`. -3584,_WeightedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,2975,class,See `weighted_categorical_column`. -3585,_CrossedColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,3025,class,See `crossed_column`. -3586,_collect_leaf_level_keys,tensorflow/tensorflow/python/feature_column/feature_column.py,3081,function,"Collects base keys by expanding all nested crosses. - -Args: - cross: A `_CrossedColumn`. - -Returns: - A list of strings or `_CategoricalColumn` instances." -3587,_IndicatorColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,3099,class,"Represents a one-hot column for use in deep networks. - -Args: - categorical_column: A `_CategoricalColumn` which is created by - `categorical_column_with_*` function." -3588,_verify_static_batch_size_equality,tensorflow/tensorflow/python/feature_column/feature_column.py,3227,function,"Validates that the first dim (batch size) of all tensors are equal or None. - -Args: - tensors: list of tensors to check. - columns: list of feature columns matching tensors. Will be used for error - messaging. - -Raises: - ValueError: if one of the tensors has a variant batch size" -3589,_SequenceCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column.py,3253,class,Represents sequences of categorical data. -3590,_initialized_session,tensorflow/tensorflow/python/feature_column/feature_column_test.py,58,function, -3591,LazyColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,65,class, -3592,NumericColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,188,class, -3593,BucketizedColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,387,class, -3594,HashedCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,668,class, -3595,CrossedColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,911,class, -3596,get_linear_model_bias,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1297,function, -3597,get_linear_model_column_var,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1302,function, -3598,get_keras_linear_model_predictions,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1307,function, -3599,LinearModelTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1327,class, -3600,_LinearModelTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,2006,class, -3601,InputLayerTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,2627,class, -3602,FunctionalInputLayerTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,2727,class, -3603,MakeParseExampleSpecTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,3264,class, -3604,_assert_sparse_tensor_value,tensorflow/tensorflow/python/feature_column/feature_column_test.py,3344,function, -3605,VocabularyFileCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,3356,class, -3606,VocabularyListCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,3830,class, -3607,IdentityCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,4239,class, -3608,TransformFeaturesTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,4541,class, -3609,IndicatorColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,4602,class, -3610,EmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,4816,class, -3611,SharedEmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,5561,class, -3612,WeightedCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_test.py,6309,class, -3613,StateManager,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,176,class,"Manages the state associated with FeatureColumns. +3677,get_linear_model_bias,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1297,function, +3678,get_linear_model_column_var,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1302,function, +3679,get_keras_linear_model_predictions,tensorflow/tensorflow/python/feature_column/feature_column_test.py,1307,function, +3680,StateManager,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,176,class,"Manages the state associated with FeatureColumns. Some `FeatureColumn`s create variables or resources to assist their computation. The `StateManager` is responsible for creating and storing these objects since `FeatureColumn`s are supposed to be stateless configuration only." -3614,_StateManagerImpl,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,272,class,Manages the state of DenseFeatures and LinearLayer. -3615,_StateManagerImplV2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,351,class,Manages the state of DenseFeatures. -3616,_transform_features_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,381,function,"Returns transformed features based on features columns passed in. - -Please note that most probably you would not need to use this function. Please -check `input_layer` and `linear_model` to see whether they will -satisfy your use case or not. - -Example: - -```python -# Define features and transformations -crosses_a_x_b = crossed_column( - columns=[""sparse_feature_a"", ""sparse_feature_b""], hash_bucket_size=10000) -price_buckets = bucketized_column( - source_column=numeric_column(""price""), boundaries=[...]) - -columns = [crosses_a_x_b, price_buckets] -features = tf.io.parse_example(..., features=make_parse_example_spec(columns)) -transformed = transform_features(features=features, feature_columns=columns) - -assertCountEqual(columns, transformed.keys()) -``` +3681,create_variable,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,185,method,"Creates a new variable. Args: - features: A mapping from key to tensors. `FeatureColumn`s look up via these - keys. For example `numeric_column('price')` will look at 'price' key in - this dict. Values can be a `SparseTensor` or a `Tensor` depends on - corresponding `FeatureColumn`. - feature_columns: An iterable containing all the `FeatureColumn`s. - state_manager: A StateManager object that holds the FeatureColumn state. + feature_column: A `FeatureColumn` object this variable corresponds to. + name: variable name. + shape: variable shape. + dtype: The type of the variable. Defaults to `self.dtype` or `float32`. + trainable: Whether this variable is trainable or not. + use_resource: If true, we use resource variables. Otherwise we use + RefVariable. + initializer: initializer instance (callable). Returns: - A `dict` mapping `FeatureColumn` to `Tensor` and `SparseTensor` values." -3617,make_parse_example_spec_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,429,function,"Creates parsing spec dictionary from input feature_columns. + The created variable." +3682,add_variable,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,211,method,"Adds an existing variable to the state. + +Args: + feature_column: A `FeatureColumn` object to associate this variable with. + var: The variable." +3683,get_variable,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,221,method,"Returns an existing variable. + +Args: + feature_column: A `FeatureColumn` object this variable corresponds to. + name: variable name." +3684,add_resource,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,231,method,"Creates a new resource. + +Resources can be things such as tables, variables, trackables, etc. + +Args: + feature_column: A `FeatureColumn` object this resource corresponds to. + name: Name of the resource. + resource: The resource. + +Returns: + The created resource." +3685,has_resource,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,247,method,"Returns true iff a resource with same name exists. + +Resources can be things such as tables, variables, trackables, etc. + +Args: + feature_column: A `FeatureColumn` object this variable corresponds to. + name: Name of the resource." +3686,get_resource,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,259,method,"Returns an already created resource. + +Resources can be things such as tables, variables, trackables, etc. + +Args: + feature_column: A `FeatureColumn` object this variable corresponds to. + name: Name of the resource." +3687,make_parse_example_spec_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,429,function,"Creates parsing spec dictionary from input feature_columns. The returned dictionary can be used as arg 'features' in `tf.io.parse_example`. @@ -19763,7 +24317,7 @@ Returns: Raises: ValueError: If any of the given `feature_columns` is not a `FeatureColumn` instance." -3618,embedding_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,491,function,"`DenseColumn` that converts from sparse, categorical input. +3688,embedding_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,491,function,"`DenseColumn` that converts from sparse, categorical input. Use this when your inputs are sparse, but you want to convert them to a dense representation (e.g., to feed to a DNN). @@ -19840,7 +24394,7 @@ Raises: is specified. ValueError: if `initializer` is specified and is not callable. RuntimeError: If eager execution is enabled." -3619,shared_embedding_columns,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,605,function,"List of dense columns that convert from sparse, categorical input. +3689,shared_embedding_columns,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,605,function,"List of dense columns that convert from sparse, categorical input. This is similar to `embedding_column`, except that it produces a list of embedding columns that share the same embedding weights. @@ -19942,7 +24496,7 @@ Raises: is specified. ValueError: if `initializer` is specified and is not callable. RuntimeError: if eager execution is enabled." -3620,shared_embedding_columns_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,789,function,"List of dense columns that convert from sparse, categorical input. +3690,shared_embedding_columns_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,789,function,"List of dense columns that convert from sparse, categorical input. This is similar to `embedding_column`, except that it produces a list of embedding columns that share the same embedding weights. @@ -20043,7 +24597,7 @@ Raises: is specified. ValueError: if `initializer` is specified and is not callable. RuntimeError: if eager execution is enabled." -3621,numeric_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,964,function,"Represents real valued or numerical features. +3691,numeric_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,964,function,"Represents real valued or numerical features. Example: @@ -20093,7 +24647,7 @@ Raises: TypeError: if `default_value` is an iterable but not compatible with `shape` TypeError: if `default_value` is not compatible with `dtype`. ValueError: if `dtype` is not convertible to `tf.float32`." -3622,bucketized_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1041,function,"Represents discretized dense input bucketed by `boundaries`. +3692,bucketized_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1041,function,"Represents discretized dense input bucketed by `boundaries`. Buckets include the left boundary, and exclude the right boundary. Namely, `boundaries=[0., 1., 2.]` generates buckets `(-inf, 0.)`, `[0., 1.)`, @@ -20158,7 +24712,7 @@ Raises: ValueError: If `source_column` is not a numeric column, or if it is not one-dimensional. ValueError: If `boundaries` is not a sorted list or tuple." -3623,categorical_column_with_hash_bucket,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1127,function,"Represents sparse feature where ids are set by hashing. +3693,categorical_column_with_hash_bucket,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1127,function,"Represents sparse feature where ids are set by hashing. Use this when your sparse features are in string or integer format, and you want to distribute your inputs into a finite number of buckets by hashing. @@ -20198,7 +24752,7 @@ Returns: Raises: ValueError: `hash_bucket_size` is not greater than 1. ValueError: `dtype` is neither string nor integer." -3624,categorical_column_with_vocabulary_file,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1186,function,"A `CategoricalColumn` with a vocabulary file. +3694,categorical_column_with_vocabulary_file,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1186,function,"A `CategoricalColumn` with a vocabulary file. Use this when your inputs are in string or integer format, and you have a vocabulary file that maps each value to an integer ID. By default, @@ -20275,7 +24829,7 @@ Raises: ValueError: `num_oov_buckets` is a negative integer. ValueError: `num_oov_buckets` and `default_value` are both specified. ValueError: `dtype` is neither string nor integer." -3625,categorical_column_with_vocabulary_file_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1277,function,"A `CategoricalColumn` with a vocabulary file. +3695,categorical_column_with_vocabulary_file_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1277,function,"A `CategoricalColumn` with a vocabulary file. Use this when your inputs are in string or integer format, and you have a vocabulary file that maps each value to an integer ID. By default, @@ -20352,7 +24906,7 @@ Raises: ValueError: `num_oov_buckets` is a negative integer. ValueError: `num_oov_buckets` and `default_value` are both specified. ValueError: `dtype` is neither string nor integer." -3626,categorical_column_with_vocabulary_list,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1397,function,"A `CategoricalColumn` with in-memory vocabulary. +3696,categorical_column_with_vocabulary_list,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1397,function,"A `CategoricalColumn` with in-memory vocabulary. Use this when your inputs are in string or integer format, and you have an in-memory vocabulary mapping each value to an integer ID. By default, @@ -20426,7 +24980,7 @@ Raises: ValueError: `num_oov_buckets` is a negative integer. ValueError: `num_oov_buckets` and `default_value` are both specified. ValueError: if `dtype` is not integer or string." -3627,categorical_column_with_identity,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1514,function,"A `CategoricalColumn` that returns identity values. +3697,categorical_column_with_identity,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1514,function,"A `CategoricalColumn` that returns identity values. Use this when your inputs are integers in the range `[0, num_buckets)`, and you want to use the input value itself as the categorical ID. Values outside @@ -20478,7 +25032,7 @@ Returns: Raises: ValueError: if `num_buckets` is less than one. ValueError: if `default_value` is not in range `[0, num_buckets)`." -3628,indicator_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1582,function,"Represents multi-hot representation of given categorical column. +3698,indicator_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1582,function,"Represents multi-hot representation of given categorical column. - For DNN model, `indicator_column` can be used to wrap any `categorical_column_*` (e.g., to feed to DNN). Consider to Use @@ -20510,7 +25064,7 @@ Returns: Raises: ValueError: If `categorical_column` is not CategoricalColumn type." -3629,weighted_categorical_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1625,function,"Applies weight values to a `CategoricalColumn`. +3699,weighted_categorical_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1625,function,"Applies weight values to a `CategoricalColumn`. Use this when each of your sparse inputs has both an ID and a value. For example, if you're representing text documents as a collection of word @@ -20573,7 +25127,7 @@ Returns: Raises: ValueError: if `dtype` is not convertible to float." -3630,crossed_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1701,function,"Returns a column for performing crosses of categorical features. +3700,crossed_column,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1701,function,"Returns a column for performing crosses of categorical features. Crossed features will be hashed according to `hash_bucket_size`. Conceptually, the transformation can be thought of as: @@ -20675,7 +25229,7 @@ Raises: ValueError: If any of the keys is neither a string nor `CategoricalColumn`. ValueError: If any of the keys is `HashedCategoricalColumn`. ValueError: If `hash_bucket_size < 1`." -3631,FeatureColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1829,class,"Represents a feature column abstraction. +3701,FeatureColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1829,class,"Represents a feature column abstraction. WARNING: Do not subclass this layer unless you know what you are doing: the API is subject to future changes. @@ -20688,44 +25242,187 @@ In this example the value of feature is ""US"" and ""country"" refers to the column of the feature. This class is an abstract class. Users should not create instances of this." -3632,DenseColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2082,class,"Represents a column which can be represented as `Tensor`. +3702,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1846,method,Returns string. Used for naming. +3703,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1913,method,"Returns intermediate representation (usually a `Tensor`). + +Uses `transformation_cache` to create an intermediate representation +(usually a `Tensor`) that other feature columns can use. + +Example usage of `transformation_cache`: +Let's say a Feature column depends on raw feature ('raw') and another +`FeatureColumn` (input_fc). To access corresponding `Tensor`s, +transformation_cache will be used as follows: + +```python +raw_tensor = transformation_cache.get('raw', state_manager) +fc_tensor = transformation_cache.get(input_fc, state_manager) +``` + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + Transformed feature `Tensor`." +3704,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1941,method,"Returns a `tf.Example` parsing spec as dict. + +It is used for get_parsing_spec for `tf.io.parse_example`. Returned spec is +a dict from keys ('string') to `VarLenFeature`, `FixedLenFeature`, and other +supported objects. Please check documentation of `tf.io.parse_example` for +all supported spec objects. + +Let's say a Feature column depends on raw feature ('raw') and another +`FeatureColumn` (input_fc). One possible implementation of +parse_example_spec is as follows: + +```python +spec = {'raw': tf.io.FixedLenFeature(...)} +spec.update(input_fc.parse_example_spec) +return spec +```" +3705,create_state,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1961,method,"Uses the `state_manager` to create state for the FeatureColumn. + +Args: + state_manager: A `StateManager` to create / access resources such as + lookup tables and variables." +3706,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1981,method,"Returns a list of immediate raw feature and FeatureColumn dependencies. + +For example: +# For the following feature columns +a = numeric_column('f1') +c = crossed_column(a, 'f2') +# The expected parents are: +a.parents = ['f1'] +c.parents = [a, 'f2']" +3707,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,1994,method,"Returns the config of the feature column. + +A FeatureColumn config is a Python dictionary (serializable) containing the +configuration of a FeatureColumn. The same FeatureColumn can be +reinstantiated later from this configuration. + +The config of a feature column does not include information about feature +columns depending on it nor the FeatureColumn class name. + +Example with (de)serialization practices followed in this file: +```python +class SerializationExampleFeatureColumn( + FeatureColumn, collections.namedtuple( + 'SerializationExampleFeatureColumn', + ('dimension', 'parent', 'dtype', 'normalizer_fn'))): + + def get_config(self): + # Create a dict from the namedtuple. + # Python attribute literals can be directly copied from / to the config. + # For example 'dimension', assuming it is an integer literal. + config = dict(zip(self._fields, self)) + + # (De)serialization of parent FeatureColumns should use the provided + # (de)serialize_feature_column() methods that take care of de-duping. + config['parent'] = serialize_feature_column(self.parent) + + # Many objects provide custom (de)serialization e.g: for tf.DType + # tf.DType.name, tf.as_dtype() can be used. + config['dtype'] = self.dtype.name + + # Non-trivial dependencies should be Keras-(de)serializable. + config['normalizer_fn'] = generic_utils.serialize_keras_object( + self.normalizer_fn) + + return config + + @classmethod + def from_config(cls, config, custom_objects=None, columns_by_name=None): + # This should do the inverse transform from `get_config` and construct + # the namedtuple. + kwargs = config.copy() + kwargs['parent'] = deserialize_feature_column( + config['parent'], custom_objects, columns_by_name) + kwargs['dtype'] = dtypes.as_dtype(config['dtype']) + kwargs['normalizer_fn'] = generic_utils.deserialize_keras_object( + config['normalizer_fn'], custom_objects=custom_objects) + return cls(**kwargs) + +``` +Returns: + A serializable Dict that can be used to deserialize the object with + from_config." +3708,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2054,method,"Creates a FeatureColumn from its config. + +This method should be the reverse of `get_config`, capable of instantiating +the same FeatureColumn from the config dictionary. See `get_config` for an +example of common (de)serialization practices followed in this file. + +TODO(b/118939620): This is a private method until consensus is reached on +supporting object deserialization deduping within Keras. + +Args: + config: A Dict config acquired with `get_config`. + custom_objects: Optional dictionary mapping names (strings) to custom + classes or functions to be considered during deserialization. + columns_by_name: A Dict[String, FeatureColumn] of existing columns in + order to avoid duplication. Should be passed to any calls to + deserialize_feature_column(). + +Returns: + A FeatureColumn for the input config." +3709,DenseColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2082,class,"Represents a column which can be represented as `Tensor`. Some examples of this type are: numeric_column, embedding_column, indicator_column." -3633,is_feature_column_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2119,function,Returns True if all feature columns are V2. -3634,_create_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2129,function,Creates a weighted sum for a dense/categorical column for linear_model. -3635,_create_dense_column_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2147,function,Create a weighted sum of a dense column for linear_model. -3636,CategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2157,class,"Represents a categorical feature. +3710,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2090,method,"`TensorShape` of `get_dense_tensor`, without batch dimension." +3711,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2095,method,"Returns a `Tensor`. + +The output of this function will be used by model-builder-functions. For +example the pseudo code of `input_layer` will be like: + +```python +def input_layer(features, feature_columns, ...): + outputs = [fc.get_dense_tensor(...) for fc in feature_columns] + return tf.concat(outputs) +``` + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + `Tensor` of shape [batch_size] + `variable_shape`." +3712,is_feature_column_v2,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2119,function,Returns True if all feature columns are V2. +3713,CategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2157,class,"Represents a categorical feature. A categorical feature typically handled with a `tf.sparse.SparseTensor` of IDs." -3637,_create_categorical_column_weighted_sum,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2195,function,"Create a weighted sum of a categorical column for linear_model. +3714,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2168,method,Returns number of buckets in this sparse feature. +3715,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2173,method,"Returns an IdWeightPair. -Note to maintainer: As implementation details, the weighted sum is -implemented via embedding_lookup_sparse toward efficiency. Mathematically, -they are the same. +`IdWeightPair` is a pair of `SparseTensor`s which represents ids and +weights. -To be specific, conceptually, categorical column can be treated as multi-hot -vector. Say: +`IdWeightPair.id_tensor` is typically a `batch_size` x `num_buckets` +`SparseTensor` of `int64`. `IdWeightPair.weight_tensor` is either a +`SparseTensor` of `float` or `None` to indicate all weights should be +taken to be 1. If specified, `weight_tensor` must have exactly the same +shape and indices as `sp_ids`. Expected `SparseTensor` is same as parsing +output of a `VarLenFeature` which is a ragged matrix. -```python - x = [0 0 1] # categorical column input - w = [a b c] # weights -``` -The weighted sum is `c` in this case, which is same as `w[2]`. +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables." +3716,SequenceDenseColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2243,class,Represents dense sequence data. +3717,get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2250,method,"Returns a `TensorSequenceLengthPair`. -Another example is - -```python - x = [0 1 1] # categorical column input - w = [a b c] # weights -``` -The weighted sum is `b + c` in this case, which is same as `w[2] + w[3]`. - -For both cases, we can implement weighted sum via embedding_lookup with -sparse_combiner = ""sum""." -3638,SequenceDenseColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2243,class,Represents dense sequence data. -3639,FeatureTransformationCache,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2262,class,"Handles caching of transformations while building the model. +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables." +3718,FeatureTransformationCache,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2262,class,"Handles caching of transformations while building the model. `FeatureColumn` specifies how to digest an input column to the network. Some feature columns require data transformations. This class caches those @@ -20751,114 +25448,225 @@ age_X_keywords = fc.crossed_column([bucketized_age, ""keywords""]) If we transform each column independently, then we'll get duplication of bucketization (one for cross, one for bucketization itself). The `FeatureTransformationCache` eliminates this duplication." -3640,_to_sparse_input_and_drop_ignore_values,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2412,function,"Converts a `Tensor` to a `SparseTensor`, dropping ignore_value cells. +3719,get,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2305,method,"Returns a `Tensor` for the given key. -If `input_tensor` is already a `SparseTensor`, just return it. +A `str` key is used to access a base feature (not-transformed). When a +`FeatureColumn` is passed, the transformed feature is returned if it +already exists, otherwise the given `FeatureColumn` is asked to provide its +transformed output, which is then cached. Args: - input_tensor: A string or integer `Tensor`. - ignore_value: Entries in `dense_tensor` equal to this value will be - absent from the resulting `SparseTensor`. If `None`, default value of - `dense_tensor`'s dtype will be used ('' for `str`, -1 for `int`). + key: a `str` or a `FeatureColumn`. + state_manager: A StateManager object that holds the FeatureColumn state. + training: Boolean indicating whether to the column is being used in + training mode. This argument is passed to the transform_feature method + of any `FeatureColumn` that takes a `training` argument. For example, if + a `FeatureColumn` performed dropout, it could expose a `training` + argument to control whether the dropout should be applied. Returns: - A `SparseTensor` with the same shape as `input_tensor`. + The transformed `Tensor` corresponding to the `key`. Raises: - ValueError: when `input_tensor`'s rank is `None`." -3641,_normalize_feature_columns,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2456,function,"Normalizes the `feature_columns` input. + ValueError: if key is not found or a transformed `Tensor` cannot be + computed." +3720,expand_dims,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2383,method, +3721,NumericColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2501,class,see `numeric_column`. +3722,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2514,method,See `FeatureColumn` base class. +3723,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2519,method,See `FeatureColumn` base class. +3724,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2548,method,"See `FeatureColumn` base class. -This method converts the `feature_columns` to list type as best as it can. In -addition, verifies the type and other parts of feature_columns, required by -downstream library. +In this case, we apply the `normalizer_fn` to the input tensor. Args: - feature_columns: The raw feature columns, usually passed by users. + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. Returns: - The normalized feature column list. + Normalized input tensor. +Raises: + ValueError: If a SparseTensor is passed in." +3725,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2568,method,See `DenseColumn` base class. +3726,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2578,method,"Returns dense `Tensor` representing numeric feature. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + Dense `Tensor` created within `transform_feature`." +3727,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2602,method,See 'FeatureColumn` base class. +3728,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2606,method,See 'FeatureColumn` base class. +3729,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2616,method,See 'FeatureColumn` base class. +3730,BucketizedColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2628,class,See `bucketized_column`. +3731,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2643,method,See `FeatureColumn` base class. +3732,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2648,method,See `FeatureColumn` base class. +3733,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2667,method,Returns bucketized categorical `source_column` tensor. +3734,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2675,method,See `DenseColumn` base class. +3735,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2693,method,Returns one hot encoded dense `Tensor`. +3736,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2707,method,See `CategoricalColumn` base class. +3737,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2745,method,Converts dense inputs to SparseTensor so downstream code can use it. +3738,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2761,method,See 'FeatureColumn` base class. +3739,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2765,method,See 'FeatureColumn` base class. +3740,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2773,method,See 'FeatureColumn` base class. +3741,EmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2783,class,See `embedding_column`. +3742,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2823,method,See `FeatureColumn` base class. +3743,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2828,method,See `FeatureColumn` base class. +3744,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2838,method,Transforms underlying `categorical_column`. +3745,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2848,method,See `DenseColumn` base class. +3746,create_state,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2858,method,Creates the embedding lookup variable. +3747,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2927,method,"Returns tensor after doing the embedding lookup. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + Embedding lookup tensor. Raises: - ValueError: for any invalid inputs, such as empty, duplicated names, etc." -3642,NumericColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2501,class,see `numeric_column`. -3643,BucketizedColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2628,class,See `bucketized_column`. -3644,EmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2783,class,See `embedding_column`. -3645,_raise_shared_embedding_column_error,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3055,function, -3646,SharedEmbeddingColumnCreator,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3061,class, -3647,SharedEmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3113,class,See `embedding_column`. -3648,_check_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3250,function,"Returns shape if it's valid, raises error otherwise." -3649,HashedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3266,class,see `categorical_column_with_hash_bucket`. -3650,VocabularyFileCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3374,class,See `categorical_column_with_vocabulary_file`. -3651,VocabularyListCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3493,class,See `categorical_column_with_vocabulary_list`. -3652,IdentityCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3612,class,See `categorical_column_with_identity`. -3653,WeightedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3721,class,See `weighted_categorical_column`. -3654,CrossedColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3845,class,See `crossed_column`. -3655,_collect_leaf_level_keys,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3988,function,"Collects base keys by expanding all nested crosses. - -Args: - cross: A `CrossedColumn`. - -Returns: - A list of strings or `CategoricalColumn` instances." -3656,_prune_invalid_ids,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4006,function,Prune invalid IDs (< 0) from the input ids and weights. -3657,_prune_invalid_weights,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4019,function,Prune invalid weights (< 0) from the input ids and weights. -3658,IndicatorColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4028,class,"Represents a one-hot column for use in deep networks. + ValueError: `categorical_column` is SequenceCategoricalColumn." +3748,get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,2977,method,See `SequenceDenseColumn` base class. +3749,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3023,method,See 'FeatureColumn` base class. +3750,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3027,method,See 'FeatureColumn` base class. +3751,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3038,method,See 'FeatureColumn` base class. +3752,SharedEmbeddingColumnCreator,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3061,class, +3753,embedding_weights,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3088,method, +3754,dimension,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3109,method, +3755,SharedEmbeddingColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3113,class,See `embedding_column`. +3756,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3143,method,See `FeatureColumn` base class. +3757,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3148,method,See `FeatureColumn` base class. +3758,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3156,method,See `FeatureColumn` base class. +3759,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3164,method,See `DenseColumn` base class. +3760,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3202,method,Returns the embedding lookup result. +3761,get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3219,method,See `SequenceDenseColumn` base class. +3762,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3245,method,See 'FeatureColumn` base class. +3763,HashedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3266,class,see `categorical_column_with_hash_bucket`. +3764,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3278,method,See `FeatureColumn` base class. +3765,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3283,method,See `FeatureColumn` base class. +3766,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3318,method,Hashes the values in the feature_column. +3767,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3331,method,Returns number of buckets in this sparse feature. +3768,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3341,method,See `CategoricalColumn` base class. +3769,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3355,method,See 'FeatureColumn` base class. +3770,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3359,method,See 'FeatureColumn` base class. +3771,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3366,method,See 'FeatureColumn` base class. +3772,VocabularyFileCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3374,class,See `categorical_column_with_vocabulary_file`. +3773,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3387,method,See `FeatureColumn` base class. +3774,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3392,method,See `FeatureColumn` base class. +3775,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3437,method,Creates a lookup table for the vocabulary. +3776,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3450,method,Returns number of buckets in this sparse feature. +3777,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3460,method,See `CategoricalColumn` base class. +3778,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3474,method,See 'FeatureColumn` base class. +3779,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3478,method,See 'FeatureColumn` base class. +3780,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3485,method,See 'FeatureColumn` base class. +3781,VocabularyListCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3493,class,See `categorical_column_with_vocabulary_list`. +3782,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3507,method,See `FeatureColumn` base class. +3783,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3512,method,See `FeatureColumn` base class. +3784,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3556,method,Creates a lookup table for the vocabulary list. +3785,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3569,method,Returns number of buckets in this sparse feature. +3786,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3579,method,See `CategoricalColumn` base class. +3787,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3593,method,See 'FeatureColumn` base class. +3788,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3597,method,See 'FeatureColumn` base class. +3789,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3604,method,See 'FeatureColumn` base class. +3790,IdentityCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3612,class,See `categorical_column_with_identity`. +3791,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3625,method,See `FeatureColumn` base class. +3792,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3630,method,See `FeatureColumn` base class. +3793,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3668,method,Returns a SparseTensor with identity values. +3794,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3681,method,Returns number of buckets in this sparse feature. +3795,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3691,method,See `CategoricalColumn` base class. +3796,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3705,method,See 'FeatureColumn` base class. +3797,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3709,method,See 'FeatureColumn` base class. +3798,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3714,method,See 'FeatureColumn` base class. +3799,WeightedCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3721,class,See `weighted_categorical_column`. +3800,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3735,method,See `FeatureColumn` base class. +3801,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3741,method,See `FeatureColumn` base class. +3802,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3762,method,See `DenseColumn` base class. +3803,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3788,method,Applies weights to tensor generated from `categorical_column`'. +3804,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3805,method,See `CategoricalColumn` base class. +3805,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3820,method,See 'FeatureColumn` base class. +3806,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3824,method,See 'FeatureColumn` base class. +3807,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3834,method,See 'FeatureColumn` base class. +3808,CrossedColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3845,class,See `crossed_column`. +3809,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3864,method,See `FeatureColumn` base class. +3810,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3875,method,See `FeatureColumn` base class. +3811,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3893,method,Generates a hashed sparse cross from the input tensors. +3812,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3939,method,Returns number of buckets in this sparse feature. +3813,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3949,method,See `CategoricalColumn` base class. +3814,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3964,method,See 'FeatureColumn` base class. +3815,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3968,method,See 'FeatureColumn` base class. +3816,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,3976,method,See 'FeatureColumn` base class. +3817,IndicatorColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4028,class,"Represents a one-hot column for use in deep networks. Args: categorical_column: A `CategoricalColumn` which is created by `categorical_column_with_*` function." -3659,_verify_static_batch_size_equality,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4254,function,"Verify equality between static batch sizes. +3818,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4047,method,See `FeatureColumn` base class. +3819,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4079,method,"Returns dense `Tensor` representing feature. Args: - tensors: iterable of input tensors. - columns: Corresponding feature columns. - -Raises: - ValueError: in case of mismatched batch sizes." -3660,SequenceCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4281,class,Represents sequences of categorical data. -3661,_check_config_keys,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4400,function,Checks that a config has all expected_keys. -3662,_standardize_and_copy_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4407,function,"Returns a shallow copy of config with lists turned to tuples. - -Keras serialization uses nest to listify everything. -This causes problems with the NumericColumn shape, which becomes -unhashable. We could try to solve this on the Keras side, but that -would require lots of tracking to avoid changing existing behavior. -Instead, we ensure here that we revive correctly. - -Args: - config: dict that will be used to revive a Feature Column + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. Returns: - Shallow copy of config with lists turned to tuples." -3663,_sanitize_column_name_for_variable_scope,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4430,function,Sanitizes user-provided feature names for use as variable scopes. -3664,_initialized_session,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,52,function, -3665,get_linear_model_bias,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,59,function, -3666,get_linear_model_column_var,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,64,function, -3667,BaseFeatureColumnForTests,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,69,class,"A base FeatureColumn useful to avoid boiler-plate in tests. + Transformed feature `Tensor`. -Provides dummy implementations for abstract methods that raise ValueError in -order to avoid re-defining all abstract methods for each test sub-class." -3668,SortableFeatureColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,88,class, -3669,LazyColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,112,class, -3670,NumericColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,260,class, -3671,BucketizedColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,477,class, -3672,HashedCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,780,class, -3673,CrossedColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,1001,class, -3674,OldLinearModelTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,1407,class, -3675,InputLayerTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,2292,class, -3676,FunctionalInputLayerTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,2393,class, -3677,MakeParseExampleSpecTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,2871,class, -3678,_assert_sparse_tensor_value,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,2983,function, -3679,VocabularyFileCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,2996,class, -3680,VocabularyListCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,3508,class, -3681,IdentityCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,3928,class, -3682,TransformFeaturesTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,4248,class, -3683,IndicatorColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,4318,class, -3684,_TestStateManager,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,4601,class, -3685,EmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,4640,class, -3686,SharedEmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,5467,class, -3687,WeightedCategoricalColumnTest,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,6001,class, -3688,concatenate_context_input,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,41,function,"Replicates `context_input` across all timesteps of `sequence_input`. +Raises: + ValueError: if input rank is not known at graph building time." +3820,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4107,method,See `FeatureColumn` base class. +3821,variable_shape,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4118,method,Returns a `TensorShape` representing the shape of the dense `Tensor`. +3822,get_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4131,method,"Returns dense `Tensor` representing feature. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + Dense `Tensor` created within `transform_feature`. + +Raises: + ValueError: If `categorical_column` is a `SequenceCategoricalColumn`." +3823,get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4181,method,See `SequenceDenseColumn` base class. +3824,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4231,method,See 'FeatureColumn` base class. +3825,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4235,method,See 'FeatureColumn` base class. +3826,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4244,method,See 'FeatureColumn` base class. +3827,SequenceCategoricalColumn,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4281,class,Represents sequences of categorical data. +3828,name,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4294,method,See `FeatureColumn` base class. +3829,parse_example_spec,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4299,method,See `FeatureColumn` base class. +3830,transform_feature,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4309,method,See `FeatureColumn` base class. +3831,num_buckets,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4320,method,Returns number of buckets in this sparse feature. +3832,get_sparse_tensors,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4346,method,"Returns an IdWeightPair. + +`IdWeightPair` is a pair of `SparseTensor`s which represents ids and +weights. + +`IdWeightPair.id_tensor` is typically a `batch_size` x `num_buckets` +`SparseTensor` of `int64`. `IdWeightPair.weight_tensor` is either a +`SparseTensor` of `float` or `None` to indicate all weights should be +taken to be 1. If specified, `weight_tensor` must have exactly the same +shape and indices as `sp_ids`. Expected `SparseTensor` is same as parsing +output of a `VarLenFeature` which is a ragged matrix. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables." +3833,parents,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4377,method,See 'FeatureColumn` base class. +3834,get_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4381,method,See 'FeatureColumn` base class. +3835,from_config,tensorflow/tensorflow/python/feature_column/feature_column_v2.py,4390,method,See 'FeatureColumn` base class. +3836,get_linear_model_bias,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,59,function, +3837,get_linear_model_column_var,tensorflow/tensorflow/python/feature_column/feature_column_v2_test.py,64,function, +3838,concatenate_context_input,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,41,function,"Replicates `context_input` across all timesteps of `sequence_input`. Expands dimension 1 of `context_input` then tiles it `sequence_length` times. This value is appended to `sequence_input` on dimension 2 and the result is @@ -20876,7 +25684,7 @@ Returns: Raises: ValueError: If `sequence_input` does not have rank 3 or `context_input` does not have rank 2." -3689,sequence_categorical_column_with_identity,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,91,function,"Returns a feature column that represents sequences of integers. +3839,sequence_categorical_column_with_identity,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,91,function,"Returns a feature column that represents sequences of integers. Pass this to `embedding_column` or `indicator_column` to convert sequence categorical data into dense representation for input to sequence NN, such as @@ -20914,7 +25722,7 @@ Returns: Raises: ValueError: if `num_buckets` is less than one. ValueError: if `default_value` is not in range `[0, num_buckets)`." -3690,sequence_categorical_column_with_hash_bucket,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,140,function,"A sequence of categorical terms where ids are set by hashing. +3840,sequence_categorical_column_with_hash_bucket,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,140,function,"A sequence of categorical terms where ids are set by hashing. Pass this to `embedding_column` or `indicator_column` to convert sequence categorical data into dense representation for input to sequence NN, such as @@ -20949,7 +25757,7 @@ Returns: Raises: ValueError: `hash_bucket_size` is not greater than 1. ValueError: `dtype` is neither string nor integer." -3691,sequence_categorical_column_with_vocabulary_file,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,186,function,"A sequence of categorical terms where ids use a vocabulary file. +3841,sequence_categorical_column_with_vocabulary_file,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,186,function,"A sequence of categorical terms where ids use a vocabulary file. Pass this to `embedding_column` or `indicator_column` to convert sequence categorical data into dense representation for input to sequence NN, such as @@ -20999,7 +25807,7 @@ Raises: ValueError: `num_oov_buckets` is a negative integer. ValueError: `num_oov_buckets` and `default_value` are both specified. ValueError: `dtype` is neither string nor integer." -3692,sequence_categorical_column_with_vocabulary_list,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,251,function,"A sequence of categorical terms where ids use an in-memory list. +3842,sequence_categorical_column_with_vocabulary_list,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,251,function,"A sequence of categorical terms where ids use an in-memory list. Pass this to `embedding_column` or `indicator_column` to convert sequence categorical data into dense representation for input to sequence NN, such as @@ -21048,7 +25856,7 @@ Raises: ValueError: `num_oov_buckets` is a negative integer. ValueError: `num_oov_buckets` and `default_value` are both specified. ValueError: if `dtype` is not integer or string." -3693,sequence_numeric_column,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,313,function,"Returns a feature column that represents sequences of numeric data. +3843,sequence_numeric_column,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,313,function,"Returns a feature column that represents sequences of numeric data. Example: @@ -21087,26 +25895,33 @@ Raises: TypeError: if any dimension in shape is not an int. ValueError: if any dimension in shape is not a positive integer. ValueError: if `dtype` is not convertible to `tf.float32`." -3694,_assert_all_equal_and_return,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,375,function,Asserts that all tensors are equal and returns the first one. -3695,SequenceNumericColumn,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,387,class,Represents sequences of numeric data. -3696,SequenceExampleParsingTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_integration_test.py,34,class, -3697,_make_sequence_example,tensorflow/tensorflow/python/feature_column/sequence_feature_column_integration_test.py,200,function, -3698,_initialized_session,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,43,function, -3699,ConcatenateContextInputTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,51,class,Tests the utility fn concatenate_context_input. -3700,_assert_sparse_tensor_value,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,113,function, -3701,_assert_sparse_tensor_indices_shape,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,121,function, -3702,_get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,129,function, -3703,_get_sequence_dense_tensor_state,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,134,function, -3704,_get_sparse_tensors,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,143,function, -3705,SequenceCategoricalColumnWithIdentityTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,149,class, -3706,SequenceCategoricalColumnWithHashBucketTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,221,class, -3707,SequenceCategoricalColumnWithVocabularyFileTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,260,class, -3708,SequenceCategoricalColumnWithVocabularyListTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,342,class, -3709,SequenceEmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,382,class, -3710,SequenceSharedEmbeddingColumnTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,517,class, -3711,SequenceIndicatorColumnTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,684,class, -3712,SequenceNumericColumnTest,tensorflow/tensorflow/python/feature_column/sequence_feature_column_test.py,798,class, -3713,serialize_feature_column,tensorflow/tensorflow/python/feature_column/serialization.py,41,function,"Serializes a FeatureColumn or a raw string key. +3844,SequenceNumericColumn,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,387,class,Represents sequences of numeric data. +3845,name,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,399,method,See `FeatureColumn` base class. +3846,parse_example_spec,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,404,method,See `FeatureColumn` base class. +3847,transform_feature,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,408,method,"See `FeatureColumn` base class. + +In this case, we apply the `normalizer_fn` to the input tensor. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables. + +Returns: + Normalized input tensor." +3848,variable_shape,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,428,method,Returns a `TensorShape` representing the shape of sequence input. +3849,get_sequence_dense_tensor,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,432,method,"Returns a `TensorSequenceLengthPair`. + +Args: + transformation_cache: A `FeatureTransformationCache` object to access + features. + state_manager: A `StateManager` to create / access resources such as + lookup tables." +3850,parents,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,465,method,See 'FeatureColumn` base class. +3851,get_config,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,469,method,See 'FeatureColumn` base class. +3852,from_config,tensorflow/tensorflow/python/feature_column/sequence_feature_column.py,476,method,See 'FeatureColumn` base class. +3853,serialize_feature_column,tensorflow/tensorflow/python/feature_column/serialization.py,41,function,"Serializes a FeatureColumn or a raw string key. This method should only be used to serialize parent FeatureColumns when implementing FeatureColumn.get_config(), else serialize_feature_columns() @@ -21144,7 +25959,7 @@ Returns: Raises: ValueError if called with input that is not string or FeatureColumn." -3714,deserialize_feature_column,tensorflow/tensorflow/python/feature_column/serialization.py,89,function,"Deserializes a `config` generated with `serialize_feature_column`. +3854,deserialize_feature_column,tensorflow/tensorflow/python/feature_column/serialization.py,89,function,"Deserializes a `config` generated with `serialize_feature_column`. This method should only be used to deserialize parent FeatureColumns when implementing FeatureColumn.from_config(), else deserialize_feature_columns() @@ -21165,7 +25980,7 @@ Raises: Returns: A FeatureColumn corresponding to the input `config`." -3715,serialize_feature_columns,tensorflow/tensorflow/python/feature_column/serialization.py,146,function,"Serializes a list of FeatureColumns. +3855,serialize_feature_columns,tensorflow/tensorflow/python/feature_column/serialization.py,146,function,"Serializes a list of FeatureColumns. Returns a list of Keras-style config dicts that represent the input FeatureColumns and can be used with `deserialize_feature_columns` for @@ -21179,7 +25994,7 @@ Returns: Raises: ValueError if called with input that is not a list of FeatureColumns." -3716,deserialize_feature_columns,tensorflow/tensorflow/python/feature_column/serialization.py,165,function,"Deserializes a list of FeatureColumns configs. +3856,deserialize_feature_columns,tensorflow/tensorflow/python/feature_column/serialization.py,165,function,"Deserializes a list of FeatureColumns configs. Returns a list of FeatureColumns given a list of config dicts acquired by `serialize_feature_columns`. @@ -21195,27 +26010,10 @@ Returns: Raises: ValueError if called with input that is not a list of FeatureColumns." -3717,_column_name_with_class_name,tensorflow/tensorflow/python/feature_column/serialization.py,190,function,"Returns a unique name for the feature column used during deduping. - -Without this two FeatureColumns that have the same name and where -one wraps the other, such as an IndicatorColumn wrapping a -SequenceCategoricalColumn, will fail to deserialize because they will have the -same name in columns_by_name, causing the wrong column to be returned. - -Args: - fc: A FeatureColumn. - -Returns: - A unique name as a string." -3718,_serialize_keras_object,tensorflow/tensorflow/python/feature_column/serialization.py,207,function,Serialize a Keras object into a JSON-compatible representation. -3719,_deserialize_keras_object,tensorflow/tensorflow/python/feature_column/serialization.py,238,function,Turns the serialized form of a Keras object back into an actual object. -3720,_class_and_config_for_serialized_keras_object,tensorflow/tensorflow/python/feature_column/serialization.py,290,function,Returns the class name and config for a serialized keras object. -3721,_get_registered_object,tensorflow/tensorflow/python/feature_column/serialization.py,333,function, -3722,FeatureColumnSerializationTest,tensorflow/tensorflow/python/feature_column/serialization_test.py,27,class,"Tests for serialization, deserialization helpers." -3723,sequence_length_from_sparse_tensor,tensorflow/tensorflow/python/feature_column/utils.py,30,function,Returns a [batch_size] Tensor with per-example sequence length. -3724,assert_string_or_int,tensorflow/tensorflow/python/feature_column/utils.py,55,function, -3725,assert_key_is_string,tensorflow/tensorflow/python/feature_column/utils.py,61,function, -3726,check_default_value,tensorflow/tensorflow/python/feature_column/utils.py,68,function,"Returns default value as tuple if it's valid, otherwise raises errors. +3857,sequence_length_from_sparse_tensor,tensorflow/tensorflow/python/feature_column/utils.py,30,function,Returns a [batch_size] Tensor with per-example sequence length. +3858,assert_string_or_int,tensorflow/tensorflow/python/feature_column/utils.py,55,function, +3859,assert_key_is_string,tensorflow/tensorflow/python/feature_column/utils.py,61,function, +3860,check_default_value,tensorflow/tensorflow/python/feature_column/utils.py,68,function,"Returns default value as tuple if it's valid, otherwise raises errors. This function verifies that `default_value` is compatible with both `shape` and `dtype`. If it is not compatible, it raises an error. If it is compatible, @@ -21239,12 +26037,9 @@ Raises: TypeError: if `default_value` is an iterable but not compatible with `shape` TypeError: if `default_value` is not compatible with `dtype`. ValueError: if `dtype` is not convertible to `tf.float32`." -3727,_create_tuple,tensorflow/tensorflow/python/feature_column/utils.py,127,function,Returns a tuple with given shape and filled with value. -3728,_as_tuple,tensorflow/tensorflow/python/feature_column/utils.py,134,function, -3729,_is_shape_and_default_value_compatible,tensorflow/tensorflow/python/feature_column/utils.py,140,function,Verifies compatibility of shape and default_value. -3730,op_is_stateful,tensorflow/tensorflow/python/framework/auto_control_deps.py,126,function, -3731,ResourceType,tensorflow/tensorflow/python/framework/auto_control_deps.py,132,class, -3732,collective_manager_ids_from_op,tensorflow/tensorflow/python/framework/auto_control_deps.py,137,function,"Returns CollectiveManager ID from the op if one exists, else None. +3861,op_is_stateful,tensorflow/tensorflow/python/framework/auto_control_deps.py,126,function, +3862,ResourceType,tensorflow/tensorflow/python/framework/auto_control_deps.py,132,class, +3863,collective_manager_ids_from_op,tensorflow/tensorflow/python/framework/auto_control_deps.py,137,function,"Returns CollectiveManager ID from the op if one exists, else None. CollectiveManager adds collective and no_op operations tagged with an ID, unique to the manager object. This function extracts that ID, or None, if the @@ -21255,7 +26050,7 @@ Args: Returns: List of CollectiveManager IDs used by the op." -3733,AutomaticControlDependencies,tensorflow/tensorflow/python/framework/auto_control_deps.py,163,class,"Context manager to automatically add control dependencies. +3864,AutomaticControlDependencies,tensorflow/tensorflow/python/framework/auto_control_deps.py,163,class,"Context manager to automatically add control dependencies. Code under this context manager will act as if a sensible set of control dependencies were present. More specifically: @@ -21268,7 +26063,23 @@ supported (the value of the variables will never change as they will keep getting reinitialized). NOT THREAD SAFE" -3734,register_acd_resource_resolver,tensorflow/tensorflow/python/framework/auto_control_deps.py,483,function,"Register a function for resolving resources touched by an op. +3865,mark_as_return,tensorflow/tensorflow/python/framework/auto_control_deps.py,188,method,"Acts like identity but marks the `Tensor` as a return value. + +This will possibly return a copy of the `Tensor`. Usage: + +``` + with AutomaticControlDependencies() as a: + ... + t = a.mark_as_return(t) + _ = ...(t...) # i.e. it's safe to use t here +``` + +Args: + tensor: the `Tensor` to be marked + +Returns: + a copy of the `Tensor`." +3866,register_acd_resource_resolver,tensorflow/tensorflow/python/framework/auto_control_deps.py,483,function,"Register a function for resolving resources touched by an op. `f` is called for every Operation added in the ACD context with the op's original resource reads and writes. `f` is expected to update the sets of @@ -21304,8 +26115,7 @@ Args: Returns: The function `f` after adding it to the registry." -3735,_get_resource_inputs,tensorflow/tensorflow/python/framework/auto_control_deps.py,525,function,Returns an iterable of resources touched by this `op`. -3736,automatic_control_dependencies,tensorflow/tensorflow/python/framework/auto_control_deps.py,550,function,"Wraps f to automatically insert control dependencies. +3867,automatic_control_dependencies,tensorflow/tensorflow/python/framework/auto_control_deps.py,550,function,"Wraps f to automatically insert control dependencies. The inserted dependencies ensure that: 1. All stateful ops in f run when the result of f runs @@ -21316,11 +26126,9 @@ Args: Returns: The wrapped function." -3737,AutomaticControlDependenciesTest,tensorflow/tensorflow/python/framework/auto_control_deps_test.py,42,class, -3738,register_read_only_resource_op,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,31,function,Declares that `op_type` does not update its touched resource. -3739,get_read_only_resource_input_indices_graph,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,36,function,Returns sorted list of read-only resource indices in func_graph.inputs. -3740,_get_read_only_resource_input_indices_op,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,63,function,Returns sorted list of read-only resource indices in op.inputs. -3741,get_read_write_resource_inputs,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,89,function,"Returns a tuple of resource reads, writes in op.inputs. +3868,register_read_only_resource_op,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,31,function,Declares that `op_type` does not update its touched resource. +3869,get_read_only_resource_input_indices_graph,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,36,function,Returns sorted list of read-only resource indices in func_graph.inputs. +3870,get_read_write_resource_inputs,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,89,function,"Returns a tuple of resource reads, writes in op.inputs. Args: op: Operation @@ -21329,43 +26137,21 @@ Returns: A 2-tuple of ObjectIdentitySets, the first entry containing read-only resource handles and the second containing read-write resource handles in `op.inputs`." -3742,_op_writes_to_resource,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,128,function,"Returns whether op writes to resource handle. - -Args: - handle: Resource handle. Must be an input of `op`. - op: Operation. - -Returns: - Returns False if op is a read-only op registered using - `register_read_only_resource_op` or if `handle` is an input at one of - the indices in the `READ_ONLY_RESOURCE_INPUTS_ATTR` attr of the op, True - otherwise. - -Raises: - ValueError: if `handle` is not an input of `op`." -3743,_input_index,tensorflow/tensorflow/python/framework/auto_control_deps_utils.py,155,function,"Returns the index of `handle` in `op.inputs`. - -Args: - op: Operation. - handle: Resource handle. - -Returns: - Index in `op.inputs` receiving the resource `handle`. - -Raises: - ValueError: If handle and its replicated input are both not found in - `op.inputs`." -3744,ScopedTFStatus,tensorflow/tensorflow/python/framework/c_api_util.py,29,class,Wrapper around TF_Status that handles deletion. -3745,ScopedTFGraph,tensorflow/tensorflow/python/framework/c_api_util.py,44,class,Wrapper around TF_Graph that handles deletion. -3746,ScopedTFImportGraphDefOptions,tensorflow/tensorflow/python/framework/c_api_util.py,61,class,Wrapper around TF_ImportGraphDefOptions that handles deletion. -3747,ScopedTFImportGraphDefResults,tensorflow/tensorflow/python/framework/c_api_util.py,76,class,Wrapper around TF_ImportGraphDefOptions that handles deletion. -3748,ScopedTFFunction,tensorflow/tensorflow/python/framework/c_api_util.py,91,class,Wrapper around TF_Function that handles deletion. -3749,ScopedTFBuffer,tensorflow/tensorflow/python/framework/c_api_util.py,110,class,An internal class to help manage the TF_Buffer lifetime. -3750,ApiDefMap,tensorflow/tensorflow/python/framework/c_api_util.py,122,class,"Wrapper around Tf_ApiDefMap that handles querying and deletion. +3871,ScopedTFStatus,tensorflow/tensorflow/python/framework/c_api_util.py,29,class,Wrapper around TF_Status that handles deletion. +3872,ScopedTFGraph,tensorflow/tensorflow/python/framework/c_api_util.py,44,class,Wrapper around TF_Graph that handles deletion. +3873,ScopedTFImportGraphDefOptions,tensorflow/tensorflow/python/framework/c_api_util.py,61,class,Wrapper around TF_ImportGraphDefOptions that handles deletion. +3874,ScopedTFImportGraphDefResults,tensorflow/tensorflow/python/framework/c_api_util.py,76,class,Wrapper around TF_ImportGraphDefOptions that handles deletion. +3875,ScopedTFFunction,tensorflow/tensorflow/python/framework/c_api_util.py,91,class,Wrapper around TF_Function that handles deletion. +3876,ScopedTFBuffer,tensorflow/tensorflow/python/framework/c_api_util.py,110,class,An internal class to help manage the TF_Buffer lifetime. +3877,ApiDefMap,tensorflow/tensorflow/python/framework/c_api_util.py,122,class,"Wrapper around Tf_ApiDefMap that handles querying and deletion. The OpDef protos are also stored in this class so that they could be queried by op name." -3751,tf_buffer,tensorflow/tensorflow/python/framework/c_api_util.py,172,function,"Context manager that creates and deletes TF_Buffer. +3878,put_api_def,tensorflow/tensorflow/python/framework/c_api_util.py,150,method, +3879,get_api_def,tensorflow/tensorflow/python/framework/c_api_util.py,153,method, +3880,get_op_def,tensorflow/tensorflow/python/framework/c_api_util.py,162,method, +3881,op_names,tensorflow/tensorflow/python/framework/c_api_util.py,167,method, +3882,tf_buffer,tensorflow/tensorflow/python/framework/c_api_util.py,172,function,"Context manager that creates and deletes TF_Buffer. Example usage: with tf_buffer() as buf: @@ -21385,7 +26171,7 @@ Args: Yields: Created TF_Buffer" -3752,tf_output,tensorflow/tensorflow/python/framework/c_api_util.py,204,function,"Returns a wrapped TF_Output with specified operation and index. +3883,tf_output,tensorflow/tensorflow/python/framework/c_api_util.py,204,function,"Returns a wrapped TF_Output with specified operation and index. Args: c_op: wrapped TF_Operation @@ -21393,14 +26179,14 @@ Args: Returns: Wrapped TF_Output" -3753,tf_operations,tensorflow/tensorflow/python/framework/c_api_util.py,220,function,"Generator that yields every TF_Operation in `graph`. +3884,tf_operations,tensorflow/tensorflow/python/framework/c_api_util.py,220,function,"Generator that yields every TF_Operation in `graph`. Args: graph: Graph Yields: wrapped TF_Operation" -3754,new_tf_operations,tensorflow/tensorflow/python/framework/c_api_util.py,238,function,"Generator that yields newly-added TF_Operations in `graph`. +3885,new_tf_operations,tensorflow/tensorflow/python/framework/c_api_util.py,238,function,"Generator that yields newly-added TF_Operations in `graph`. Specifically, yields TF_Operations that don't have associated Operations in `graph`. This is useful for processing nodes added by the C API. @@ -21410,28 +26196,22 @@ Args: Yields: wrapped TF_Operation" -3755,ApiDefMapTest,tensorflow/tensorflow/python/framework/c_api_util_test.py,26,class, -3756,EagerGraphCombination,tensorflow/tensorflow/python/framework/combinations.py,33,class,"Run the test in Graph or Eager mode. +3886,EagerGraphCombination,tensorflow/tensorflow/python/framework/combinations.py,33,class,"Run the test in Graph or Eager mode. The optional `mode` parameter controls the test's execution mode. Its accepted values are ""graph"" or ""eager"" literals." -3757,TFVersionCombination,tensorflow/tensorflow/python/framework/combinations.py,56,class,"Control the execution of the test in TF1.x and TF2. +3887,context_managers,tensorflow/tensorflow/python/framework/combinations.py,40,method, +3888,parameter_modifiers,tensorflow/tensorflow/python/framework/combinations.py,52,method, +3889,TFVersionCombination,tensorflow/tensorflow/python/framework/combinations.py,56,class,"Control the execution of the test in TF1.x and TF2. If TF2 is enabled then a test with TF1 test is going to be skipped and vice versa. Test targets continuously run in TF2 thanks to the tensorflow.v2 TAP target. A test can be run in TF2 with bazel by passing --test_env=TF2_BEHAVIOR=1." -3758,_broadcast_shape_helper,tensorflow/tensorflow/python/framework/common_shapes.py,25,function,"Helper functions for is_broadcast_compatible and broadcast_shape. - -Args: - shape_x: A `TensorShape` - shape_y: A `TensorShape` - -Returns: - Returns None if the shapes are not broadcast compatible, - a list of the broadcast dimensions otherwise." -3759,is_broadcast_compatible,tensorflow/tensorflow/python/framework/common_shapes.py,73,function,"Returns True if `shape_x` and `shape_y` are broadcast compatible. +3890,should_execute_combination,tensorflow/tensorflow/python/framework/combinations.py,66,method, +3891,parameter_modifiers,tensorflow/tensorflow/python/framework/combinations.py,74,method, +3892,is_broadcast_compatible,tensorflow/tensorflow/python/framework/common_shapes.py,73,function,"Returns True if `shape_x` and `shape_y` are broadcast compatible. Args: shape_x: A `TensorShape` @@ -21440,7 +26220,7 @@ Args: Returns: True if a shape exists that both `shape_x` and `shape_y` can be broadcasted to. False otherwise." -3760,broadcast_shape,tensorflow/tensorflow/python/framework/common_shapes.py,89,function,"Returns the broadcasted shape between `shape_x` and `shape_y`. +3893,broadcast_shape,tensorflow/tensorflow/python/framework/common_shapes.py,89,function,"Returns the broadcasted shape between `shape_x` and `shape_y`. Args: shape_x: A `TensorShape` @@ -21451,8 +26231,7 @@ Returns: Raises: ValueError: If the two shapes can not be broadcasted." -3761,CommonShapesTest,tensorflow/tensorflow/python/framework/common_shapes_test.py,29,class, -3762,CompositeTensor,tensorflow/tensorflow/python/framework/composite_tensor.py,31,class,"Abstract base class for Tensor-like objects that are composed from Tensors. +3894,CompositeTensor,tensorflow/tensorflow/python/framework/composite_tensor.py,31,class,"Abstract base class for Tensor-like objects that are composed from Tensors. Each `CompositeTensor` can be decomposed into a structured collection of component `tf.Tensor`s, and reconstructed from those components. @@ -21469,7 +26248,7 @@ transformed_list_of_tensors = ... # do something with the flat tensors. result = nest.pack_sequence_as(ct, transformed_list_of_tensors, expand_composites=True) ```" -3763,replace_composites_with_components,tensorflow/tensorflow/python/framework/composite_tensor.py,94,function,"Recursively replaces CompositeTensors with their components. +3895,replace_composites_with_components,tensorflow/tensorflow/python/framework/composite_tensor.py,94,function,"Recursively replaces CompositeTensors with their components. Args: structure: A `nest`-compatible structure, possibly containing composite @@ -21480,16 +26259,13 @@ Returns: its components. The result will contain no composite tensors. Note that `nest.flatten(replace_composites_with_components(structure))` returns the same value as `nest.flatten(structure)`." -3764,CTSpec,tensorflow/tensorflow/python/framework/composite_tensor_test.py,40,class,"A generic CompositeTensor TypeSpec, used for constructing tests." -3765,CT,tensorflow/tensorflow/python/framework/composite_tensor_test.py,60,class,"A generic CompositeTensor, used for constructing tests." -3766,CTSpec2,tensorflow/tensorflow/python/framework/composite_tensor_test.py,87,class, -3767,CT2,tensorflow/tensorflow/python/framework/composite_tensor_test.py,91,class, -3768,CompositeTensorTest,tensorflow/tensorflow/python/framework/composite_tensor_test.py,96,class, -3769,is_composite_or_composite_value,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,31,function,Returns true if 'tensor' is a CompositeTensor or a CT Value object. -3770,get_shape,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,41,function,Returns the shape of the passed composite tensor. -3771,_append_sparse_tensor_value,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,50,function,Append sparse tensor value objects. -3772,_append_ragged_tensor_value,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,94,function,Append ragged tensor value objects. -3773,append_composite_tensor,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,113,function,"Helper function to append composite tensors to each other in the 0 axis. +3896,CTSpec,tensorflow/tensorflow/python/framework/composite_tensor_test.py,40,class,"A generic CompositeTensor TypeSpec, used for constructing tests." +3897,CT,tensorflow/tensorflow/python/framework/composite_tensor_test.py,60,class,"A generic CompositeTensor, used for constructing tests." +3898,CTSpec2,tensorflow/tensorflow/python/framework/composite_tensor_test.py,87,class, +3899,CT2,tensorflow/tensorflow/python/framework/composite_tensor_test.py,91,class, +3900,is_composite_or_composite_value,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,31,function,Returns true if 'tensor' is a CompositeTensor or a CT Value object. +3901,get_shape,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,41,function,Returns the shape of the passed composite tensor. +3902,append_composite_tensor,tensorflow/tensorflow/python/framework/composite_tensor_utils.py,113,function,"Helper function to append composite tensors to each other in the 0 axis. In order to support batching within a fit/evaluate/predict call, we need to be able to aggregate within a CompositeTensor. Unfortunately, the CT @@ -21508,12 +26284,11 @@ Returns: Raises: RuntimeError: if concatenation is not possible." -3774,CompositeTensorTest,tensorflow/tensorflow/python/framework/composite_tensor_utils_test.py,32,class, -3775,tensor_float_32_execution_allowed,tensorflow/tensorflow/python/framework/config.py,28,function,"Get if TensorFloat-32 operations are enabled on supported hardware. +3903,tensor_float_32_execution_allowed,tensorflow/tensorflow/python/framework/config.py,28,function,"Get if TensorFloat-32 operations are enabled on supported hardware. Returns: True if TensorFloat-32 execution is enabled and False otherwise." -3776,allow_tensor_float_32_execution,tensorflow/tensorflow/python/framework/config.py,38,function,"Allow use of TensorFloat-32 with float32 ops on supported hardware. +3904,allow_tensor_float_32_execution,tensorflow/tensorflow/python/framework/config.py,38,function,"Allow use of TensorFloat-32 with float32 ops on supported hardware. TensorFloat-32 is a math mode introduced with the NVIDIA Ampere architecture. TensorFloat-32 kernels take float32 inputs and produce float32 outputs. @@ -21527,7 +26302,7 @@ future version. Args: allowed: whether to allow TensorFloat-32 execution" -3777,get_intra_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,58,function,"Get number of threads used within an individual op for parallelism. +3905,get_intra_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,58,function,"Get number of threads used within an individual op for parallelism. Certain operations like matrix multiplication and reductions can utilize parallel threads for speed ups. A value of 0 means the system picks an @@ -21535,7 +26310,7 @@ appropriate number. Returns: Number of parallel threads" -3778,set_intra_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,72,function,"Set number of threads used within an individual op for parallelism. +3906,set_intra_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,72,function,"Set number of threads used within an individual op for parallelism. Certain operations like matrix multiplication and reductions can utilize parallel threads for speed ups. A value of 0 means the system picks an @@ -21543,21 +26318,21 @@ appropriate number. Args: num_threads: Number of parallel threads" -3779,get_inter_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,86,function,"Get number of threads used for parallelism between independent operations. +3907,get_inter_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,86,function,"Get number of threads used for parallelism between independent operations. Determines the number of threads used by independent non-blocking operations. 0 means the system picks an appropriate number. Returns: Number of parallel threads" -3780,set_inter_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,99,function,"Set number of threads used for parallelism between independent operations. +3908,set_inter_op_parallelism_threads,tensorflow/tensorflow/python/framework/config.py,99,function,"Set number of threads used for parallelism between independent operations. Determines the number of threads used by independent non-blocking operations. 0 means the system picks an appropriate number. Args: num_threads: Number of parallel threads" -3781,get_optimizer_jit,tensorflow/tensorflow/python/framework/config.py,112,function,"Get if JIT compilation is enabled. +3909,get_optimizer_jit,tensorflow/tensorflow/python/framework/config.py,112,function,"Get if JIT compilation is enabled. Note that optimizations are only applied to code that is compiled into a graph. In eager mode, which is the TF2 API default, that means only code that @@ -21565,7 +26340,7 @@ is defined under a tf.function decorator. Returns: If JIT compilation is enabled." -3782,set_optimizer_jit,tensorflow/tensorflow/python/framework/config.py,126,function,"Set if JIT compilation is enabled. +3910,set_optimizer_jit,tensorflow/tensorflow/python/framework/config.py,126,function,"Set if JIT compilation is enabled. Note that optimizations are only applied to code that is compiled into a graph. In eager mode, which is the TF2 API default, that means only code that @@ -21573,7 +26348,7 @@ is defined under a tf.function decorator. Args: enabled: Whether to enable JIT compilation." -3783,get_optimizer_experimental_options,tensorflow/tensorflow/python/framework/config.py,140,function,"Get experimental optimizer options. +3911,get_optimizer_experimental_options,tensorflow/tensorflow/python/framework/config.py,140,function,"Get experimental optimizer options. Refer to tf.config.optimizer.set_experimental_options for a list of current options. @@ -21583,7 +26358,7 @@ In addition, as these are experimental options, the list is subject to change. Returns: Dictionary of configured experimental optimizer options" -3784,set_optimizer_experimental_options,tensorflow/tensorflow/python/framework/config.py,156,function,"Set experimental optimizer options. +3912,set_optimizer_experimental_options,tensorflow/tensorflow/python/framework/config.py,156,function,"Set experimental optimizer options. Note that optimizations are only applied in graph mode, (within tf.function). In addition, as these are experimental options, the list is subject to change. @@ -21619,7 +26394,7 @@ Args: - disable_meta_optimizer: Disable the entire meta optimizer. - min_graph_nodes: The minimum number of nodes in a graph to optimizer. For smaller graphs, optimization is skipped." -3785,get_soft_device_placement,tensorflow/tensorflow/python/framework/config.py,198,function,"Get if soft device placement is enabled. +3913,get_soft_device_placement,tensorflow/tensorflow/python/framework/config.py,198,function,"Get if soft device placement is enabled. If enabled, an op will be placed on CPU if any of the following are true 1. there's no GPU implementation for the OP @@ -21628,7 +26403,7 @@ If enabled, an op will be placed on CPU if any of the following are true Returns: If soft placement is enabled." -3786,set_soft_device_placement,tensorflow/tensorflow/python/framework/config.py,213,function,"Set if soft device placement is enabled. +3914,set_soft_device_placement,tensorflow/tensorflow/python/framework/config.py,213,function,"Set if soft device placement is enabled. If enabled, an op will be placed on CPU if any of the following are true 1. there's no GPU implementation for the OP @@ -21637,7 +26412,7 @@ If enabled, an op will be placed on CPU if any of the following are true Args: enabled: Whether to enable soft placement." -3787,get_device_policy,tensorflow/tensorflow/python/framework/config.py,228,function,"Gets the current device policy. +3915,get_device_policy,tensorflow/tensorflow/python/framework/config.py,228,function,"Gets the current device policy. The device policy controls how operations requiring inputs on a specific device (e.g., on GPU:0) handle inputs on a different device (e.g. GPU:1). @@ -21647,7 +26422,7 @@ subsequently started thread will again use the default policy. Returns: Current thread device policy" -3788,set_device_policy,tensorflow/tensorflow/python/framework/config.py,254,function,"Sets the current thread device policy. +3916,set_device_policy,tensorflow/tensorflow/python/framework/config.py,254,function,"Sets the current thread device policy. The device policy controls how operations requiring inputs on a specific device (e.g., on GPU:0) handle inputs on a different device (e.g. GPU:1). @@ -21673,14 +26448,14 @@ Args: Raises: ValueError: If an invalid `device_policy` is passed." -3789,get_synchronous_execution,tensorflow/tensorflow/python/framework/config.py,297,function,"Gets whether operations are executed synchronously or asynchronously. +3917,get_synchronous_execution,tensorflow/tensorflow/python/framework/config.py,297,function,"Gets whether operations are executed synchronously or asynchronously. TensorFlow can execute operations synchronously or asynchronously. If asynchronous execution is enabled, operations may return ""non-ready"" handles. Returns: Current thread execution mode" -3790,set_synchronous_execution,tensorflow/tensorflow/python/framework/config.py,310,function,"Specifies whether operations are executed synchronously or asynchronously. +3918,set_synchronous_execution,tensorflow/tensorflow/python/framework/config.py,310,function,"Specifies whether operations are executed synchronously or asynchronously. TensorFlow can execute operations synchronously or asynchronously. If asynchronous execution is enabled, operations may return ""non-ready"" handles. @@ -21694,7 +26469,7 @@ Args: - None: sets the system default. - True: executes each operation synchronously. - False: executes each operation asynchronously." -3791,list_physical_devices,tensorflow/tensorflow/python/framework/config.py,338,function,"Return a list of physical devices visible to the host runtime. +3919,list_physical_devices,tensorflow/tensorflow/python/framework/config.py,338,function,"Return a list of physical devices visible to the host runtime. Physical devices are hardware devices present on the host machine. By default all discovered CPU and GPU devices are considered visible. @@ -21720,7 +26495,7 @@ Args: Returns: List of discovered `tf.config.PhysicalDevice` objects" -3792,list_logical_devices,tensorflow/tensorflow/python/framework/config.py,373,function,"Return a list of logical devices created by runtime. +3920,list_logical_devices,tensorflow/tensorflow/python/framework/config.py,373,function,"Return a list of logical devices created by runtime. Logical devices may correspond to physical devices or remote devices in the cluster. Operations and tensors may be placed on these devices by using the @@ -21748,7 +26523,7 @@ Args: Returns: List of initialized `LogicalDevice`s" -3793,get_visible_devices,tensorflow/tensorflow/python/framework/config.py,410,function,"Get the list of visible physical devices. +3921,get_visible_devices,tensorflow/tensorflow/python/framework/config.py,410,function,"Get the list of visible physical devices. Returns the list of `PhysicalDevice`s currently marked as visible to the runtime. A visible device will have at least one `LogicalDevice` associated @@ -21773,7 +26548,7 @@ Args: Returns: List of visible `PhysicalDevice`s" -3794,set_visible_devices,tensorflow/tensorflow/python/framework/config.py,444,function,"Set the list of visible devices. +3922,set_visible_devices,tensorflow/tensorflow/python/framework/config.py,444,function,"Set the list of visible devices. Specifies which `PhysicalDevice` objects are visible to the runtime. TensorFlow will only allocate memory and place operations on visible @@ -21801,7 +26576,7 @@ Args: Raises: ValueError: If argument validation fails. RuntimeError: Runtime is already initialized." -3795,get_memory_growth,tensorflow/tensorflow/python/framework/config.py,478,function,"Get if memory growth is enabled for a `PhysicalDevice`. +3923,get_memory_growth,tensorflow/tensorflow/python/framework/config.py,478,function,"Get if memory growth is enabled for a `PhysicalDevice`. If memory growth is enabled for a `PhysicalDevice`, the runtime initialization will not allocate all memory on the device. @@ -21824,7 +26599,7 @@ Returns: Raises: ValueError: Invalid `PhysicalDevice` specified." -3796,set_memory_growth,tensorflow/tensorflow/python/framework/config.py,507,function,"Set if memory growth should be enabled for a `PhysicalDevice`. +3924,set_memory_growth,tensorflow/tensorflow/python/framework/config.py,507,function,"Set if memory growth should be enabled for a `PhysicalDevice`. If memory growth is enabled for a `PhysicalDevice`, the runtime initialization will not allocate all memory on the device. Memory growth cannot be configured @@ -21846,7 +26621,7 @@ Args: Raises: ValueError: Invalid `PhysicalDevice` specified. RuntimeError: Runtime is already initialized." -3797,get_device_details,tensorflow/tensorflow/python/framework/config.py,535,function,"Returns details about a physical devices. +3925,get_device_details,tensorflow/tensorflow/python/framework/config.py,535,function,"Returns details about a physical devices. This API takes in a `tf.config.PhysicalDevice` returned by `tf.config.list_physical_devices`. It returns a dict with string keys @@ -21885,7 +26660,7 @@ Args: Returns: A dict with string keys." -3798,get_logical_device_configuration,tensorflow/tensorflow/python/framework/config.py,583,function,"Get the virtual device configuration for a `tf.config.PhysicalDevice`. +3926,get_logical_device_configuration,tensorflow/tensorflow/python/framework/config.py,583,function,"Get the virtual device configuration for a `tf.config.PhysicalDevice`. Returns the list of `tf.config.LogicalDeviceConfiguration` objects previously configured by a call to @@ -21917,7 +26692,7 @@ Returns: List of `tf.config.LogicalDeviceConfiguration` objects or `None` if no virtual device configuration has been set for this physical device." -3799,set_logical_device_configuration,tensorflow/tensorflow/python/framework/config.py,624,function,"Set the logical device configuration for a `tf.config.PhysicalDevice`. +3927,set_logical_device_configuration,tensorflow/tensorflow/python/framework/config.py,624,function,"Set the logical device configuration for a `tf.config.PhysicalDevice`. A visible `tf.config.PhysicalDevice` will by default have a single `tf.config.LogicalDevice` associated with it once the runtime is initialized. @@ -21976,7 +26751,7 @@ Args: Raises: ValueError: If argument validation fails. RuntimeError: Runtime is already initialized." -3800,enable_mlir_bridge,tensorflow/tensorflow/python/framework/config.py,689,function,"Enables experimental MLIR-Based TensorFlow Compiler Bridge. +3928,enable_mlir_bridge,tensorflow/tensorflow/python/framework/config.py,689,function,"Enables experimental MLIR-Based TensorFlow Compiler Bridge. DO NOT USE, DEV AND TESTING ONLY AT THE MOMENT. @@ -21987,7 +26762,7 @@ and testing only. TensorFlow Compiler Bridge (TF Bridge) is responsible for translating parts of TensorFlow graph into a form that can be accepted as an input by a backend compiler such as XLA." -3801,enable_mlir_graph_optimization,tensorflow/tensorflow/python/framework/config.py,706,function,"Enables experimental MLIR-Based TensorFlow Compiler Optimizations. +3929,enable_mlir_graph_optimization,tensorflow/tensorflow/python/framework/config.py,706,function,"Enables experimental MLIR-Based TensorFlow Compiler Optimizations. DO NOT USE, DEV AND TESTING ONLY AT THE MOMENT. @@ -21998,16 +26773,10 @@ and testing only. TensorFlow Compiler Optimizations are responsible general graph level optimizations that in the current stack mostly done by Grappler graph optimizers." -3802,disable_mlir_bridge,tensorflow/tensorflow/python/framework/config.py,723,function,Disables experimental MLIR-Based TensorFlow Compiler Bridge. -3803,disable_mlir_graph_optimization,tensorflow/tensorflow/python/framework/config.py,729,function,Disables experimental MLIR-Based TensorFlow Compiler Optimizations. -3804,reset_eager,tensorflow/tensorflow/python/framework/config_test.py,42,function, -3805,ConfigTest,tensorflow/tensorflow/python/framework/config_test.py,55,class, -3806,DeviceTest,tensorflow/tensorflow/python/framework/config_test.py,369,class, -3807,TensorFloat32Test,tensorflow/tensorflow/python/framework/config_test.py,759,class, -3808,_eager_reshape,tensorflow/tensorflow/python/framework/constant_op.py,39,function,Eager-only version of Reshape op; requires tensor is an eager Tensor. -3809,_eager_fill,tensorflow/tensorflow/python/framework/constant_op.py,51,function,Eager-only version of Fill op; requires value is an eager Tensor. -3810,_eager_identity,tensorflow/tensorflow/python/framework/constant_op.py,62,function,Eager-only version of Identity op; requires tensor is an eager Tensor. -3811,convert_to_eager_tensor,tensorflow/tensorflow/python/framework/constant_op.py,70,function,"Converts the given `value` to an `EagerTensor`. +3930,disable_mlir_bridge,tensorflow/tensorflow/python/framework/config.py,723,function,Disables experimental MLIR-Based TensorFlow Compiler Bridge. +3931,disable_mlir_graph_optimization,tensorflow/tensorflow/python/framework/config.py,729,function,Disables experimental MLIR-Based TensorFlow Compiler Optimizations. +3932,reset_eager,tensorflow/tensorflow/python/framework/config_test.py,42,function, +3933,convert_to_eager_tensor,tensorflow/tensorflow/python/framework/constant_op.py,70,function,"Converts the given `value` to an `EagerTensor`. Note that this function could return cached copies of created constants for performance reasons. @@ -22022,7 +26791,7 @@ Returns: Raises: TypeError: if `dtype` is not compatible with the type of t." -3812,constant_v1,tensorflow/tensorflow/python/framework/constant_op.py,102,function,"Creates a constant tensor. +3934,constant_v1,tensorflow/tensorflow/python/framework/constant_op.py,102,function,"Creates a constant tensor. The resulting tensor is populated with values of type `dtype`, as specified by arguments `value` and (optionally) `shape` (see examples @@ -22079,7 +26848,7 @@ Returns: Raises: TypeError: if shape is incorrectly specified or unsupported." -3813,constant,tensorflow/tensorflow/python/framework/constant_op.py,167,function,"Creates a constant tensor from a tensor-like object. +3935,constant,tensorflow/tensorflow/python/framework/constant_op.py,167,function,"Creates a constant tensor from a tensor-like object. Note: All eager `tf.Tensor` values are immutable (in contrast to `tf.Variable`). There is nothing especially _constant_ about the value @@ -22174,43 +26943,8 @@ Returns: Raises: TypeError: if shape is incorrectly specified or unsupported. ValueError: if called on a symbolic tensor." -3814,_constant_impl,tensorflow/tensorflow/python/framework/constant_op.py,268,function,Implementation of constant. -3815,_constant_eager_impl,tensorflow/tensorflow/python/framework/constant_op.py,299,function,Implementation of eager constant. -3816,is_constant,tensorflow/tensorflow/python/framework/constant_op.py,328,function, -3817,_constant_tensor_conversion_function,tensorflow/tensorflow/python/framework/constant_op.py,336,function, -3818,_tensor_shape_tensor_conversion_function,tensorflow/tensorflow/python/framework/constant_op.py,348,function,Function to convert TensorShape to Tensor. -3819,_dimension_tensor_conversion_function,tensorflow/tensorflow/python/framework/constant_op.py,381,function,Function to convert Dimension to Tensor. -3820,ConstantOpTest,tensorflow/tensorflow/python/framework/constant_op_test.py,29,class, -3821,_TensorData,tensorflow/tensorflow/python/framework/convert_to_constants.py,53,class,Data about a tensor that was converted to a constant. -3822,_EndPoint,tensorflow/tensorflow/python/framework/convert_to_constants.py,63,class,An endpoint in a graph. -3823,_Edge,tensorflow/tensorflow/python/framework/convert_to_constants.py,71,class,A directed graph edge. -3824,_Convertible,tensorflow/tensorflow/python/framework/convert_to_constants.py,79,class,An entity that can have variables converted to constants. -3825,_Function,tensorflow/tensorflow/python/framework/convert_to_constants.py,140,class,"A library function Convertible. - -Edges into functions are edges from node _inputs_ into function _inputs_: -Functions get their input from their callers, not from node outputs, and the -callers in turn get those values as inputs." -3826,_Node,tensorflow/tensorflow/python/framework/convert_to_constants.py,206,class,A Convertible NodeDef. -3827,_Intermediate,tensorflow/tensorflow/python/framework/convert_to_constants.py,350,class,Specialization of _Node to intermediate ops. -3828,_Merge,tensorflow/tensorflow/python/framework/convert_to_constants.py,363,class,Specialization of _Node to Merge ops. -3829,_VarHandle,tensorflow/tensorflow/python/framework/convert_to_constants.py,375,class,Specialization of _Node to VarHandleOp. -3830,_ResourceGather,tensorflow/tensorflow/python/framework/convert_to_constants.py,395,class,Specialization of _Node to ResourceGather. -3831,_ResourceGatherNd,tensorflow/tensorflow/python/framework/convert_to_constants.py,428,class,Specialization of _Node to ResourceGatherNd. -3832,_ReadVariable,tensorflow/tensorflow/python/framework/convert_to_constants.py,443,class,Specialization of _Node to ReadVariableOp. -3833,_FunctionCaller,tensorflow/tensorflow/python/framework/convert_to_constants.py,471,class,A base class for Convertibles that reference functions. -3834,_If,tensorflow/tensorflow/python/framework/convert_to_constants.py,561,class,Specialization of _Node to If-like operations. -3835,_Case,tensorflow/tensorflow/python/framework/convert_to_constants.py,574,class,Specialization of _Node to Case-like operations. -3836,_PartitionedCall,tensorflow/tensorflow/python/framework/convert_to_constants.py,587,class,Specialization of _Node to PartitionedCall-like operations. -3837,_While,tensorflow/tensorflow/python/framework/convert_to_constants.py,600,class,Specialization of _Node to While-like operations. -3838,_GraphDef,tensorflow/tensorflow/python/framework/convert_to_constants.py,631,class,A convertible GraphDef. -3839,_ConverterData,tensorflow/tensorflow/python/framework/convert_to_constants.py,705,class,"Container for constant conversion supporting data. - -The data includes the graph being converted, and the pre-converted -tensors. This class will be specialized for ConcreteFunction and Session-based -conversions, as the means to obtain that data is different for each case." -3840,_FunctionConverterData,tensorflow/tensorflow/python/framework/convert_to_constants.py,774,class,Container for ConcreteFunction-based conversion data. -3841,_SessionConverterData,tensorflow/tensorflow/python/framework/convert_to_constants.py,847,class,Container for Session-based conversion data. -3842,disable_lower_using_switch_merge,tensorflow/tensorflow/python/framework/convert_to_constants.py,881,function,"Set '_lower_using_switch_merge' attributes to False. +3936,is_constant,tensorflow/tensorflow/python/framework/constant_op.py,328,function, +3937,disable_lower_using_switch_merge,tensorflow/tensorflow/python/framework/convert_to_constants.py,881,function,"Set '_lower_using_switch_merge' attributes to False. Sets the attribute to False in the NodeDefs in the main graph and the NodeDefs in each function's graph. @@ -22220,43 +26954,7 @@ Args: Returns: GraphDef" -3843,_run_inline_graph_optimization,tensorflow/tensorflow/python/framework/convert_to_constants.py,910,function,"Apply function inline optimization to the graph. - -Returns the GraphDef after Grappler's function inlining optimization is -applied. This optimization does not work on models with control flow. - -Args: - func: ConcreteFunction. - lower_control_flow: Boolean indicating whether or not to lower control flow - ops such as If and While. (default True) - aggressive_inlining: Boolean indicating whether or not to to aggressive - function inlining (might be unsafe if function has stateful ops not - properly connected to control outputs). - -Returns: - GraphDef" -3844,_construct_concrete_function,tensorflow/tensorflow/python/framework/convert_to_constants.py,975,function,"Constructs a concrete function from the `output_graph_def`. - -Args: - func: ConcreteFunction - output_graph_def: GraphDef proto. - converted_input_indices: Set of integers of input indices that were - converted to constants. - -Returns: - ConcreteFunction." -3845,_replace_variables_by_constants,tensorflow/tensorflow/python/framework/convert_to_constants.py,1012,function,"Replaces variables by constants on a given graph. - -Given a _ConverterData instance with converted variables in its tensor_data -field, create a new graph where the respective variables are replaced with the -converted constants. - -Args: - converter_data: A pre-populated _ConverterData instance. - -Returns: - The converted graph." -3846,convert_variables_to_constants_v2,tensorflow/tensorflow/python/framework/convert_to_constants.py,1042,function,"Replaces all the variables in a graph with constants of the same values. +3938,convert_variables_to_constants_v2,tensorflow/tensorflow/python/framework/convert_to_constants.py,1042,function,"Replaces all the variables in a graph with constants of the same values. TensorFlow 2.0 function for converting all Variable ops into Const ops holding the same values. This makes it possible to describe the network fully with a @@ -22277,7 +26975,7 @@ Args: Returns: ConcreteFunction containing a simplified version of the original." -3847,convert_variables_to_constants_v2_as_graph,tensorflow/tensorflow/python/framework/convert_to_constants.py,1080,function,"Replaces all the variables in a graph with constants of the same values. +3939,convert_variables_to_constants_v2_as_graph,tensorflow/tensorflow/python/framework/convert_to_constants.py,1080,function,"Replaces all the variables in a graph with constants of the same values. This function works as same as convert_variables_to_constants_v2, but it returns the intermediate `GraphDef` as well. This `GraphDef` contains all the @@ -22295,7 +26993,7 @@ Returns: ConcreteFunction containing a simplified version of the original, and also the intermediate GraphDef containing the node debug information for the transformations in the frozen phase." -3848,convert_variables_to_constants_from_session_graph,tensorflow/tensorflow/python/framework/convert_to_constants.py,1115,function,"Replaces all the variables in a graph with constants of the same values. +3940,convert_variables_to_constants_from_session_graph,tensorflow/tensorflow/python/framework/convert_to_constants.py,1115,function,"Replaces all the variables in a graph with constants of the same values. This function works similarly to convert_variables_to_constants_v2, but it retrieves the constant values from a Session instead of from a @@ -22315,19 +27013,16 @@ Args: Returns: An optimized GraphDef." -3849,_GraphMerger,tensorflow/tensorflow/python/framework/convert_to_constants_test.py,64,class,GraphDef merging methods for testing purposes. -3850,VariablesToConstantsTest,tensorflow/tensorflow/python/framework/convert_to_constants_test.py,145,class, -3851,ConvertVariablesToConstantsSessionTest,tensorflow/tensorflow/python/framework/convert_to_constants_test.py,524,class, -3852,check_valid,tensorflow/tensorflow/python/framework/device.py,32,function,"Check that a device spec is valid. +3941,check_valid,tensorflow/tensorflow/python/framework/device.py,32,function,"Check that a device spec is valid. Args: spec: a string. Raises: An exception if the spec is invalid." -3853,is_device_spec,tensorflow/tensorflow/python/framework/device.py,45,function,Abstract away the fact that DeviceSpecV2 is the base class. -3854,canonical_name,tensorflow/tensorflow/python/framework/device.py,50,function,Returns a canonical name for the given `DeviceSpec` or device name. -3855,merge_device,tensorflow/tensorflow/python/framework/device.py,67,function,"Returns a device function that merges devices specifications. +3942,is_device_spec,tensorflow/tensorflow/python/framework/device.py,45,function,Abstract away the fact that DeviceSpecV2 is the base class. +3943,canonical_name,tensorflow/tensorflow/python/framework/device.py,50,function,Returns a canonical name for the given `DeviceSpec` or device name. +3944,merge_device,tensorflow/tensorflow/python/framework/device.py,67,function,"Returns a device function that merges devices specifications. This can be used to merge partial specifications of devices. The innermost setting for a device field takes precedence. For example: @@ -22351,15 +27046,41 @@ Returns: Raises: ValueError: if the spec was not valid." -3856,MergeDevice,tensorflow/tensorflow/python/framework/device.py,107,class,"Wraps a device specification (DeviceSpec or str) with merge functionality. +3945,MergeDevice,tensorflow/tensorflow/python/framework/device.py,107,class,"Wraps a device specification (DeviceSpec or str) with merge functionality. When called, this class will merge a node_def with its own spec. It also exposes a `shortcut_string_merge` method which can significantly improve performance of device placement." -3857,_as_str_or_none,tensorflow/tensorflow/python/framework/device_spec.py,34,function, -3858,_as_int_or_none,tensorflow/tensorflow/python/framework/device_spec.py,38,function, -3859,_as_device_str_or_none,tensorflow/tensorflow/python/framework/device_spec.py,42,function, -3860,DeviceSpecV2,tensorflow/tensorflow/python/framework/device_spec.py,51,class,"Represents a (possibly partial) specification for a TensorFlow device. +3946,shortcut_string_merge,tensorflow/tensorflow/python/framework/device.py,135,method,"Merge a node def without materializing a full DeviceSpec object. + +Often a device merge is invoked in order to generate a string which can be +passed into the c api. In such a case, we can cache the + node_def.device -> merge_result_string + +map, and in most cases avoid: + - Materializing a copy of self._spec (In the case of DeviceSpecV1) + - Materializing a DeviceSpec for node_def.device + - A DeviceSpec.merge_from invocation + +In practice the cache hit rate for this function is very high, because the +number of invocations when iterating through the device stack is much +larger than the number of devices. + +Args: + node_def: An Operation (or Operation-like) to merge device constraints + with self._spec + +Returns: + A string containing the merged device specification." +3947,is_null_merge,tensorflow/tensorflow/python/framework/device.py,175,method,"Indicate whether the wrapped spec is empty. + +In the degenerate case where self._spec is an empty specification, a caller +may wish to skip a merge step entirely. (However this class does not have +enough information to make that determination.) + +Returns: + A boolean indicating whether a device merge will be trivial." +3948,DeviceSpecV2,tensorflow/tensorflow/python/framework/device_spec.py,51,class,"Represents a (possibly partial) specification for a TensorFlow device. `DeviceSpec`s are used throughout TensorFlow to describe where state is stored and computations occur. Using `DeviceSpec` allows you to parse device spec @@ -22413,10 +27134,127 @@ which is optionally specified: * Task: The task index. * Device type: The device type string (e.g. ""CPU"" or ""GPU""). * Device index: The device index." -3861,DeviceSpecV1,tensorflow/tensorflow/python/framework/device_spec.py,397,class, -3862,DeviceSpecTest,tensorflow/tensorflow/python/framework/device_spec_test.py,32,class, -3863,DeviceTest,tensorflow/tensorflow/python/framework/device_test.py,36,class, -3864,DType,tensorflow/tensorflow/python/framework/dtypes.py,37,class,"Represents the type of the elements in a `Tensor`. +3949,to_string,tensorflow/tensorflow/python/framework/device_spec.py,133,method,"Return a string representation of this `DeviceSpec`. + +Returns: + a string of the form + /job:/replica:/task:/device::." +3950,from_string,tensorflow/tensorflow/python/framework/device_spec.py,143,method,"Construct a `DeviceSpec` from a string. + +Args: + spec: a string of the form + /job:/replica:/task:/device:CPU: + or + /job:/replica:/task:/device:GPU: + as cpu and gpu are mutually exclusive. + All entries are optional. + +Returns: + A DeviceSpec." +3951,parse_from_string,tensorflow/tensorflow/python/framework/device_spec.py,159,method,"Parse a `DeviceSpec` name into its components. + +2.x behavior change: + In TensorFlow 1.x, this function mutates its own state and returns itself. + In 2.x, DeviceSpecs are immutable, and this function will return a + DeviceSpec which contains the spec. + + Recommended: + ``` + # my_spec and my_updated_spec are unrelated. + my_spec = tf.DeviceSpec.from_string(""/CPU:0"") + my_updated_spec = tf.DeviceSpec.from_string(""/GPU:0"") + with tf.device(my_updated_spec): + ... + ``` + + Will work in 1.x and 2.x (though deprecated in 2.x): + ``` + my_spec = tf.DeviceSpec.from_string(""/CPU:0"") + my_updated_spec = my_spec.parse_from_string(""/GPU:0"") + with tf.device(my_updated_spec): + ... + ``` + + Will NOT work in 2.x: + ``` + my_spec = tf.DeviceSpec.from_string(""/CPU:0"") + my_spec.parse_from_string(""/GPU:0"") # <== Will not update my_spec + with tf.device(my_spec): + ... + ``` + + In general, `DeviceSpec.from_string` should completely replace + `DeviceSpec.parse_from_string`, and `DeviceSpec.replace` should + completely replace setting attributes directly. + +Args: + spec: an optional string of the form + /job:/replica:/task:/device:CPU: + or + /job:/replica:/task:/device:GPU: + as cpu and gpu are mutually exclusive. + All entries are optional. + +Returns: + The `DeviceSpec`. + +Raises: + ValueError: if the spec was not valid." +3952,make_merged_spec,tensorflow/tensorflow/python/framework/device_spec.py,212,method,"Returns a new DeviceSpec which incorporates `dev`. + +When combining specs, `dev` will take precedence over the current spec. +So for instance: +``` +first_spec = tf.DeviceSpec(job=0, device_type=""CPU"") +second_spec = tf.DeviceSpec(device_type=""GPU"") +combined_spec = first_spec.make_merged_spec(second_spec) +``` + +is equivalent to: +``` +combined_spec = tf.DeviceSpec(job=0, device_type=""GPU"") +``` + +Args: + dev: a `DeviceSpec` + +Returns: + A new `DeviceSpec` which combines `self` and `dev`" +3953,replace,tensorflow/tensorflow/python/framework/device_spec.py,236,method,"Convenience method for making a new DeviceSpec by overriding fields. + +For instance: +``` +my_spec = DeviceSpec=(job=""my_job"", device=""CPU"") +my_updated_spec = my_spec.replace(device=""GPU"") +my_other_spec = my_spec.replace(device=None) +``` + +Args: + **kwargs: This method takes the same args as the DeviceSpec constructor + +Returns: + A DeviceSpec with the fields specified in kwargs overridden." +3954,job,tensorflow/tensorflow/python/framework/device_spec.py,261,method, +3955,replica,tensorflow/tensorflow/python/framework/device_spec.py,265,method, +3956,task,tensorflow/tensorflow/python/framework/device_spec.py,269,method, +3957,device_type,tensorflow/tensorflow/python/framework/device_spec.py,273,method, +3958,device_index,tensorflow/tensorflow/python/framework/device_spec.py,277,method, +3959,DeviceSpecV1,tensorflow/tensorflow/python/framework/device_spec.py,397,class, +3960,job,tensorflow/tensorflow/python/framework/device_spec.py,402,method, +3961,replica,tensorflow/tensorflow/python/framework/device_spec.py,407,method, +3962,task,tensorflow/tensorflow/python/framework/device_spec.py,412,method, +3963,device_type,tensorflow/tensorflow/python/framework/device_spec.py,417,method, +3964,device_index,tensorflow/tensorflow/python/framework/device_spec.py,422,method, +3965,to_string,tensorflow/tensorflow/python/framework/device_spec.py,431,method, +3966,parse_from_string,tensorflow/tensorflow/python/framework/device_spec.py,438,method, +3967,merge_from,tensorflow/tensorflow/python/framework/device_spec.py,444,method,"Merge the properties of ""dev"" into this `DeviceSpec`. + +Note: Will be removed in TensorFlow 2.x since DeviceSpecs will become + immutable. + +Args: + dev: a `DeviceSpec`." +3968,DType,tensorflow/tensorflow/python/framework/dtypes.py,37,class,"Represents the type of the elements in a `Tensor`. The following `DType` objects are defined: @@ -22446,7 +27284,40 @@ The following `DType` objects are defined: The `tf.as_dtype()` function converts numpy types and string type names to a `DType` object." -3865,as_dtype,tensorflow/tensorflow/python/framework/dtypes.py,607,function,"Converts the given `type_value` to a `DType`. +3969,base_dtype,tensorflow/tensorflow/python/framework/dtypes.py,85,method,Returns a non-reference `DType` based on this `DType`. +3970,real_dtype,tensorflow/tensorflow/python/framework/dtypes.py,93,method,Returns the `DType` corresponding to this `DType`'s real part. +3971,as_numpy_dtype,tensorflow/tensorflow/python/framework/dtypes.py,104,method,Returns a Python `type` object based on this `DType`. +3972,min,tensorflow/tensorflow/python/framework/dtypes.py,109,method,"Returns the minimum representable value in this data type. + +Raises: + TypeError: if this is a non-numeric, unordered, or quantized type." +3973,max,tensorflow/tensorflow/python/framework/dtypes.py,133,method,"Returns the maximum representable value in this data type. + +Raises: + TypeError: if this is a non-numeric, unordered, or quantized type." +3974,limits,tensorflow/tensorflow/python/framework/dtypes.py,157,method,"Return intensity limits, i.e. + +(min, max) tuple, of the dtype. +Args: + clip_negative : bool, optional If True, clip the negative range (i.e. + return 0 for min intensity) even if the image dtype allows negative + values. Returns + min, max : tuple Lower and upper intensity limits." +3975,is_compatible_with,tensorflow/tensorflow/python/framework/dtypes.py,172,method,"Returns True if the `other` DType will be converted to this DType. + +The conversion rules are as follows: + +```python +DType(T) .is_compatible_with(DType(T)) == True +``` + +Args: + other: A `DType` (or object that may be converted to a `DType`). + +Returns: + True if a Tensor of the `other` `DType` will be implicitly converted to + this `DType`." +3976,as_dtype,tensorflow/tensorflow/python/framework/dtypes.py,607,function,"Converts the given `type_value` to a `DType`. Note: `DType` values are interned. When passed a new `DType` object, `as_dtype` always returns the interned value. @@ -22462,9 +27333,7 @@ Returns: Raises: TypeError: If `type_value` cannot be converted to a `DType`." -3866,_is_numeric_dtype_enum,tensorflow/tensorflow/python/framework/dtypes_test.py,30,function, -3867,TypesTest,tensorflow/tensorflow/python/framework/dtypes_test.py,39,class, -3868,parse_message,tensorflow/tensorflow/python/framework/error_interpolation.py,69,function,"Parses the message. +3977,parse_message,tensorflow/tensorflow/python/framework/error_interpolation.py,69,function,"Parses the message. Splits the message into separators and tags. Tags are named tuples representing the string {{type name}} and they are separated by @@ -22479,80 +27348,7 @@ Returns: For example, if message is ""123{{node Foo}}456"" then this function returns ([""123"", ""456""], [_ParseTag(""node"", ""Foo"")])" -3869,_compute_device_summary_from_list,tensorflow/tensorflow/python/framework/error_interpolation.py,101,function,"Return a summary of an op's device function stack. - -Args: - name: The name of the op. - device_assignment_list: The op._device_assignments list. - prefix: An optional string prefix used before each line of the multi- - line string returned by this function. - -Returns: - A multi-line string similar to: - Device assignments active during op 'foo' creation: - with tf.device(/cpu:0): - with tf.device(some_func): - The first line will have no padding to its left by default. Subsequent - lines will have two spaces of left-padding. Use the prefix argument - to increase indentation." -3870,_compute_device_assignment_summary_from_op,tensorflow/tensorflow/python/framework/error_interpolation.py,143,function, -3871,_compute_colocation_summary_from_dict,tensorflow/tensorflow/python/framework/error_interpolation.py,150,function,"Return a summary of an op's colocation stack. - -Args: - name: The op name. - colocation_dict: The op._colocation_dict. - prefix: An optional string prefix used before each line of the multi- - line string returned by this function. - -Returns: - A multi-line string similar to: - Node-device colocations active during op creation: - with tf.compat.v1.colocate_with(test_node_1): - with tf.compat.v1.colocate_with(test_node_2): - The first line will have no padding to its left by default. Subsequent - lines will have two spaces of left-padding. Use the prefix argument - to increase indentation." -3872,_compute_colocation_summary_from_op,tensorflow/tensorflow/python/framework/error_interpolation.py,192,function,"Fetch colocation file, line, and nesting and return a summary string." -3873,_is_framework_filename,tensorflow/tensorflow/python/framework/error_interpolation.py,200,function,"Returns whether a filename should be considered a part of the framework. - -A file is part of the framework if it does not match a pattern in -_EXTERNAL_FILENAME_PATTERNS and it either matches a pattern in -_FRAMEWORK_FILENAME_PATTERNS or starts with a _FRAMEWORK_PATH_PREFIXES prefix. - -Args: - filename: A filename string. - -Returns: - Whether the filename should be considered to be internal to the - TensorFlow framework for the purposes of reporting errors." -3874,_find_index_of_defining_frame,tensorflow/tensorflow/python/framework/error_interpolation.py,226,function,"Return index in op.traceback with first 'useful' frame. - -This method reads through the stack stored in op.traceback looking for the -innermost frame which (hopefully) belongs to the caller. It accomplishes this -by rejecting frames deemed to be part of the TensorFlow framework (by -pattern matching the filename). - -Args: - traceback: A list of traceback frames (as from Operation.traceback). - -Returns: - Integer index into op.traceback where the first non-TF file was found - (innermost to outermost), or 0 (for the outermost stack frame) if all files - came from TensorFlow." -3875,_get_defining_frame,tensorflow/tensorflow/python/framework/error_interpolation.py,254,function,Find and return stack frame where op was defined. -3876,_compute_useful_frames,tensorflow/tensorflow/python/framework/error_interpolation.py,260,function,"Return a list of frames, which form a 'useful' stack. - -Starting from the defining frame to the outermost one, this method computes -the contiguous portion of the 'useful' stack trace and returns the selected -frames. - -Args: - traceback: A list of traceback frames (as from Operation.traceback). - num: total number of frames to return. - -Returns: - A list of frames." -3877,create_graph_debug_info_def,tensorflow/tensorflow/python/framework/error_interpolation.py,284,function,"Construct and returns a `GraphDebugInfo` protocol buffer. +3978,create_graph_debug_info_def,tensorflow/tensorflow/python/framework/error_interpolation.py,284,function,"Construct and returns a `GraphDebugInfo` protocol buffer. Args: func_named_operations: An iterable of (func_name, op.Operation) tuples @@ -22564,37 +27360,7 @@ Returns: Raises: TypeError: If the arguments are not of the correct proto buffer type." -3878,_compute_field_dict,tensorflow/tensorflow/python/framework/error_interpolation.py,340,function,"Return a dictionary mapping interpolation tokens to values. - -Args: - op: op.Operation object having a _traceback member. - strip_file_prefix: The common path in the stacktrace. We remove the prefix - from the file names. - -Returns: - A dictionary mapping string tokens to string values. The keys are shown - below along with example values. - { - ""file"": ""tool_utils.py"", - ""line"": ""124"", - ""defined_at"": "" (defined at tool_utils.py:124)"", - ""colocations"": - '''Node-device colocations active during op creation: - with tf.compat.v1.colocate_with(test_node_1): - with tf.compat.v1.colocate_with(test_node_2): ''' - ""devices"": - '''Device assignments active during op 'foo' creation: - with tf.device(/cpu:0): - with tf.device(some_func): ''' - ""devs_and_colocs"": A concatenation of colocations and devices, e.g. - '''Node-device colocations active during op creation: - with tf.compat.v1.colocate_with(test_node_1): - with tf.compat.v1.colocate_with(test_node_2): ''' - Device assignments active during op 'foo' creation: - with tf.device(/cpu:0): - with tf.device(some_func): ''' - }" -3879,traceback_files_common_prefix,tensorflow/tensorflow/python/framework/error_interpolation.py,404,function,"Determines the common prefix from the paths of the stacktrace of 'all_ops'. +3979,traceback_files_common_prefix,tensorflow/tensorflow/python/framework/error_interpolation.py,404,function,"Determines the common prefix from the paths of the stacktrace of 'all_ops'. For example, if the paths are '/foo/bar/baz/' and '/foo/car', this would return '/foo'. @@ -22604,25 +27370,7 @@ Args: Returns: The common prefix." -3880,_sources_for_node,tensorflow/tensorflow/python/framework/error_interpolation.py,428,function,"Gets the input op nodes for 'node'. - -Args: - node: The node. - graph: The graph containing the node. - -Returns: - The unique input nodes." -3881,_build_error_message,tensorflow/tensorflow/python/framework/error_interpolation.py,455,function,"Returns the formatted error message for the given op. - -Args: - op: The node. - input_ops: The input nodes to the 'op' node - common_prefix: The prefix path common to the stacktrace of inputs. - -Returns: - The formatted error message for the given op. The error message also - includes the information about the input sources for the given op." -3882,interpolate,tensorflow/tensorflow/python/framework/error_interpolation.py,487,function,"Interpolates an error message. +3980,interpolate,tensorflow/tensorflow/python/framework/error_interpolation.py,487,function,"Interpolates an error message. The error message can contain tags of the form `{{type name}}` which will be replaced. For example: ""{{node }}"" would get expanded to: @@ -22635,27 +27383,30 @@ Args: Returns: The string with tags of the form {{type name}} interpolated." -3883,_make_frame_with_filename,tensorflow/tensorflow/python/framework/error_interpolation_test.py,38,function,Return a copy of an existing stack frame with a new filename. -3884,_modify_op_stack_with_filenames,tensorflow/tensorflow/python/framework/error_interpolation_test.py,48,function,Replace op._traceback with a new traceback using special filenames. -3885,ComputeDeviceSummaryFromOpTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,70,class, -3886,ComputeColocationSummaryFromOpTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,98,class, -3887,CreateGraphDebugInfoDefTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,130,class, -3888,InterpolateFilenamesAndLineNumbersTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,189,class, -3889,InputNodesTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,263,class, -3890,InterpolateDeviceSummaryTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,294,class, -3891,InterpolateColocationSummaryTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,339,class, -3892,IsFrameworkFilenameTest,tensorflow/tensorflow/python/framework/error_interpolation_test.py,390,class, -3893,_compact_stack_trace,tensorflow/tensorflow/python/framework/errors_impl.py,35,function,Returns a traceback for `op` with common file prefixes stripped. -3894,InaccessibleTensorError,tensorflow/tensorflow/python/framework/errors_impl.py,47,class, -3895,OperatorNotAllowedInGraphError,tensorflow/tensorflow/python/framework/errors_impl.py,52,class,"An error is raised for unsupported operator in Graph execution. +3981,InaccessibleTensorError,tensorflow/tensorflow/python/framework/errors_impl.py,47,class, +3982,OperatorNotAllowedInGraphError,tensorflow/tensorflow/python/framework/errors_impl.py,52,class,"An error is raised for unsupported operator in Graph execution. For example, using a `tf.Tensor` as a Python `bool` in Graph execution is not allowed." -3896,OpError,tensorflow/tensorflow/python/framework/errors_impl.py,63,class,"A generic error that is raised when TensorFlow execution fails. +3983,OpError,tensorflow/tensorflow/python/framework/errors_impl.py,63,class,"A generic error that is raised when TensorFlow execution fails. Whenever possible, the session will raise a more specific subclass of `OpError` from the `tf.errors` module." -3897,CancelledError,tensorflow/tensorflow/python/framework/errors_impl.py,217,class,"Raised when an operation or step is cancelled. +3984,message,tensorflow/tensorflow/python/framework/errors_impl.py,93,method,The error message that describes the error. +3985,op,tensorflow/tensorflow/python/framework/errors_impl.py,98,method,"The operation that failed, if known. + +*N.B.* If the failed op was synthesized at runtime, e.g. a `Send` +or `Recv` op, there will be no corresponding +`tf.Operation` +object. In that case, this will return `None`, and you should +instead use the `tf.errors.OpError.node_def` to +discover information about the op. + +Returns: + The `Operation` that failed, or None." +3986,error_code,tensorflow/tensorflow/python/framework/errors_impl.py,114,method,The integer error code that describes the error. +3987,node_def,tensorflow/tensorflow/python/framework/errors_impl.py,119,method,The `NodeDef` proto representing the op that failed. +3988,CancelledError,tensorflow/tensorflow/python/framework/errors_impl.py,217,class,"Raised when an operation or step is cancelled. For example, a long-running operation (e.g. `tf.QueueBase.enqueue` may be @@ -22666,7 +27417,7 @@ A step that is running such a long-running operation will fail by raising `CancelledError`. @@__init__" -3898,UnknownError,tensorflow/tensorflow/python/framework/errors_impl.py,238,class,"Unknown error. +3989,UnknownError,tensorflow/tensorflow/python/framework/errors_impl.py,238,class,"Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that @@ -22675,7 +27426,7 @@ do not return enough error information may be converted to this error. @@__init__" -3899,InvalidArgumentError,tensorflow/tensorflow/python/framework/errors_impl.py,256,class,"Raised when an operation receives an invalid argument. +3990,InvalidArgumentError,tensorflow/tensorflow/python/framework/errors_impl.py,256,class,"Raised when an operation receives an invalid argument. This may occur, for example, if an operation receives an input tensor that has an invalid value or shape. For example, the @@ -22686,12 +27437,12 @@ this error if the new shape does not match the number of elements in the input tensor. @@__init__" -3900,DeadlineExceededError,tensorflow/tensorflow/python/framework/errors_impl.py,277,class,"Raised when a deadline expires before an operation could complete. +3991,DeadlineExceededError,tensorflow/tensorflow/python/framework/errors_impl.py,277,class,"Raised when a deadline expires before an operation could complete. This exception is not currently used. @@__init__" -3901,NotFoundError,tensorflow/tensorflow/python/framework/errors_impl.py,292,class,"Raised when a requested entity (e.g., a file or directory) was not found. +3992,NotFoundError,tensorflow/tensorflow/python/framework/errors_impl.py,292,class,"Raised when a requested entity (e.g., a file or directory) was not found. For example, running the `tf.WholeFileReader.read` @@ -22699,7 +27450,7 @@ operation could raise `NotFoundError` if it receives the name of a file that does not exist. @@__init__" -3902,AlreadyExistsError,tensorflow/tensorflow/python/framework/errors_impl.py,309,class,"Raised when an entity that we attempted to create already exists. +3993,AlreadyExistsError,tensorflow/tensorflow/python/framework/errors_impl.py,309,class,"Raised when an entity that we attempted to create already exists. For example, running an operation that saves a file (e.g. `tf.train.Saver.save`) @@ -22707,7 +27458,7 @@ could potentially raise this exception if an explicit filename for an existing file was passed. @@__init__" -3903,PermissionDeniedError,tensorflow/tensorflow/python/framework/errors_impl.py,327,class,"Raised when the caller does not have permission to run an operation. +3994,PermissionDeniedError,tensorflow/tensorflow/python/framework/errors_impl.py,327,class,"Raised when the caller does not have permission to run an operation. For example, running the `tf.WholeFileReader.read` @@ -22715,25 +27466,25 @@ operation could raise `PermissionDeniedError` if it receives the name of a file for which the user does not have the read file permission. @@__init__" -3904,UnauthenticatedError,tensorflow/tensorflow/python/framework/errors_impl.py,345,class,"The request does not have valid authentication credentials. +3995,UnauthenticatedError,tensorflow/tensorflow/python/framework/errors_impl.py,345,class,"The request does not have valid authentication credentials. This exception is not currently used. @@__init__" -3905,ResourceExhaustedError,tensorflow/tensorflow/python/framework/errors_impl.py,360,class,"Some resource has been exhausted. +3996,ResourceExhaustedError,tensorflow/tensorflow/python/framework/errors_impl.py,360,class,"Some resource has been exhausted. For example, this error might be raised if a per-user quota is exhausted, or perhaps the entire file system is out of space. @@__init__" -3906,FailedPreconditionError,tensorflow/tensorflow/python/framework/errors_impl.py,376,class,"Operation was rejected because the system is not in a state to execute it. +3997,FailedPreconditionError,tensorflow/tensorflow/python/framework/errors_impl.py,376,class,"Operation was rejected because the system is not in a state to execute it. This exception is most commonly raised when running an operation that reads a `tf.Variable` before it has been initialized. @@__init__" -3907,AbortedError,tensorflow/tensorflow/python/framework/errors_impl.py,393,class,"The operation was aborted, typically due to a concurrent action. +3998,AbortedError,tensorflow/tensorflow/python/framework/errors_impl.py,393,class,"The operation was aborted, typically due to a concurrent action. For example, running a `tf.QueueBase.enqueue` @@ -22742,7 +27493,7 @@ operation may raise `AbortedError` if a previously ran. @@__init__" -3908,OutOfRangeError,tensorflow/tensorflow/python/framework/errors_impl.py,411,class,"Raised when an operation iterates past the valid input range. +3999,OutOfRangeError,tensorflow/tensorflow/python/framework/errors_impl.py,411,class,"Raised when an operation iterates past the valid input range. This exception is raised in ""end-of-file"" conditions, such as when a `tf.QueueBase.dequeue` @@ -22751,7 +27502,7 @@ operation is blocked on an empty queue, and a operation executes. @@__init__" -3909,UnimplementedError,tensorflow/tensorflow/python/framework/errors_impl.py,430,class,"Raised when an operation has not been implemented. +4000,UnimplementedError,tensorflow/tensorflow/python/framework/errors_impl.py,430,class,"Raised when an operation has not been implemented. Some operations may raise this error when passed otherwise-valid arguments that it does not currently support. For example, running @@ -22760,32 +27511,29 @@ would raise this error if pooling was requested on the batch dimension, because this is not yet supported. @@__init__" -3910,InternalError,tensorflow/tensorflow/python/framework/errors_impl.py,449,class,"Raised when the system experiences an internal error. +4001,InternalError,tensorflow/tensorflow/python/framework/errors_impl.py,449,class,"Raised when the system experiences an internal error. This exception is raised when some invariant expected by the runtime has been broken. Catching this exception is not recommended. @@__init__" -3911,UnavailableError,tensorflow/tensorflow/python/framework/errors_impl.py,464,class,"Raised when the runtime is currently unavailable. +4002,UnavailableError,tensorflow/tensorflow/python/framework/errors_impl.py,464,class,"Raised when the runtime is currently unavailable. This exception is not currently used. @@__init__" -3912,DataLossError,tensorflow/tensorflow/python/framework/errors_impl.py,479,class,"Raised when unrecoverable data loss or corruption is encountered. +4003,DataLossError,tensorflow/tensorflow/python/framework/errors_impl.py,479,class,"Raised when unrecoverable data loss or corruption is encountered. For example, this may be raised by running a `tf.WholeFileReader.read` operation, if the file is truncated while it is being read. @@__init__" -3913,exception_type_from_error_code,tensorflow/tensorflow/python/framework/errors_impl.py,520,function, -3914,error_code_from_exception_type,tensorflow/tensorflow/python/framework/errors_impl.py,525,function, -3915,_make_specific_exception,tensorflow/tensorflow/python/framework/errors_impl.py,533,function, -3916,raise_exception_on_not_ok_status,tensorflow/tensorflow/python/framework/errors_impl.py,547,class,Context manager to check for C API status. -3917,ErrorsTest,tensorflow/tensorflow/python/framework/errors_test.py,34,class, -3918,FileSystemTest,tensorflow/tensorflow/python/framework/file_system_test.py,31,class, -3919,UnknownArgument,tensorflow/tensorflow/python/framework/func_graph.py,64,class,Signifies an argument which is not currently handled. -3920,convert_structure_to_signature,tensorflow/tensorflow/python/framework/func_graph.py,69,function,"Convert a potentially nested structure to a signature. +4004,exception_type_from_error_code,tensorflow/tensorflow/python/framework/errors_impl.py,520,function, +4005,error_code_from_exception_type,tensorflow/tensorflow/python/framework/errors_impl.py,525,function, +4006,raise_exception_on_not_ok_status,tensorflow/tensorflow/python/framework/errors_impl.py,547,class,Context manager to check for C API status. +4007,UnknownArgument,tensorflow/tensorflow/python/framework/func_graph.py,64,class,Signifies an argument which is not currently handled. +4008,convert_structure_to_signature,tensorflow/tensorflow/python/framework/func_graph.py,69,function,"Convert a potentially nested structure to a signature. Args: structure: Structure to convert, where top level collection is a list or a @@ -22796,7 +27544,7 @@ Args: Returns: Identical structure that has TensorSpec objects instead of Tensors and UnknownArgument instead of any unsupported types." -3921,FuncGraph,tensorflow/tensorflow/python/framework/func_graph.py,134,class,"Graph representing a function body. +4009,FuncGraph,tensorflow/tensorflow/python/framework/func_graph.py,134,class,"Graph representing a function body. Attributes: name: The name of the function. @@ -22824,7 +27572,131 @@ Attributes: seed: The graph-level random seed. capture_by_value: If True, the func graph will capture Variables by value instead of reference." -3922,func_graph_from_py_func,tensorflow/tensorflow/python/framework/func_graph.py,801,function,"Returns a `FuncGraph` generated from `python_func`. +4010,watch_variable,tensorflow/tensorflow/python/framework/func_graph.py,265,method,Marks the variable v as accessed while building this graph. +4011,capture_call_time_value,tensorflow/tensorflow/python/framework/func_graph.py,271,method,"Creates a placeholder which at call time has the value closure(). + +Useful, for example, to respect TensorFlow context managers, which are often +dynamically scoped. + +Args: + closure: function which takes no arguments, to be evaluated at function + call time, returning a nest of tensors compatible with `spec`. + spec: nest of TypeSpec for the value to capture. + key: optional. If not None, multiple calls to lazy_capture with the same + key in the same graph will return the same placeholder, and the + first closure will be used at function call time. + +Returns: + Nest of placeholders which, at function call time, will be fed with the + result of calling closure(). + +Raises: + ValueError: at function call time, if the return value of closure() is + not compatible with `spec`." +4012,control_dependencies,tensorflow/tensorflow/python/framework/func_graph.py,321,method,"Handles control dependencies. + +FuncGraph wraps Graph's control_dependencies logic by first filtering out +any external tensors / operations and storing them in the graph's +control_captures member. Any consumers of this function graph must then +decide how to handle the control captures. + +Args: + control_inputs: A list of `Operation` or `Tensor` objects which + must be executed or computed before running the operations + defined in the context. Can also be `None` to clear the control + dependencies. + +Returns: + A context manager that specifies control dependencies for all + operations constructed within the context. + +Raises: + TypeError: If `control_inputs` is not a list of `Operation` or + `Tensor` objects." +4013,as_default,tensorflow/tensorflow/python/framework/func_graph.py,362,method, +4014,outer_graph,tensorflow/tensorflow/python/framework/func_graph.py,428,method,"The Graph this FuncGraph is nested in. + +Functions may capture Tensors from graphs they are nested in (transitive). + +Returns: + A Graph object. Initially set to the current default graph when the + FuncGraph was created. If the previous `outer_graph` was deleted because + the function that owns it was deleted, `outer_graph` is reset to the + outermost default graph active when the FuncGraph was created. This + FuncGraph won't have captured anything from the new `outer_graph` (and + likely not from the previous setting, since that would have created a + strong reference), but it is returned so that FuncGraphs always have a + parent." +4015,output_types,tensorflow/tensorflow/python/framework/func_graph.py,449,method, +4016,output_shapes,tensorflow/tensorflow/python/framework/func_graph.py,453,method, +4017,trainable_variables,tensorflow/tensorflow/python/framework/func_graph.py,457,method,"A sequence of trainable variables accessed by this FuncGraph. + +Note that functions keep only weak references to variables. Calling the +function after a variable it accesses has been deleted is an error. + +Returns: + Sequence of trainable variables for this func graph." +4018,variables,tensorflow/tensorflow/python/framework/func_graph.py,469,method,"A sequence of variables accessed by this FuncGraph. + +Note that functions keep only weak references to variables. Calling the +function after a variable it accesses has been deleted is an error. + +Returns: + Sequence of variables for this func graph." +4019,variables,tensorflow/tensorflow/python/framework/func_graph.py,492,method, +4020,capture,tensorflow/tensorflow/python/framework/func_graph.py,595,method,"Captures `tensor` if it's external to this graph. + +If `tensor` is from a different graph, returns a placeholder for it. +`tensor` and the placeholder will appear in self.captures, and the +placeholder will appear in self.inputs. Multiple calls to this method with +the same `tensor` argument will return the same placeholder. If `tensor` is +from this graph, returns `tensor`. + +Args: + tensor: Tensor. May be from this FuncGraph or a different graph. + name: Optional name if a placeholder is created. + shape: Optional shape if a placeholder is created. + +Returns: + Tensor from this FuncGraph. + +Raises: + InaccessibleTensorError: if any tensors are accessed in a manner that + bypasses the mechanisms required for the data dependencies to be correctly + wired." +4021,captures,tensorflow/tensorflow/python/framework/func_graph.py,665,method,Order list of tuples containing external and internal captures. +4022,add_capture,tensorflow/tensorflow/python/framework/func_graph.py,669,method,"Capture a specific tensor and utilize the provided placeholder. + +Args: + tensor: Tensor to captures. + placeholder: Provided placeholder for the tensor." +4023,replace_capture,tensorflow/tensorflow/python/framework/func_graph.py,679,method,Replace already existing capture. +4024,reset_captures,tensorflow/tensorflow/python/framework/func_graph.py,683,method,Set the captures with the provided list of captures & placeholder. +4025,pop_capture,tensorflow/tensorflow/python/framework/func_graph.py,689,method,Remove the capture and return the generated placeholder. +4026,clear_captures,tensorflow/tensorflow/python/framework/func_graph.py,697,method, +4027,capture_distributed_variable,tensorflow/tensorflow/python/framework/func_graph.py,707,method,Add given distributed variable to captures with given placeholder. +4028,capture_eager_tensor,tensorflow/tensorflow/python/framework/func_graph.py,714,method, +4029,captured,tensorflow/tensorflow/python/framework/func_graph.py,731,method,Check if the specified tensor has been captured. +4030,external_captures,tensorflow/tensorflow/python/framework/func_graph.py,736,method,External tensors captured by this function. +4031,internal_captures,tensorflow/tensorflow/python/framework/func_graph.py,741,method,Placeholders in this function corresponding captured tensors. +4032,deferred_external_captures,tensorflow/tensorflow/python/framework/func_graph.py,746,method,Ordered nest of tensors whose placeholders will be fed at call time. +4033,deferred_internal_captures,tensorflow/tensorflow/python/framework/func_graph.py,751,method,List of nest of placeholders which at call time will be fed. +4034,variable_captures,tensorflow/tensorflow/python/framework/func_graph.py,756,method,Map of python object ids of variables to variables which are captured. +4035,mark_as_unsaveable,tensorflow/tensorflow/python/framework/func_graph.py,764,method,"Marks this FuncGraph as unsaveable. + +Any attempts to export this FuncGraph will raise an error with the specified +message. + +Args: + error_message: List or string containing the error message to be raised + when saving this FuncGraph to SavedModel." +4036,saveable,tensorflow/tensorflow/python/framework/func_graph.py,780,method,Returns whether this FuncGraph is saveable. +4037,saving_errors,tensorflow/tensorflow/python/framework/func_graph.py,785,method,Returns set of errors preventing this FuncGraph from being saved. +4038,inner_cm,tensorflow/tensorflow/python/framework/func_graph.py,366,method,Context manager for copying distribute.Strategy scope information. +4039,deref,tensorflow/tensorflow/python/framework/func_graph.py,478,method, +4040,convert_to_placeholder,tensorflow/tensorflow/python/framework/func_graph.py,297,method, +4041,wrapped_closure,tensorflow/tensorflow/python/framework/func_graph.py,307,method, +4042,func_graph_from_py_func,tensorflow/tensorflow/python/framework/func_graph.py,801,function,"Returns a `FuncGraph` generated from `python_func`. Args: name: an identifier for the function. @@ -22877,16 +27749,16 @@ Raises: `Tensor`. ValueError: If both `signature` and `override_flat_arg_shapes` are passed in." -3923,maybe_captured,tensorflow/tensorflow/python/framework/func_graph.py,1037,function,"If t is a captured value placeholder, returns the original captured value. +4043,maybe_captured,tensorflow/tensorflow/python/framework/func_graph.py,1037,function,"If t is a captured value placeholder, returns the original captured value. Args: tensor: Tensor. Returns: A tensor, potentially from a different Graph/FuncGraph." -3924,device_stack_has_callable,tensorflow/tensorflow/python/framework/func_graph.py,1055,function,Checks whether a device stack contains a callable. -3925,check_mutation,tensorflow/tensorflow/python/framework/func_graph.py,1061,function,Check if two list of arguments are exactly the same. -3926,flatten,tensorflow/tensorflow/python/framework/func_graph.py,1081,function,"Like nest.flatten w/ expand_composites, but returns flow for TensorArrays. +4044,device_stack_has_callable,tensorflow/tensorflow/python/framework/func_graph.py,1055,function,Checks whether a device stack contains a callable. +4045,check_mutation,tensorflow/tensorflow/python/framework/func_graph.py,1061,function,Check if two list of arguments are exactly the same. +4046,flatten,tensorflow/tensorflow/python/framework/func_graph.py,1081,function,"Like nest.flatten w/ expand_composites, but returns flow for TensorArrays. Args: sequence: A nested structure of Tensors, CompositeTensors, and @@ -22894,7 +27766,7 @@ Args: Returns: A list of tensors." -3927,pack_sequence_as,tensorflow/tensorflow/python/framework/func_graph.py,1098,function,"Like `nest.pack_sequence_as` but also builds TensorArrays from flows. +4047,pack_sequence_as,tensorflow/tensorflow/python/framework/func_graph.py,1098,function,"Like `nest.pack_sequence_as` but also builds TensorArrays from flows. Args: structure: The structure to pack into. May contain Tensors, @@ -22906,34 +27778,7 @@ Returns: Raises: AssertionError if `structure` and `flat_sequence` are not compatible." -3928,_create_substitute_placeholder,tensorflow/tensorflow/python/framework/func_graph.py,1123,function,Creates a placeholder for `value` and propagates shape info to it. -3929,_get_defun_inputs_from_args,tensorflow/tensorflow/python/framework/func_graph.py,1136,function,Maps Python function positional args to graph-construction inputs. -3930,_get_composite_tensor_spec,tensorflow/tensorflow/python/framework/func_graph.py,1142,function,"Returns the TypeSpec for x if it's a composite tensor, or x otherwise." -3931,_get_defun_inputs,tensorflow/tensorflow/python/framework/func_graph.py,1148,function,"Maps python function args to graph-construction inputs. - -Args: - args: A flat list of user-specified arguments. - names: A list of strings with user-specified argument names, same length as - `args`. May be `None`, in which case a generic name is used. - structure: The original argument list or dictionary. - flat_shapes: A flat list of values that are either `None` or - instances of `TensorShape`. If provided, then length must match - that of `nest.flatten(args, expand_composites=True)`; and locations where - `args` are instances of `Tensor` must have a corresponding `TensorShape` - in `flat_shapes`. May be `None`, in which case exact shapes are read - directly from the args. - -Returns: - Placeholders with the same structure as `structure`. - -Raises: - RuntimeError: if `flat_shapes` is provided, but - `len(flat_shapes) != len(nest.flatten(args, expand_composites=True))`. - RuntimeError: if a shape from `flat_shapes` is not None - for an argument that is not a `Tensor`, `TensorSpec`, - or `ResourceVariable`." -3932,_get_defun_inputs_from_kwargs,tensorflow/tensorflow/python/framework/func_graph.py,1258,function,Maps Python function keyword args to graph-construction inputs. -3933,dismantle_func_graph,tensorflow/tensorflow/python/framework/func_graph.py,1269,function,"Removes reference cycles in `func_graph` FuncGraph. +4048,dismantle_func_graph,tensorflow/tensorflow/python/framework/func_graph.py,1269,function,"Removes reference cycles in `func_graph` FuncGraph. Helpful for making sure the garbage collector doesn't need to run when the FuncGraph goes out of scope, e.g. in tests using defun with @@ -22942,8 +27787,8 @@ the FuncGraph goes out of scope, e.g. in tests using defun with Args: func_graph: A `FuncGraph` object to destroy. `func_graph` is unusable after this function." -3934,override_func_graph_name_scope,tensorflow/tensorflow/python/framework/func_graph.py,1284,function, -3935,Defun,tensorflow/tensorflow/python/framework/function.py,45,class,"Decorator used to define TensorFlow functions. +4049,override_func_graph_name_scope,tensorflow/tensorflow/python/framework/func_graph.py,1284,function, +4050,Defun,tensorflow/tensorflow/python/framework/function.py,45,class,"Decorator used to define TensorFlow functions. Use this decorator to make a Python function usable directly as a TensorFlow function. @@ -22988,29 +27833,7 @@ a = tf.constant([1.0]) b = tf.constant([2.0]) c, d = MyFunc(a, b, name='mycall') ```" -3936,_DefinedFunctionDeleter,tensorflow/tensorflow/python/framework/function.py,194,class,Unregister function from eager context. -3937,_DefinedFunction,tensorflow/tensorflow/python/framework/function.py,218,class,"_DefinedFunction encapsulates a function definition and its properties. - -Attributes: - name: The function name. - definition: The definition of this function. A FunctionDef proto. - grad_func_name: If not None, the name of this function's gradient function. - python_grad_func: A python callable implementing the gradient of - the function python-side." -3938,_OverloadedFunction,tensorflow/tensorflow/python/framework/function.py,584,class,"_OverloadedFunction encapsulates an overloaded function. - -_OverloadedFunction maintains a mapping from input types to -instantiated _DefinedFunction in self._overload." -3939,_FuncGraph,tensorflow/tensorflow/python/framework/function.py,683,class,"A helper for constructing a function. - -_FuncGraph overrides ops.Graph's create_op() so that we can keep -track of all inputs into every op created inside the function. If -any input is from other graphs, we keep track of it in self.capture -and substitute the input with a place holder. - -Each captured input's corresponding place holder is converted into a -function argument and the caller passes in the captured tensor." -3940,func_graph_from_py_func,tensorflow/tensorflow/python/framework/function.py,907,function,"Returns a _FuncGraph generated from `func`. +4051,func_graph_from_py_func,tensorflow/tensorflow/python/framework/function.py,907,function,"Returns a _FuncGraph generated from `func`. Args: func: A Python callable which constructs a TF function body. The arguments @@ -23037,54 +27860,7 @@ Returns: Raises: ValueError: if func returns None." -3941,_is_guaranteed_const,tensorflow/tensorflow/python/framework/function.py,997,function,"Determines whether `tensor` is guaranteed to be a constant. - -A tensor is guaranteed to be a constant if either it was produced by -a `GuaranteeConst` op or if all of its children are guaranteed to be -constants. - -Args: - tensor: The tensor for which to determine const-ness. - -Returns: - True if `tensor` is guaranteed to be a constant, False otherwise." -3942,_call,tensorflow/tensorflow/python/framework/function.py,1048,function,"Adds a node calling a function. - -This adds a `call` op to the default graph that calls the function -of signature `sig`, passing the tensors in `inputs` as arguments. -It returns the outputs of the call, which are one or more tensors. - -`sig` is OpDefArg.a `_DefinedFunction` object. - -You can pass an optional keyword parameter `name=string` to name the -added operation. - -You can pass an optional keyword parameter `noinline=True|False` to -instruct the runtime not to inline the function body into the call -site. - -Args: - sig: OpDefArg. The signature of the function. - *inputs: arguments to the function. - **kwargs: Optional keyword arguments. Can only contain 'name' or - 'noinline'. - -Returns: - A 2-element tuple. First element: a Tensor if the function returns a single - value; a list of Tensors if the function returns multiple value; the - Operation if the function returns no values. Second element: the Operation. - -Raises: - ValueError: if the arguments are invalid." -3943,_from_definition,tensorflow/tensorflow/python/framework/function.py,1100,function,"Creates a _DefinedFunction initialized from a FunctionDef proto. - -Args: - fdef: a FunctionDef - grad_func: a _DefinedFunction or None - -Returns: - A _DefinedFunction representing fdef" -3944,from_library,tensorflow/tensorflow/python/framework/function.py,1138,function,"Creates _DefinedFunctions initialized from a FunctionDefLibrary proto. +4052,from_library,tensorflow/tensorflow/python/framework/function.py,1138,function,"Creates _DefinedFunctions initialized from a FunctionDefLibrary proto. This method handles assigning the correct gradient functions to each function. @@ -23097,32 +27873,28 @@ Returns: Raises: ValueError: `lib` is invalid" -3945,_get_experimental_kwarg_as_attr,tensorflow/tensorflow/python/framework/function.py,1202,function,Creates an AttrValue for a python object. -3946,_get_kwarg_as_str_attr,tensorflow/tensorflow/python/framework/function.py,1217,function,Creates an AttrValue for a python object. -3947,_parse_kwargs_as_attrs,tensorflow/tensorflow/python/framework/function.py,1226,function,Parses **kwargs into a node's attributes. -3948,get_extra_vars,tensorflow/tensorflow/python/framework/function.py,1267,function,"Returns the captured variables by the function. +4053,get_extra_vars,tensorflow/tensorflow/python/framework/function.py,1267,function,"Returns the captured variables by the function. Returns: If the default graph is being used to define a function, the returned list of variables are those created inside the function body so far. Otherwise, returns an empty list." -3949,get_extra_inputs,tensorflow/tensorflow/python/framework/function.py,1282,function,"Returns the captured input tensors by the function. +4054,get_extra_inputs,tensorflow/tensorflow/python/framework/function.py,1282,function,"Returns the captured input tensors by the function. Returns: If the default graph is being used to define a function, the returned list of tensors are those accessed inside the function body but defined outside the function body so far. Otherwise, returns an empty list." -3950,get_extra_args,tensorflow/tensorflow/python/framework/function.py,1298,function,"Returns the corresponding function arguments for the captured inputs. +4055,get_extra_args,tensorflow/tensorflow/python/framework/function.py,1298,function,"Returns the corresponding function arguments for the captured inputs. Returns: If the default graph is being used to define a function, the returned list of place holders are those used inside the function body corresponding those returned by get_extra_inputs(). Otherwise, returns an empty list." -3951,_type_list_to_str,tensorflow/tensorflow/python/framework/function.py,1314,function, -3952,function_def_from_tf_function,tensorflow/tensorflow/python/framework/function.py,1346,function,Converts a SWIG-wrapped TF_Function* to a FunctionDef proto. -3953,function_def_to_graph,tensorflow/tensorflow/python/framework/function_def_to_graph.py,33,function,"Converts a FunctionDef to a FuncGraph (sub-class Graph). +4056,function_def_from_tf_function,tensorflow/tensorflow/python/framework/function.py,1346,function,Converts a SWIG-wrapped TF_Function* to a FunctionDef proto. +4057,function_def_to_graph,tensorflow/tensorflow/python/framework/function_def_to_graph.py,33,function,"Converts a FunctionDef to a FuncGraph (sub-class Graph). The returned FuncGraph's `name`, `inputs` and `outputs` fields will be set. The input tensors are represented as placeholders. @@ -23140,8 +27912,8 @@ Args: Returns: A FuncGraph." -3954,is_function,tensorflow/tensorflow/python/framework/function_def_to_graph.py,107,function,Checks for a function definition with `fname` in the current context. -3955,function_def_to_graph_def,tensorflow/tensorflow/python/framework/function_def_to_graph.py,122,function,"Convert a FunctionDef to a GraphDef. +4058,is_function,tensorflow/tensorflow/python/framework/function_def_to_graph.py,107,function,Checks for a function definition with `fname` in the current context. +4059,function_def_to_graph_def,tensorflow/tensorflow/python/framework/function_def_to_graph.py,122,function,"Convert a FunctionDef to a GraphDef. Steps: 1. Creates placeholder nodes corresponding to inputs in @@ -23165,24 +27937,31 @@ Returns: Raises: ValueError: If the length of input_shapes does not match the number of input_args or if the FunctionDef is invalid." -3956,_get_num_args,tensorflow/tensorflow/python/framework/function_def_to_graph.py,258,function, -3957,FunctionDefToGraphTest,tensorflow/tensorflow/python/framework/function_def_to_graph_test.py,37,class, -3958,FunctionDefToGraphDefTest,tensorflow/tensorflow/python/framework/function_def_to_graph_test.py,103,class, -3959,_OptimizerOptions,tensorflow/tensorflow/python/framework/function_test.py,57,function, -3960,FunctionTest,tensorflow/tensorflow/python/framework/function_test.py,89,class,"Test methods for verifying Function support. - -These test methods are used as mix-ins in two test cases: with -and without C API support." -3961,FunctionsFromProtos,tensorflow/tensorflow/python/framework/function_test.py,1168,class, -3962,FunctionOverloadTest,tensorflow/tensorflow/python/framework/function_test.py,1406,class, -3963,FunctionCaptureByValueTest,tensorflow/tensorflow/python/framework/function_test.py,1459,class, -3964,UnrollLSTMTest,tensorflow/tensorflow/python/framework/function_test.py,1489,class, -3965,FunctionInlineControlTest,tensorflow/tensorflow/python/framework/function_test.py,1625,class, -3966,ModuleFunctionTest,tensorflow/tensorflow/python/framework/function_test.py,1684,class, -3967,VariableHoistingTest,tensorflow/tensorflow/python/framework/function_test.py,1708,class, -3968,TemplateTest,tensorflow/tensorflow/python/framework/function_test.py,1781,class, -3969,DevicePlacementTest,tensorflow/tensorflow/python/framework/function_test.py,1832,class, -3970,compute_capability_from_device_desc,tensorflow/tensorflow/python/framework/gpu_util.py,35,function,"Returns the GpuInfo given a DeviceAttributes proto. +4060,FunctionsFromProtos,tensorflow/tensorflow/python/framework/function_test.py,1168,class, +4061,expectFunctionsEqual,tensorflow/tensorflow/python/framework/function_test.py,1170,method, +4062,Foo,tensorflow/tensorflow/python/framework/function_test.py,1188,method, +4063,G,tensorflow/tensorflow/python/framework/function_test.py,1196,method, +4064,F,tensorflow/tensorflow/python/framework/function_test.py,1200,method, +4065,Foo,tensorflow/tensorflow/python/framework/function_test.py,1209,method, +4066,Outer,tensorflow/tensorflow/python/framework/function_test.py,1226,method, +4067,G1,tensorflow/tensorflow/python/framework/function_test.py,1242,method, +4068,G2,tensorflow/tensorflow/python/framework/function_test.py,1246,method, +4069,F1,tensorflow/tensorflow/python/framework/function_test.py,1251,method, +4070,F2,tensorflow/tensorflow/python/framework/function_test.py,1255,method, +4071,F3,tensorflow/tensorflow/python/framework/function_test.py,1260,method, +4072,F4,tensorflow/tensorflow/python/framework/function_test.py,1265,method, +4073,CheckNewFunc,tensorflow/tensorflow/python/framework/function_test.py,1281,method, +4074,G1,tensorflow/tensorflow/python/framework/function_test.py,1300,method, +4075,F1,tensorflow/tensorflow/python/framework/function_test.py,1304,method, +4076,F1,tensorflow/tensorflow/python/framework/function_test.py,1334,method, +4077,F2,tensorflow/tensorflow/python/framework/function_test.py,1338,method, +4078,FunctionWithStrAttr,tensorflow/tensorflow/python/framework/function_test.py,1363,method, +4079,FunctionWithIntAttr,tensorflow/tensorflow/python/framework/function_test.py,1367,method, +4080,FunctionWithFloatAttr,tensorflow/tensorflow/python/framework/function_test.py,1371,method, +4081,FunctionWithBoolAttr,tensorflow/tensorflow/python/framework/function_test.py,1375,method, +4082,FunctionWithStrAttr,tensorflow/tensorflow/python/framework/function_test.py,1395,method, +4083,Inner,tensorflow/tensorflow/python/framework/function_test.py,1229,method, +4084,compute_capability_from_device_desc,tensorflow/tensorflow/python/framework/gpu_util.py,35,function,"Returns the GpuInfo given a DeviceAttributes proto. Args: device_attrs: A DeviceAttributes proto. @@ -23190,9 +27969,15 @@ Args: Returns A gpu_info tuple. Both fields are None if `device_attrs` does not have a valid physical_device_desc field." -3971,run_benchmark,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,44,function, -3972,SingleOpBenchmarks,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,52,class,Benchmark for graph building time of ops. -3973,write_graph,tensorflow/tensorflow/python/framework/graph_io.py,31,function,"Writes a graph proto to a file. +4085,run_benchmark,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,44,function, +4086,SingleOpBenchmarks,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,52,class,Benchmark for graph building time of ops. +4087,benchmarkAddScalars,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,65,method, +4088,benchmarkAddBatchedMatrices,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,75,method, +4089,benchmarkMatMul,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,87,method, +4090,bench,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,70,method, +4091,bench,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,82,method, +4092,bench,tensorflow/tensorflow/python/framework/graph_building_benchmark.py,94,method, +4093,write_graph,tensorflow/tensorflow/python/framework/graph_io.py,31,function,"Writes a graph proto to a file. The graph is written as a text proto unless `as_text` is `False`. @@ -23219,14 +28004,7 @@ Args: Returns: The path of the output proto file." -3974,_make_argname_from_tensor_name,tensorflow/tensorflow/python/framework/graph_to_function_def.py,29,function, -3975,_tensor_to_argdef,tensorflow/tensorflow/python/framework/graph_to_function_def.py,33,function,"Convert tensor t to an argdef, with a specified name or a unique name." -3976,_is_in_placeholders,tensorflow/tensorflow/python/framework/graph_to_function_def.py,54,function,Checks whether any output of this op is in func_arg_placeholders. -3977,_get_node_def,tensorflow/tensorflow/python/framework/graph_to_function_def.py,60,function, -3978,_get_op_def,tensorflow/tensorflow/python/framework/graph_to_function_def.py,64,function, -3979,_create_input_dict,tensorflow/tensorflow/python/framework/graph_to_function_def.py,68,function,Create a mapping from graph tensor names to function tensor names. -3980,_add_op_node,tensorflow/tensorflow/python/framework/graph_to_function_def.py,99,function,Converts an op to a function def node and add it to `func`. -3981,graph_to_function_def,tensorflow/tensorflow/python/framework/graph_to_function_def.py,122,function,"Returns `graph` as a `FunctionDef` protocol buffer. +4094,graph_to_function_def,tensorflow/tensorflow/python/framework/graph_to_function_def.py,122,function,"Returns `graph` as a `FunctionDef` protocol buffer. This method creates a [`FunctionDef`]( https://www.tensorflow.org/code/tensorflow/core/framework/function.proto) @@ -23250,8 +28028,7 @@ Returns: Raises: ValueError: if out_names is specified and the wrong length." -3982,_is_variable_op,tensorflow/tensorflow/python/framework/graph_util_impl.py,62,function,Returns true if 'op' refers to a Variable node. -3983,must_run_on_cpu,tensorflow/tensorflow/python/framework/graph_util_impl.py,71,function,"Returns True if the given node_def must run on CPU, otherwise False. +4095,must_run_on_cpu,tensorflow/tensorflow/python/framework/graph_util_impl.py,71,function,"Returns True if the given node_def must run on CPU, otherwise False. Args: node: The node to be assigned to a device. Could be either an ops.Operation @@ -23261,12 +28038,7 @@ Args: Returns: True if the given node must run on CPU, otherwise False." -3984,_node_name,tensorflow/tensorflow/python/framework/graph_util_impl.py,122,function, -3985,_get_colocated_node_name,tensorflow/tensorflow/python/framework/graph_util_impl.py,129,function,Decodes colocated node name and returns it without loc:@ prepended. -3986,_extract_graph_summary,tensorflow/tensorflow/python/framework/graph_util_impl.py,137,function,Extracts useful information from the graph and returns them. -3987,_assert_nodes_are_present,tensorflow/tensorflow/python/framework/graph_util_impl.py,160,function,Assert that nodes are present in the graph. -3988,_bfs_for_reachable_nodes,tensorflow/tensorflow/python/framework/graph_util_impl.py,166,function,Breadth first search for reachable nodes from target nodes. -3989,extract_sub_graph,tensorflow/tensorflow/python/framework/graph_util_impl.py,187,function,"Extract the subgraph that can reach any of the nodes in 'dest_nodes'. +4096,extract_sub_graph,tensorflow/tensorflow/python/framework/graph_util_impl.py,187,function,"Extract the subgraph that can reach any of the nodes in 'dest_nodes'. Args: graph_def: A graph_pb2.GraphDef proto. @@ -23276,8 +28048,8 @@ Returns: Raises: TypeError: If 'graph_def' is not a graph_pb2.GraphDef proto." -3990,tensor_shape_from_node_def_name,tensorflow/tensorflow/python/framework/graph_util_impl.py,229,function,Convenience function to get a shape from a NodeDef's input string. -3991,convert_variables_to_constants,tensorflow/tensorflow/python/framework/graph_util_impl.py,247,function,"Replaces all the variables in a graph with constants of the same values. +4097,tensor_shape_from_node_def_name,tensorflow/tensorflow/python/framework/graph_util_impl.py,229,function,Convenience function to get a shape from a NodeDef's input string. +4098,convert_variables_to_constants,tensorflow/tensorflow/python/framework/graph_util_impl.py,247,function,"Replaces all the variables in a graph with constants of the same values. If you have a trained graph containing Variable ops, it can be convenient to convert them all to Const ops holding the same values. This makes it possible @@ -23299,7 +28071,7 @@ Returns: Raises: RuntimeError: if a DT_RESOURCE op is found whose ancestor Variables are both denylisted AND whitelisted for freezing." -3992,remove_training_nodes,tensorflow/tensorflow/python/framework/graph_util_impl.py,291,function,"Prunes out nodes that aren't needed for inference. +4099,remove_training_nodes,tensorflow/tensorflow/python/framework/graph_util_impl.py,291,function,"Prunes out nodes that aren't needed for inference. There are nodes like Identity and CheckNumerics that are only useful during training, and can be removed in graphs that will be used for @@ -23316,66 +28088,7 @@ Args: Returns: A list of nodes with the unnecessary ones removed." -3993,test_device_func_pin_variable_to_cpu,tensorflow/tensorflow/python/framework/graph_util_test.py,36,function, -3994,DeviceFunctionsTest,tensorflow/tensorflow/python/framework/graph_util_test.py,42,class, -3995,_IsControlInput,tensorflow/tensorflow/python/framework/importer.py,37,function, -3996,_ParseTensorName,tensorflow/tensorflow/python/framework/importer.py,42,function,"Parses a tensor name into an operation name and output index. - -This function will canonicalize tensor names as follows: - -* ""foo:0"" -> (""foo"", 0) -* ""foo:7"" -> (""foo"", 7) -* ""foo"" -> (""foo"", 0) -* ""foo:bar:baz"" -> ValueError - -Args: - tensor_name: The name of a tensor. - -Returns: - A tuple containing the operation name, and the output index. - -Raises: - ValueError: If `tensor_name' cannot be interpreted as the name of a tensor." -3997,_MaybeDevice,tensorflow/tensorflow/python/framework/importer.py,77,function,Applies the given device only if device is not None or empty. -3998,_ProcessGraphDefParam,tensorflow/tensorflow/python/framework/importer.py,86,function,Type-checks and possibly canonicalizes `graph_def`. -3999,_ProcessInputMapParam,tensorflow/tensorflow/python/framework/importer.py,116,function,Type-checks and possibly canonicalizes `input_map`. -4000,_ProcessReturnElementsParam,tensorflow/tensorflow/python/framework/importer.py,128,function,Type-checks and possibly canonicalizes `return_elements`. -4001,_FindAttrInOpDef,tensorflow/tensorflow/python/framework/importer.py,138,function, -4002,_RemoveDefaultAttrs,tensorflow/tensorflow/python/framework/importer.py,145,function,"Removes unknown default attrs according to `producer_op_list`. - -Removes any unknown attrs in `graph_def` (i.e. attrs that do not appear in -registered OpDefs) that have a default value in `producer_op_list`. - -Args: - producer_op_list: OpList proto. - graph_def: GraphDef proto" -4003,_ConvertInputMapValues,tensorflow/tensorflow/python/framework/importer.py,178,function,"Ensures all input map values are tensors. - -This should be called from inside the import name scope. - -Args: - name: the `name` argument passed to import_graph_def - input_map: the `input_map` argument passed to import_graph_def. - -Returns: - An possibly-updated version of `input_map`. - -Raises: - ValueError: if input map values cannot be converted due to empty name scope." -4004,_PopulateTFImportGraphDefOptions,tensorflow/tensorflow/python/framework/importer.py,204,function,Populates the TF_ImportGraphDefOptions `options`. -4005,_ProcessNewOps,tensorflow/tensorflow/python/framework/importer.py,237,function,Processes the newly-added TF_Operations in `graph`. -4006,_GetColocationNames,tensorflow/tensorflow/python/framework/importer.py,290,function,Returns names of the ops that `op` should be colocated with. -4007,_GatherReturnElements,tensorflow/tensorflow/python/framework/importer.py,307,function,"Returns the requested return elements from results. - -Args: - requested_return_elements: list of strings of operation and tensor names - graph: Graph - results: wrapped TF_ImportGraphDefResults - -Returns: - list of `Operation` and/or `Tensor` objects" -4008,_SetDefaultAttrValues,tensorflow/tensorflow/python/framework/importer.py,336,function,Set any default attr values in `node_def` that aren't present. -4009,import_graph_def,tensorflow/tensorflow/python/framework/importer.py,351,function,"Imports the graph from `graph_def` into the current default `Graph`. +4100,import_graph_def,tensorflow/tensorflow/python/framework/importer.py,351,function,"Imports the graph from `graph_def` into the current default `Graph`. This function provides a way to import a serialized TensorFlow [`GraphDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto) @@ -23416,50 +28129,8 @@ Raises: ValueError: If `input_map`, or `return_elements` contains names that do not appear in `graph_def`, or `graph_def` is not well-formed (e.g. it refers to an unknown tensor)." -4010,import_graph_def_for_function,tensorflow/tensorflow/python/framework/importer.py,408,function,Like import_graph_def but does not validate colocation constraints. -4011,_import_graph_def_internal,tensorflow/tensorflow/python/framework/importer.py,415,function,"Imports the graph from `graph_def` into the current default `Graph`. - -This function provides a way to import a serialized TensorFlow -[`GraphDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto) -protocol buffer, and extract individual objects in the `GraphDef` as -`tf.Tensor` and `tf.Operation` objects. Once extracted, -these objects are placed into the current default `Graph`. See -`tf.Graph.as_graph_def` for a way to create a `GraphDef` -proto. - -Args: - graph_def: A `GraphDef` proto containing operations to be imported into the - default graph. - input_map: A dictionary mapping input names (as strings) in `graph_def` to - `Tensor` objects. The values of the named input tensors in the imported - graph will be re-mapped to the respective `Tensor` values. - return_elements: A list of strings containing operation names in `graph_def` - that will be returned as `Operation` objects; and/or tensor names in - `graph_def` that will be returned as `Tensor` objects. - validate_colocation_constraints: Whether to validate colocation constraints. - name: (Optional.) A prefix that will be prepended to the names in - `graph_def`. Note that this does not apply to imported function names. - Defaults to `""import""`. - producer_op_list: (Optional.) An `OpList` proto with the (possibly stripped) - list of `OpDef`s used by the producer of the graph. If provided, - unrecognized attrs for ops in `graph_def` that have their default value - according to `producer_op_list` will be removed. This will allow some more - `GraphDef`s produced by later binaries to be accepted by earlier binaries. - -Returns: - A list of `Operation` and/or `Tensor` objects from the imported graph, - corresponding to the names in `return_elements`, - and None if `returns_elements` is None. - -Raises: - TypeError: If `graph_def` is not a `GraphDef` proto, - `input_map` is not a dictionary mapping strings to `Tensor` objects, - or `return_elements` is not a list of strings. - ValueError: If `input_map`, or `return_elements` contains names that - do not appear in `graph_def`, or `graph_def` is not well-formed (e.g. - it refers to an unknown tensor)." -4012,ImportGraphDefTest,tensorflow/tensorflow/python/framework/importer_test.py,48,class, -4013,IndexedSlices,tensorflow/tensorflow/python/framework/indexed_slices.py,61,class,"A sparse representation of a set of tensor slices at given indices. +4101,import_graph_def_for_function,tensorflow/tensorflow/python/framework/importer.py,408,function,Like import_graph_def but does not validate colocation constraints. +4102,IndexedSlices,tensorflow/tensorflow/python/framework/indexed_slices.py,61,class,"A sparse representation of a set of tensor slices at given indices. This class is a simple wrapper for a pair of `Tensor` objects: @@ -23484,8 +28155,21 @@ gradients for operations that have sparse gradients Contrast this representation with `tf.sparse.SparseTensor`, which uses multi-dimensional indices and scalar values." -4014,IndexedSlicesSpec,tensorflow/tensorflow/python/framework/indexed_slices.py,193,class,Type specification for a `tf.IndexedSlices`. -4015,convert_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,260,function,"Converts the given object to a `Tensor` or an `IndexedSlices`. +4103,values,tensorflow/tensorflow/python/framework/indexed_slices.py,96,method,A `Tensor` containing the values of the slices. +4104,indices,tensorflow/tensorflow/python/framework/indexed_slices.py,101,method,A 1-D `Tensor` containing the indices of the slices. +4105,dense_shape,tensorflow/tensorflow/python/framework/indexed_slices.py,106,method,A 1-D `Tensor` containing the shape of the corresponding dense tensor. +4106,shape,tensorflow/tensorflow/python/framework/indexed_slices.py,111,method,"Gets the `tf.TensorShape` representing the shape of the dense tensor. + +Returns: + A `tf.TensorShape` object." +4107,name,tensorflow/tensorflow/python/framework/indexed_slices.py,123,method,The name of this `IndexedSlices`. +4108,device,tensorflow/tensorflow/python/framework/indexed_slices.py,128,method,"The name of the device on which `values` will be produced, or `None`." +4109,op,tensorflow/tensorflow/python/framework/indexed_slices.py,133,method,The `Operation` that produces `values` as an output. +4110,dtype,tensorflow/tensorflow/python/framework/indexed_slices.py,138,method,The `DType` of elements in this tensor. +4111,graph,tensorflow/tensorflow/python/framework/indexed_slices.py,143,method,"The `Graph` that contains the values, indices, and shape tensors." +4112,consumers,tensorflow/tensorflow/python/framework/indexed_slices.py,184,method, +4113,IndexedSlicesSpec,tensorflow/tensorflow/python/framework/indexed_slices.py,193,class,Type specification for a `tf.IndexedSlices`. +4114,convert_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,260,function,"Converts the given object to a `Tensor` or an `IndexedSlices`. If `value` is an `IndexedSlices` or `SparseTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using @@ -23503,7 +28187,7 @@ Returns: Raises: ValueError: If `dtype` does not match the element type of `value`." -4016,internal_convert_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,284,function,"Converts the given object to a `Tensor` or an `IndexedSlices`. +4115,internal_convert_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,284,function,"Converts the given object to a `Tensor` or an `IndexedSlices`. If `value` is an `IndexedSlices` or `SparseTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using @@ -23522,7 +28206,7 @@ Returns: Raises: ValueError: If `dtype` does not match the element type of `value`." -4017,internal_convert_n_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,321,function,"Converts `values` to a list of `Tensor` or `IndexedSlices` objects. +4116,internal_convert_n_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,321,function,"Converts `values` to a list of `Tensor` or `IndexedSlices` objects. Any `IndexedSlices` or `SparseTensor` objects in `values` are returned unmodified. @@ -23544,7 +28228,7 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4018,convert_n_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,362,function,"Converts `values` to a list of `Output` or `IndexedSlices` objects. +4117,convert_n_to_tensor_or_indexed_slices,tensorflow/tensorflow/python/framework/indexed_slices.py,362,function,"Converts `values` to a list of `Output` or `IndexedSlices` objects. Any `IndexedSlices` or `SparseTensor` objects in `values` are returned unmodified. @@ -23565,33 +28249,17 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4019,_indexed_slices_to_tensor,tensorflow/tensorflow/python/framework/indexed_slices.py,394,function,"Converts an IndexedSlices object `value` to a Tensor. - -NOTE(mrry): This function is potentially expensive. - -Args: - value: An ops.IndexedSlices object. - dtype: The dtype of the Tensor to be returned. - name: Optional name to use for the returned Tensor. - as_ref: True if a ref is requested. - -Returns: - A dense Tensor representing the values in the given IndexedSlices. - -Raises: - ValueError: If the IndexedSlices does not have the same dtype." -4020,is_mlir_bridge_enabled,tensorflow/tensorflow/python/framework/is_mlir_bridge_test_true.py,28,function,Returns true to if MLIR bridge should be enabled for tests. -4021,is_tfrt_enabled,tensorflow/tensorflow/python/framework/is_tfrt_test_true.py,28,function,Returns true to state TFRT should be enabled for Tensorflow tests. -4022,is_xla_enabled,tensorflow/tensorflow/python/framework/is_xla_test_true.py,27,function,Returns true to state XLA should be enabled for Tensorflow tests. -4023,get_all_registered_kernels,tensorflow/tensorflow/python/framework/kernels.py,26,function,"Returns a KernelList proto of all registered kernels. +4118,is_mlir_bridge_enabled,tensorflow/tensorflow/python/framework/is_mlir_bridge_test_true.py,28,function,Returns true to if MLIR bridge should be enabled for tests. +4119,is_tfrt_enabled,tensorflow/tensorflow/python/framework/is_tfrt_test_true.py,28,function,Returns true to state TFRT should be enabled for Tensorflow tests. +4120,is_xla_enabled,tensorflow/tensorflow/python/framework/is_xla_test_true.py,27,function,Returns true to state XLA should be enabled for Tensorflow tests. +4121,get_all_registered_kernels,tensorflow/tensorflow/python/framework/kernels.py,26,function,"Returns a KernelList proto of all registered kernels. " -4024,get_registered_kernels_for_op,tensorflow/tensorflow/python/framework/kernels.py,36,function,"Returns a KernelList proto of registered kernels for a given op. +4122,get_registered_kernels_for_op,tensorflow/tensorflow/python/framework/kernels.py,36,function,"Returns a KernelList proto of registered kernels for a given op. Args: name: A string representing the name of the op whose kernels to retrieve." -4025,GetAllRegisteredKernelsTest,tensorflow/tensorflow/python/framework/kernels_test.py,25,class, -4026,GetRegisteredKernelsForOp,tensorflow/tensorflow/python/framework/kernels_test.py,32,class, -4027,load_op_library,tensorflow/tensorflow/python/framework/load_library.py,36,function,"Loads a TensorFlow plugin, containing custom ops and kernels. +4123,GetRegisteredKernelsForOp,tensorflow/tensorflow/python/framework/kernels_test.py,32,class, +4124,load_op_library,tensorflow/tensorflow/python/framework/load_library.py,36,function,"Loads a TensorFlow plugin, containing custom ops and kernels. Pass ""library_filename"" to a platform-specific mechanism for dynamically loading a library. The rules for determining the exact location of the @@ -23611,7 +28279,7 @@ Returns: Raises: RuntimeError: when unable to load the library or get the python wrappers." -4028,load_file_system_library,tensorflow/tensorflow/python/framework/load_library.py,83,function,"Loads a TensorFlow plugin, containing file system implementation. +4125,load_file_system_library,tensorflow/tensorflow/python/framework/load_library.py,83,function,"Loads a TensorFlow plugin, containing file system implementation. Pass `library_filename` to a platform-specific mechanism for dynamically loading a library. The rules for determining the exact location of the @@ -23626,8 +28294,7 @@ Returns: Raises: RuntimeError: when unable to load the library." -4029,_is_shared_object,tensorflow/tensorflow/python/framework/load_library.py,103,function,"Check the file to see if it is a shared object, only using extension." -4030,load_library,tensorflow/tensorflow/python/framework/load_library.py,124,function,"Loads a TensorFlow plugin. +4126,load_library,tensorflow/tensorflow/python/framework/load_library.py,124,function,"Loads a TensorFlow plugin. ""library_location"" can be a path to a specific shared object, or a folder. If it is a folder, all shared objects that are named ""libtfkernel*"" will be @@ -23644,8 +28311,7 @@ Returns: Raises: OSError: When the file to be loaded is not found. RuntimeError: when unable to load the library." -4031,_get_test_name_best_effort,tensorflow/tensorflow/python/framework/memory_checker.py,32,function,"If available, return the current test name. Otherwise, `None`." -4032,MemoryChecker,tensorflow/tensorflow/python/framework/memory_checker.py,47,class,"Memory leak detection class. +4127,MemoryChecker,tensorflow/tensorflow/python/framework/memory_checker.py,47,class,"Memory leak detection class. This is a utility class to detect Python and C++ memory leaks. It's intended for both testing and debugging. Basic usage: @@ -23670,29 +28336,33 @@ for both testing and debugging. Basic usage: `record_snapshot()` must be called once every iteration at the same location. This is because the detection algorithm relies on the assumption that if there is a leak, it's happening similarly on every snapshot." -4033,MemoryCheckerTest,tensorflow/tensorflow/python/framework/memory_checker_test.py,27,class, -4034,_node_def,tensorflow/tensorflow/python/framework/meta_graph.py,58,function,"Create a `NodeDef` proto with export_scope stripped. +4128,record_snapshot,tensorflow/tensorflow/python/framework/memory_checker.py,91,method,"Take a memory snapshot for later analysis. + +`record_snapshot()` must be called once every iteration at the same +location. This is because the detection algorithm relies on the assumption +that if there is a leak, it's happening similarly on every snapshot. + +The recommended number of `record_snapshot()` call depends on the testing +code complexity and the allcoation pattern." +4129,report,tensorflow/tensorflow/python/framework/memory_checker.py,106,method,"Generates a html graph file showing allocations over snapshots. + +It create a temporary directory and put all the output files there. +If this is running under Google internal testing infra, it will use the +directory provided the infra instead." +4130,assert_no_leak_if_all_possibly_except_one,tensorflow/tensorflow/python/framework/memory_checker.py,118,method,"Raises an exception if a leak is detected. + +This algorithm classifies a series of allocations as a leak if it's the same +type(Python) orit happens at the same stack trace(C++) at every snapshot, +but possibly except one snapshot." +4131,assert_no_new_python_objects,tensorflow/tensorflow/python/framework/memory_checker.py,131,method,"Raises an exception if there are new Python objects created. + +It computes the number of new Python objects per type using the first and +the last snapshots. Args: - from_node_def: A `node_def_pb2.NodeDef` protocol buffer. - export_scope: A `string` representing the name scope to remove. - unbound_inputs: An array of unbound input names if they exist. - clear_devices: Boolean which controls whether to clear device information - from node_def. Default false. - -Returns: - A `node_def_pb2.NodeDef` protocol buffer." -4035,_read_file,tensorflow/tensorflow/python/framework/meta_graph.py,106,function,"Reads a file containing `GraphDef` and returns the protocol buffer. - -Args: - filename: `graph_def` filename including the path. - -Returns: - A `GraphDef` protocol buffer. - -Raises: - IOError: If the file doesn't exist, or cannot be successfully parsed." -4036,ops_used_by_graph_def,tensorflow/tensorflow/python/framework/meta_graph.py,138,function,"Collect the list of ops used by a graph. + threshold: A dictionary of [Type name string], [count] pair. It won't + raise an exception if the new Python objects are under this threshold." +4132,ops_used_by_graph_def,tensorflow/tensorflow/python/framework/meta_graph.py,138,function,"Collect the list of ops used by a graph. Does not validate that the ops are all registered. @@ -23701,7 +28371,7 @@ Args: Returns: A list of strings, each naming an op used by the graph." -4037,stripped_op_list_for_graph,tensorflow/tensorflow/python/framework/meta_graph.py,179,function,"Collect the stripped OpDefs for ops used by a graph. +4133,stripped_op_list_for_graph,tensorflow/tensorflow/python/framework/meta_graph.py,179,function,"Collect the stripped OpDefs for ops used by a graph. This function computes the `stripped_op_list` field of `MetaGraphDef` and similar protos. The result can be communicated from the producer to the @@ -23713,60 +28383,7 @@ Args: Returns: An `OpList` of ops used by the graph." -4038,_get_kind_name,tensorflow/tensorflow/python/framework/meta_graph.py,205,function,"Returns the kind name in CollectionDef. - -Args: - item: A data item. - -Returns: - The string representation of the kind in CollectionDef." -4039,_op_name,tensorflow/tensorflow/python/framework/meta_graph.py,235,function,"Extract the Op name from a Tensor name. - -The Op name is everything before a colon, if present, -not including any ^ prefix denoting a control dependency. - -Args: - tensor_name: the full name of a Tensor in the graph. -Returns: - The name of the Op of which the given Tensor is an output. -Raises: - ValueError: if tensor_name is None or empty." -4040,_get_scope,tensorflow/tensorflow/python/framework/meta_graph.py,260,function,"Extract the scope name from a node name. - -The scope name is everything before the final slash, -not including any ^ prefix denoting a control dependency. - -Args: - node_name: the full name of an Op or a Tensor in the graph. -Returns: - The deepest named scope containing the node. -Raises: - ValueError: if tensor_name is None or empty" -4041,_find_extraneous_saver_nodes,tensorflow/tensorflow/python/framework/meta_graph.py,286,function,"Identifies any nodes in the graph_def related to unused Savers. - -This approach assumes that each Saver is cleanly isolated in its own name -scope, so we need only identify the scopes associated with extraneous Savers -and return all the nodes in those scopes. - -Args: - graph_def: a GraphDef proto to evaluate. - saver_def: a SaverDef proto referencing Save/Restore ops to be retained. -Returns: - An iterable of node names that may be safely omitted." -4042,_should_include_node,tensorflow/tensorflow/python/framework/meta_graph.py,342,function,"Returns `True` if a node should be included. - -Args: - node_or_node_name: A node or `string` node name. - export_scope: `string`. Name scope under which to extract the subgraph. The - scope name will be stripped from the node definitions for easy import - later into new name scopes. - exclude_nodes: An iterable of nodes or `string` node names to omit from the - export, or None. Note no sanity-checking is done, so this list must be - carefully constructed to avoid producing an invalid graph. - -Returns: - `True` if the node should be included." -4043,add_collection_def,tensorflow/tensorflow/python/framework/meta_graph.py,374,function,"Adds a collection to MetaGraphDef protocol buffer. +4134,add_collection_def,tensorflow/tensorflow/python/framework/meta_graph.py,374,function,"Adds a collection to MetaGraphDef protocol buffer. Args: meta_graph_def: MetaGraphDef protocol buffer. @@ -23777,8 +28394,7 @@ Args: collection, or None. override_contents: An iterable of values to place in the collection, ignoring the current values (if set)." -4044,_is_default_attr_value,tensorflow/tensorflow/python/framework/meta_graph.py,448,function,Checks if given attribute matches the default value in the op def. -4045,strip_graph_default_valued_attrs,tensorflow/tensorflow/python/framework/meta_graph.py,462,function,"Strips default valued attributes for node defs in given MetaGraphDef. +4135,strip_graph_default_valued_attrs,tensorflow/tensorflow/python/framework/meta_graph.py,462,function,"Strips default valued attributes for node defs in given MetaGraphDef. This method also sets `meta_info_def.stripped_default_attrs` in the given `MetaGraphDef` proto to True. @@ -23788,7 +28404,7 @@ Args: Returns: None." -4046,create_meta_graph_def,tensorflow/tensorflow/python/framework/meta_graph.py,509,function,"Construct and returns a `MetaGraphDef` protocol buffer. +4136,create_meta_graph_def,tensorflow/tensorflow/python/framework/meta_graph.py,509,function,"Construct and returns a `MetaGraphDef` protocol buffer. Args: meta_info_def: `MetaInfoDef` protocol buffer. @@ -23811,7 +28427,7 @@ Returns: Raises: TypeError: If the arguments are not of the correct proto buffer type." -4047,read_meta_graph_file,tensorflow/tensorflow/python/framework/meta_graph.py,616,function,"Reads a file containing `MetaGraphDef` and returns the protocol buffer. +4137,read_meta_graph_file,tensorflow/tensorflow/python/framework/meta_graph.py,616,function,"Reads a file containing `MetaGraphDef` and returns the protocol buffer. Args: filename: `meta_graph_def` filename including the path. @@ -23821,7 +28437,7 @@ Returns: Raises: IOError: If the file doesn't exist, or cannot be successfully parsed." -4048,import_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,648,function,"Recreates a `Graph` saved in a `MetaGraphDef` proto. +4138,import_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,648,function,"Recreates a `Graph` saved in a `MetaGraphDef` proto. This function takes a `MetaGraphDef` protocol buffer as input. If the argument is a file containing a `MetaGraphDef` protocol buffer , @@ -23861,7 +28477,7 @@ Returns: Raises: ValueError: If the graph_def contains unbound inputs." -4049,import_scoped_meta_graph_with_return_elements,tensorflow/tensorflow/python/framework/meta_graph.py,701,function,"Imports graph from `MetaGraphDef` and returns vars and return elements. +4139,import_scoped_meta_graph_with_return_elements,tensorflow/tensorflow/python/framework/meta_graph.py,701,function,"Imports graph from `MetaGraphDef` and returns vars and return elements. This function takes a `MetaGraphDef` protocol buffer as input. If the argument is a file containing a `MetaGraphDef` protocol buffer , @@ -23906,7 +28522,7 @@ Returns: Raises: ValueError: If the graph_def contains unbound inputs." -4050,export_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,908,function,"Returns `MetaGraphDef` proto. Optionally writes it to filename. +4140,export_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,908,function,"Returns `MetaGraphDef` proto. Optionally writes it to filename. This function exports the graph, saver, and collection objects into `MetaGraphDef` protocol buffer with the intention of it being imported @@ -23949,7 +28565,7 @@ Raises: ValueError: When the `GraphDef` is larger than 2GB. ValueError: When executing in Eager mode and either `graph_def` or `graph` is undefined." -4051,copy_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,1073,function,"Copies a sub-meta_graph from one scope to another. +4141,copy_scoped_meta_graph,tensorflow/tensorflow/python/framework/meta_graph.py,1073,function,"Copies a sub-meta_graph from one scope to another. Args: from_scope: `String` name scope containing the subgraph to be copied. @@ -23965,12 +28581,7 @@ Returns: Raises: ValueError: If `from_scope` and `to_scope` are the same while `from_graph` and `to_graph` are also the same." -4052,_TestDir,tensorflow/tensorflow/python/framework/meta_graph_test.py,54,function, -4053,SimpleMetaGraphTest,tensorflow/tensorflow/python/framework/meta_graph_test.py,65,class, -4054,ScopedMetaGraphTest,tensorflow/tensorflow/python/framework/meta_graph_test.py,339,class, -4055,MetaGraphWithVariableScopeTest,tensorflow/tensorflow/python/framework/meta_graph_test.py,925,class, -4056,ExportImportAcrossScopesTest,tensorflow/tensorflow/python/framework/meta_graph_test.py,983,class, -4057,add_op_callback,tensorflow/tensorflow/python/framework/op_callbacks.py,25,function,"Add a thread-local callback that intercepts op execution and op creation. +4142,add_op_callback,tensorflow/tensorflow/python/framework/op_callbacks.py,25,function,"Add a thread-local callback that intercepts op execution and op creation. The `callback_fn` will be invoked immediately after any of the three types of events: @@ -24046,12 +28657,12 @@ Args: Raises: ValueEror: If `callback_fn` is `None` or not callable." -4058,should_invoke_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,118,function,"Determine if op callbacks are present and should be invoked. +4143,should_invoke_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,118,function,"Determine if op callbacks are present and should be invoked. Returns: A thread-local result (boolean) indicating whether any op callback(s) exist and should be invoked." -4059,remove_op_callback,tensorflow/tensorflow/python/framework/op_callbacks.py,129,function,"Remove an already-added op callback. +4144,remove_op_callback,tensorflow/tensorflow/python/framework/op_callbacks.py,129,function,"Remove an already-added op callback. Args: op_callback: The op callback to be removed. @@ -24059,8 +28670,8 @@ Args: Raises: KeyError: If `op_callback` has not been registered using `add_op_callback()` before." -4060,clear_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,146,function,Clear all op callbacks registered in the current thread. -4061,invoke_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,152,function,"Invoke the callbacks that exist in the current scope (if any). +4145,clear_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,146,function,Clear all op callbacks registered in the current thread. +4146,invoke_op_callbacks,tensorflow/tensorflow/python/framework/op_callbacks.py,152,function,"Invoke the callbacks that exist in the current scope (if any). If no callbacks are present in the current scope, this method returns immediately. @@ -24086,62 +28697,7 @@ Args: Returns: `None`, or a `list` or `tuple` of output tenors that will override the original (input) `outputs`." -4062,_NumpyFunctionCallback,tensorflow/tensorflow/python/framework/op_callbacks_test.py,76,class, -4063,OpCallbacksTest,tensorflow/tensorflow/python/framework/op_callbacks_test.py,158,class, -4064,OpCallbacksErrorConditionsTest,tensorflow/tensorflow/python/framework/op_callbacks_test.py,798,class, -4065,_Attr,tensorflow/tensorflow/python/framework/op_def_library.py,38,function, -4066,_AttrValue,tensorflow/tensorflow/python/framework/op_def_library.py,46,function, -4067,_SatisfiesTypeConstraint,tensorflow/tensorflow/python/framework/op_def_library.py,53,function, -4068,_IsListParameter,tensorflow/tensorflow/python/framework/op_def_library.py,64,function, -4069,_NumTypeFields,tensorflow/tensorflow/python/framework/op_def_library.py,72,function, -4070,_IsListValue,tensorflow/tensorflow/python/framework/op_def_library.py,80,function, -4071,_Flatten,tensorflow/tensorflow/python/framework/op_def_library.py,84,function,"Converts [1, 2, [3, 4], [5]] to [1, 2, 3, 4, 5]." -4072,_Restructure,tensorflow/tensorflow/python/framework/op_def_library.py,92,function,"Returns the elements of list l structured according to the given structure. - -A structure is represented by a list whose elements are either -`None` or a non-negative integer. `None` corresponds to a single -element in the output list, and an integer N corresponds to a nested -list of length N. - -The function returns a data structure whose shape is given by -`structure`, and whose elements are taken from `l`. If `structure` -is a singleton, the function returns the single data structure -implied by the 0th element of `structure`. For example: - - _Restructure([""foo"", ""bar"", ""baz"", ""qux""], [None, 2, None]) - -> [""foo"", [""bar"", ""baz""], ""qux""] - - _Restructure([""foo""], [None]) -> ""foo"" - - _Restructure([""foo""], [1]) -> [""foo""] - - _Restructure([], [0]) -> [] - -Args: - l: A list. - structure: A list whose elements are either `None` or a non-negative - integer. - -Returns: - The elements of `l`, restructured according to `structure`. If - `structure` is a list of length 1, this function returns the - single data structure implied by `structure[0]`." -4073,_MakeFloat,tensorflow/tensorflow/python/framework/op_def_library.py,141,function, -4074,_MakeInt,tensorflow/tensorflow/python/framework/op_def_library.py,148,function, -4075,_MakeStr,tensorflow/tensorflow/python/framework/op_def_library.py,159,function, -4076,_MakeBool,tensorflow/tensorflow/python/framework/op_def_library.py,166,function, -4077,_MakeType,tensorflow/tensorflow/python/framework/op_def_library.py,173,function, -4078,_MakeShape,tensorflow/tensorflow/python/framework/op_def_library.py,184,function,Convert v into a TensorShapeProto. -4079,_MakeTensor,tensorflow/tensorflow/python/framework/op_def_library.py,207,function,Ensure v is a TensorProto. -4080,_MakeFunc,tensorflow/tensorflow/python/framework/op_def_library.py,216,function,Ensure v is a func. -4081,_MaybeColocateWith,tensorflow/tensorflow/python/framework/op_def_library.py,236,function,"A context manager for (maybe) colocating with a list of input tensors. - -Args: - inputs: A list of `Tensor` or `Operation` objects. - -Returns: - A context manager." -4082,apply_op,tensorflow/tensorflow/python/framework/op_def_library.py,255,function,"Add a node invoking a registered Op to a graph. +4147,apply_op,tensorflow/tensorflow/python/framework/op_def_library.py,255,function,"Add a node invoking a registered Op to a graph. Example usage: # input1 and input2 can be Tensors or anything ops.convert_to_tensor() @@ -24171,44 +28727,23 @@ Raises: RuntimeError: On some errors. TypeError: On some errors. ValueError: On some errors." -4083,_apply_op_helper,tensorflow/tensorflow/python/framework/op_def_library.py,299,function,"Implementation of apply_op that returns output_structure, op." -4084,OpDefLibraryTest,tensorflow/tensorflow/python/framework/op_def_library_test.py,35,class, -4085,OpDefLibraryGraphTest,tensorflow/tensorflow/python/framework/op_def_library_test.py,1361,class, -4086,get,tensorflow/tensorflow/python/framework/op_def_registry.py,34,function,Returns an OpDef for a given `name` or None if the lookup fails. -4087,sync,tensorflow/tensorflow/python/framework/op_def_registry.py,59,function,No-op. Used to synchronize the contents of the Python registry with C++. -4088,tensor_id,tensorflow/tensorflow/python/framework/ops.py,114,function,Returns a unique identifier for this Tensor. -4089,_UserDeviceSpec,tensorflow/tensorflow/python/framework/ops.py,119,class,Store user-specified device and provide computation of merged device. -4090,NullContextmanager,tensorflow/tensorflow/python/framework/ops.py,166,class, -4091,_override_helper,tensorflow/tensorflow/python/framework/ops.py,178,function,"Overrides (string) operator on Tensors to call func. - -Args: - clazz_object: the class to override for; either Tensor or SparseTensor. - operator: the string name of the operator to override. - func: the function that replaces the overridden operator. - -Raises: - ValueError: If operator is not allowed to be overwritten." -4092,_as_graph_element,tensorflow/tensorflow/python/framework/ops.py,194,function,"Convert `obj` to a graph element if possible, otherwise return `None`. - -Args: - obj: Object to convert. - -Returns: - The result of `obj._as_graph_element()` if that method is available; - otherwise `None`." -4093,is_dense_tensor_like,tensorflow/tensorflow/python/framework/ops.py,213,function, -4094,uid,tensorflow/tensorflow/python/framework/ops.py,217,function,A unique (within this program execution) integer. -4095,numpy_text,tensorflow/tensorflow/python/framework/ops.py,222,function,Human readable representation of a tensor's numpy value. -4096,enable_tensor_equality,tensorflow/tensorflow/python/framework/ops.py,235,function,"Compare Tensors with element-wise comparison and thus be unhashable. +4148,get,tensorflow/tensorflow/python/framework/op_def_registry.py,34,function,Returns an OpDef for a given `name` or None if the lookup fails. +4149,sync,tensorflow/tensorflow/python/framework/op_def_registry.py,59,function,No-op. Used to synchronize the contents of the Python registry with C++. +4150,tensor_id,tensorflow/tensorflow/python/framework/ops.py,114,function,Returns a unique identifier for this Tensor. +4151,NullContextmanager,tensorflow/tensorflow/python/framework/ops.py,166,class, +4152,is_dense_tensor_like,tensorflow/tensorflow/python/framework/ops.py,213,function, +4153,uid,tensorflow/tensorflow/python/framework/ops.py,217,function,A unique (within this program execution) integer. +4154,numpy_text,tensorflow/tensorflow/python/framework/ops.py,222,function,Human readable representation of a tensor's numpy value. +4155,enable_tensor_equality,tensorflow/tensorflow/python/framework/ops.py,235,function,"Compare Tensors with element-wise comparison and thus be unhashable. Comparing tensors with element-wise allows comparisons such as tf.Variable(1.0) == 1.0. Element-wise equality implies that tensors are unhashable. Thus tensors can no longer be directly used in sets or as a key in a dictionary." -4097,disable_tensor_equality,tensorflow/tensorflow/python/framework/ops.py,248,function,"Compare Tensors by their id and be hashable. +4156,disable_tensor_equality,tensorflow/tensorflow/python/framework/ops.py,248,function,"Compare Tensors by their id and be hashable. This is a legacy behaviour of TensorFlow and is highly discouraged." -4098,Tensor,tensorflow/tensorflow/python/framework/ops.py,259,class,"A tensor is a multidimensional array of elements represented by a +4157,Tensor,tensorflow/tensorflow/python/framework/ops.py,259,class,"A tensor is a multidimensional array of elements represented by a `tf.Tensor` object. All elements are of a single known data type. @@ -24262,8 +28797,280 @@ A number of specialized tensors are available: see `tf.Variable`, `tf.RaggedTensor`. For more on Tensors, see the [guide](https://tensorflow.org/guide/tensor)." -4099,_EagerTensorBase,tensorflow/tensorflow/python/framework/ops.py,965,class,Base class for EagerTensor. -4100,convert_to_tensor_v1_with_dispatch,tensorflow/tensorflow/python/framework/ops.py,1263,function,"Converts the given `value` to a `Tensor`. +4158,op,tensorflow/tensorflow/python/framework/ops.py,394,method,The `Operation` that produces this tensor as an output. +4159,dtype,tensorflow/tensorflow/python/framework/ops.py,399,method,The `DType` of elements in this tensor. +4160,graph,tensorflow/tensorflow/python/framework/ops.py,404,method,The `Graph` that contains this tensor. +4161,name,tensorflow/tensorflow/python/framework/ops.py,409,method,The string name of this tensor. +4162,device,tensorflow/tensorflow/python/framework/ops.py,418,method,"The name of the device on which this tensor will be produced, or None." +4163,shape,tensorflow/tensorflow/python/framework/ops.py,423,method,"Returns a `tf.TensorShape` that represents the shape of this tensor. + +>>> t = tf.constant([1,2,3,4,5]) +>>> t.shape +TensorShape([5]) + +`tf.Tensor.shape` is equivalent to `tf.Tensor.get_shape()`. + +In a `tf.function` or when building a model using +`tf.keras.Input`, they return the build-time shape of the +tensor, which may be partially unknown. + +A `tf.TensorShape` is not a tensor. Use `tf.shape(t)` to get a tensor +containing the shape, calculated at runtime. + +See `tf.Tensor.get_shape()`, and `tf.TensorShape` for details and examples." +4164,get_shape,tensorflow/tensorflow/python/framework/ops.py,536,method,"Returns a `tf.TensorShape` that represents the shape of this tensor. + +In eager execution the shape is always fully-known. + +>>> a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) +>>> print(a.shape) +(2, 3) + +`tf.Tensor.get_shape()` is equivalent to `tf.Tensor.shape`. + + +When executing in a `tf.function` or building a model using +`tf.keras.Input`, `Tensor.shape` may return a partial shape (including +`None` for unknown dimensions). See `tf.TensorShape` for more details. + +>>> inputs = tf.keras.Input(shape = [10]) +>>> # Unknown batch size +>>> print(inputs.shape) +(None, 10) + +The shape is computed using shape inference functions that are +registered for each `tf.Operation`. + +The returned `tf.TensorShape` is determined at *build* time, without +executing the underlying kernel. It is not a `tf.Tensor`. If you need a +shape *tensor*, either convert the `tf.TensorShape` to a `tf.constant`, or +use the `tf.shape(tensor)` function, which returns the tensor's shape at +*execution* time. + +This is useful for debugging and providing early errors. For +example, when tracing a `tf.function`, no ops are being executed, shapes +may be unknown (See the [Concrete Functions +Guide](https://www.tensorflow.org/guide/concrete_function) for details). + +>>> @tf.function +... def my_matmul(a, b): +... result = a@b +... # the `print` executes during tracing. +... print(""Result shape: "", result.shape) +... return result + +The shape inference functions propagate shapes to the extent possible: + +>>> f = my_matmul.get_concrete_function( +... tf.TensorSpec([None,3]), +... tf.TensorSpec([3,5])) +Result shape: (None, 5) + +Tracing may fail if a shape missmatch can be detected: + +>>> cf = my_matmul.get_concrete_function( +... tf.TensorSpec([None,3]), +... tf.TensorSpec([4,5])) +Traceback (most recent call last): +... +ValueError: Dimensions must be equal, but are 3 and 4 for 'matmul' (op: +'MatMul') with input shapes: [?,3], [4,5]. + +In some cases, the inferred shape may have unknown dimensions. If +the caller has additional information about the values of these +dimensions, `Tensor.set_shape()` can be used to augment the +inferred shape. + +>>> @tf.function +... def my_fun(a): +... a.set_shape([5, 5]) +... # the `print` executes during tracing. +... print(""Result shape: "", a.shape) +... return a + +>>> cf = my_fun.get_concrete_function( +... tf.TensorSpec([None, None])) +Result shape: (5, 5) + +Returns: + A `tf.TensorShape` representing the shape of this tensor." +4165,set_shape,tensorflow/tensorflow/python/framework/ops.py,617,method,"Updates the shape of this tensor. + +With eager execution this operates as a shape assertion. +Here the shapes match: + +>>> t = tf.constant([[1,2,3]]) +>>> t.set_shape([1, 3]) + +Passing a `None` in the new shape allows any value for that axis: + +>>> t.set_shape([1,None]) + +An error is raised if an incompatible shape is passed. + +>>> t.set_shape([1,5]) +Traceback (most recent call last): +... +ValueError: Tensor's shape (1, 3) is not compatible with supplied +shape [1, 5] + +When executing in a `tf.function`, or building a model using +`tf.keras.Input`, `Tensor.set_shape` will *merge* the given `shape` with +the current shape of this tensor, and set the tensor's shape to the +merged value (see `tf.TensorShape.merge_with` for details): + +>>> t = tf.keras.Input(shape=[None, None, 3]) +>>> print(t.shape) +(None, None, None, 3) + +Dimensions set to `None` are not updated: + +>>> t.set_shape([None, 224, 224, None]) +>>> print(t.shape) +(None, 224, 224, 3) + +The main use case for this is to provide additional shape information +that cannot be inferred from the graph alone. + +For example if you know all the images in a dataset have shape [28,28,3] you +can set it with `tf.set_shape`: + +>>> @tf.function +... def load_image(filename): +... raw = tf.io.read_file(filename) +... image = tf.image.decode_png(raw, channels=3) +... # the `print` executes during tracing. +... print(""Initial shape: "", image.shape) +... image.set_shape([28, 28, 3]) +... print(""Final shape: "", image.shape) +... return image + +Trace the function, see the [Concrete Functions +Guide](https://www.tensorflow.org/guide/concrete_function) for details. + +>>> cf = load_image.get_concrete_function( +... tf.TensorSpec([], dtype=tf.string)) +Initial shape: (None, None, 3) +Final shape: (28, 28, 3) + +Similarly the `tf.io.parse_tensor` function could return a tensor with +any shape, even the `tf.rank` is unknown. If you know that all your +serialized tensors will be 2d, set it with `set_shape`: + +>>> @tf.function +... def my_parse(string_tensor): +... result = tf.io.parse_tensor(string_tensor, out_type=tf.float32) +... # the `print` executes during tracing. +... print(""Initial shape: "", result.shape) +... result.set_shape([None, None]) +... print(""Final shape: "", result.shape) +... return result + +Trace the function + +>>> concrete_parse = my_parse.get_concrete_function( +... tf.TensorSpec([], dtype=tf.string)) +Initial shape: +Final shape: (None, None) + +Make sure it works: + +>>> t = tf.ones([5,3], dtype=tf.float32) +>>> serialized = tf.io.serialize_tensor(t) +>>> print(serialized.dtype) + +>>> print(serialized.shape) +() +>>> t2 = concrete_parse(serialized) +>>> print(t2.shape) +(5, 3) + +Caution: `set_shape` ensures that the applied shape is compatible with +the existing shape, but it does not check at runtime. Setting +incorrect shapes can result in inconsistencies between the +statically-known graph and the runtime value of tensors. For runtime +validation of the shape, use `tf.ensure_shape` instead. It also modifies +the `shape` of the tensor. + +>>> # Serialize a rank-3 tensor +>>> t = tf.ones([5,5,5], dtype=tf.float32) +>>> serialized = tf.io.serialize_tensor(t) +>>> # The function still runs, even though it `set_shape([None,None])` +>>> t2 = concrete_parse(serialized) +>>> print(t2.shape) +(5, 5, 5) + +Args: + shape: A `TensorShape` representing the shape of this tensor, a + `TensorShapeProto`, a list, a tuple, or None. + +Raises: + ValueError: If `shape` is not compatible with the current shape of + this tensor." +4166,value_index,tensorflow/tensorflow/python/framework/ops.py,759,method,The index of this tensor in the outputs of its `Operation`. +4167,consumers,tensorflow/tensorflow/python/framework/ops.py,763,method,"Returns a list of `Operation`s that consume this tensor. + +Returns: + A list of `Operation`s." +4168,eval,tensorflow/tensorflow/python/framework/ops.py,891,method,"Evaluates this tensor in a `Session`. + +Note: If you are not using `compat.v1` libraries, you should not need this, +(or `feed_dict` or `Session`). In eager execution (or within `tf.function`) +you do not need to call `eval`. + +Calling this method will execute all preceding operations that +produce the inputs needed for the operation that produces this +tensor. + +*N.B.* Before invoking `Tensor.eval()`, its graph must have been +launched in a session, and either a default session must be +available, or `session` must be specified explicitly. + +Args: + feed_dict: A dictionary that maps `Tensor` objects to feed values. See + `tf.Session.run` for a description of the valid feed values. + session: (Optional.) The `Session` to be used to evaluate this tensor. If + none, the default session will be used. + +Returns: + A numpy array corresponding to the value of this tensor." +4169,experimental_ref,tensorflow/tensorflow/python/framework/ops.py,918,method, +4170,ref,tensorflow/tensorflow/python/framework/ops.py,921,method,"Returns a hashable reference object to this Tensor. + +The primary use case for this API is to put tensors in a set/dictionary. +We can't put tensors in a set/dictionary as `tensor.__hash__()` is no longer +available starting Tensorflow 2.0. + +The following will raise an exception starting 2.0 + +>>> x = tf.constant(5) +>>> y = tf.constant(10) +>>> z = tf.constant(10) +>>> tensor_set = {x, y, z} +Traceback (most recent call last): + ... +TypeError: Tensor is unhashable. Instead, use tensor.ref() as the key. +>>> tensor_dict = {x: 'five', y: 'ten'} +Traceback (most recent call last): + ... +TypeError: Tensor is unhashable. Instead, use tensor.ref() as the key. + +Instead, we can use `tensor.ref()`. + +>>> tensor_set = {x.ref(), y.ref(), z.ref()} +>>> x.ref() in tensor_set +True +>>> tensor_dict = {x.ref(): 'five', y.ref(): 'ten', z.ref(): 'ten'} +>>> tensor_dict[y.ref()] +'ten' + +Also, the reference object provides `.deref()` function that returns the +original Tensor. + +>>> x = tf.constant(5) +>>> x.ref().deref() +" +4171,convert_to_tensor_v1_with_dispatch,tensorflow/tensorflow/python/framework/ops.py,1263,function,"Converts the given `value` to a `Tensor`. This function converts Python objects of various types to `Tensor` objects. It accepts `Tensor` objects, numpy arrays, Python lists, @@ -24311,8 +29118,8 @@ Raises: TypeError: If no conversion function is registered for `value` to `dtype`. RuntimeError: If a registered conversion function returns an invalid value. ValueError: If the `value` is a tensor not of given `dtype` in graph mode." -4101,convert_to_tensor_v1,tensorflow/tensorflow/python/framework/ops.py,1323,function,Converts the given `value` to a `Tensor` (with the TF1 API). -4102,convert_to_tensor_v2_with_dispatch,tensorflow/tensorflow/python/framework/ops.py,1336,function,"Converts the given `value` to a `Tensor`. +4172,convert_to_tensor_v1,tensorflow/tensorflow/python/framework/ops.py,1323,function,Converts the given `value` to a `Tensor` (with the TF1 API). +4173,convert_to_tensor_v2_with_dispatch,tensorflow/tensorflow/python/framework/ops.py,1336,function,"Converts the given `value` to a `Tensor`. This function converts Python objects of various types to `Tensor` objects. It accepts `Tensor` objects, numpy arrays, Python lists, @@ -24371,9 +29178,8 @@ Raises: TypeError: If no conversion function is registered for `value` to `dtype`. RuntimeError: If a registered conversion function returns an invalid value. ValueError: If the `value` is a tensor not of given `dtype` in graph mode." -4103,convert_to_tensor_v2,tensorflow/tensorflow/python/framework/ops.py,1402,function,Converts the given `value` to a `Tensor`. -4104,_error_prefix,tensorflow/tensorflow/python/framework/ops.py,1412,function, -4105,pack_eager_tensors,tensorflow/tensorflow/python/framework/ops.py,1416,function,"Pack multiple `EagerTensor`s of the same dtype and shape. +4174,convert_to_tensor_v2,tensorflow/tensorflow/python/framework/ops.py,1402,function,Converts the given `value` to a `Tensor`. +4175,pack_eager_tensors,tensorflow/tensorflow/python/framework/ops.py,1416,function,"Pack multiple `EagerTensor`s of the same dtype and shape. Args: tensors: a list of EagerTensors to pack. @@ -24381,8 +29187,8 @@ Args: Returns: A packed EagerTensor." -4106,convert_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1475,function,Implementation of the public convert_to_tensor. -4107,internal_convert_n_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1550,function,"Converts `values` to a list of `Tensor` objects. +4176,convert_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1475,function,Implementation of the public convert_to_tensor. +4177,internal_convert_n_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1550,function,"Converts `values` to a list of `Tensor` objects. Args: values: A list of objects that can be consumed by `tf.convert_to_tensor()`. @@ -24405,7 +29211,7 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4108,convert_n_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1598,function,"Converts `values` to a list of `Tensor` objects. +4178,convert_n_to_tensor,tensorflow/tensorflow/python/framework/ops.py,1598,function,"Converts `values` to a list of `Tensor` objects. Args: values: A list of objects that can be consumed by `tf.convert_to_tensor()`. @@ -24426,7 +29232,7 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4109,convert_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1629,function,"Converts the given object to a `Tensor` or `CompositeTensor`. +4179,convert_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1629,function,"Converts the given object to a `Tensor` or `CompositeTensor`. If `value` is a `CompositeTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using `convert_to_tensor()`. @@ -24443,7 +29249,7 @@ Returns: Raises: ValueError: If `dtype` does not match the element type of `value`." -4110,internal_convert_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1652,function,"Converts the given object to a `Tensor` or `CompositeTensor`. +4180,internal_convert_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1652,function,"Converts the given object to a `Tensor` or `CompositeTensor`. If `value` is a `CompositeTensor` it is returned unmodified. Otherwise, it is converted to a `Tensor` using `convert_to_tensor()`. @@ -24461,7 +29267,7 @@ Returns: Raises: ValueError: If `dtype` does not match the element type of `value`." -4111,internal_convert_n_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1691,function,"Converts `values` to a list of `Tensor` or `CompositeTensor` objects. +4181,internal_convert_n_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1691,function,"Converts `values` to a list of `Tensor` or `CompositeTensor` objects. Any `CompositeTensor` objects in `values` are returned unmodified. @@ -24482,7 +29288,7 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4112,convert_n_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1731,function,"Converts `values` to a list of `Output` or `CompositeTensor` objects. +4182,convert_n_to_tensor_or_composite,tensorflow/tensorflow/python/framework/ops.py,1731,function,"Converts `values` to a list of `Output` or `CompositeTensor` objects. Any `CompositeTensor` objects in `values` are returned unmodified. @@ -24502,32 +29308,7 @@ Raises: `values`. RuntimeError: If a registered conversion function returns an invalid value." -4113,_device_string,tensorflow/tensorflow/python/framework/ops.py,1757,function, -4114,_NodeDef,tensorflow/tensorflow/python/framework/ops.py,1764,function,"Create a NodeDef proto. - -Args: - op_type: Value for the ""op"" attribute of the NodeDef proto. - name: Value for the ""name"" attribute of the NodeDef proto. - attrs: Dictionary where the key is the attribute name (a string) - and the value is the respective ""attr"" attribute of the NodeDef proto (an - AttrValue). - -Returns: - A node_def_pb2.NodeDef protocol buffer." -4115,_create_c_op,tensorflow/tensorflow/python/framework/ops.py,1791,function,"Creates a TF_Operation. - -Args: - graph: a `Graph`. - node_def: `node_def_pb2.NodeDef` for the operation to create. - inputs: A flattened list of `Tensor`s. This function handles grouping - tensors into lists as per attributes in the `node_def`. - control_inputs: A list of `Operation`s to set as control dependencies. - op_def: Optional. `op_def_pb2.OpDef` for the operation to create. If not - specified, is looked up from the `graph` using `node_def.op`. - -Returns: - A wrapped TF_Operation*." -4116,Operation,tensorflow/tensorflow/python/framework/ops.py,1848,class,"Represents a graph node that performs computation on tensors. +4183,Operation,tensorflow/tensorflow/python/framework/ops.py,1848,class,"Represents a graph node that performs computation on tensors. An `Operation` is a node in a `tf.Graph` that takes zero or more `Tensor` objects as input, and produces zero or more `Tensor` objects as output. @@ -24542,7 +29323,67 @@ produces `c` as output. If a `tf.compat.v1.Session` is used, an `Operation` of a `tf.Graph` can be executed by passing it to `tf.Session.run`. `op.run()` is a shortcut for calling `tf.compat.v1.get_default_session().run(op)`." -4117,RegisterGradient,tensorflow/tensorflow/python/framework/ops.py,2584,class,"A decorator for registering the gradient function for an op type. +4184,colocation_groups,tensorflow/tensorflow/python/framework/ops.py,2040,method,Returns the list of colocation groups of the op. +4185,values,tensorflow/tensorflow/python/framework/ops.py,2059,method,DEPRECATED: Use outputs. +4186,name,tensorflow/tensorflow/python/framework/ops.py,2080,method,The full name of this operation. +4187,device,tensorflow/tensorflow/python/framework/ops.py,2090,method,"The name of the device to which this op has been assigned, if any. + +Returns: + The string name of the device to which this op has been + assigned, or an empty string if it has not been assigned to a + device." +4188,outputs,tensorflow/tensorflow/python/framework/ops.py,2335,method,The list of `Tensor` objects representing the outputs of this op. +4189,inputs,tensorflow/tensorflow/python/framework/ops.py,2340,method,The sequence of `Tensor` objects representing the data inputs of this op. +4190,control_inputs,tensorflow/tensorflow/python/framework/ops.py,2361,method,"The `Operation` objects on which this op has a control dependency. + +Before this op is executed, TensorFlow will ensure that the +operations in `self.control_inputs` have finished executing. This +mechanism can be used to run ops sequentially for performance +reasons, or to ensure that the side effects of an op are observed +in the correct order. + +Returns: + A list of `Operation` objects." +4191,type,tensorflow/tensorflow/python/framework/ops.py,2404,method,"The type of the op (e.g. `""MatMul""`)." +4192,graph,tensorflow/tensorflow/python/framework/ops.py,2409,method,The `Graph` that contains this operation. +4193,node_def,tensorflow/tensorflow/python/framework/ops.py,2414,method,"Returns the `NodeDef` representation of this operation. + +Returns: + A + [`NodeDef`](https://www.tensorflow.org/code/tensorflow/core/framework/node_def.proto) + protocol buffer." +4194,op_def,tensorflow/tensorflow/python/framework/ops.py,2432,method,"Returns the `OpDef` proto that represents the type of this op. + +Returns: + An + [`OpDef`](https://www.tensorflow.org/code/tensorflow/core/framework/op_def.proto) + protocol buffer." +4195,traceback,tensorflow/tensorflow/python/framework/ops.py,2445,method,Returns the call stack from when this operation was constructed. +4196,get_attr,tensorflow/tensorflow/python/framework/ops.py,2498,method,"Returns the value of the attr of this op with the given `name`. + +Args: + name: The name of the attr to fetch. + +Returns: + The value of the attr, as a Python object. + +Raises: + ValueError: If this op does not have an attr with the given `name`." +4197,run,tensorflow/tensorflow/python/framework/ops.py,2562,method,"Runs this operation in a `Session`. + +Calling this method will execute all preceding operations that +produce the inputs needed for this operation. + +*N.B.* Before invoking `Operation.run()`, its graph must have been +launched in a session, and either a default session must be +available, or `session` must be specified explicitly. + +Args: + feed_dict: A dictionary that maps `Tensor` objects to feed values. See + `tf.Session.run` for a description of the valid feed values. + session: (Optional.) The `Session` to be used to run to this operation. If + none, the default session will be used." +4198,RegisterGradient,tensorflow/tensorflow/python/framework/ops.py,2584,class,"A decorator for registering the gradient function for an op type. This decorator is only used when defining a new op type. For an op with `m` inputs and `n` outputs, the gradient function is a function @@ -24564,7 +29405,7 @@ def _sub_grad(unused_op, grad): The decorator argument `op_type` is the string type of an operation. This corresponds to the `OpDef.name` field for the proto that defines the operation." -4118,no_gradient,tensorflow/tensorflow/python/framework/ops.py,2633,function,"Specifies that ops of type `op_type` is not differentiable. +4199,no_gradient,tensorflow/tensorflow/python/framework/ops.py,2633,function,"Specifies that ops of type `op_type` is not differentiable. This function should *not* be used for operations that have a well-defined gradient that is not yet implemented. @@ -24589,9 +29430,9 @@ Args: Raises: TypeError: If `op_type` is not a string." -4119,get_gradient_function,tensorflow/tensorflow/python/framework/ops.py,2671,function,"Returns the function that computes gradients for ""op""." -4120,set_shape_and_handle_data_for_outputs,tensorflow/tensorflow/python/framework/ops.py,2687,function,No op. TODO(b/74620627): Remove this. -4121,OpStats,tensorflow/tensorflow/python/framework/ops.py,2692,class,"A holder for statistics about an operator. +4200,get_gradient_function,tensorflow/tensorflow/python/framework/ops.py,2671,function,"Returns the function that computes gradients for ""op""." +4201,set_shape_and_handle_data_for_outputs,tensorflow/tensorflow/python/framework/ops.py,2687,function,No op. TODO(b/74620627): Remove this. +4202,OpStats,tensorflow/tensorflow/python/framework/ops.py,2692,class,"A holder for statistics about an operator. This class holds information about the resource requirements for an op, including the size of its weight parameters on-disk and how many FLOPS it @@ -24602,7 +29443,11 @@ set of information about its usage of the CPU and disk space when serialized. The function itself takes a Graph object that's been set up so you can call methods like get_tensor_by_name to help calculate the results, and a NodeDef argument." -4122,RegisterStatistics,tensorflow/tensorflow/python/framework/ops.py,2744,class,"A decorator for registering the statistics function for an op type. +4203,statistic_type,tensorflow/tensorflow/python/framework/ops.py,2715,method, +4204,statistic_type,tensorflow/tensorflow/python/framework/ops.py,2719,method, +4205,value,tensorflow/tensorflow/python/framework/ops.py,2723,method, +4206,value,tensorflow/tensorflow/python/framework/ops.py,2727,method, +4207,RegisterStatistics,tensorflow/tensorflow/python/framework/ops.py,2744,class,"A decorator for registering the statistics function for an op type. This decorator can be defined for an op type so that it gives a report on the resources used by an instance of an operator, in the @@ -24642,7 +29487,7 @@ doohickey = ops.get_stats_for_node_def(graph, node_def, ""doohickey"") If the NodeDef is for an op with a registered doohickey function, you'll get back the calculated amount in doohickey.value, or None if it's not defined." -4123,get_stats_for_node_def,tensorflow/tensorflow/python/framework/ops.py,2809,function,"Looks up the node's statistics function in the registry and calls it. +4208,get_stats_for_node_def,tensorflow/tensorflow/python/framework/ops.py,2809,function,"Looks up the node's statistics function in the registry and calls it. This function takes a Graph object and a NodeDef from a GraphDef, and if there's an associated statistics method, calls it and returns a result. If no @@ -24656,14 +29501,14 @@ Args: Returns: An OpStats object containing information about resource usage." -4124,name_from_scope_name,tensorflow/tensorflow/python/framework/ops.py,2834,function,"Returns the name of an op given the name of its scope. +4209,name_from_scope_name,tensorflow/tensorflow/python/framework/ops.py,2834,function,"Returns the name of an op given the name of its scope. Args: name: the name of the scope. Returns: the name of the op (equal to scope name minus any trailing slash)." -4125,Graph,tensorflow/tensorflow/python/framework/ops.py,2851,class,"A TensorFlow computation, represented as a dataflow graph. +4210,Graph,tensorflow/tensorflow/python/framework/ops.py,2851,class,"A TensorFlow computation, represented as a dataflow graph. Graphs are used by `tf.function`s to represent the function's computations. Each graph contains a set of `tf.Operation` objects, which represent units of @@ -24704,11 +29549,649 @@ example, the `tf.Variable` uses a collection (named `tf.GraphKeys.GLOBAL_VARIABLES`) for all variables that are created during the construction of a graph. The caller may define additional collections by specifying a new name." -4126,enable_auto_cast_variables,tensorflow/tensorflow/python/framework/ops.py,5212,class,"Enables the autocasting of `AutoCastVariable`s. +4211,version,tensorflow/tensorflow/python/framework/ops.py,3111,method,"Returns a version number that increases as ops are added to the graph. + +Note that this is unrelated to the +`tf.Graph.graph_def_versions`. + +Returns: + An integer version that increases as ops are added to the graph." +4212,graph_def_versions,tensorflow/tensorflow/python/framework/ops.py,3127,method,"The GraphDef version information of this graph. + +For details on the meaning of each version, see +[`GraphDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto). + +Returns: + A `VersionDef`." +4213,seed,tensorflow/tensorflow/python/framework/ops.py,3146,method,The graph-level random seed of this graph. +4214,seed,tensorflow/tensorflow/python/framework/ops.py,3151,method, +4215,finalized,tensorflow/tensorflow/python/framework/ops.py,3155,method,True if this graph has been finalized. +4216,finalize,tensorflow/tensorflow/python/framework/ops.py,3159,method,"Finalizes this graph, making it read-only. + +After calling `g.finalize()`, no new operations can be added to +`g`. This method is used to ensure that no operations are added +to a graph when it is shared between multiple threads, for example +when using a `tf.compat.v1.train.QueueRunner`." +4217,as_graph_def,tensorflow/tensorflow/python/framework/ops.py,3301,method,"Returns a serialized `GraphDef` representation of this graph. + +The serialized `GraphDef` can be imported into another `Graph` +(using `tf.import_graph_def`) or used with the +[C++ Session API](../../api_docs/cc/index.md). + +This method is thread-safe. + +Args: + from_version: Optional. If this is set, returns a `GraphDef` containing + only the nodes that were added to this graph since its `version` + property had the given value. + add_shapes: If true, adds an ""_output_shapes"" list attr to each node with + the inferred shapes of each of its outputs. + +Returns: + A + [`GraphDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto) + protocol buffer. + +Raises: + ValueError: If the `graph_def` would be too large." +4218,building_function,tensorflow/tensorflow/python/framework/ops.py,3388,method,Returns True iff this graph represents a function. +4219,create_op,tensorflow/tensorflow/python/framework/ops.py,3396,method,"Creates an `Operation` in this graph. + +This is a low-level interface for creating an `Operation`. Most +programs will not call this method directly, and instead use the +Python op constructors, such as `tf.constant()`, which add ops to +the default graph. + +Args: + op_type: The `Operation` type to create. This corresponds to the + `OpDef.name` field for the proto that defines the operation. + inputs: A list of `Tensor` objects that will be inputs to the `Operation`. + dtypes: (Optional) A list of `DType` objects that will be the types of the + tensors that the operation produces. + input_types: (Optional.) A list of `DType`s that will be the types of the + tensors that the operation consumes. By default, uses the base `DType` + of each input in `inputs`. Operations that expect reference-typed inputs + must specify `input_types` explicitly. + name: (Optional.) A string name for the operation. If not specified, a + name is generated based on `op_type`. + attrs: (Optional.) A dictionary where the key is the attribute name (a + string) and the value is the respective `attr` attribute of the + `NodeDef` proto that will represent the operation (an `AttrValue` + proto). + op_def: (Optional.) The `OpDef` proto that describes the `op_type` that + the operation will have. + compute_shapes: (Optional.) Deprecated. Has no effect (shapes are always + computed). + compute_device: (Optional.) If True, device functions will be executed to + compute the device property of the Operation. + +Raises: + TypeError: if any of the inputs is not a `Tensor`. + ValueError: if colocation conflicts with existing device assignment. + +Returns: + An `Operation` object." +4220,as_graph_element,tensorflow/tensorflow/python/framework/ops.py,3674,method,"Returns the object referred to by `obj`, as an `Operation` or `Tensor`. + +This function validates that `obj` represents an element of this +graph, and gives an informative error message if it is not. + +This function is the canonical way to get/validate an object of +one of the allowed types from an external argument reference in the +Session API. + +This method may be called concurrently from multiple threads. + +Args: + obj: A `Tensor`, an `Operation`, or the name of a tensor or operation. Can + also be any object with an `_as_graph_element()` method that returns a + value of one of these types. Note: `_as_graph_element` will be called + inside the graph's lock and so may not modify the graph. + allow_tensor: If true, `obj` may refer to a `Tensor`. + allow_operation: If true, `obj` may refer to an `Operation`. + +Returns: + The `Tensor` or `Operation` in the Graph corresponding to `obj`. + +Raises: + TypeError: If `obj` is not a type we support attempting to convert + to types. + ValueError: If `obj` is of an appropriate type but invalid. For + example, an invalid string. + KeyError: If `obj` is not an object in the graph." +4221,get_operations,tensorflow/tensorflow/python/framework/ops.py,3799,method,"Return the list of operations in the graph. + +You can modify the operations in place, but modifications +to the list such as inserts/delete have no effect on the +list of operations known to the graph. + +This method may be called concurrently from multiple threads. + +Returns: + A list of Operations." +4222,get_operation_by_name,tensorflow/tensorflow/python/framework/ops.py,3817,method,"Returns the `Operation` with the given `name`. + +This method may be called concurrently from multiple threads. + +Args: + name: The name of the `Operation` to return. + +Returns: + The `Operation` with the given `name`. + +Raises: + TypeError: If `name` is not a string. + KeyError: If `name` does not correspond to an operation in this graph." +4223,get_tensor_by_name,tensorflow/tensorflow/python/framework/ops.py,3865,method,"Returns the `Tensor` with the given `name`. + +This method may be called concurrently from multiple threads. + +Args: + name: The name of the `Tensor` to return. + +Returns: + The `Tensor` with the given `name`. + +Raises: + TypeError: If `name` is not a string. + KeyError: If `name` does not correspond to a tensor in this graph." +4224,as_default,tensorflow/tensorflow/python/framework/ops.py,3924,method,"Returns a context manager that makes this `Graph` the default graph. + +This method should be used if you want to create multiple graphs +in the same process. For convenience, a global default graph is +provided, and all ops will be added to this graph if you do not +create a new graph explicitly. + +Use this method with the `with` keyword to specify that ops created within +the scope of a block should be added to this graph. In this case, once +the scope of the `with` is exited, the previous default graph is set again +as default. There is a stack, so it's ok to have multiple nested levels +of `as_default` calls. + +The default graph is a property of the current thread. If you +create a new thread, and wish to use the default graph in that +thread, you must explicitly add a `with g.as_default():` in that +thread's function. + +The following code examples are equivalent: + +```python +# 1. Using Graph.as_default(): +g = tf.Graph() +with g.as_default(): + c = tf.constant(5.0) + assert c.graph is g + +# 2. Constructing and making default: +with tf.Graph().as_default() as g: + c = tf.constant(5.0) + assert c.graph is g +``` + +If eager execution is enabled ops created under this context manager will be +added to the graph instead of executed eagerly. + +Returns: + A context manager for using this graph as the default graph." +4225,collections,tensorflow/tensorflow/python/framework/ops.py,3967,method,Returns the names of the collections known to this graph. +4226,add_to_collection,tensorflow/tensorflow/python/framework/ops.py,3971,method,"Stores `value` in the collection with the given `name`. + +Note that collections are not sets, so it is possible to add a value to +a collection several times. + +Args: + name: The key for the collection. The `GraphKeys` class contains many + standard names for collections. + value: The value to add to the collection." +4227,add_to_collections,tensorflow/tensorflow/python/framework/ops.py,3989,method,"Stores `value` in the collections given by `names`. + +Note that collections are not sets, so it is possible to add a value to +a collection several times. This function makes sure that duplicates in +`names` are ignored, but it will not check for pre-existing membership of +`value` in any of the collections in `names`. + +`names` can be any iterable, but if `names` is a string, it is treated as a +single collection name. + +Args: + names: The keys for the collections to add to. The `GraphKeys` class + contains many standard names for collections. + value: The value to add to the collections." +4228,get_collection_ref,tensorflow/tensorflow/python/framework/ops.py,4010,method,"Returns a list of values in the collection with the given `name`. + +If the collection exists, this returns the list itself, which can +be modified in place to change the collection. If the collection does +not exist, it is created as an empty list and the list is returned. + +This is different from `get_collection()` which always returns a copy of +the collection list if it exists and never creates an empty collection. + +Args: + name: The key for the collection. For example, the `GraphKeys` class + contains many standard names for collections. + +Returns: + The list of values in the collection with the given `name`, or an empty + list if no value has been added to that collection." +4229,get_collection,tensorflow/tensorflow/python/framework/ops.py,4035,method,"Returns a list of values in the collection with the given `name`. + +This is different from `get_collection_ref()` which always returns the +actual collection list if it exists in that it returns a new list each time +it is called. + +Args: + name: The key for the collection. For example, the `GraphKeys` class + contains many standard names for collections. + scope: (Optional.) A string. If supplied, the resulting list is filtered + to include only items whose `name` attribute matches `scope` using + `re.match`. Items without a `name` attribute are never returned if a + scope is supplied. The choice of `re.match` means that a `scope` without + special tokens filters by prefix. + +Returns: + The list of values in the collection with the given `name`, or + an empty list if no value has been added to that collection. The + list contains the values in the order under which they were + collected." +4230,get_all_collection_keys,tensorflow/tensorflow/python/framework/ops.py,4075,method,Returns a list of collections used in this graph. +4231,clear_collection,tensorflow/tensorflow/python/framework/ops.py,4080,method,"Clears all values in a collection. + +Args: + name: The key for the collection. The `GraphKeys` class contains many + standard names for collections." +4232,name_scope,tensorflow/tensorflow/python/framework/ops.py,4130,method,"Returns a context manager that creates hierarchical names for operations. + +A graph maintains a stack of name scopes. A `with name_scope(...):` +statement pushes a new name onto the stack for the lifetime of the context. + +The `name` argument will be interpreted as follows: + +* A string (not ending with '/') will create a new name scope, in which + `name` is appended to the prefix of all operations created in the + context. If `name` has been used before, it will be made unique by + calling `self.unique_name(name)`. +* A scope previously captured from a `with g.name_scope(...) as + scope:` statement will be treated as an ""absolute"" name scope, which + makes it possible to re-enter existing scopes. +* A value of `None` or the empty string will reset the current name scope + to the top-level (empty) name scope. + +For example: + +```python +with tf.Graph().as_default() as g: + c = tf.constant(5.0, name=""c"") + assert c.op.name == ""c"" + c_1 = tf.constant(6.0, name=""c"") + assert c_1.op.name == ""c_1"" + + # Creates a scope called ""nested"" + with g.name_scope(""nested"") as scope: + nested_c = tf.constant(10.0, name=""c"") + assert nested_c.op.name == ""nested/c"" + + # Creates a nested scope called ""inner"". + with g.name_scope(""inner""): + nested_inner_c = tf.constant(20.0, name=""c"") + assert nested_inner_c.op.name == ""nested/inner/c"" + + # Create a nested scope called ""inner_1"". + with g.name_scope(""inner""): + nested_inner_1_c = tf.constant(30.0, name=""c"") + assert nested_inner_1_c.op.name == ""nested/inner_1/c"" + + # Treats `scope` as an absolute name scope, and + # switches to the ""nested/"" scope. + with g.name_scope(scope): + nested_d = tf.constant(40.0, name=""d"") + assert nested_d.op.name == ""nested/d"" + + with g.name_scope(""""): + e = tf.constant(50.0, name=""e"") + assert e.op.name == ""e"" +``` + +The name of the scope itself can be captured by `with +g.name_scope(...) as scope:`, which stores the name of the scope +in the variable `scope`. This value can be used to name an +operation that represents the overall result of executing the ops +in a scope. For example: + +```python +inputs = tf.constant(...) +with g.name_scope('my_layer') as scope: + weights = tf.Variable(..., name=""weights"") + biases = tf.Variable(..., name=""biases"") + affine = tf.matmul(inputs, weights) + biases + output = tf.nn.relu(affine, name=scope) +``` + +NOTE: This constructor validates the given `name`. Valid scope +names match one of the following regular expressions: + + [A-Za-z0-9.][A-Za-z0-9_.\-/]* (for scopes at the root) + [A-Za-z0-9_.\-/]* (for other scopes) + +Args: + name: A name for the scope. + +Returns: + A context manager that installs `name` as a new name scope. + +Raises: + ValueError: If `name` is not a valid scope name, according to the rules + above." +4233,unique_name,tensorflow/tensorflow/python/framework/ops.py,4244,method,"Return a unique operation name for `name`. + +Note: You rarely need to call `unique_name()` directly. Most of +the time you just need to create `with g.name_scope()` blocks to +generate structured names. + +`unique_name` is used to generate structured names, separated by +`""/""`, to help identify operations when debugging a graph. +Operation names are displayed in error messages reported by the +TensorFlow runtime, and in various visualization tools such as +TensorBoard. + +If `mark_as_used` is set to `True`, which is the default, a new +unique name is created and marked as in use. If it's set to `False`, +the unique name is returned without actually being marked as used. +This is useful when the caller simply wants to know what the name +to be created will be. + +Args: + name: The name for an operation. + mark_as_used: Whether to mark this name as being used. + +Returns: + A string to be passed to `create_op()` that will be used + to name the operation being created." +4234,get_name_scope,tensorflow/tensorflow/python/framework/ops.py,4296,method,"Returns the current name scope. + +For example: + +```python +with tf.name_scope('scope1'): + with tf.name_scope('scope2'): + print(tf.compat.v1.get_default_graph().get_name_scope()) +``` +would print the string `scope1/scope2`. + +Returns: + A string representing the current name scope." +4235,colocate_with,tensorflow/tensorflow/python/framework/ops.py,4327,method,"Returns a context manager that specifies an op to colocate with. + +Note: this function is not for public use, only for internal libraries. + +For example: + +```python +a = tf.Variable([1.0]) +with g.colocate_with(a): + b = tf.constant(1.0) + c = tf.add(a, b) +``` + +`b` and `c` will always be colocated with `a`, no matter where `a` +is eventually placed. + +**NOTE** Using a colocation scope resets any existing device constraints. + +If `op` is `None` then `ignore_existing` must be `True` and the new +scope resets all colocation and device constraints. + +Args: + op: The op to colocate all created ops with, or `None`. + ignore_existing: If true, only applies colocation of this op within the + context, rather than applying all colocation properties on the stack. + If `op` is `None`, this value must be `True`. + +Raises: + ValueError: if op is None but ignore_existing is False. + +Yields: + A context manager that specifies the op with which to colocate + newly created ops." +4236,device,tensorflow/tensorflow/python/framework/ops.py,4413,method,"Returns a context manager that specifies the default device to use. + +The `device_name_or_function` argument may either be a device name +string, a device function, or None: + +* If it is a device name string, all operations constructed in + this context will be assigned to the device with that name, unless + overridden by a nested `device()` context. +* If it is a function, it will be treated as a function from + Operation objects to device name strings, and invoked each time + a new Operation is created. The Operation will be assigned to + the device with the returned name. +* If it is None, all `device()` invocations from the enclosing context + will be ignored. + +For information about the valid syntax of device name strings, see +the documentation in +[`DeviceNameUtils`](https://www.tensorflow.org/code/tensorflow/core/util/device_name_utils.h). + +For example: + +```python +with g.device('/device:GPU:0'): + # All operations constructed in this context will be placed + # on GPU 0. + with g.device(None): + # All operations constructed in this context will have no + # assigned device. + +# Defines a function from `Operation` to device string. +def matmul_on_gpu(n): + if n.type == ""MatMul"": + return ""/device:GPU:0"" + else: + return ""/cpu:0"" + +with g.device(matmul_on_gpu): + # All operations of type ""MatMul"" constructed in this context + # will be placed on GPU 0; all other operations will be placed + # on CPU 0. +``` + +**N.B.** The device scope may be overridden by op wrappers or +other library code. For example, a variable assignment op +`v.assign()` must be colocated with the `tf.Variable` `v`, and +incompatible device scopes will be ignored. + +Args: + device_name_or_function: The device name or function to use in the + context. + +Yields: + A context manager that specifies the default device to use for newly + created ops. + +Raises: + RuntimeError: If device scopes are not properly nested." +4237,container,tensorflow/tensorflow/python/framework/ops.py,4510,method,"Returns a context manager that specifies the resource container to use. + +Stateful operations, such as variables and queues, can maintain their +states on devices so that they can be shared by multiple processes. +A resource container is a string name under which these stateful +operations are tracked. These resources can be released or cleared +with `tf.Session.reset()`. + +For example: + +```python +with g.container('experiment0'): + # All stateful Operations constructed in this context will be placed + # in resource container ""experiment0"". + v1 = tf.Variable([1.0]) + v2 = tf.Variable([2.0]) + with g.container(""experiment1""): + # All stateful Operations constructed in this context will be + # placed in resource container ""experiment1"". + v3 = tf.Variable([3.0]) + q1 = tf.queue.FIFOQueue(10, tf.float32) + # All stateful Operations constructed in this context will be + # be created in the ""experiment0"". + v4 = tf.Variable([4.0]) + q1 = tf.queue.FIFOQueue(20, tf.float32) + with g.container(""""): + # All stateful Operations constructed in this context will be + # be placed in the default resource container. + v5 = tf.Variable([5.0]) + q3 = tf.queue.FIFOQueue(30, tf.float32) + +# Resets container ""experiment0"", after which the state of v1, v2, v4, q1 +# will become undefined (such as uninitialized). +tf.Session.reset(target, [""experiment0""]) +``` + +Args: + container_name: container name string. + +Returns: + A context manager for defining resource containers for stateful ops, + yields the container name." +4238,control_dependencies,tensorflow/tensorflow/python/framework/ops.py,4690,method,"Returns a context manager that specifies control dependencies. + +Use with the `with` keyword to specify that all operations constructed +within the context should have control dependencies on +`control_inputs`. For example: + +```python +with g.control_dependencies([a, b, c]): + # `d` and `e` will only run after `a`, `b`, and `c` have executed. + d = ... + e = ... +``` + +Multiple calls to `control_dependencies()` can be nested, and in +that case a new `Operation` will have control dependencies on the union +of `control_inputs` from all active contexts. + +```python +with g.control_dependencies([a, b]): + # Ops constructed here run after `a` and `b`. + with g.control_dependencies([c, d]): + # Ops constructed here run after `a`, `b`, `c`, and `d`. +``` + +You can pass None to clear the control dependencies: + +```python +with g.control_dependencies([a, b]): + # Ops constructed here run after `a` and `b`. + with g.control_dependencies(None): + # Ops constructed here run normally, not waiting for either `a` or `b`. + with g.control_dependencies([c, d]): + # Ops constructed here run after `c` and `d`, also not waiting + # for either `a` or `b`. +``` + +*N.B.* The control dependencies context applies *only* to ops that +are constructed within the context. Merely using an op or tensor +in the context does not add a control dependency. The following +example illustrates this point: + +```python +# WRONG +def my_func(pred, tensor): + t = tf.matmul(tensor, tensor) + with tf.control_dependencies([pred]): + # The matmul op is created outside the context, so no control + # dependency will be added. + return t + +# RIGHT +def my_func(pred, tensor): + with tf.control_dependencies([pred]): + # The matmul op is created in the context, so a control dependency + # will be added. + return tf.matmul(tensor, tensor) +``` + +Also note that though execution of ops created under this scope will trigger +execution of the dependencies, the ops created under this scope might still +be pruned from a normal tensorflow graph. For example, in the following +snippet of code the dependencies are never executed: + +```python + loss = model.loss() + with tf.control_dependencies(dependencies): + loss = loss + tf.constant(1) # note: dependencies ignored in the + # backward pass + return tf.gradients(loss, model.variables) +``` + +This is because evaluating the gradient graph does not require evaluating +the constant(1) op created in the forward pass. + +Args: + control_inputs: A list of `Operation` or `Tensor` objects which must be + executed or computed before running the operations defined in the + context. Can also be `None` to clear the control dependencies. + +Returns: + A context manager that specifies control dependencies for all + operations constructed within the context. + +Raises: + TypeError: If `control_inputs` is not a list of `Operation` or + `Tensor` objects." +4239,gradient_override_map,tensorflow/tensorflow/python/framework/ops.py,4944,method,"EXPERIMENTAL: A context manager for overriding gradient functions. + +This context manager can be used to override the gradient function +that will be used for ops within the scope of the context. + +For example: + +```python +@tf.RegisterGradient(""CustomSquare"") +def _custom_square_grad(op, grad): + # ... + +with tf.Graph().as_default() as g: + c = tf.constant(5.0) + s_1 = tf.square(c) # Uses the default gradient for tf.square. + with g.gradient_override_map({""Square"": ""CustomSquare""}): + s_2 = tf.square(s_2) # Uses _custom_square_grad to compute the + # gradient of s_2. +``` + +Args: + op_type_map: A dictionary mapping op type strings to alternative op type + strings. + +Returns: + A context manager that sets the alternative op type to be used for one + or more ops created in that context. + +Raises: + TypeError: If `op_type_map` is not a dictionary mapping strings to + strings." +4240,prevent_feeding,tensorflow/tensorflow/python/framework/ops.py,5006,method,Marks the given `tensor` as unfeedable in this graph. +4241,is_feedable,tensorflow/tensorflow/python/framework/ops.py,5010,method,Returns `True` if and only if `tensor` is feedable. +4242,prevent_fetching,tensorflow/tensorflow/python/framework/ops.py,5014,method,Marks the given `op` as unfetchable in this graph. +4243,is_fetchable,tensorflow/tensorflow/python/framework/ops.py,5018,method,Returns `True` if and only if `tensor_or_op` is fetchable. +4244,switch_to_thread_local,tensorflow/tensorflow/python/framework/ops.py,5025,method,"Make device, colocation and dependencies stacks thread-local. + +Device, colocation and dependencies stacks are not thread-local be default. +If multiple threads access them, then the state is shared. This means that +one thread may affect the behavior of another thread. + +After this method is called, the stacks become thread-local. If multiple +threads access them, then the state is not shared. Each thread uses its own +value; a thread doesn't affect other threads by mutating such a stack. + +The initial value for every thread's stack is set to the current value +of the stack when `switch_to_thread_local()` was first called." +4245,control_inputs,tensorflow/tensorflow/python/framework/ops.py,4620,method, +4246,add_op,tensorflow/tensorflow/python/framework/ops.py,4623,method, +4247,op_in_group,tensorflow/tensorflow/python/framework/ops.py,4628,method, +4248,enable_auto_cast_variables,tensorflow/tensorflow/python/framework/ops.py,5212,class,"Enables the autocasting of `AutoCastVariable`s. Under this context manager, `AutoCastVariable`s will be cast to `dtype` if `dtype` is floating-point. Otherwise, `AutoCastVariable`s will not be cast." -4127,device,tensorflow/tensorflow/python/framework/ops.py,5249,function,"Wrapper for `Graph.device()` using the default graph. +4249,device,tensorflow/tensorflow/python/framework/ops.py,5249,function,"Wrapper for `Graph.device()` using the default graph. See `tf.Graph.device` for more details. @@ -24721,7 +30204,7 @@ Returns: Raises: RuntimeError: If eager execution is enabled and a function is passed in." -4128,device_v2,tensorflow/tensorflow/python/framework/ops.py,5285,function,"Specifies the device for ops created/executed in this context. +4250,device_v2,tensorflow/tensorflow/python/framework/ops.py,5285,function,"Specifies the device for ops created/executed in this context. This function specifies the device to be used for ops created/executed in a particular context. Nested contexts will inherit and also create/execute @@ -24752,7 +30235,7 @@ Returns: Raises: RuntimeError: If a function is passed in." -4129,container,tensorflow/tensorflow/python/framework/ops.py,5324,function,"Wrapper for `Graph.container()` using the default graph. +4251,container,tensorflow/tensorflow/python/framework/ops.py,5324,function,"Wrapper for `Graph.container()` using the default graph. Args: container_name: The container string to use in the context. @@ -24760,10 +30243,8 @@ Args: Returns: A context manager that specifies the default container to use for newly created stateful ops." -4130,_colocate_with_for_gradient,tensorflow/tensorflow/python/framework/ops.py,5337,function, -4131,colocate_with,tensorflow/tensorflow/python/framework/ops.py,5360,function, -4132,_colocate_with,tensorflow/tensorflow/python/framework/ops.py,5367,function, -4133,control_dependencies,tensorflow/tensorflow/python/framework/ops.py,5372,function,"Wrapper for `Graph.control_dependencies()` using the default graph. +4252,colocate_with,tensorflow/tensorflow/python/framework/ops.py,5360,function, +4253,control_dependencies,tensorflow/tensorflow/python/framework/ops.py,5372,function,"Wrapper for `Graph.control_dependencies()` using the default graph. See `tf.Graph.control_dependencies` for more details. @@ -24786,8 +30267,7 @@ Args: Returns: A context manager that specifies control dependencies for all operations constructed within the context." -4134,_DefaultStack,tensorflow/tensorflow/python/framework/ops.py,5408,class,A thread-local stack of objects for providing implicit defaults. -4135,default_session,tensorflow/tensorflow/python/framework/ops.py,5455,function,"Python ""with"" handler for defining a default session. +4254,default_session,tensorflow/tensorflow/python/framework/ops.py,5455,function,"Python ""with"" handler for defining a default session. This function provides a means of registering a session for handling Tensor.eval() and Operation.run() calls. It is primarily intended for use @@ -24830,7 +30310,7 @@ Args: Returns: A context manager for the default session." -4136,get_default_session,tensorflow/tensorflow/python/framework/ops.py,5504,function,"Returns the default session for the current thread. +4255,get_default_session,tensorflow/tensorflow/python/framework/ops.py,5504,function,"Returns the default session for the current thread. The returned `Session` will be the innermost session on which a `Session` or `Session.as_default()` context has been entered. @@ -24842,40 +30322,7 @@ thread's function. Returns: The default `Session` being used in the current thread." -4137,_eval_using_default_session,tensorflow/tensorflow/python/framework/ops.py,5521,function,"Uses the default session to evaluate one or more tensors. - -Args: - tensors: A single Tensor, or a list of Tensor objects. - feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists, - numpy ndarrays, TensorProtos, or strings. - graph: The graph in which the tensors are defined. - session: (Optional) A different session to use to evaluate ""tensors"". - -Returns: - Either a single numpy ndarray if ""tensors"" is a single tensor; or a list - of numpy ndarrays that each correspond to the respective element in - ""tensors"". - -Raises: - ValueError: If no default session is available; the default session - does not have ""graph"" as its graph; or if ""session"" is specified, - and it does not have ""graph"" as its graph." -4138,_run_using_default_session,tensorflow/tensorflow/python/framework/ops.py,5561,function,"Uses the default session to run ""operation"". - -Args: - operation: The Operation to be run. - feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists, - numpy ndarrays, TensorProtos, or strings. - graph: The graph in which ""operation"" is defined. - session: (Optional) A different session to use to run ""operation"". - -Raises: - ValueError: If no default session is available; the default session - does not have ""graph"" as its graph; or if ""session"" is specified, - and it does not have ""graph"" as its graph." -4139,_DefaultGraphStack,tensorflow/tensorflow/python/framework/ops.py,5596,class,A thread-local stack of objects for providing an implicit default graph. -4140,_get_outer_context_and_inner_device_stack,tensorflow/tensorflow/python/framework/ops.py,5647,function,Get the outermost context not building a function. -4141,init_scope,tensorflow/tensorflow/python/framework/ops.py,5687,function,"A context manager that lifts ops out of control-flow scopes and function-building graphs. +4256,init_scope,tensorflow/tensorflow/python/framework/ops.py,5687,function,"A context manager that lifts ops out of control-flow scopes and function-building graphs. There is often a need to lift variable initialization ops out of control-flow scopes, function-building graphs, and gradient tapes. Entering an @@ -24920,7 +30367,7 @@ def func(): Raises: RuntimeError: if graph state is incompatible with this initialization." -4142,executing_eagerly_outside_functions,tensorflow/tensorflow/python/framework/ops.py,5791,function,"Returns True if executing eagerly, even if inside a graph function. +4257,executing_eagerly_outside_functions,tensorflow/tensorflow/python/framework/ops.py,5791,function,"Returns True if executing eagerly, even if inside a graph function. This function will check the outermost context for the program and see if it is in eager mode. It is useful comparing to `tf.executing_eagerly()`, @@ -24942,8 +30389,8 @@ Example: Returns: boolean, whether the outermost context is in eager mode." -4143,inside_function,tensorflow/tensorflow/python/framework/ops.py,5823,function, -4144,enable_eager_execution,tensorflow/tensorflow/python/framework/ops.py,5828,function,"Enables eager execution for the lifetime of this program. +4258,inside_function,tensorflow/tensorflow/python/framework/ops.py,5823,function, +4259,enable_eager_execution,tensorflow/tensorflow/python/framework/ops.py,5828,function,"Enables eager execution for the lifetime of this program. Eager execution provides an imperative interface to TensorFlow. With eager execution enabled, TensorFlow functions execute operations immediately (as @@ -25002,12 +30449,12 @@ Raises: ValueError: If eager execution is enabled after creating/executing a TensorFlow graph, or if options provided conflict with a previous call to this function." -4145,disable_eager_execution,tensorflow/tensorflow/python/framework/ops.py,5900,function,"Disables eager execution. +4260,disable_eager_execution,tensorflow/tensorflow/python/framework/ops.py,5900,function,"Disables eager execution. This function can only be called before any Graphs, Ops, or Tensors have been created. It can be used at the beginning of the program for complex migration projects from TensorFlow 1.x to 2.x." -4146,enable_eager_execution_internal,tensorflow/tensorflow/python/framework/ops.py,5914,function,"Enables eager execution for the lifetime of this program. +4261,enable_eager_execution_internal,tensorflow/tensorflow/python/framework/ops.py,5914,function,"Enables eager execution for the lifetime of this program. Most of the doc string for enable_eager_execution is relevant here as well. @@ -25023,7 +30470,7 @@ Args: Raises: ValueError" -4147,eager_run,tensorflow/tensorflow/python/framework/ops.py,5987,function,"Runs the program with an optional main function and argv list. +4262,eager_run,tensorflow/tensorflow/python/framework/ops.py,5987,function,"Runs the program with an optional main function and argv list. The program will run with eager execution enabled. @@ -25045,7 +30492,7 @@ if __name__ == ""__main__"": Args: main: the main function to run. argv: the arguments to pass to it." -4148,reset_default_graph,tensorflow/tensorflow/python/framework/ops.py,6016,function,"Clears the default graph stack and resets the global default graph. +4263,reset_default_graph,tensorflow/tensorflow/python/framework/ops.py,6016,function,"Clears the default graph stack and resets the global default graph. NOTE: The default graph is a property of the current thread. This function applies only to the current thread. Calling this function while @@ -25055,7 +30502,7 @@ behavior. Using any previously created `tf.Operation` or `tf.Tensor` objects after calling this function will result in undefined behavior. Raises: AssertionError: If this function is called within a nested graph." -4149,get_default_graph,tensorflow/tensorflow/python/framework/ops.py,6036,function,"Returns the default graph for the current thread. +4264,get_default_graph,tensorflow/tensorflow/python/framework/ops.py,6036,function,"Returns the default graph for the current thread. The returned graph will be the innermost graph on which a `Graph.as_default()` context has been entered, or a global default @@ -25068,8 +30515,8 @@ thread's function. Returns: The default `Graph` being used in the current thread." -4150,has_default_graph,tensorflow/tensorflow/python/framework/ops.py,6054,function,Returns True if there is a default graph. -4151,get_name_scope,tensorflow/tensorflow/python/framework/ops.py,6059,function,"Returns the current name scope in the default_graph. +4265,has_default_graph,tensorflow/tensorflow/python/framework/ops.py,6054,function,Returns True if there is a default graph. +4266,get_name_scope,tensorflow/tensorflow/python/framework/ops.py,6059,function,"Returns the current name scope in the default_graph. For example: @@ -25082,44 +30529,7 @@ would print the string `scope1/scope2`. Returns: A string representing the current name scope." -4152,_assert_same_graph,tensorflow/tensorflow/python/framework/ops.py,6079,function,"Fail if the 2 items are from different graphs. - -Args: - original_item: Original item to check against. - item: Item to check. - -Raises: - ValueError: if graphs do not match." -4153,_get_graph_from_inputs,tensorflow/tensorflow/python/framework/ops.py,6097,function,"Returns the appropriate graph to use for the given inputs. - -This library method provides a consistent algorithm for choosing the graph -in which an Operation should be constructed: - -1. If the default graph is being used to construct a function, we - use the default graph. -2. If the ""graph"" is specified explicitly, we validate that all of the inputs - in ""op_input_list"" are compatible with that graph. -3. Otherwise, we attempt to select a graph from the first Operation- - or Tensor-valued input in ""op_input_list"", and validate that all other - such inputs are in the same graph. -4. If the graph was not specified and it could not be inferred from - ""op_input_list"", we attempt to use the default graph. - -Args: - op_input_list: A list of inputs to an operation, which may include `Tensor`, - `Operation`, and other objects that may be converted to a graph element. - graph: (Optional) The explicit graph to use. - -Raises: - TypeError: If op_input_list is not a list or tuple, or if graph is not a - Graph. - ValueError: If a graph is explicitly passed and not all inputs are from it, - or if the inputs are from multiple graphs, or we could not find a graph - and there was no default graph. - -Returns: - The appropriate graph to use for the given inputs." -4154,GraphKeys,tensorflow/tensorflow/python/framework/ops.py,6168,class,"Standard names to use for graph collections. +4267,GraphKeys,tensorflow/tensorflow/python/framework/ops.py,6168,class,"Standard names to use for graph collections. The standard library uses various well-known names to collect and retrieve values associated with a graph. For example, the @@ -25167,7 +30577,8 @@ automatically populated as many of the others are: * `WEIGHTS` * `BIASES` * `ACTIVATIONS`" -4155,dismantle_graph,tensorflow/tensorflow/python/framework/ops.py,6313,function,"Cleans up reference cycles from a `Graph`. +4268,VARIABLES,tensorflow/tensorflow/python/framework/ops.py,6309,method, +4269,dismantle_graph,tensorflow/tensorflow/python/framework/ops.py,6313,function,"Cleans up reference cycles from a `Graph`. Helpful for making sure the garbage collector doesn't need to run after a temporary `Graph` is no longer needed. @@ -25175,7 +30586,7 @@ temporary `Graph` is no longer needed. Args: graph: A `Graph` object to destroy. Neither it nor any of its ops are usable after this function runs." -4156,add_to_collection,tensorflow/tensorflow/python/framework/ops.py,6334,function,"Wrapper for `Graph.add_to_collection()` using the default graph. +4270,add_to_collection,tensorflow/tensorflow/python/framework/ops.py,6334,function,"Wrapper for `Graph.add_to_collection()` using the default graph. See `tf.Graph.add_to_collection` for more details. @@ -25189,7 +30600,7 @@ Args: Collections are only supported in eager when variables are created inside an EagerVariableStore (e.g. as part of a layer or template). @end_compatibility" -4157,add_to_collections,tensorflow/tensorflow/python/framework/ops.py,6354,function,"Wrapper for `Graph.add_to_collections()` using the default graph. +4271,add_to_collections,tensorflow/tensorflow/python/framework/ops.py,6354,function,"Wrapper for `Graph.add_to_collections()` using the default graph. See `tf.Graph.add_to_collections` for more details. @@ -25203,7 +30614,7 @@ Args: Collections are only supported in eager when variables are created inside an EagerVariableStore (e.g. as part of a layer or template). @end_compatibility" -4158,get_collection_ref,tensorflow/tensorflow/python/framework/ops.py,6374,function,"Wrapper for `Graph.get_collection_ref()` using the default graph. +4272,get_collection_ref,tensorflow/tensorflow/python/framework/ops.py,6374,function,"Wrapper for `Graph.get_collection_ref()` using the default graph. See `tf.Graph.get_collection_ref` for more details. @@ -25221,7 +30632,7 @@ Returns: @compatibility(eager) Collections are not supported when eager execution is enabled. @end_compatibility" -4159,get_collection,tensorflow/tensorflow/python/framework/ops.py,6398,function,"Wrapper for `Graph.get_collection()` using the default graph. +4273,get_collection,tensorflow/tensorflow/python/framework/ops.py,6398,function,"Wrapper for `Graph.get_collection()` using the default graph. See `tf.Graph.get_collection` for more details. @@ -25244,8 +30655,8 @@ Returns: @compatibility(eager) Collections are not supported when eager execution is enabled. @end_compatibility" -4160,get_all_collection_keys,tensorflow/tensorflow/python/framework/ops.py,6426,function,Returns a list of collections used in the default graph. -4161,name_scope,tensorflow/tensorflow/python/framework/ops.py,6431,function,"Internal-only entry point for `name_scope*`. +4274,get_all_collection_keys,tensorflow/tensorflow/python/framework/ops.py,6426,function,Returns a list of collections used in the default graph. +4275,name_scope,tensorflow/tensorflow/python/framework/ops.py,6431,function,"Internal-only entry point for `name_scope*`. Internal ops do not use the public API and instead rely on `ops.name_scope` regardless of the execution mode. This function @@ -25268,8 +30679,9 @@ Args: Returns: `name_scope*` context manager." -4162,internal_name_scope_v1,tensorflow/tensorflow/python/framework/ops.py,6476,class,Graph-only version of `name_scope_v1`. -4163,name_scope_v1,tensorflow/tensorflow/python/framework/ops.py,6552,class,"A context manager for use when defining a Python op. +4276,internal_name_scope_v1,tensorflow/tensorflow/python/framework/ops.py,6476,class,Graph-only version of `name_scope_v1`. +4277,name,tensorflow/tensorflow/python/framework/ops.py,6480,method, +4278,name_scope_v1,tensorflow/tensorflow/python/framework/ops.py,6552,class,"A context manager for use when defining a Python op. This context manager validates that the given `values` are from the same graph, makes that graph the default graph, and pushes a @@ -25288,7 +30700,8 @@ def my_op(a, b, c, name=None): # Define some computation that uses `a`, `b`, and `c`. return foo_op(..., name=scope) ```" -4164,name_scope_v2,tensorflow/tensorflow/python/framework/ops.py,6603,class,"A context manager for use when defining a Python op. +4279,name,tensorflow/tensorflow/python/framework/ops.py,6577,method, +4280,name_scope_v2,tensorflow/tensorflow/python/framework/ops.py,6603,class,"A context manager for use when defining a Python op. This context manager pushes a name scope, which will make the name of all operations added within it have a prefix. @@ -25311,7 +30724,8 @@ and `MyOp/c`. Inside a `tf.function`, if the scope name already exists, the name will be made unique by appending `_n`. For example, calling `my_op` the second time will generate `MyOp_1/a`, etc." -4165,strip_name_scope,tensorflow/tensorflow/python/framework/ops.py,6695,function,"Removes name scope from a name. +4281,name,tensorflow/tensorflow/python/framework/ops.py,6646,method, +4282,strip_name_scope,tensorflow/tensorflow/python/framework/ops.py,6695,function,"Removes name scope from a name. Args: name: A `string` name. @@ -25320,7 +30734,7 @@ Args: Returns: Name with name scope removed, or the original name if export_scope is None." -4166,prepend_name_scope,tensorflow/tensorflow/python/framework/ops.py,6723,function,"Prepends name scope to a name. +4283,prepend_name_scope,tensorflow/tensorflow/python/framework/ops.py,6723,function,"Prepends name scope to a name. Args: name: A `string` name. @@ -25329,8 +30743,8 @@ Args: Returns: Name with name scope added, or the original name if import_scope is None." -4167,op_scope,tensorflow/tensorflow/python/framework/ops.py,6754,function,"DEPRECATED. Same as name_scope above, just different argument order." -4168,register_proto_function,tensorflow/tensorflow/python/framework/ops.py,6765,function,"Registers `to_proto` and `from_proto` functions for collection_name. +4284,op_scope,tensorflow/tensorflow/python/framework/ops.py,6754,function,"DEPRECATED. Same as name_scope above, just different argument order." +4285,register_proto_function,tensorflow/tensorflow/python/framework/ops.py,6765,function,"Registers `to_proto` and `from_proto` functions for collection_name. `to_proto` function converts a Python object to the corresponding protocol buffer, and returns the protocol buffer. @@ -25344,13 +30758,10 @@ Args: `variable_pb2.VariableDef`, `queue_runner_pb2.QueueRunnerDef`.. to_proto: Function that implements Python object to protobuf conversion. from_proto: Function that implements protobuf to Python object conversion." -4169,get_collection_proto_type,tensorflow/tensorflow/python/framework/ops.py,6793,function,Returns the proto_type for collection_name. -4170,get_to_proto_function,tensorflow/tensorflow/python/framework/ops.py,6801,function,Returns the to_proto function for collection_name. -4171,get_from_proto_function,tensorflow/tensorflow/python/framework/ops.py,6809,function,Returns the from_proto function for collection_name. -4172,_operation_conversion_error,tensorflow/tensorflow/python/framework/ops.py,6817,function,Produce a nice error if someone converts an Operation to a Tensor. -4173,_op_to_colocate_with,tensorflow/tensorflow/python/framework/ops.py,6824,function,Operation object corresponding to v to use for colocation constraints. -4174,_is_keras_symbolic_tensor,tensorflow/tensorflow/python/framework/ops.py,6853,function, -4175,to_raw_op,tensorflow/tensorflow/python/framework/ops.py,6881,function,"Make a given op wrapper function `f` raw. +4286,get_collection_proto_type,tensorflow/tensorflow/python/framework/ops.py,6793,function,Returns the proto_type for collection_name. +4287,get_to_proto_function,tensorflow/tensorflow/python/framework/ops.py,6801,function,Returns the to_proto function for collection_name. +4288,get_from_proto_function,tensorflow/tensorflow/python/framework/ops.py,6809,function,Returns the from_proto function for collection_name. +4289,to_raw_op,tensorflow/tensorflow/python/framework/ops.py,6881,function,"Make a given op wrapper function `f` raw. Raw op wrappers can only be called with keyword arguments. @@ -25359,8 +30770,8 @@ Args: Returns: Raw `f`." -4176,raise_from_not_ok_status,tensorflow/tensorflow/python/framework/ops.py,6899,function, -4177,add_exit_callback_to_default_func_graph,tensorflow/tensorflow/python/framework/ops.py,6906,function,"Add a callback to run when the default function graph goes out of scope. +4290,raise_from_not_ok_status,tensorflow/tensorflow/python/framework/ops.py,6899,function, +4291,add_exit_callback_to_default_func_graph,tensorflow/tensorflow/python/framework/ops.py,6906,function,"Add a callback to run when the default function graph goes out of scope. Usage: @@ -25383,66 +30794,10 @@ Raises: RuntimeError: If executed when the current default graph is not a FuncGraph, or not currently executing in function creation mode (e.g., if inside an init_scope)." -4178,_reconstruct_sequence_inputs,tensorflow/tensorflow/python/framework/ops.py,6939,function,"Regroups a flat list of input tensors into scalar and sequence inputs. - -Args: - op_def: The `op_def_pb2.OpDef` (for knowing the input types) - inputs: a list of input `Tensor`s to the op. - attrs: mapping from attr name to `attr_value_pb2.AttrValue` (these define - how long each sequence is) - -Returns: - A list of `Tensor`s (corresponding to scalar inputs) and lists of - `Tensor`s (corresponding to sequence inputs)." -4179,_TensorIterator,tensorflow/tensorflow/python/framework/ops.py,6975,class,Iterates over the leading dim of a Tensor. Performs no error checks. -4180,set_int_list_attr,tensorflow/tensorflow/python/framework/ops.py,6998,function,TF internal method used to set a list(int) attribute in the node_def. -4181,OpsEnableAndDisableEagerTest,tensorflow/tensorflow/python/framework/ops_enable_eager_test.py,26,class, -4182,ResourceTest,tensorflow/tensorflow/python/framework/ops_test.py,67,class, -4183,TensorAndShapeTest,tensorflow/tensorflow/python/framework/ops_test.py,95,class, -4184,IndexedSlicesTest,tensorflow/tensorflow/python/framework/ops_test.py,464,class, -4185,IndexedSlicesSpecTest,tensorflow/tensorflow/python/framework/ops_test.py,509,class, -4186,NodeDefConstructorTest,tensorflow/tensorflow/python/framework/ops_test.py,638,class, -4187,_apply_op,tensorflow/tensorflow/python/framework/ops_test.py,645,function, -4188,OperationTest,tensorflow/tensorflow/python/framework/ops_test.py,654,class, -4189,CreateOpTest,tensorflow/tensorflow/python/framework/ops_test.py,1128,class, -4190,CreateOpFromTFOperationTest,tensorflow/tensorflow/python/framework/ops_test.py,1192,class, -4191,ApplyOpTest,tensorflow/tensorflow/python/framework/ops_test.py,1353,class, -4192,NameStackTest,tensorflow/tensorflow/python/framework/ops_test.py,1406,class, -4193,NameTest,tensorflow/tensorflow/python/framework/ops_test.py,1526,class, -4194,DeviceTest,tensorflow/tensorflow/python/framework/ops_test.py,1596,class, -4195,MultithreadedGraphStateTest,tensorflow/tensorflow/python/framework/ops_test.py,1855,class, -4196,ObjectWithName,tensorflow/tensorflow/python/framework/ops_test.py,2057,class, -4197,CollectionTest,tensorflow/tensorflow/python/framework/ops_test.py,2067,class, -4198,_CopyGrad,tensorflow/tensorflow/python/framework/ops_test.py,2209,function, -4199,_CopyOverrideGrad,tensorflow/tensorflow/python/framework/ops_test.py,2215,function, -4200,RegistrationTest,tensorflow/tensorflow/python/framework/ops_test.py,2220,class, -4201,ComparisonTest,tensorflow/tensorflow/python/framework/ops_test.py,2248,class, -4202,ControlDependenciesTest,tensorflow/tensorflow/python/framework/ops_test.py,2260,class, -4203,OpScopeTest,tensorflow/tensorflow/python/framework/ops_test.py,2467,class, -4204,InitScopeTest,tensorflow/tensorflow/python/framework/ops_test.py,2605,class, -4205,GraphTest,tensorflow/tensorflow/python/framework/ops_test.py,2907,class, -4206,AttrScopeTest,tensorflow/tensorflow/python/framework/ops_test.py,3027,class, -4207,KernelLabelTest,tensorflow/tensorflow/python/framework/ops_test.py,3076,class, -4208,AsGraphDefTest,tensorflow/tensorflow/python/framework/ops_test.py,3109,class, -4209,_calc_a_forward_flops,tensorflow/tensorflow/python/framework/ops_test.py,3171,function, -4210,StatisticsTest,tensorflow/tensorflow/python/framework/ops_test.py,3175,class, -4211,DeviceStackTest,tensorflow/tensorflow/python/framework/ops_test.py,3199,class, -4212,ColocationGroupTest,tensorflow/tensorflow/python/framework/ops_test.py,3250,class, -4213,DeprecatedTest,tensorflow/tensorflow/python/framework/ops_test.py,3409,class, -4214,NameScopeTest,tensorflow/tensorflow/python/framework/ops_test.py,3429,class, -4215,EnableEagerExecutionTest,tensorflow/tensorflow/python/framework/ops_test.py,3479,class, -4216,_TupleTensor,tensorflow/tensorflow/python/framework/ops_test.py,3493,class,`Tensor`-like `tuple`-like for custom `Tensor` conversion masquerading. -4217,_TupleTensorSpec,tensorflow/tensorflow/python/framework/ops_test.py,3514,class, -4218,_MyTuple,tensorflow/tensorflow/python/framework/ops_test.py,3532,class,Pretend user-side class for `ConvertToCompositeTensorTest . -4219,CustomConvertToCompositeTensorTest,tensorflow/tensorflow/python/framework/ops_test.py,3553,class, -4220,PackEagerTensorTest,tensorflow/tensorflow/python/framework/ops_test.py,3570,class, -4221,ProtoTest,tensorflow/tensorflow/python/framework/proto_test.py,28,class, -4222,_get_typename,tensorflow/tensorflow/python/framework/python_memory_checker.py,33,function,Return human readable pretty type name string. -4223,_create_python_object_snapshot,tensorflow/tensorflow/python/framework/python_memory_checker.py,44,function, -4224,_snapshot_diff,tensorflow/tensorflow/python/framework/python_memory_checker.py,53,function, -4225,_PythonMemoryChecker,tensorflow/tensorflow/python/framework/python_memory_checker.py,64,class,Python memory leak detection class. -4226,_truncate_seed,tensorflow/tensorflow/python/framework/random_seed.py,37,function, -4227,get_seed,tensorflow/tensorflow/python/framework/random_seed.py,43,function,"Returns the local seeds an operation should use given an op-specific seed. +4292,set_int_list_attr,tensorflow/tensorflow/python/framework/ops.py,6998,function,TF internal method used to set a list(int) attribute in the node_def. +4293,ObjectWithName,tensorflow/tensorflow/python/framework/ops_test.py,2057,class, +4294,name,tensorflow/tensorflow/python/framework/ops_test.py,2063,method, +4295,get_seed,tensorflow/tensorflow/python/framework/random_seed.py,43,function,"Returns the local seeds an operation should use given an op-specific seed. Given operation-specific seed, `op_seed`, this helper function returns two seeds derived from graph-level and op-level seeds. Many random operations @@ -25458,7 +30813,7 @@ Args: Returns: A tuple of two integers that should be used for the local seed of this operation." -4228,set_random_seed,tensorflow/tensorflow/python/framework/random_seed.py,93,function,"Sets the graph-level random seed for the default graph. +4296,set_random_seed,tensorflow/tensorflow/python/framework/random_seed.py,93,function,"Sets the graph-level random seed for the default graph. Operations that rely on a random seed actually derive it from two seeds: the graph-level and operation-level seeds. This sets the graph-level seed. @@ -25555,7 +30910,7 @@ with tf.compat.v1.Session() as sess2: Args: seed: integer." -4229,set_seed,tensorflow/tensorflow/python/framework/random_seed.py,199,function,"Sets the global random seed. +4297,set_seed,tensorflow/tensorflow/python/framework/random_seed.py,199,function,"Sets the global random seed. Operations that rely on a random seed actually derive it from two seeds: the global and operation-level seeds. This sets the global seed. @@ -25700,11 +31055,29 @@ states. Args: seed: integer." -4230,RandomSeedTest,tensorflow/tensorflow/python/framework/random_seed_test.py,27,class, -4231,Registry,tensorflow/tensorflow/python/framework/registry.py,36,class,Provides a registry for saving objects. -4232,bar,tensorflow/tensorflow/python/framework/registry_test.py,28,function, -4233,RegistryTest,tensorflow/tensorflow/python/framework/registry_test.py,32,class, -4234,smart_cond,tensorflow/tensorflow/python/framework/smart_cond.py,27,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. +4298,Registry,tensorflow/tensorflow/python/framework/registry.py,36,class,Provides a registry for saving objects. +4299,register,tensorflow/tensorflow/python/framework/registry.py,46,method,"Registers a Python object ""candidate"" for the given ""name"". + +Args: + candidate: The candidate object to add to the registry. + name: An optional string specifying the registry key for the candidate. + If None, candidate.__name__ will be used. +Raises: + KeyError: If same name is used twice." +4300,list,tensorflow/tensorflow/python/framework/registry.py,76,method,"Lists registered items. + +Returns: + A list of names of registered objects." +4301,lookup,tensorflow/tensorflow/python/framework/registry.py,84,method,"Looks up ""name"". + +Args: + name: a string specifying the registry key for the candidate. +Returns: + Registered object if found +Raises: + LookupError: if ""name"" has not been registered." +4302,bar,tensorflow/tensorflow/python/framework/registry_test.py,28,function, +4303,smart_cond,tensorflow/tensorflow/python/framework/smart_cond.py,27,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. If `pred` is a bool or has a constant value, we return either `true_fn()` or `false_fn()`, otherwise we use `tf.cond` to dynamically route to both. @@ -25721,7 +31094,7 @@ Returns: Raises: TypeError: If `true_fn` or `false_fn` is not callable." -4235,smart_constant_value,tensorflow/tensorflow/python/framework/smart_cond.py,62,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. +4304,smart_constant_value,tensorflow/tensorflow/python/framework/smart_cond.py,62,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. Arguments: pred: A scalar, either a Python bool or tensor. @@ -25731,7 +31104,7 @@ Returns: Raises: TypeError: If `pred` is not a Tensor or bool." -4236,smart_case,tensorflow/tensorflow/python/framework/smart_cond.py,93,function,"Like tf.case, except attempts to statically evaluate predicates. +4305,smart_case,tensorflow/tensorflow/python/framework/smart_cond.py,93,function,"Like tf.case, except attempts to statically evaluate predicates. If any predicate in `pred_fn_pairs` is a bool or has a constant value, the associated callable will be called or omitted depending on its value. @@ -25753,11 +31126,8 @@ Raises: TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples. TypeError: If `fns[i]` is not callable for any i, or `default` is not callable." -4237,raise_exception,tensorflow/tensorflow/python/framework/smart_cond_test.py,32,function, -4238,SmartCondTest,tensorflow/tensorflow/python/framework/smart_cond_test.py,36,class, -4239,SmartCaseTest,tensorflow/tensorflow/python/framework/smart_cond_test.py,102,class, -4240,SmartConstantValueTest,tensorflow/tensorflow/python/framework/smart_cond_test.py,145,class, -4241,SparseTensor,tensorflow/tensorflow/python/framework/sparse_tensor.py,47,class,"Represents a sparse tensor. +4306,raise_exception,tensorflow/tensorflow/python/framework/smart_cond_test.py,32,function, +4307,SparseTensor,tensorflow/tensorflow/python/framework/sparse_tensor.py,47,class,"Represents a sparse tensor. TensorFlow represents a sparse tensor as three separate dense tensors: `indices`, `values`, and `dense_shape`. In Python, the three tensors are @@ -25813,8 +31183,52 @@ represents the dense tensor [0, 0, 2, 0] [0, 0, 0, 0]] ```" -4242,SparseTensorSpec,tensorflow/tensorflow/python/framework/sparse_tensor.py,270,class,Type specification for a `tf.sparse.SparseTensor`. -4243,convert_to_tensor_or_sparse_tensor,tensorflow/tensorflow/python/framework/sparse_tensor.py,415,function,"Converts value to a `SparseTensor` or `Tensor`. +4308,from_value,tensorflow/tensorflow/python/framework/sparse_tensor.py,107,method, +4309,get_shape,tensorflow/tensorflow/python/framework/sparse_tensor.py,154,method,"Get the `TensorShape` representing the shape of the dense tensor. + +Returns: + A `TensorShape` object." +4310,indices,tensorflow/tensorflow/python/framework/sparse_tensor.py,163,method,"The indices of non-zero values in the represented dense tensor. + +Returns: + A 2-D Tensor of int64 with dense_shape `[N, ndims]`, where `N` is the + number of non-zero values in the tensor, and `ndims` is the rank." +4311,values,tensorflow/tensorflow/python/framework/sparse_tensor.py,173,method,"The non-zero values in the represented dense tensor. + +Returns: + A 1-D Tensor of any data type." +4312,op,tensorflow/tensorflow/python/framework/sparse_tensor.py,182,method,The `Operation` that produces `values` as an output. +4313,dtype,tensorflow/tensorflow/python/framework/sparse_tensor.py,187,method,The `DType` of elements in this tensor. +4314,dense_shape,tensorflow/tensorflow/python/framework/sparse_tensor.py,192,method,A 1-D Tensor of int64 representing the shape of the dense tensor. +4315,shape,tensorflow/tensorflow/python/framework/sparse_tensor.py,197,method,"Get the `TensorShape` representing the shape of the dense tensor. + +Returns: + A `TensorShape` object." +4316,graph,tensorflow/tensorflow/python/framework/sparse_tensor.py,206,method,"The `Graph` that contains the index, value, and dense_shape tensors." +4317,eval,tensorflow/tensorflow/python/framework/sparse_tensor.py,214,method,"Evaluates this sparse tensor in a `Session`. + +Calling this method will execute all preceding operations that +produce the inputs needed for the operation that produces this +tensor. + +*N.B.* Before invoking `SparseTensor.eval()`, its graph must have been +launched in a session, and either a default session must be +available, or `session` must be specified explicitly. + +Args: + feed_dict: A dictionary that maps `Tensor` objects to feed values. See + `tf.Session.run` for a description of the valid feed values. + session: (Optional.) The `Session` to be used to evaluate this sparse + tensor. If none, the default session will be used. + +Returns: + A `SparseTensorValue` object." +4318,consumers,tensorflow/tensorflow/python/framework/sparse_tensor.py,259,method, +4319,SparseTensorSpec,tensorflow/tensorflow/python/framework/sparse_tensor.py,270,class,Type specification for a `tf.sparse.SparseTensor`. +4320,dtype,tensorflow/tensorflow/python/framework/sparse_tensor.py,292,method,The `tf.dtypes.DType` specified by this type for the SparseTensor. +4321,shape,tensorflow/tensorflow/python/framework/sparse_tensor.py,297,method,The `tf.TensorShape` specified by this type for the SparseTensor. +4322,from_value,tensorflow/tensorflow/python/framework/sparse_tensor.py,393,method, +4323,convert_to_tensor_or_sparse_tensor,tensorflow/tensorflow/python/framework/sparse_tensor.py,415,function,"Converts value to a `SparseTensor` or `Tensor`. Args: value: A `SparseTensor`, `SparseTensorValue`, or an object whose type has a @@ -25828,7 +31242,7 @@ Returns: Raises: RuntimeError: If result type is incompatible with `dtype`." -4244,is_sparse,tensorflow/tensorflow/python/framework/sparse_tensor.py,443,function,"Check whether `x` is sparse. +4324,is_sparse,tensorflow/tensorflow/python/framework/sparse_tensor.py,443,function,"Check whether `x` is sparse. Check whether an object is a `tf.sparse.SparseTensor` or `tf.compat.v1.SparseTensorValue`. @@ -25839,100 +31253,7 @@ Args: Returns: `True` iff `x` is a `tf.sparse.SparseTensor` or `tf.compat.v1.SparseTensorValue`." -4245,SparseTensorTest,tensorflow/tensorflow/python/framework/sparse_tensor_test.py,38,class, -4246,ConvertToTensorOrSparseTensorTest,tensorflow/tensorflow/python/framework/sparse_tensor_test.py,101,class, -4247,SparseTensorShapeTest,tensorflow/tensorflow/python/framework/sparse_tensor_test.py,129,class, -4248,SparseTensorSpecTest,tensorflow/tensorflow/python/framework/sparse_tensor_test.py,208,class, -4249,_recursive_apply,tensorflow/tensorflow/python/framework/subscribe.py,30,function,"Helper method to recursively apply a function to structure of tensors. - -The structure of the tensors should take the form similar to fetches in -`tf.compat.v1.Session` and includes single `Tensor`, `list`, nested `list`, -`tuple`, -`namedtuple`, or `dict`. - -Args: - tensors: Single `Tensor`, `list`, nested `list, `tuple`, `namedtuple`, or - `dict`. - apply_fn: Function to apply to each `Tensor` and should return a `Tensor`. - -Returns: - Returns the modified tensors with the same structure. -Raises: - `TypeError` if undefined type in the tensors structure." -4250,_ControlOutputCache,tensorflow/tensorflow/python/framework/subscribe.py,67,class,Helper class to manage calculating and caching control_outputs in graph. -4251,_subscribe_new,tensorflow/tensorflow/python/framework/subscribe.py,109,function,"Helper method that subscribes a single tensor to a list of side_effects. - -Args: - tensor: `tf.Tensor` - side_effects: List of side_effect functions see subscribe for details. - control_cache: `_ControlOutputCache` helper to get control_outputs faster. - -Returns: - The modified replacement to the passed in tensor which triggers the side - effects." -4252,_subscribe_extend,tensorflow/tensorflow/python/framework/subscribe.py,156,function,"Helper method to extend the list of side_effects for a subscribed tensor. - -Args: - tensor: A `tf.Tensor` as returned by subscribe(). - side_effects: List of side_effect functions, see subscribe for details. - -Returns: - The given subscribed tensor (for API consistency)." -4253,_is_subscribed_identity,tensorflow/tensorflow/python/framework/subscribe.py,184,function,"Checks if the given tensor is an identity op returned by `subscribe()`. - -Args: - tensor: A `tf.Tensor` to check. - -Returns: - True if the given tensor matches the criteria for subscription identities: - its op type is `Identity`, its name matches the name of its input and - conforms to the convention for subscribed nodes. - False otherwise." -4254,_subscribe,tensorflow/tensorflow/python/framework/subscribe.py,218,function,"Helper method that subscribes a single tensor to a list of side_effects. - -This method will check if the given tensor has already been subscribed or if -it's a tensor returned by a previous call to `subscribe()` and, if so, will -reuse the existing identity op, appending the given side effects to the list -of existing ones. - -Args: - tensor: The `tf.Tensor` to be subscribed. - side_effects: List of side_effect functions, see subscribe for details. - control_cache: `_ControlOutputCache` helper to get control_outputs faster. - -Returns: - The modified replacement to the passed in tensor which triggers the side - effects or the given tensor, if it was already been subscribed." -4255,_preserve_control_flow_context,tensorflow/tensorflow/python/framework/subscribe.py,261,function,"Preserve the control flow context for the given tensor. - -Sets the graph context to the tensor's context so that side effect ops are -added under the same context. - -This is needed when subscribing to tensors defined within a conditional -block or a while loop. In these cases we need that the side-effect ops -are created within the same control flow context as that of the tensor -they are attached to. - -Args: - tensor: tensor whose context should be preserved. - -Yields: - None" -4256,_scoped_subscribe,tensorflow/tensorflow/python/framework/subscribe.py,291,function,"Helper method that subscribes a single tensor to a list of side_effects. - -This is a thin wrapper around `_subscribe` and ensures that the side effect -ops are added within the same device and control flow context of the -subscribed tensor. - -Args: - tensor: The `tf.Tensor` to be subscribed. - side_effects: List of side_effect functions, see subscribe for details. - control_cache: `_ControlOutputCache` helper to get control_outputs faster. - -Returns: - The modified replacement to the passed in tensor which triggers the side - effects or the given tensor, if it was already been subscribed." -4257,subscribe,tensorflow/tensorflow/python/framework/subscribe.py,313,function,"Subscribe to a tensor. +4325,subscribe,tensorflow/tensorflow/python/framework/subscribe.py,313,function,"Subscribe to a tensor. This method will attach side effect graphs to a given set of tensors. Set of tensors follows from session.run and supports @@ -25966,9 +31287,7 @@ Returns: such that these are downstream of the control dependencies for the side effect graphs. Use these functionally equivalent tensors instead of the passed in tensors for further construction or running." -4258,SubscribeTest,tensorflow/tensorflow/python/framework/subscribe_test.py,39,class, -4259,_default_conversion_function,tensorflow/tensorflow/python/framework/tensor_conversion_registry.py,50,function, -4260,register_tensor_conversion_function,tensorflow/tensorflow/python/framework/tensor_conversion_registry.py,57,function,"Registers a function for converting objects of `base_type` to `Tensor`. +4326,register_tensor_conversion_function,tensorflow/tensorflow/python/framework/tensor_conversion_registry.py,57,function,"Registers a function for converting objects of `base_type` to `Tensor`. The conversion function must have the following signature: @@ -26005,14 +31324,14 @@ Args: Raises: TypeError: If the arguments do not have the appropriate type." -4261,get,tensorflow/tensorflow/python/framework/tensor_conversion_registry.py,114,function,"Get conversion function for objects of `cls`. +4327,get,tensorflow/tensorflow/python/framework/tensor_conversion_registry.py,114,function,"Get conversion function for objects of `cls`. Args: query: The type to query for. Returns: A list of conversion functions in increasing order of priority." -4262,enable_v2_tensorshape,tensorflow/tensorflow/python/framework/tensor_shape.py,35,function,"In TensorFlow 2.0, iterating over a TensorShape instance returns values. +4328,enable_v2_tensorshape,tensorflow/tensorflow/python/framework/tensor_shape.py,35,function,"In TensorFlow 2.0, iterating over a TensorShape instance returns values. This enables the new behavior. @@ -26056,10 +31375,10 @@ dim.assert_is_compatible_with(other_shape) # or using any other shape method # you might do in-place modifications to `dim` and expect them to be reflected # in `tensor_shape[i]`, but they would not be. ```" -4263,disable_v2_tensorshape,tensorflow/tensorflow/python/framework/tensor_shape.py,87,function,"Disables the V2 TensorShape behavior and reverts to V1 behavior. +4329,disable_v2_tensorshape,tensorflow/tensorflow/python/framework/tensor_shape.py,87,function,"Disables the V2 TensorShape behavior and reverts to V1 behavior. See docstring for `enable_v2_tensorshape` for details about the new behavior." -4264,dimension_value,tensorflow/tensorflow/python/framework/tensor_shape.py,99,function,"Compatibility utility required to allow for both V1 and V2 behavior in TF. +4330,dimension_value,tensorflow/tensorflow/python/framework/tensor_shape.py,99,function,"Compatibility utility required to allow for both V1 and V2 behavior in TF. Until the release of TF 2.0, we need the legacy behavior of `TensorShape` to coexist with the new behavior. This utility is a bridge between the two. @@ -26083,7 +31402,7 @@ Arguments: Returns: A plain value, i.e. an integer or None." -4265,dimension_at_index,tensorflow/tensorflow/python/framework/tensor_shape.py,133,function,"Compatibility utility required to allow for both V1 and V2 behavior in TF. +4331,dimension_at_index,tensorflow/tensorflow/python/framework/tensor_shape.py,133,function,"Compatibility utility required to allow for both V1 and V2 behavior in TF. Until the release of TF 2.0, we need the legacy behavior of `TensorShape` to coexist with the new behavior. This utility is a bridge between the two. @@ -26120,8 +31439,55 @@ Arguments: Returns: A dimension object." -4266,Dimension,tensorflow/tensorflow/python/framework/tensor_shape.py,180,class,Represents the value of one dimension in a TensorShape. -4267,as_dimension,tensorflow/tensorflow/python/framework/tensor_shape.py,704,function,"Converts the given value to a Dimension. +4332,Dimension,tensorflow/tensorflow/python/framework/tensor_shape.py,180,class,Represents the value of one dimension in a TensorShape. +4333,value,tensorflow/tensorflow/python/framework/tensor_shape.py,248,method,"The value of this dimension, or None if it is unknown." +4334,is_compatible_with,tensorflow/tensorflow/python/framework/tensor_shape.py,252,method,"Returns true if `other` is compatible with this Dimension. + +Two known Dimensions are compatible if they have the same value. +An unknown Dimension is compatible with all other Dimensions. + +Args: + other: Another Dimension. + +Returns: + True if this Dimension and `other` are compatible." +4335,assert_is_compatible_with,tensorflow/tensorflow/python/framework/tensor_shape.py,268,method,"Raises an exception if `other` is not compatible with this Dimension. + +Args: + other: Another Dimension. + +Raises: + ValueError: If `self` and `other` are not compatible (see + is_compatible_with)." +4336,merge_with,tensorflow/tensorflow/python/framework/tensor_shape.py,282,method,"Returns a Dimension that combines the information in `self` and `other`. + +Dimensions are combined as follows: + +```python +tf.compat.v1.Dimension(n) .merge_with(tf.compat.v1.Dimension(n)) == +tf.compat.v1.Dimension(n) +tf.compat.v1.Dimension(n) .merge_with(tf.compat.v1.Dimension(None)) == +tf.compat.v1.Dimension(n) +tf.compat.v1.Dimension(None).merge_with(tf.compat.v1.Dimension(n)) == +tf.compat.v1.Dimension(n) +# equivalent to tf.compat.v1.Dimension(None) +tf.compat.v1.Dimension(None).merge_with(tf.compat.v1.Dimension(None)) + +# raises ValueError for n != m +tf.compat.v1.Dimension(n) .merge_with(tf.compat.v1.Dimension(m)) +``` + +Args: + other: Another Dimension. + +Returns: + A Dimension containing the combined information of `self` and + `other`. + +Raises: + ValueError: If `self` and `other` are not compatible (see + is_compatible_with)." +4337,as_dimension,tensorflow/tensorflow/python/framework/tensor_shape.py,704,function,"Converts the given value to a Dimension. A Dimension input will be returned unmodified. An input of `None` will be converted to an unknown Dimension. @@ -26132,7 +31498,7 @@ Args: Returns: A Dimension corresponding to the given value." -4268,TensorShape,tensorflow/tensorflow/python/framework/tensor_shape.py,724,class,"Represents the shape of a `Tensor`. +4338,TensorShape,tensorflow/tensorflow/python/framework/tensor_shape.py,724,class,"Represents the shape of a `Tensor`. A `TensorShape` represents a possibly-partial shape specification for a `Tensor`. It may be one of the following: @@ -26150,8 +31516,172 @@ may be inferred if there is a registered shape function for functions](https://tensorflow.org/extend/adding_an_op#shape_functions_in_c) for details of shape functions and how to register them. Alternatively, the shape may be set explicitly using `tf.Tensor.set_shape`." -4269,as_shape,tensorflow/tensorflow/python/framework/tensor_shape.py,1230,function,Converts the given object to a TensorShape. -4270,unknown_shape,tensorflow/tensorflow/python/framework/tensor_shape.py,1238,function,"Returns an unknown TensorShape, optionally with a known rank. +4339,rank,tensorflow/tensorflow/python/framework/tensor_shape.py,820,method,"Returns the rank of this shape, or None if it is unspecified." +4340,dims,tensorflow/tensorflow/python/framework/tensor_shape.py,827,method,"Deprecated. Returns list of dimensions for this shape. + +Suggest `TensorShape.as_list` instead. + +Returns: + A list containing `tf.compat.v1.Dimension`s, or None if the shape is + unspecified." +4341,ndims,tensorflow/tensorflow/python/framework/tensor_shape.py,839,method,Deprecated accessor for `rank`. +4342,num_elements,tensorflow/tensorflow/python/framework/tensor_shape.py,916,method,"Returns the total number of elements, or none for incomplete shapes." +4343,merge_with,tensorflow/tensorflow/python/framework/tensor_shape.py,926,method,"Returns a `TensorShape` combining the information in `self` and `other`. + +The dimensions in `self` and `other` are merged elementwise, +according to the rules defined for `Dimension.merge_with()`. + +Args: + other: Another `TensorShape`. + +Returns: + A `TensorShape` containing the combined information of `self` and + `other`. + +Raises: + ValueError: If `self` and `other` are not compatible." +4344,concatenate,tensorflow/tensorflow/python/framework/tensor_shape.py,965,method,"Returns the concatenation of the dimension in `self` and `other`. + +*N.B.* If either `self` or `other` is completely unknown, +concatenation will discard information about the other shape. In +future, we might support concatenation that preserves this +information for use with slicing. + +Args: + other: Another `TensorShape`. + +Returns: + A `TensorShape` whose dimensions are the concatenation of the + dimensions in `self` and `other`." +4345,assert_same_rank,tensorflow/tensorflow/python/framework/tensor_shape.py,988,method,"Raises an exception if `self` and `other` do not have compatible ranks. + +Args: + other: Another `TensorShape`. + +Raises: + ValueError: If `self` and `other` do not represent shapes with the + same rank." +4346,assert_has_rank,tensorflow/tensorflow/python/framework/tensor_shape.py,1004,method,"Raises an exception if `self` is not compatible with the given `rank`. + +Args: + rank: An integer. + +Raises: + ValueError: If `self` does not represent a shape with the given `rank`." +4347,with_rank,tensorflow/tensorflow/python/framework/tensor_shape.py,1016,method,"Returns a shape based on `self` with the given rank. + +This method promotes a completely unknown shape to one with a +known rank. + +Args: + rank: An integer. + +Returns: + A shape that is at least as specific as `self` with the given rank. + +Raises: + ValueError: If `self` does not represent a shape with the given `rank`." +4348,with_rank_at_least,tensorflow/tensorflow/python/framework/tensor_shape.py,1036,method,"Returns a shape based on `self` with at least the given rank. + +Args: + rank: An integer. + +Returns: + A shape that is at least as specific as `self` with at least the given + rank. + +Raises: + ValueError: If `self` does not represent a shape with at least the given + `rank`." +4349,with_rank_at_most,tensorflow/tensorflow/python/framework/tensor_shape.py,1055,method,"Returns a shape based on `self` with at most the given rank. + +Args: + rank: An integer. + +Returns: + A shape that is at least as specific as `self` with at most the given + rank. + +Raises: + ValueError: If `self` does not represent a shape with at most the given + `rank`." +4350,is_compatible_with,tensorflow/tensorflow/python/framework/tensor_shape.py,1074,method,"Returns True iff `self` is compatible with `other`. + +Two possibly-partially-defined shapes are compatible if there +exists a fully-defined shape that both shapes can represent. Thus, +compatibility allows the shape inference code to reason about +partially-defined shapes. For example: + +* TensorShape(None) is compatible with all shapes. + +* TensorShape([None, None]) is compatible with all two-dimensional + shapes, such as TensorShape([32, 784]), and also TensorShape(None). It is + not compatible with, for example, TensorShape([None]) or + TensorShape([None, None, None]). + +* TensorShape([32, None]) is compatible with all two-dimensional shapes + with size 32 in the 0th dimension, and also TensorShape([None, None]) + and TensorShape(None). It is not compatible with, for example, + TensorShape([32]), TensorShape([32, None, 1]) or TensorShape([64, None]). + +* TensorShape([32, 784]) is compatible with itself, and also + TensorShape([32, None]), TensorShape([None, 784]), TensorShape([None, + None]) and TensorShape(None). It is not compatible with, for example, + TensorShape([32, 1, 784]) or TensorShape([None]). + +The compatibility relation is reflexive and symmetric, but not +transitive. For example, TensorShape([32, 784]) is compatible with +TensorShape(None), and TensorShape(None) is compatible with +TensorShape([4, 4]), but TensorShape([32, 784]) is not compatible with +TensorShape([4, 4]). + +Args: + other: Another TensorShape. + +Returns: + True iff `self` is compatible with `other`." +4351,assert_is_compatible_with,tensorflow/tensorflow/python/framework/tensor_shape.py,1121,method,"Raises exception if `self` and `other` do not represent the same shape. + +This method can be used to assert that there exists a shape that both +`self` and `other` represent. + +Args: + other: Another TensorShape. + +Raises: + ValueError: If `self` and `other` do not represent the same shape." +4352,most_specific_compatible_shape,tensorflow/tensorflow/python/framework/tensor_shape.py,1136,method,"Returns the most specific TensorShape compatible with `self` and `other`. + +* TensorShape([None, 1]) is the most specific TensorShape compatible with + both TensorShape([2, 1]) and TensorShape([5, 1]). Note that + TensorShape(None) is also compatible with above mentioned TensorShapes. + +* TensorShape([1, 2, 3]) is the most specific TensorShape compatible with + both TensorShape([1, 2, 3]) and TensorShape([1, 2, 3]). There are more + less specific TensorShapes compatible with above mentioned TensorShapes, + e.g. TensorShape([1, 2, None]), TensorShape(None). + +Args: + other: Another `TensorShape`. + +Returns: + A `TensorShape` which is the most specific compatible shape of `self` + and `other`." +4353,is_fully_defined,tensorflow/tensorflow/python/framework/tensor_shape.py,1166,method,Returns True iff `self` is fully defined in every dimension. +4354,assert_is_fully_defined,tensorflow/tensorflow/python/framework/tensor_shape.py,1171,method,"Raises an exception if `self` is not fully defined in every dimension. + +Raises: + ValueError: If `self` does not have a known value for every dimension." +4355,as_list,tensorflow/tensorflow/python/framework/tensor_shape.py,1180,method,"Returns a list of integers or `None` for each dimension. + +Returns: + A list of integers or `None` for each dimension. + +Raises: + ValueError: If `self` is an unknown shape with an unknown rank." +4356,as_proto,tensorflow/tensorflow/python/framework/tensor_shape.py,1193,method,Returns this shape as a `TensorShapeProto`. +4357,as_shape,tensorflow/tensorflow/python/framework/tensor_shape.py,1230,function,Converts the given object to a TensorShape. +4358,unknown_shape,tensorflow/tensorflow/python/framework/tensor_shape.py,1238,function,"Returns an unknown TensorShape, optionally with a known rank. Args: rank: (Optional) If specified, the number of dimensions in the shape. @@ -26162,15 +31692,29 @@ Returns: Raises: TypeError: In case of invalid arguments." -4271,DimensionDivTest,tensorflow/tensorflow/python/framework/tensor_shape_div_test.py,28,class, -4272,DimensionTest,tensorflow/tensorflow/python/framework/tensor_shape_test.py,30,class, -4273,ShapeTest,tensorflow/tensorflow/python/framework/tensor_shape_test.py,232,class, -4274,DenseSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,32,class,"Describes a dense object with shape, dtype, and name." -4275,TensorSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,121,class,"Describes a tf.Tensor. +4359,DenseSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,32,class,"Describes a dense object with shape, dtype, and name." +4360,from_spec,tensorflow/tensorflow/python/framework/tensor_spec.py,60,method, +4361,shape,tensorflow/tensorflow/python/framework/tensor_spec.py,64,method,Returns the `TensorShape` that represents the shape of the tensor. +4362,dtype,tensorflow/tensorflow/python/framework/tensor_spec.py,69,method,Returns the `dtype` of elements in the tensor. +4363,name,tensorflow/tensorflow/python/framework/tensor_spec.py,74,method,Returns the (optionally provided) name of the described tensor. +4364,is_compatible_with,tensorflow/tensorflow/python/framework/tensor_spec.py,78,method, +4365,most_specific_compatible_type,tensorflow/tensorflow/python/framework/tensor_spec.py,100,method, +4366,TensorSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,121,class,"Describes a tf.Tensor. Metadata for describing the `tf.Tensor` objects accepted or returned by some TensorFlow APIs." -4276,BoundedTensorSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,197,class,"A `TensorSpec` that specifies minimum and maximum values. +4367,is_compatible_with,tensorflow/tensorflow/python/framework/tensor_spec.py,130,method,"Returns True if spec_or_tensor is compatible with this TensorSpec. + +Two tensors are considered compatible if they have the same dtype +and their shapes are compatible (see `tf.TensorShape.is_compatible_with`). + +Args: + spec_or_tensor: A tf.TensorSpec or a tf.Tensor + +Returns: + True if spec_or_tensor is compatible with self." +4368,from_tensor,tensorflow/tensorflow/python/framework/tensor_spec.py,145,method, +4369,BoundedTensorSpec,tensorflow/tensorflow/python/framework/tensor_spec.py,197,class,"A `TensorSpec` that specifies minimum and maximum values. Example usage: ```python @@ -26185,43 +31729,35 @@ with values in the set {0, 1, 2}: ```python spec = tensor_spec.BoundedTensorSpec((3, 5), tf.int32, 0, 2) ```" -4277,TensorSpecTest,tensorflow/tensorflow/python/framework/tensor_spec_test.py,36,class, -4278,BoundedTensorSpecTest,tensorflow/tensorflow/python/framework/tensor_spec_test.py,172,class, -4279,ExtractBitsFromFloat16,tensorflow/tensorflow/python/framework/tensor_util.py,46,function, -4280,SlowAppendFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,50,function, -4281,_MediumAppendFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,55,function, -4282,ExtractBitsFromBFloat16,tensorflow/tensorflow/python/framework/tensor_util.py,62,function, -4283,SlowAppendBFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,67,function, -4284,FastAppendBFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,72,function, -4285,SlowAppendFloat32ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,126,function, -4286,SlowAppendFloat64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,129,function, -4287,SlowAppendIntArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,132,function, -4288,SlowAppendInt64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,135,function, -4289,SlowAppendQIntArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,138,function, -4290,SlowAppendUInt32ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,141,function, -4291,SlowAppendUInt64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,144,function, -4292,SlowAppendComplex64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,147,function, -4293,SlowAppendComplex128ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,151,function, -4294,SlowAppendObjectArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,155,function, -4295,SlowAppendBoolArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,158,function, -4296,GetFromNumpyDTypeDict,tensorflow/tensorflow/python/framework/tensor_util.py,187,function, -4297,GetNumpyAppendFn,tensorflow/tensorflow/python/framework/tensor_util.py,195,function, -4298,TensorShapeProtoToList,tensorflow/tensorflow/python/framework/tensor_util.py,208,function,"Convert a TensorShape to a list. +4370,from_spec,tensorflow/tensorflow/python/framework/tensor_spec.py,265,method, +4371,minimum,tensorflow/tensorflow/python/framework/tensor_spec.py,272,method,Returns a NumPy array specifying the minimum bounds (inclusive). +4372,maximum,tensorflow/tensorflow/python/framework/tensor_spec.py,277,method,Returns a NumPy array specifying the maximum bounds (inclusive). +4373,ExtractBitsFromFloat16,tensorflow/tensorflow/python/framework/tensor_util.py,46,function, +4374,SlowAppendFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,50,function, +4375,ExtractBitsFromBFloat16,tensorflow/tensorflow/python/framework/tensor_util.py,62,function, +4376,SlowAppendBFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,67,function, +4377,FastAppendBFloat16ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,72,function, +4378,SlowAppendFloat32ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,126,function, +4379,SlowAppendFloat64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,129,function, +4380,SlowAppendIntArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,132,function, +4381,SlowAppendInt64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,135,function, +4382,SlowAppendQIntArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,138,function, +4383,SlowAppendUInt32ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,141,function, +4384,SlowAppendUInt64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,144,function, +4385,SlowAppendComplex64ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,147,function, +4386,SlowAppendComplex128ArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,151,function, +4387,SlowAppendObjectArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,155,function, +4388,SlowAppendBoolArrayToTensorProto,tensorflow/tensorflow/python/framework/tensor_util.py,158,function, +4389,GetFromNumpyDTypeDict,tensorflow/tensorflow/python/framework/tensor_util.py,187,function, +4390,GetNumpyAppendFn,tensorflow/tensorflow/python/framework/tensor_util.py,195,function, +4391,TensorShapeProtoToList,tensorflow/tensorflow/python/framework/tensor_util.py,208,function,"Convert a TensorShape to a list. Args: shape: A TensorShapeProto. Returns: List of integers representing the dimensions of the tensor." -4299,_GetDenseDimensions,tensorflow/tensorflow/python/framework/tensor_util.py,220,function,Returns the inferred dense dimensions of a list of lists. -4300,_FlattenToStrings,tensorflow/tensorflow/python/framework/tensor_util.py,230,function, -4301,_check_failed,tensorflow/tensorflow/python/framework/tensor_util.py,247,function, -4302,_check_quantized,tensorflow/tensorflow/python/framework/tensor_util.py,253,function, -4303,_generate_isinstance_check,tensorflow/tensorflow/python/framework/tensor_util.py,263,function, -4304,_check_not_tensor,tensorflow/tensorflow/python/framework/tensor_util.py,281,function, -4305,_AssertCompatible,tensorflow/tensorflow/python/framework/tensor_util.py,310,function, -4306,_is_array_like,tensorflow/tensorflow/python/framework/tensor_util.py,340,function,Check if a given object is array-like. -4307,make_tensor_proto,tensorflow/tensorflow/python/framework/tensor_util.py,362,function,"Create a TensorProto. +4392,make_tensor_proto,tensorflow/tensorflow/python/framework/tensor_util.py,362,function,"Create a TensorProto. In TensorFlow 2.0, representing tensors as protos should no longer be a common workflow. That said, this utility function is still useful for @@ -26275,7 +31811,7 @@ Raises: TypeError: if unsupported types are provided. ValueError: if arguments have inappropriate values or if verify_shape is True and shape of values is not equals to a shape from the argument." -4308,MakeNdarray,tensorflow/tensorflow/python/framework/tensor_util.py,571,function,"Create a numpy ndarray from a tensor. +4393,MakeNdarray,tensorflow/tensorflow/python/framework/tensor_util.py,571,function,"Create a numpy ndarray from a tensor. Create a numpy ndarray with the same shape and data as the tensor. @@ -26298,7 +31834,7 @@ Returns: Raises: TypeError: if tensor has unsupported type." -4309,ShapeEquals,tensorflow/tensorflow/python/framework/tensor_util.py,651,function,"Returns True if ""tensor_proto"" has the given ""shape"". +4394,ShapeEquals,tensorflow/tensorflow/python/framework/tensor_util.py,651,function,"Returns True if ""tensor_proto"" has the given ""shape"". Args: tensor_proto: A TensorProto. @@ -26310,8 +31846,7 @@ Returns: Raises: TypeError: If ""tensor_proto"" is not a TensorProto, or shape is not a TensorShape, list, or tuple." -4310,_ConstantValue,tensorflow/tensorflow/python/framework/tensor_util.py,675,function, -4311,constant_value,tensorflow/tensorflow/python/framework/tensor_util.py,806,function,"Returns the constant value of the given tensor, if efficiently calculable. +4395,constant_value,tensorflow/tensorflow/python/framework/tensor_util.py,806,function,"Returns the constant value of the given tensor, if efficiently calculable. This function attempts to partially evaluate the given tensor, and returns its value as a numpy ndarray if this succeeds. @@ -26332,7 +31867,7 @@ Returns: Raises: TypeError: if tensor is not an ops.Tensor." -4312,constant_value_as_shape,tensorflow/tensorflow/python/framework/tensor_util.py,848,function,"A version of `constant_value()` that returns a `TensorShape`. +4396,constant_value_as_shape,tensorflow/tensorflow/python/framework/tensor_util.py,848,function,"A version of `constant_value()` that returns a `TensorShape`. This version should be used when a constant tensor value is interpreted as a (possibly partial) shape, e.g. in the shape @@ -26349,7 +31884,7 @@ Returns: Raises: ValueError: If the shape is rank-0 and is not statically known to be -1." -4313,is_tensor,tensorflow/tensorflow/python/framework/tensor_util.py,993,function,"Checks whether `x` is a TF-native type that can be passed to many TF ops. +4397,is_tensor,tensorflow/tensorflow/python/framework/tensor_util.py,993,function,"Checks whether `x` is a TF-native type that can be passed to many TF ops. Use is_tensor to differentiate types that can ingested by TensorFlow ops without any conversion (e.g., `tf.Tensor`, `tf.SparseTensor`, and @@ -26372,8 +31907,8 @@ Args: Returns: `True` if `x` is a tensor or ""tensor-like"", `False` if not." -4314,shape_tensor,tensorflow/tensorflow/python/framework/tensor_util.py,1023,function,"Convert to an int32 or int64 tensor, defaulting to int32 if empty." -4315,maybe_set_static_shape,tensorflow/tensorflow/python/framework/tensor_util.py,1042,function,"Sets the shape of `tensor` to the `shape`'s constant value, if inferrable. +4398,shape_tensor,tensorflow/tensorflow/python/framework/tensor_util.py,1023,function,"Convert to an int32 or int64 tensor, defaulting to int32 if empty." +4399,maybe_set_static_shape,tensorflow/tensorflow/python/framework/tensor_util.py,1042,function,"Sets the shape of `tensor` to the `shape`'s constant value, if inferrable. This is a temporary workaround to fix shape inference across functional op boundaries. E.g. @@ -26398,26 +31933,24 @@ A longer term solution would be to fix C++ shape inference. Args: tensor: A tensor. shape: A shape tensor." -4316,TensorUtilTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,43,class, -4317,IsTensorTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,775,class, -4318,ConstantValueTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,808,class, -4319,ConstantValueAsShapeTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,1041,class, -4320,MaybeSetStaticShapeTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,1182,class, -4321,ShapeTensorTest,tensorflow/tensorflow/python/framework/tensor_util_test.py,1228,class, -4322,TestCombination,tensorflow/tensorflow/python/framework/test_combinations.py,62,class,"Customize the behavior of `generate()` and the tests that it executes. +4400,ParameterModifier,tensorflow/tensorflow/python/framework/test_combinations.py,115,class,Customizes the behavior of a particular parameter. +4401,modified_arguments,tensorflow/tensorflow/python/framework/test_combinations.py,133,method,"Replace user-provided arguments before they are passed to a test. -Here is sequence of steps for executing a test combination: - 1. The test combination is evaluated for whether it should be executed in - the given environment by calling `should_execute_combination`. - 2. If the test combination is going to be executed, then the arguments for - all combined parameters are validated. Some arguments can be handled in - a special way. This is achieved by implementing that logic in - `ParameterModifier` instances that returned from `parameter_modifiers`. - 3. Before executing the test, `context_managers` are installed - around it." -4323,ParameterModifier,tensorflow/tensorflow/python/framework/test_combinations.py,115,class,Customizes the behavior of a particular parameter. -4324,OptionalParameter,tensorflow/tensorflow/python/framework/test_combinations.py,172,class,A parameter that is optional in `combine()` and in the test signature. -4325,generate,tensorflow/tensorflow/python/framework/test_combinations.py,182,function,"A decorator for generating combinations of a test method or a test class. +This makes it possible to adjust user-provided arguments before passing +them to the test method. + +Arguments: + kwargs: The combined arguments for the test. + requested_parameters: The set of parameters that are defined in the + signature of the test method. + +Returns: + A dictionary with updates to `kwargs`. Keys with values set to + `ParameterModifier.DO_NOT_PASS_TO_THE_TEST` are going to be deleted and + not passed to the test." +4402,OptionalParameter,tensorflow/tensorflow/python/framework/test_combinations.py,172,class,A parameter that is optional in `combine()` and in the test signature. +4403,modified_arguments,tensorflow/tensorflow/python/framework/test_combinations.py,175,method, +4404,generate,tensorflow/tensorflow/python/framework/test_combinations.py,182,function,"A decorator for generating combinations of a test method or a test class. Parameters of the test method must match by name to get the corresponding value of the combination. Tests must accept all parameters that are passed @@ -26434,8 +31967,7 @@ Returns: Raises: ValueError: if any parameters were not accepted by the test method" -4326,_augment_with_special_arguments,tensorflow/tensorflow/python/framework/test_combinations.py,246,function, -4327,combine,tensorflow/tensorflow/python/framework/test_combinations.py,319,function,"Generate combinations based on its keyword arguments. +4405,combine,tensorflow/tensorflow/python/framework/test_combinations.py,319,function,"Generate combinations based on its keyword arguments. Two sets of returned combinations can be concatenated using +. Their product can be computed using `times()`. @@ -26448,7 +31980,7 @@ Returns: a list of dictionaries for each combination. Keys in the dictionaries are the keyword argument names. Each key has one value - one of the corresponding keyword argument values." -4328,times,tensorflow/tensorflow/python/framework/test_combinations.py,356,function,"Generate a product of N sets of combinations. +4406,times,tensorflow/tensorflow/python/framework/test_combinations.py,356,function,"Generate a product of N sets of combinations. times(combine(a=[1,2]), combine(b=[3,4])) == combine(a=[1,2], b=[3,4]) @@ -26460,16 +31992,12 @@ Returns: Raises: ValueError: if some of the inputs have overlapping keys." -4329,NamedObject,tensorflow/tensorflow/python/framework/test_combinations.py,389,class,A class that translates an object into a good test name. -4330,_get_name,tensorflow/tensorflow/python/framework/test_combinations.py,410,function, -4331,TestingCombinationsTest,tensorflow/tensorflow/python/framework/test_combinations_test.py,29,class, -4332,CombineTheTestSuite,tensorflow/tensorflow/python/framework/test_combinations_test.py,133,class, -4333,is_xla_enabled,tensorflow/tensorflow/python/framework/test_util.py,93,function, -4334,is_mlir_bridge_enabled,tensorflow/tensorflow/python/framework/test_util.py,104,function, -4335,is_tfrt_enabled,tensorflow/tensorflow/python/framework/test_util.py,115,function, -4336,_get_object_count_by_type,tensorflow/tensorflow/python/framework/test_util.py,125,function, -4337,gpu_device_name,tensorflow/tensorflow/python/framework/test_util.py,129,function,Returns the name of a GPU device if available or the empty string. -4338,assert_ops_in_graph,tensorflow/tensorflow/python/framework/test_util.py,137,function,"Assert all expected operations are found. +4407,NamedObject,tensorflow/tensorflow/python/framework/test_combinations.py,389,class,A class that translates an object into a good test name. +4408,is_xla_enabled,tensorflow/tensorflow/python/framework/test_util.py,93,function, +4409,is_mlir_bridge_enabled,tensorflow/tensorflow/python/framework/test_util.py,104,function, +4410,is_tfrt_enabled,tensorflow/tensorflow/python/framework/test_util.py,115,function, +4411,gpu_device_name,tensorflow/tensorflow/python/framework/test_util.py,129,function,Returns the name of a GPU device if available or the empty string. +4412,assert_ops_in_graph,tensorflow/tensorflow/python/framework/test_util.py,137,function,"Assert all expected operations are found. Args: expected_ops: `dict` of op name to op type. @@ -26480,7 +32008,7 @@ Returns: Raises: ValueError: If the expected ops are not present in the graph." -4339,assert_equal_graph_def_v2,tensorflow/tensorflow/python/framework/test_util.py,165,function,"Asserts that two `GraphDef`s are (mostly) the same. +4413,assert_equal_graph_def_v2,tensorflow/tensorflow/python/framework/test_util.py,165,function,"Asserts that two `GraphDef`s are (mostly) the same. Compares two `GraphDef` protos for equality, ignoring versions and ordering of nodes, attrs, and control inputs. Node names are used to match up nodes @@ -26494,7 +32022,7 @@ Args: Raises: AssertionError: If the `GraphDef`s do not match. TypeError: If either argument is not a `GraphDef`." -4340,assert_equal_graph_def_v1,tensorflow/tensorflow/python/framework/test_util.py,186,function,"Asserts that two `GraphDef`s are (mostly) the same. +4414,assert_equal_graph_def_v1,tensorflow/tensorflow/python/framework/test_util.py,186,function,"Asserts that two `GraphDef`s are (mostly) the same. Compares two `GraphDef` protos for equality, ignoring versions and ordering of nodes, attrs, and control inputs. Node names are used to match up nodes @@ -26511,25 +32039,23 @@ Args: Raises: AssertionError: If the `GraphDef`s do not match. TypeError: If either argument is not a `GraphDef`." -4341,assert_equal_graph_def,tensorflow/tensorflow/python/framework/test_util.py,210,function, -4342,assert_meta_graph_protos_equal,tensorflow/tensorflow/python/framework/test_util.py,233,function,Compares MetaGraphDefs `a` and `b` in unit test class `tester`. -4343,_strip_checkpoint_v2_randomized,tensorflow/tensorflow/python/framework/test_util.py,277,function, -4344,_strip_hash_table_shared_name,tensorflow/tensorflow/python/framework/test_util.py,294,function, -4345,IsGoogleCudaEnabled,tensorflow/tensorflow/python/framework/test_util.py,304,function, -4346,IsBuiltWithROCm,tensorflow/tensorflow/python/framework/test_util.py,308,function, -4347,IsBuiltWithXLA,tensorflow/tensorflow/python/framework/test_util.py,312,function, -4348,IsBuiltWithNvcc,tensorflow/tensorflow/python/framework/test_util.py,316,function, -4349,GpuSupportsHalfMatMulAndConv,tensorflow/tensorflow/python/framework/test_util.py,320,function, -4350,IsMklEnabled,tensorflow/tensorflow/python/framework/test_util.py,324,function, -4351,InstallStackTraceHandler,tensorflow/tensorflow/python/framework/test_util.py,328,function, -4352,NHWCToNCHW,tensorflow/tensorflow/python/framework/test_util.py,332,function,"Converts the input from the NHWC format to NCHW. +4415,assert_equal_graph_def,tensorflow/tensorflow/python/framework/test_util.py,210,function, +4416,assert_meta_graph_protos_equal,tensorflow/tensorflow/python/framework/test_util.py,233,function,Compares MetaGraphDefs `a` and `b` in unit test class `tester`. +4417,IsGoogleCudaEnabled,tensorflow/tensorflow/python/framework/test_util.py,304,function, +4418,IsBuiltWithROCm,tensorflow/tensorflow/python/framework/test_util.py,308,function, +4419,IsBuiltWithXLA,tensorflow/tensorflow/python/framework/test_util.py,312,function, +4420,IsBuiltWithNvcc,tensorflow/tensorflow/python/framework/test_util.py,316,function, +4421,GpuSupportsHalfMatMulAndConv,tensorflow/tensorflow/python/framework/test_util.py,320,function, +4422,IsMklEnabled,tensorflow/tensorflow/python/framework/test_util.py,324,function, +4423,InstallStackTraceHandler,tensorflow/tensorflow/python/framework/test_util.py,328,function, +4424,NHWCToNCHW,tensorflow/tensorflow/python/framework/test_util.py,332,function,"Converts the input from the NHWC format to NCHW. Args: input_tensor: a 4- or 5-D tensor, or an array representing shape Returns: converted tensor or shape array" -4353,NHWCToNCHW_VECT_C,tensorflow/tensorflow/python/framework/test_util.py,351,function,"Transforms the input from the NHWC layout to NCHW_VECT_C layout. +4425,NHWCToNCHW_VECT_C,tensorflow/tensorflow/python/framework/test_util.py,351,function,"Transforms the input from the NHWC layout to NCHW_VECT_C layout. Note: Does not include quantization or type conversion steps, which should be applied afterwards. @@ -26543,7 +32069,7 @@ Returns: Raises: ValueError: if last dimension of `input_shape_or_tensor` is not evenly divisible by 4." -4354,NCHW_VECT_CToNHWC,tensorflow/tensorflow/python/framework/test_util.py,386,function,"Transforms the input from the NCHW_VECT_C layout to NHWC layout. +4426,NCHW_VECT_CToNHWC,tensorflow/tensorflow/python/framework/test_util.py,386,function,"Transforms the input from the NCHW_VECT_C layout to NHWC layout. Note: Does not include de-quantization or type conversion steps, which should be applied beforehand. @@ -26556,14 +32082,14 @@ Returns: Raises: ValueError: if last dimension of `input_shape_or_tensor` is not 4." -4355,NCHWToNHWC,tensorflow/tensorflow/python/framework/test_util.py,418,function,"Converts the input from the NCHW format to NHWC. +4427,NCHWToNHWC,tensorflow/tensorflow/python/framework/test_util.py,418,function,"Converts the input from the NCHW format to NHWC. Args: input_tensor: a 4- or 5-D tensor, or an array representing shape Returns: converted tensor or shape array" -4356,skip_if,tensorflow/tensorflow/python/framework/test_util.py,437,function,"Skips the decorated function if condition is or evaluates to True. +4428,skip_if,tensorflow/tensorflow/python/framework/test_util.py,437,function,"Skips the decorated function if condition is or evaluates to True. Args: condition: Either an expression that can be used in ""if not condition"" @@ -26571,7 +32097,7 @@ Args: Returns: The wrapped function" -4357,skip_if_error,tensorflow/tensorflow/python/framework/test_util.py,464,function,"Context manager to skip cases not considered failures by the tests. +4429,skip_if_error,tensorflow/tensorflow/python/framework/test_util.py,464,function,"Context manager to skip cases not considered failures by the tests. Note that this does not work if used in setUpClass/tearDownClass. Usage in setUp/tearDown works fine just like regular test methods. @@ -26589,9 +32115,9 @@ Args: Yields: Nothing." -4358,enable_c_shapes,tensorflow/tensorflow/python/framework/test_util.py,495,function,No-op. TODO(b/74620627): Remove this. -4359,with_c_shapes,tensorflow/tensorflow/python/framework/test_util.py,500,function,No-op. TODO(b/74620627): Remove this. -4360,enable_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,505,function,"Decorator for enabling CondV2 and WhileV2 on a test. +4430,enable_c_shapes,tensorflow/tensorflow/python/framework/test_util.py,495,function,No-op. TODO(b/74620627): Remove this. +4431,with_c_shapes,tensorflow/tensorflow/python/framework/test_util.py,500,function,No-op. TODO(b/74620627): Remove this. +4432,enable_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,505,function,"Decorator for enabling CondV2 and WhileV2 on a test. Note this enables using CondV2 and WhileV2 after running the test class's setup/teardown methods. @@ -26604,7 +32130,7 @@ Args: Returns: The wrapped function" -4361,with_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,532,function,"Adds methods that call original methods with WhileV2 and CondV2 enabled. +4433,with_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,532,function,"Adds methods that call original methods with WhileV2 and CondV2 enabled. Note this enables CondV2 and WhileV2 in new methods after running the test class's setup method. @@ -26646,7 +32172,7 @@ Args: Returns: cls with new test methods added" -4362,disable_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,587,function,"Decorator for a function in a with_control_flow_v2 enabled test class. +4434,disable_control_flow_v2,tensorflow/tensorflow/python/framework/test_util.py,587,function,"Decorator for a function in a with_control_flow_v2 enabled test class. Blocks the function from being run with v2 control flow ops. @@ -26655,14 +32181,14 @@ Args: Returns: The wrapped function with _disable_control_flow_v2 attr set to True." -4363,enable_output_all_intermediates,tensorflow/tensorflow/python/framework/test_util.py,606,function,"Force-enable outputing all intermediates from functional control flow ops. +4435,enable_output_all_intermediates,tensorflow/tensorflow/python/framework/test_util.py,606,function,"Force-enable outputing all intermediates from functional control flow ops. Args: fn: the function to be wrapped Returns: The wrapped function" -4364,assert_no_new_pyobjects_executing_eagerly,tensorflow/tensorflow/python/framework/test_util.py,629,function,"Decorator for asserting that no new Python objects persist after a test. +4436,assert_no_new_pyobjects_executing_eagerly,tensorflow/tensorflow/python/framework/test_util.py,629,function,"Decorator for asserting that no new Python objects persist after a test. Runs the test multiple times executing eagerly, first as a warmup and then to let objects accumulate. The warmup helps ignore caches which do not grow as @@ -26677,7 +32203,7 @@ Args: Returns: The wrapped function performing the test." -4365,assert_no_new_tensors,tensorflow/tensorflow/python/framework/test_util.py,712,function,"Decorator for asserting that no new Tensors persist after a test. +4437,assert_no_new_tensors,tensorflow/tensorflow/python/framework/test_util.py,712,function,"Decorator for asserting that no new Tensors persist after a test. Mainly useful for checking that code using the Python C API has correctly manipulated reference counts. @@ -26693,8 +32219,7 @@ Args: Returns: The decorated test case." -4366,_find_reference_cycle,tensorflow/tensorflow/python/framework/test_util.py,774,function, -4367,assert_no_garbage_created,tensorflow/tensorflow/python/framework/test_util.py,877,function,"Test method decorator to assert that no garbage has been created. +4438,assert_no_garbage_created,tensorflow/tensorflow/python/framework/test_util.py,877,function,"Test method decorator to assert that no garbage has been created. Note that this decorator sets DEBUG_SAVEALL, which in some Python interpreters cannot be un-set (i.e. will disable garbage collection for any other unit @@ -26705,35 +32230,8 @@ Args: Returns: The decorated function." -4368,_combine_named_parameters,tensorflow/tensorflow/python/framework/test_util.py,952,function,"Generate combinations based on its keyword arguments. - -Two sets of returned combinations can be concatenated using +. Their product -can be computed using `times()`. - -Args: - **kwargs: keyword arguments of form `option=[possibilities, ...]` or - `option=the_only_possibility`. - -Returns: - a list of dictionaries for each combination. Keys in the dictionaries are - the keyword argument names. Each key has one value - one of the - corresponding keyword argument values." -4369,generate_combinations_with_testcase_name,tensorflow/tensorflow/python/framework/test_util.py,977,function,"Generate combinations based on its keyword arguments using combine(). - -This function calls combine() and appends a testcase name to the list of -dictionaries returned. The 'testcase_name' key is a required for named -parameterized tests. - -Args: - **kwargs: keyword arguments of form `option=[possibilities, ...]` or - `option=the_only_possibility`. - -Returns: - a list of dictionaries for each combination. Keys in the dictionaries are - the keyword argument names. Each key has one value - one of the - corresponding keyword argument values." -4370,run_all_in_graph_and_eager_modes,tensorflow/tensorflow/python/framework/test_util.py,1010,function,Execute all test methods in the given class with and without eager. -4371,build_as_function_and_v1_graph,tensorflow/tensorflow/python/framework/test_util.py,1025,function,"Run a test case in v1 graph mode and inside tf.function in eager mode. +4439,run_all_in_graph_and_eager_modes,tensorflow/tensorflow/python/framework/test_util.py,1010,function,Execute all test methods in the given class with and without eager. +4440,build_as_function_and_v1_graph,tensorflow/tensorflow/python/framework/test_util.py,1025,function,"Run a test case in v1 graph mode and inside tf.function in eager mode. WARNING: This decorator can only be used in test cases that statically checks generated graph. Attempting to evaluate graph or function results via. @@ -26747,9 +32245,9 @@ Args: Returns: Decorated test case function." -4372,run_in_async_and_sync_mode,tensorflow/tensorflow/python/framework/test_util.py,1077,function,Execute the test in async mode and sync mode. -4373,eager_lazy_remote_copy_on_and_off,tensorflow/tensorflow/python/framework/test_util.py,1092,function,Execute the test method w/o lazy tensor copy for function remote inputs. -4374,run_in_graph_and_eager_modes,tensorflow/tensorflow/python/framework/test_util.py,1107,function,"Execute the decorated test with and without enabling eager execution. +4441,run_in_async_and_sync_mode,tensorflow/tensorflow/python/framework/test_util.py,1077,function,Execute the test in async mode and sync mode. +4442,eager_lazy_remote_copy_on_and_off,tensorflow/tensorflow/python/framework/test_util.py,1092,function,Execute the test method w/o lazy tensor copy for function remote inputs. +4443,run_in_graph_and_eager_modes,tensorflow/tensorflow/python/framework/test_util.py,1107,function,"Execute the decorated test with and without enabling eager execution. This function returns a decorator intended to be applied to test methods in a `tf.test.TestCase` class. Doing so will cause the contents of the test @@ -26804,8 +32302,8 @@ Returns: Returns a decorator that will run the decorated test method twice: once by constructing and executing a graph in a session and once with eager execution enabled." -4375,py_func_if_in_function,tensorflow/tensorflow/python/framework/test_util.py,1214,function, -4376,also_run_as_tf_function,tensorflow/tensorflow/python/framework/test_util.py,1238,function,"Runs the decorated test twice--once as is, once inside a tf.function. +4444,py_func_if_in_function,tensorflow/tensorflow/python/framework/test_util.py,1214,function, +4445,also_run_as_tf_function,tensorflow/tensorflow/python/framework/test_util.py,1238,function,"Runs the decorated test twice--once as is, once inside a tf.function. This allows you to run a test both in eager execution and inside a tf.function, exercising the two execution modes supported in tf 2.0. The test @@ -26822,7 +32320,7 @@ Args: Returns: The decorated test method, which will run both in eager and inside a tf.function." -4377,deprecated_graph_mode_only,tensorflow/tensorflow/python/framework/test_util.py,1273,function,"Execute the decorated test in graph mode. +4446,deprecated_graph_mode_only,tensorflow/tensorflow/python/framework/test_util.py,1273,function,"Execute the decorated test in graph mode. This function returns a decorator intended to be applied to tests that are not compatible with eager mode. When this decorator is applied, the test body will @@ -26840,8 +32338,8 @@ Args: Returns: Returns a decorator that will run the decorated test method in graph mode." -4378,run_all_in_deprecated_graph_mode_only,tensorflow/tensorflow/python/framework/test_util.py,1325,function,Execute all tests in a class in graph mode. -4379,run_v1_only,tensorflow/tensorflow/python/framework/test_util.py,1338,function,"Execute the decorated test only if running in v1 mode. +4447,run_all_in_deprecated_graph_mode_only,tensorflow/tensorflow/python/framework/test_util.py,1325,function,Execute all tests in a class in graph mode. +4448,run_v1_only,tensorflow/tensorflow/python/framework/test_util.py,1338,function,"Execute the decorated test only if running in v1 mode. This function is intended to be applied to tests that exercise v1 only functionality. If the test is run in v2 mode it will simply be skipped. @@ -26858,7 +32356,7 @@ Args: Returns: Returns a decorator that will conditionally skip the decorated test method." -4380,run_v2_only,tensorflow/tensorflow/python/framework/test_util.py,1391,function,"Execute the decorated test only if running in v2 mode. +4449,run_v2_only,tensorflow/tensorflow/python/framework/test_util.py,1391,function,"Execute the decorated test only if running in v2 mode. This function is intended to be applied to tests that exercise v2 only functionality. If the test is run in v1 mode it will simply be skipped. @@ -26874,7 +32372,7 @@ Args: Returns: Returns a decorator that will conditionally skip the decorated test method." -4381,run_gpu_only,tensorflow/tensorflow/python/framework/test_util.py,1428,function,"Execute the decorated test only if a GPU is available. +4450,run_gpu_only,tensorflow/tensorflow/python/framework/test_util.py,1428,function,"Execute the decorated test only if a GPU is available. This function is intended to be applied to tests that require the presence of a GPU. If a GPU is absent, it will simply be skipped. @@ -26886,7 +32384,7 @@ Args: Returns: Returns a decorator that will conditionally skip the decorated test method." -4382,run_cuda_only,tensorflow/tensorflow/python/framework/test_util.py,1461,function,"Execute the decorated test only if a GPU is available. +4451,run_cuda_only,tensorflow/tensorflow/python/framework/test_util.py,1461,function,"Execute the decorated test only if a GPU is available. This function is intended to be applied to tests that require the presence of a CUDA GPU. If a CUDA GPU is absent, it will simply be skipped. @@ -26898,7 +32396,7 @@ Args: Returns: Returns a decorator that will conditionally skip the decorated test method." -4383,with_forward_compatibility_horizons,tensorflow/tensorflow/python/framework/test_util.py,1494,function,"Executes the decorated test with the specified forward-compat horizons. +4452,with_forward_compatibility_horizons,tensorflow/tensorflow/python/framework/test_util.py,1494,function,"Executes the decorated test with the specified forward-compat horizons. Args: *horizons: A list of (year, month, day) tuples. If the list includes @@ -26907,7 +32405,7 @@ Args: Returns: A decorator that will execute the test with the specified horizons." -4384,is_gpu_available,tensorflow/tensorflow/python/framework/test_util.py,1532,function,"Returns whether TensorFlow can access a GPU. +4453,is_gpu_available,tensorflow/tensorflow/python/framework/test_util.py,1532,function,"Returns whether TensorFlow can access a GPU. Warning: if a non-GPU version of the package is installed, the function would also return False. Use `tf.test.is_built_with_cuda` to validate if TensorFlow @@ -26935,12 +32433,13 @@ built with CUDA support or ROCm support. However no changes here because Returns: True if a GPU device of the requested kind is available." -4385,device,tensorflow/tensorflow/python/framework/test_util.py,1581,function,Uses gpu when requested and available. -4386,use_gpu,tensorflow/tensorflow/python/framework/test_util.py,1592,function,Uses gpu when requested and available. -4387,force_gpu,tensorflow/tensorflow/python/framework/test_util.py,1599,function,Force the gpu to be used. -4388,force_cpu,tensorflow/tensorflow/python/framework/test_util.py,1606,function,Force the cpu to be used. -4389,CapturedWrites,tensorflow/tensorflow/python/framework/test_util.py,1612,class,A utility class to load the captured writes made to a stream. -4390,FakeEagerSession,tensorflow/tensorflow/python/framework/test_util.py,1625,class,"Fake session so tests that conditionally use placeholders can use eager. +4454,device,tensorflow/tensorflow/python/framework/test_util.py,1581,function,Uses gpu when requested and available. +4455,use_gpu,tensorflow/tensorflow/python/framework/test_util.py,1592,function,Uses gpu when requested and available. +4456,force_gpu,tensorflow/tensorflow/python/framework/test_util.py,1599,function,Force the gpu to be used. +4457,force_cpu,tensorflow/tensorflow/python/framework/test_util.py,1606,function,Force the cpu to be used. +4458,CapturedWrites,tensorflow/tensorflow/python/framework/test_util.py,1612,class,A utility class to load the captured writes made to a stream. +4459,contents,tensorflow/tensorflow/python/framework/test_util.py,1618,method,Get the captured writes as a single string. +4460,FakeEagerSession,tensorflow/tensorflow/python/framework/test_util.py,1625,class,"Fake session so tests that conditionally use placeholders can use eager. There are a number of tests that conditionally use placeholders for shape inference. The pattern is demonstrated here: @@ -26961,8 +32460,23 @@ Since the feed_dict is empty when not using placeholders we should be able to call self.evaluate(), however this requires rewriting the test case. This class should be considered a stop-gap solution to get tests running with eager with minimal changes to the actual test." -4391,ErrorLoggingSession,tensorflow/tensorflow/python/framework/test_util.py,1682,class,Wrapper around a Session that logs errors in run(). -4392,disable_cudnn_autotune,tensorflow/tensorflow/python/framework/test_util.py,1697,function,"Disable autotuning during the call to this function. +4461,run,tensorflow/tensorflow/python/framework/test_util.py,1652,method,"Evaluate `fetches`. + +Fail if additional args are specified. + +Args: + fetches: A Tensor or a nested list/tuple of Tensors. + *args: Positional arguments + **kwargs: Keyword arguments + +Raises: + RuntimeError: If args or kwargs are specified. + +Returns: + Tensors as numpy values." +4462,ErrorLoggingSession,tensorflow/tensorflow/python/framework/test_util.py,1682,class,Wrapper around a Session that logs errors in run(). +4463,run,tensorflow/tensorflow/python/framework/test_util.py,1685,method, +4464,disable_cudnn_autotune,tensorflow/tensorflow/python/framework/test_util.py,1697,function,"Disable autotuning during the call to this function. Some tests want to base assertions on a graph being isomorphic with a copy. To ensure this, this decorator disables autotuning. @@ -26972,28 +32486,14 @@ Args: Returns: Decorated function." -4393,enable_tf_xla_constant_folding,tensorflow/tensorflow/python/framework/test_util.py,1743,function, -4394,_disable_test,tensorflow/tensorflow/python/framework/test_util.py,1781,function, -4395,disable_xla,tensorflow/tensorflow/python/framework/test_util.py,1802,function,Execute the test method only if xla is not enabled. -4396,disable_mlir_bridge,tensorflow/tensorflow/python/framework/test_util.py,1809,function,Execute the test method only if MLIR bridge is not enabled. -4397,disable_tfrt,tensorflow/tensorflow/python/framework/test_util.py,1816,function, -4398,for_all_test_methods,tensorflow/tensorflow/python/framework/test_util.py,1845,function,"Generate class-level decorator from given method-level decorator. - -It is expected for the given decorator to take some arguments and return -a method that is then called on the test method to produce a decorated -method. - -Args: - decorator: The decorator to apply. - *args: Positional arguments - **kwargs: Keyword arguments -Returns: Function that will decorate a given classes test methods with the - decorator." -4399,no_xla_auto_jit,tensorflow/tensorflow/python/framework/test_util.py,1873,function,This test is not intended to be run with XLA auto jit enabled. -4400,xla_allow_fallback,tensorflow/tensorflow/python/framework/test_util.py,1880,function, -4401,EagerSessionWarner,tensorflow/tensorflow/python/framework/test_util.py,1909,class, -4402,TensorFlowTestCase,tensorflow/tensorflow/python/framework/test_util.py,1922,class,Base class for tests that need to test TensorFlow. -4403,create_local_cluster,tensorflow/tensorflow/python/framework/test_util.py,3164,function,"Create and start local servers and return the associated `Server` objects. +4465,enable_tf_xla_constant_folding,tensorflow/tensorflow/python/framework/test_util.py,1743,function, +4466,disable_xla,tensorflow/tensorflow/python/framework/test_util.py,1802,function,Execute the test method only if xla is not enabled. +4467,disable_mlir_bridge,tensorflow/tensorflow/python/framework/test_util.py,1809,function,Execute the test method only if MLIR bridge is not enabled. +4468,disable_tfrt,tensorflow/tensorflow/python/framework/test_util.py,1816,function, +4469,no_xla_auto_jit,tensorflow/tensorflow/python/framework/test_util.py,1873,function,This test is not intended to be run with XLA auto jit enabled. +4470,xla_allow_fallback,tensorflow/tensorflow/python/framework/test_util.py,1880,function, +4471,EagerSessionWarner,tensorflow/tensorflow/python/framework/test_util.py,1909,class, +4472,create_local_cluster,tensorflow/tensorflow/python/framework/test_util.py,3164,function,"Create and start local servers and return the associated `Server` objects. ""PS"" stands for ""parameter server"": a task responsible for storing and updating the model's parameters. Other tasks send updates to these parameters @@ -27044,7 +32544,7 @@ Returns: Raises: ImportError: if portpicker module was not found at load time" -4404,get_node_def_from_graph,tensorflow/tensorflow/python/framework/test_util.py,3252,function,"Returns the `NodeDef` instance for given node name in the graph def. +4473,get_node_def_from_graph,tensorflow/tensorflow/python/framework/test_util.py,3252,function,"Returns the `NodeDef` instance for given node name in the graph def. This method explores only the NodeDefs in `graph_def.node`. @@ -27054,19 +32554,56 @@ Args: Returns: the `NodeDef` instance whose name field matches the given node_name or None." -4405,set_producer_version,tensorflow/tensorflow/python/framework/test_util.py,3270,function,Sets graph.graph_def_versions.producer to `producer_version`. -4406,TestUtilTest,tensorflow/tensorflow/python/framework/test_util_test.py,53,class, -4407,SkipTestTest,tensorflow/tensorflow/python/framework/test_util_test.py,812,class, -4408,GraphAndEagerNoVariableSharing,tensorflow/tensorflow/python/framework/test_util_test.py,874,class, -4409,GarbageCollectionTest,tensorflow/tensorflow/python/framework/test_util_test.py,888,class, -4410,set_environ,tensorflow/tensorflow/python/framework/tf2_test.py,30,function, -4411,unset_environ,tensorflow/tensorflow/python/framework/tf2_test.py,34,function, -4412,EnablingTF2Behavior,tensorflow/tensorflow/python/framework/tf2_test.py,38,class, -4413,TraceableObject,tensorflow/tensorflow/python/framework/traceable_stack.py,24,class,Wrap an object together with its the code definition location. -4414,TraceableStack,tensorflow/tensorflow/python/framework/traceable_stack.py,80,class,A stack of TraceableObjects. -4415,TraceableObjectTest,tensorflow/tensorflow/python/framework/traceable_stack_test.py,30,class, -4416,TraceableStackTest,tensorflow/tensorflow/python/framework/traceable_stack_test.py,77,class, -4417,TypeSpec,tensorflow/tensorflow/python/framework/type_spec.py,49,class,"Specifies a TensorFlow value type. +4474,set_producer_version,tensorflow/tensorflow/python/framework/test_util.py,3270,function,Sets graph.graph_def_versions.producer to `producer_version`. +4475,GraphAndEagerNoVariableSharing,tensorflow/tensorflow/python/framework/test_util_test.py,874,class, +4476,setUp,tensorflow/tensorflow/python/framework/test_util_test.py,876,method, +4477,set_environ,tensorflow/tensorflow/python/framework/tf2_test.py,30,function, +4478,unset_environ,tensorflow/tensorflow/python/framework/tf2_test.py,34,function, +4479,EnablingTF2Behavior,tensorflow/tensorflow/python/framework/tf2_test.py,38,class, +4480,setUp,tensorflow/tensorflow/python/framework/tf2_test.py,40,method, +4481,state,tensorflow/tensorflow/python/framework/tf2_test.py,54,method,"Returns bool tuple (tf2_enabled, force_enabled, force_disabled)." +4482,TraceableObject,tensorflow/tensorflow/python/framework/traceable_stack.py,24,class,Wrap an object together with its the code definition location. +4483,set_filename_and_line_from_caller,tensorflow/tensorflow/python/framework/traceable_stack.py,35,method,"Set filename and line using the caller's stack frame. + +If the requested stack information is not available, a heuristic may +be applied and self.HEURISTIC USED will be returned. If the heuristic +fails then no change will be made to the filename and lineno members +(None by default) and self.FAILURE will be returned. + +Args: + offset: Integer. If 0, the caller's stack frame is used. If 1, + the caller's caller's stack frame is used. Larger values are + permissible but if out-of-range (larger than the number of stack + frames available) the outermost stack frame will be used. + +Returns: + TraceableObject.SUCCESS if appropriate stack information was found, + TraceableObject.HEURISTIC_USED if the offset was larger than the stack, + and TraceableObject.FAILURE if the stack was empty." +4484,copy_metadata,tensorflow/tensorflow/python/framework/traceable_stack.py,75,method,"Return a TraceableObject like this one, but without the object." +4485,TraceableStack,tensorflow/tensorflow/python/framework/traceable_stack.py,80,class,A stack of TraceableObjects. +4486,push_obj,tensorflow/tensorflow/python/framework/traceable_stack.py,92,method,"Add object to the stack and record its filename and line information. + +Args: + obj: An object to store on the stack. + offset: Integer. If 0, the caller's stack frame is used. If 1, + the caller's caller's stack frame is used. + +Returns: + TraceableObject.SUCCESS if appropriate stack information was found, + TraceableObject.HEURISTIC_USED if the stack was smaller than expected, + and TraceableObject.FAILURE if the stack was empty." +4487,pop_obj,tensorflow/tensorflow/python/framework/traceable_stack.py,111,method,"Remove last-inserted object and return it, without filename/line info." +4488,peek_top_obj,tensorflow/tensorflow/python/framework/traceable_stack.py,115,method,Return the most recent stored object. +4489,peek_objs,tensorflow/tensorflow/python/framework/traceable_stack.py,119,method,Return iterator over stored objects ordered newest to oldest. +4490,peek_traceable_objs,tensorflow/tensorflow/python/framework/traceable_stack.py,123,method,Return iterator over stored TraceableObjects ordered newest to oldest. +4491,copy,tensorflow/tensorflow/python/framework/traceable_stack.py,131,method,"Return a copy of self referencing the same objects but in a new list. + +This method is implemented to support thread-local stacks. + +Returns: + TraceableStack with a new list that holds existing objects." +4492,TypeSpec,tensorflow/tensorflow/python/framework/type_spec.py,49,class,"Specifies a TensorFlow value type. A `tf.TypeSpec` provides metadata describing an object accepted or returned by TensorFlow APIs. Concrete subclasses, such as `tf.TensorSpec` and @@ -27078,7 +32615,21 @@ For example, `tf.function`'s `input_signature` argument accepts a list Creating new subclasses of TypeSpec (outside of TensorFlow core) is not currently supported. In particular, we may make breaking changes to the private methods and properties defined by this base class." -4418,BatchableTypeSpec,tensorflow/tensorflow/python/framework/type_spec.py,459,class,"TypeSpec with a batchable tensor encoding. +4493,value_type,tensorflow/tensorflow/python/framework/type_spec.py,85,method,"The Python type for values that are compatible with this TypeSpec. + +In particular, all values that are compatible with this TypeSpec must be an +instance of this type." +4494,is_compatible_with,tensorflow/tensorflow/python/framework/type_spec.py,93,method,Returns true if `spec_or_value` is compatible with this TypeSpec. +4495,most_specific_compatible_type,tensorflow/tensorflow/python/framework/type_spec.py,110,method,"Returns the most specific TypeSpec compatible with `self` and `other`. + +Args: + other: A `TypeSpec`. + +Raises: + ValueError: If there is no TypeSpec that is compatible with both `self` + and `other`." +4496,relax,tensorflow/tensorflow/python/framework/type_spec.py,148,method, +4497,BatchableTypeSpec,tensorflow/tensorflow/python/framework/type_spec.py,459,class,"TypeSpec with a batchable tensor encoding. The batchable tensor encoding is a list of `tf.Tensor`s that supports batching and unbatching. In particular, stacking (or unstacking) @@ -27090,7 +32641,7 @@ may require using encoding/decoding ops. If a subclass's batchable tensor encoding is not simply a flattened version of the component encoding, then the subclass must override `_to_tensor_list`, `_from_tensor_list`, and _flat_tensor_specs`." -4419,type_spec_from_value,tensorflow/tensorflow/python/framework/type_spec.py,507,function,"Returns a `tf.TypeSpec` that represents the given `value`. +4498,type_spec_from_value,tensorflow/tensorflow/python/framework/type_spec.py,507,function,"Returns a `tf.TypeSpec` that represents the given `value`. Examples: @@ -27118,8 +32669,7 @@ Returns: Raises: TypeError: If a TypeSpec cannot be built for `value`, because its type is not supported." -4420,_type_spec_from_value,tensorflow/tensorflow/python/framework/type_spec.py,555,function,Returns a `TypeSpec` that represents the given `value`. -4421,register_type_spec_from_value_converter,tensorflow/tensorflow/python/framework/type_spec.py,590,function,"Registers a function for converting values with a given type to TypeSpecs. +4499,register_type_spec_from_value_converter,tensorflow/tensorflow/python/framework/type_spec.py,590,function,"Registers a function for converting values with a given type to TypeSpecs. If multiple registered `type_object`s match a value, then the most recent registration takes precedence. Custom converters should not be defined for @@ -27132,46 +32682,31 @@ Args: type represented by `type_object`) and returns a `TypeSpec`. allow_subclass: If true, then use `isinstance(value, type_object)` to check for matches. If false, then use `type(value) is type_object`." -4422,TwoTensors,tensorflow/tensorflow/python/framework/type_spec_test.py,35,class,"A simple value type to test TypeSpec. +4500,TwoTensors,tensorflow/tensorflow/python/framework/type_spec_test.py,35,class,"A simple value type to test TypeSpec. Contains two tensors (x, y) and a string (color). The color value is a stand-in for any extra type metadata we might need to store." -4423,TwoTensorsSpec,tensorflow/tensorflow/python/framework/type_spec_test.py,49,class,A TypeSpec for the TwoTensors value type. -4424,TypeSpecTest,tensorflow/tensorflow/python/framework/type_spec_test.py,85,class, -4425,VersionTest,tensorflow/tensorflow/python/framework/versions_test.py,25,class, -4426,ArithmeticOptimizerTest,tensorflow/tensorflow/python/grappler/arithmetic_optimizer_test.py,28,class, -4427,_input,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,54,function,Generates an input of a given shape. -4428,_weight,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,59,function,Generates a weight of a given shape. -4429,_bias,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,66,function,Generates a bias of a given shape. -4430,_conv2d,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,71,function,Returns a 2d convolution layer with full stride. -4431,_conv3d,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,76,function,Returns a 3d convolution layer with full stride. -4432,_max_pool_2x2,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,81,function,Downsamples a feature map by 2X. -4433,_fused_batchnorm,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,87,function,Batchnorm. -4434,_conv_bn,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,93,function,Conv followed by batchnorm. -4435,_conv3d_bn,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,105,function,Conv3D followed by batchnorm. -4436,_matmul_act,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,118,function,Matmul followed by activation. -4437,_conv_pool,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,127,function,(Conv -> bias -> relu -> max_pool) x2. -4438,_simple_loop,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,141,function,Simple loop whose body is provided by the functor. -4439,_loop_vars_intertwined,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,150,function,Loop whose loop variables are intertwined. -4440,_lstm_cell,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,159,function,Create an LSTM cell. -4441,_recurrent_lstm,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,180,function,Dynamic single-layer LSTM with TensorArray. -4442,_make_node_with_color,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,201,function,Returns a node representative of the specified list type. -4443,_build_simple_loop_graph,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,216,function,Builds a test graph with a simple loop. -4444,_get_config,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,234,function,Returns a ConfigProto with auto mixed precision enabled if appropriate. -4445,_is_cast_to_fp16,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,257,function, -4446,_is_cast_to_bf16,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,261,function, -4447,_is_cast_to_fp32,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,265,function, -4448,_count_casts,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,269,function,Counts the number of casts to f16 and fp32. -4449,_build_node_map,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,290,function, -4450,_example_noninlined_funcdef_shape,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,297,function, -4451,_example_noninlined_funcdef_grad,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,305,function,Gradient of Swish function defined below. -4452,_example_noninlined_funcdef,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,318,function,Computes the Swish activation function: `x * sigmoid(x)`. -4453,AutoMixedPrecisionTest,tensorflow/tensorflow/python/grappler/auto_mixed_precision_test.py,323,class,Tests the Grappler auto mixed precision optimizer. -4454,Cluster,tensorflow/tensorflow/python/grappler/cluster.py,29,class,Grappler Clusters. -4455,Provision,tensorflow/tensorflow/python/grappler/cluster.py,115,function, -4456,ClusterTest,tensorflow/tensorflow/python/grappler/cluster_test.py,32,class, -4457,ConstantFoldingTest,tensorflow/tensorflow/python/grappler/constant_folding_test.py,37,class, -4458,GenerateCostReport,tensorflow/tensorflow/python/grappler/cost_analyzer.py,26,function,"Analyze the cost of each TensorFlow op and node in the provided metagraph. +4501,TwoTensorsSpec,tensorflow/tensorflow/python/framework/type_spec_test.py,49,class,A TypeSpec for the TwoTensors value type. +4502,from_value,tensorflow/tensorflow/python/framework/type_spec_test.py,76,method, +4503,Cluster,tensorflow/tensorflow/python/grappler/cluster.py,29,class,Grappler Clusters. +4504,Shutdown,tensorflow/tensorflow/python/grappler/cluster.py,59,method, +4505,tf_cluster,tensorflow/tensorflow/python/grappler/cluster.py,68,method, +4506,ListDevices,tensorflow/tensorflow/python/grappler/cluster.py,71,method,Returns a list of available hardware devices. +4507,ListAvailableOps,tensorflow/tensorflow/python/grappler/cluster.py,78,method,Returns a list of all available operations (sorted alphabetically). +4508,GetSupportedDevices,tensorflow/tensorflow/python/grappler/cluster.py,82,method, +4509,EstimatePerformance,tensorflow/tensorflow/python/grappler/cluster.py,85,method, +4510,MeasureCosts,tensorflow/tensorflow/python/grappler/cluster.py,88,method,"Returns the cost of running the specified item. + +Args: + item: The item for which to measure the costs. +Returns: The triplet op_perfs, runtime, step_stats." +4511,DeterminePeakMemoryUsage,tensorflow/tensorflow/python/grappler/cluster.py,103,method,"Returns a snapshot of the peak memory usage. + +Args: + item: The item for which to measure the costs. +Returns: A hashtable indexed by device name." +4512,Provision,tensorflow/tensorflow/python/grappler/cluster.py,115,function, +4513,GenerateCostReport,tensorflow/tensorflow/python/grappler/cost_analyzer.py,26,function,"Analyze the cost of each TensorFlow op and node in the provided metagraph. Args: metagraph: A TensorFlow MetaGraphDef. @@ -27184,7 +32719,7 @@ Args: Returns: A string of cost report." -4459,GenerateMemoryReport,tensorflow/tensorflow/python/grappler/cost_analyzer.py,52,function,"Analyze the peak memory usage for the provided metagraph. +4514,GenerateMemoryReport,tensorflow/tensorflow/python/grappler/cost_analyzer.py,52,function,"Analyze the peak memory usage for the provided metagraph. Args: metagraph: A TensorFlow MetaGraphDef. @@ -27195,35 +32730,20 @@ Args: Returns: A string with the formatted memory usage." -4460,CostAnalysisTest,tensorflow/tensorflow/python/grappler/cost_analyzer_test.py,39,class, -4461,get_metagraph,tensorflow/tensorflow/python/grappler/cost_analyzer_tool.py,40,function,Constructs and returns a MetaGraphDef from the input file. -4462,main,tensorflow/tensorflow/python/grappler/cost_analyzer_tool.py,80,function, -4463,GrapplerTest,tensorflow/tensorflow/python/grappler/datasets_test.py,34,class, -4464,main,tensorflow/tensorflow/python/grappler/graph_analyzer.py,32,function, -4465,Item,tensorflow/tensorflow/python/grappler/item.py,26,class,GrapplerItem. -4466,ItemTest,tensorflow/tensorflow/python/grappler/item_test.py,36,class, -4467,_weight,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,51,function,Generates a weight of a given shape. -4468,_bias,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,56,function,Generates a bias of a given shape. -4469,_conv2d,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,61,function,Returns a 2d convolution layer with full stride. -4470,_max_pool_2x2,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,66,function,Downsamples a feature map by 2X. -4471,_two_layer_model,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,73,function, -4472,_model_with_second_port,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,86,function, -4473,_model_with_branch,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,97,function, -4474,_model_with_vec_and_4d,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,107,function, -4475,_loop,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,116,function, -4476,_loop_with_branch,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,127,function, -4477,_loop_with_vec_and_4d,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,138,function, -4478,_get_config,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,149,function, -4479,_simple_metagraph,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,168,function, -4480,_get_cluster,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,183,function, -4481,_is_transpose,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,194,function, -4482,_is_permute,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,199,function, -4483,LayoutOptimizerTest,tensorflow/tensorflow/python/grappler/layout_optimizer_test.py,206,class,Tests the Grappler layout optimizer. -4484,MemoryOptimizerSwapTest,tensorflow/tensorflow/python/grappler/memory_optimizer_test.py,38,class,Tests the Grappler memory optimizer. -4485,MemoryOptimizerRecomputeTest,tensorflow/tensorflow/python/grappler/memory_optimizer_test.py,107,class,"Tests the Python interface to recomputation rewrites. +4515,get_metagraph,tensorflow/tensorflow/python/grappler/cost_analyzer_tool.py,40,function,Constructs and returns a MetaGraphDef from the input file. +4516,Item,tensorflow/tensorflow/python/grappler/item.py,26,class,GrapplerItem. +4517,IdentifyImportantOps,tensorflow/tensorflow/python/grappler/item.py,52,method, +4518,GetOpProperties,tensorflow/tensorflow/python/grappler/item.py,55,method,Get Op properties. +4519,GetColocationGroups,tensorflow/tensorflow/python/grappler/item.py,69,method,"Return a list of hard colocation constraints. -See core/grappler/optimizers/memory_optimizer_test.cc for functional tests." -4486,GenerateModelReport,tensorflow/tensorflow/python/grappler/model_analyzer.py,24,function,"Report what's known statically about each node in the provided metagraph. +All the nodes in a colocation tuple must be placed on the same device for +the model to work. + +Returns: + A list of colocation tuples." +4520,metagraph,tensorflow/tensorflow/python/grappler/item.py,81,method, +4521,tf_item,tensorflow/tensorflow/python/grappler/item.py,85,method, +4522,GenerateModelReport,tensorflow/tensorflow/python/grappler/model_analyzer.py,24,function,"Report what's known statically about each node in the provided metagraph. Args: metagraph: A TensorFlow MetaGraphDef. @@ -27232,8 +32752,7 @@ Args: Returns: A string containing the report." -4487,PyWrapOptimizeGraphTest,tensorflow/tensorflow/python/grappler/model_analyzer_test.py,30,class, -4488,OptimizeGraph,tensorflow/tensorflow/python/grappler/tf_optimizer.py,27,function,"Optimize the provided metagraph. +4523,OptimizeGraph,tensorflow/tensorflow/python/grappler/tf_optimizer.py,27,function,"Optimize the provided metagraph. For best results, the signature_def field in `metagraph` should be populated with information about input (feed) and output (fetch) tensors. @@ -27249,8 +32768,7 @@ Args: values should be removed after all the optimization passes. This option is useful if the resulting graph will be executed by an older process that might not know some of the recently added attributes." -4489,PyWrapOptimizeGraphTest,tensorflow/tensorflow/python/grappler/tf_optimizer_test.py,37,class, -4490,softmax,tensorflow/tensorflow/python/keras/activations.py,46,function,"Softmax converts a real vector to a vector of categorical probabilities. +4524,softmax,tensorflow/tensorflow/python/keras/activations.py,46,function,"Softmax converts a real vector to a vector of categorical probabilities. The elements of the output vector are in range (0, 1) and sum to 1. @@ -27276,7 +32794,7 @@ Returns: Raises: ValueError: In case `dim(x) == 1`." -4491,elu,tensorflow/tensorflow/python/keras/activations.py,88,function,"Exponential Linear Unit. +4525,elu,tensorflow/tensorflow/python/keras/activations.py,88,function,"Exponential Linear Unit. The exponential linear unit (ELU) with `alpha > 0` is: `x` if `x > 0` and @@ -27319,7 +32837,7 @@ Returns: Reference: [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) (Clevert et al, 2016)](https://arxiv.org/abs/1511.07289)" -4492,selu,tensorflow/tensorflow/python/keras/activations.py,138,function,"Scaled Exponential Linear Unit (SELU). +4526,selu,tensorflow/tensorflow/python/keras/activations.py,138,function,"Scaled Exponential Linear Unit (SELU). The Scaled Exponential Linear Unit (SELU) activation function is defined as: @@ -27366,7 +32884,7 @@ Notes: References: - [Klambauer et al., 2017](https://arxiv.org/abs/1706.02515)" -4493,softplus,tensorflow/tensorflow/python/keras/activations.py,192,function,"Softplus activation function, `softplus(x) = log(exp(x) + 1)`. +4527,softplus,tensorflow/tensorflow/python/keras/activations.py,192,function,"Softplus activation function, `softplus(x) = log(exp(x) + 1)`. Example Usage: @@ -27381,7 +32899,7 @@ Arguments: Returns: The softplus activation: `log(exp(x) + 1)`." -4494,softsign,tensorflow/tensorflow/python/keras/activations.py,214,function,"Softsign activation function, `softsign(x) = x / (abs(x) + 1)`. +4528,softsign,tensorflow/tensorflow/python/keras/activations.py,214,function,"Softsign activation function, `softsign(x) = x / (abs(x) + 1)`. Example Usage: @@ -27395,7 +32913,7 @@ Arguments: Returns: The softsign activation: `x / (abs(x) + 1)`." -4495,swish,tensorflow/tensorflow/python/keras/activations.py,235,function,"Swish activation function, `swish(x) = x * sigmoid(x)`. +4529,swish,tensorflow/tensorflow/python/keras/activations.py,235,function,"Swish activation function, `swish(x) = x * sigmoid(x)`. Swish activation function which returns `x*sigmoid(x)`. It is a smooth, non-monotonic function that consistently matches @@ -27419,7 +32937,7 @@ Returns: Reference: - [Ramachandran et al., 2017](https://arxiv.org/abs/1710.05941)" -4496,relu,tensorflow/tensorflow/python/keras/activations.py,266,function,"Applies the rectified linear unit activation function. +4530,relu,tensorflow/tensorflow/python/keras/activations.py,266,function,"Applies the rectified linear unit activation function. With default values, this returns the standard ReLU activation: `max(x, 0)`, the element-wise maximum of 0 and the input tensor. @@ -27453,7 +32971,7 @@ Returns: A `Tensor` representing the input tensor, transformed by the relu activation function. Tensor will be of the same shape and dtype of input `x`." -4497,tanh,tensorflow/tensorflow/python/keras/activations.py,307,function,"Hyperbolic tangent activation function. +4531,tanh,tensorflow/tensorflow/python/keras/activations.py,307,function,"Hyperbolic tangent activation function. For example: @@ -27468,7 +32986,7 @@ Arguments: Returns: Tensor of same shape and dtype of input `x`, with tanh activation: `tanh(x) = sinh(x)/cosh(x) = ((exp(x) - exp(-x))/(exp(x) + exp(-x)))`." -4498,sigmoid,tensorflow/tensorflow/python/keras/activations.py,329,function,"Sigmoid activation function, `sigmoid(x) = 1 / (1 + exp(-x))`. +4532,sigmoid,tensorflow/tensorflow/python/keras/activations.py,329,function,"Sigmoid activation function, `sigmoid(x) = 1 / (1 + exp(-x))`. Applies the sigmoid activation function. For small values (<-5), `sigmoid` returns a value close to zero, and for large values (>5) @@ -27491,7 +33009,7 @@ Arguments: Returns: Tensor with the sigmoid activation: `1 / (1 + exp(-x))`." -4499,exponential,tensorflow/tensorflow/python/keras/activations.py,359,function,"Exponential activation function. +4533,exponential,tensorflow/tensorflow/python/keras/activations.py,359,function,"Exponential activation function. For example: @@ -27505,7 +33023,7 @@ Arguments: Returns: Tensor with exponential activation: `exp(x)`." -4500,hard_sigmoid,tensorflow/tensorflow/python/keras/activations.py,380,function,"Hard sigmoid activation function. +4534,hard_sigmoid,tensorflow/tensorflow/python/keras/activations.py,380,function,"Hard sigmoid activation function. A faster approximation of the sigmoid activation. @@ -27525,7 +33043,7 @@ Returns: - `if x < -2.5: return 0` - `if x > 2.5: return 1` - `if -2.5 <= x <= 2.5: return 0.2 * x + 0.5`" -4501,linear,tensorflow/tensorflow/python/keras/activations.py,407,function,"Linear activation function (pass-through). +4535,linear,tensorflow/tensorflow/python/keras/activations.py,407,function,"Linear activation function (pass-through). For example: @@ -27539,7 +33057,7 @@ Arguments: Returns: The input, unmodified." -4502,serialize,tensorflow/tensorflow/python/keras/activations.py,428,function,"Returns the string identifier of an activation function. +4536,serialize,tensorflow/tensorflow/python/keras/activations.py,428,function,"Returns the string identifier of an activation function. Arguments: activation : Function object. @@ -27560,7 +33078,7 @@ ValueError: ('Cannot serialize', 'abcd') Raises: ValueError: The input function is not a valid one." -4503,deserialize,tensorflow/tensorflow/python/keras/activations.py,459,function,"Returns activation function given a string identifier. +4537,deserialize,tensorflow/tensorflow/python/keras/activations.py,459,function,"Returns activation function given a string identifier. Arguments: x : String identifier. @@ -27587,7 +33105,7 @@ Args: Raises: ValueError: `Unknown activation function` if the input string does not denote any defined Tensorflow activation function." -4504,get,tensorflow/tensorflow/python/keras/activations.py,497,function,"Returns function. +4538,get,tensorflow/tensorflow/python/keras/activations.py,497,function,"Returns function. Arguments: identifier: Function or string @@ -27613,20 +33131,13 @@ ValueError: Unknown activation function:abcd Raises: ValueError: Input is an unknown function or string, i.e., the input does not denote any defined function." -4505,_ref_softmax,tensorflow/tensorflow/python/keras/activations_test.py,34,function, -4506,KerasActivationsTest,tensorflow/tensorflow/python/keras/activations_test.py,41,class, -4507,_DummyEagerGraph,tensorflow/tensorflow/python/keras/backend.py,116,class,"_DummyEagerGraph provides a thread local `key` attribute. - -We can't use threading.local directly, i.e. without subclassing, because -gevent monkey patches threading.local and its version does not support -weak references." -4508,backend,tensorflow/tensorflow/python/keras/backend.py,167,function,"Publicly accessible method for determining the current backend. +4539,backend,tensorflow/tensorflow/python/keras/backend.py,167,function,"Publicly accessible method for determining the current backend. Only exists for API compatibility with multi-backend Keras. Returns: The string ""tensorflow""." -4509,cast_to_floatx,tensorflow/tensorflow/python/keras/backend.py,180,function,"Cast a Numpy array to the default Keras float type. +4540,cast_to_floatx,tensorflow/tensorflow/python/keras/backend.py,180,function,"Cast a Numpy array to the default Keras float type. Arguments: x: Numpy array or TensorFlow tensor. @@ -27647,7 +33158,7 @@ dtype('float64') array([1., 2.], dtype=float32) >>> new_arr.dtype dtype('float32')" -4510,get_uid,tensorflow/tensorflow/python/keras/backend.py,218,function,"Associates a string prefix with an integer counter in a TensorFlow graph. +4541,get_uid,tensorflow/tensorflow/python/keras/backend.py,218,function,"Associates a string prefix with an integer counter in a TensorFlow graph. Arguments: prefix: String prefix to index. @@ -27661,9 +33172,9 @@ Example: 1 >>> get_uid('dense') 2" -4511,reset_uids,tensorflow/tensorflow/python/keras/backend.py,244,function,"Resets graph identifiers. +4542,reset_uids,tensorflow/tensorflow/python/keras/backend.py,244,function,"Resets graph identifiers. " -4512,clear_session,tensorflow/tensorflow/python/keras/backend.py,252,function,"Resets all state generated by Keras. +4543,clear_session,tensorflow/tensorflow/python/keras/backend.py,252,function,"Resets all state generated by Keras. Keras manages a global state, which it uses to implement the Functional model-building API and to uniquify autogenerated layer names. @@ -27703,7 +33214,7 @@ dense_10 >>> new_layer = tf.keras.layers.Dense(10) >>> print(new_layer.name) dense" -4513,manual_variable_initialization,tensorflow/tensorflow/python/keras/backend.py,314,function,"Sets the manual variable initialization flag. +4544,manual_variable_initialization,tensorflow/tensorflow/python/keras/backend.py,314,function,"Sets the manual variable initialization flag. This boolean flag determines whether variables should be initialized @@ -27713,7 +33224,7 @@ the user should handle the initialization Arguments: value: Python boolean." -4514,learning_phase,tensorflow/tensorflow/python/keras/backend.py,331,function,"Returns the learning phase flag. +4545,learning_phase,tensorflow/tensorflow/python/keras/backend.py,331,function,"Returns the learning phase flag. The learning phase flag is a bool tensor (0 = test, 1 = train) to be passed as input to any Keras function @@ -27721,19 +33232,9 @@ that uses a different behavior at train time and test time. Returns: Learning phase (scalar integer tensor or Python integer)." -4515,global_learning_phase_is_set,tensorflow/tensorflow/python/keras/backend.py,360,function, -4516,_mark_func_graph_as_unsaveable,tensorflow/tensorflow/python/keras/backend.py,364,function,"Mark func graph as unsaveable due to use of symbolic keras learning phase. - -Functions that capture the symbolic learning phase cannot be exported to -SavedModel. Mark the funcgraph as unsaveable, so that an error will be raised -if it is exported. - -Args: - graph: Graph or FuncGraph object. - learning_phase: Learning phase placeholder or int defined in the graph." -4517,symbolic_learning_phase,tensorflow/tensorflow/python/keras/backend.py,383,function, -4518,_default_learning_phase,tensorflow/tensorflow/python/keras/backend.py,389,function, -4519,set_learning_phase,tensorflow/tensorflow/python/keras/backend.py,402,function,"Sets the learning phase to a fixed value. +4546,global_learning_phase_is_set,tensorflow/tensorflow/python/keras/backend.py,360,function, +4547,symbolic_learning_phase,tensorflow/tensorflow/python/keras/backend.py,383,function, +4548,set_learning_phase,tensorflow/tensorflow/python/keras/backend.py,402,function,"Sets the learning phase to a fixed value. The backend learning phase affects any code that calls `backend.learning_phase()` @@ -27755,7 +33256,7 @@ Arguments: Raises: ValueError: if `value` is neither `0` nor `1`." -4520,deprecated_internal_set_learning_phase,tensorflow/tensorflow/python/keras/backend.py,429,function,"A deprecated internal implementation of set_learning_phase. +4549,deprecated_internal_set_learning_phase,tensorflow/tensorflow/python/keras/backend.py,429,function,"A deprecated internal implementation of set_learning_phase. This method is an internal-only version of `set_learning_phase` that does not raise a deprecation error. It is required because @@ -27774,7 +33275,7 @@ Arguments: Raises: ValueError: if `value` is neither `0` nor `1`." -4521,learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,467,function,"Provides a scope within which the learning phase is equal to `value`. +4550,learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,467,function,"Provides a scope within which the learning phase is equal to `value`. The learning phase gets restored to its original value upon exiting the scope. @@ -27787,7 +33288,7 @@ Yields: Raises: ValueError: if `value` is neither `0` nor `1`." -4522,deprecated_internal_learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,490,function,"An internal-only version of `learning_phase_scope`. +4551,deprecated_internal_learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,490,function,"An internal-only version of `learning_phase_scope`. Unlike the public method, this method does not raise a deprecation warning. This is needed because saved model saving needs to set learning phase @@ -27806,7 +33307,7 @@ Yields: Raises: ValueError: if `value` is neither `0` nor `1`." -4523,eager_learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,544,function,"Internal scope that sets the learning phase in eager / tf.function only. +4552,eager_learning_phase_scope,tensorflow/tensorflow/python/keras/backend.py,544,function,"Internal scope that sets the learning phase in eager / tf.function only. Arguments: value: Learning phase value, either 0 or 1 (integers). @@ -27817,9 +33318,7 @@ Yields: Raises: ValueError: if `value` is neither `0` nor `1`." -4524,_current_graph,tensorflow/tensorflow/python/keras/backend.py,574,function,"Return the graph members of `op_input_list`, or the current graph." -4525,_get_session,tensorflow/tensorflow/python/keras/backend.py,579,function,Returns the session object for the current thread. -4526,get_session,tensorflow/tensorflow/python/keras/backend.py,605,function,"Returns the TF session to be used by the backend. +4553,get_session,tensorflow/tensorflow/python/keras/backend.py,605,function,"Returns the TF session to be used by the backend. If a default TensorFlow session is available, we will return it. @@ -27839,79 +33338,14 @@ Arguments: Returns: A TensorFlow session." -4527,get_graph,tensorflow/tensorflow/python/keras/backend.py,639,function, -4528,_scratch_graph,tensorflow/tensorflow/python/keras/backend.py,650,function,"Retrieve a shared and temporary func graph. - -The eager execution path lifts a subgraph from the keras global graph into -a scratch graph in order to create a function. DistributionStrategies, in -turn, constructs multiple functions as well as a final combined function. In -order for that logic to work correctly, all of the functions need to be -created on the same scratch FuncGraph. - -Args: - graph: A graph to be used as the current scratch graph. If not set then - a scratch graph will either be retrieved or created: - -Yields: - The current scratch graph." -4529,set_session,tensorflow/tensorflow/python/keras/backend.py,686,function,"Sets the global TensorFlow session. +4554,get_graph,tensorflow/tensorflow/python/keras/backend.py,639,function, +4555,set_session,tensorflow/tensorflow/python/keras/backend.py,686,function,"Sets the global TensorFlow session. Arguments: session: A TF Session." -4530,get_default_session_config,tensorflow/tensorflow/python/keras/backend.py,696,function, -4531,get_default_graph_uid_map,tensorflow/tensorflow/python/keras/backend.py,708,function, -4532,_TfDeviceCaptureOp,tensorflow/tensorflow/python/keras/backend.py,720,class,Class for capturing the TF device scope. -4533,_get_current_tf_device,tensorflow/tensorflow/python/keras/backend.py,736,function,"Return explicit device of current context, otherwise returns `None`. - -Returns: - If the current device scope is explicitly set, it returns a string with - the device (`CPU` or `GPU`). If the scope is not explicitly set, it will - return `None`." -4534,_is_current_explicit_device,tensorflow/tensorflow/python/keras/backend.py,753,function,"Check if the current device is explicitly set on the device type specified. - -Arguments: - device_type: A string containing `GPU` or `CPU` (case-insensitive). - -Returns: - A boolean indicating if the current device scope is explicitly set on the - device type. - -Raises: - ValueError: If the `device_type` string indicates an unsupported device." -4535,_get_available_gpus,tensorflow/tensorflow/python/keras/backend.py,773,function,"Get a list of available gpu devices (formatted as strings). - -Returns: - A list of available GPU devices." -4536,_has_nchw_support,tensorflow/tensorflow/python/keras/backend.py,789,function,"Check whether the current scope supports NCHW ops. - -TensorFlow does not support NCHW on CPU. Therefore we check if we are not -explicitly put on -CPU, and have GPUs available. In this case there will be soft-placing on the -GPU device. - -Returns: - bool: if the current scope device placement would support nchw" -4537,_constant_to_tensor,tensorflow/tensorflow/python/keras/backend.py,808,function,"Convert the input `x` to a tensor of type `dtype`. - -This is slightly faster than the _to_tensor function, at the cost of -handling fewer cases. - -Arguments: - x: An object to be converted (numpy arrays, floats, ints and lists of - them). - dtype: The destination type. - -Returns: - A tensor." -4538,_to_tensor,tensorflow/tensorflow/python/keras/backend.py,825,function,"Convert the input `x` to a tensor of type `dtype`. - -Arguments: - x: An object to be converted (numpy array, list, tensors). - dtype: The destination type. - -Returns: - A tensor." -4539,is_sparse,tensorflow/tensorflow/python/keras/backend.py,839,function,"Returns whether a tensor is a sparse tensor. +4556,get_default_session_config,tensorflow/tensorflow/python/keras/backend.py,696,function, +4557,get_default_graph_uid_map,tensorflow/tensorflow/python/keras/backend.py,708,function, +4558,is_sparse,tensorflow/tensorflow/python/keras/backend.py,839,function,"Returns whether a tensor is a sparse tensor. Arguments: tensor: A tensor instance. @@ -27928,7 +33362,7 @@ False >>> b = tf.keras.backend.placeholder((2, 2), sparse=True) >>> print(tf.keras.backend.is_sparse(b)) True" -4540,to_dense,tensorflow/tensorflow/python/keras/backend.py,867,function,"Converts a sparse tensor into a dense tensor and returns it. +4559,to_dense,tensorflow/tensorflow/python/keras/backend.py,867,function,"Converts a sparse tensor into a dense tensor and returns it. Arguments: tensor: A tensor instance (potentially sparse). @@ -27945,7 +33379,7 @@ True >>> c = tf.keras.backend.to_dense(b) >>> print(tf.keras.backend.is_sparse(c)) False" -4541,name_scope,tensorflow/tensorflow/python/keras/backend.py,894,function,"A context manager for use when defining a Python op. +4560,name_scope,tensorflow/tensorflow/python/keras/backend.py,894,function,"A context manager for use when defining a Python op. This context manager pushes a name scope, which will make the name of all operations added within it have a prefix. @@ -27967,7 +33401,7 @@ Args: Returns: Name scope context manager." -4542,variable,tensorflow/tensorflow/python/keras/backend.py,925,function,"Instantiates a variable and returns it. +4561,variable,tensorflow/tensorflow/python/keras/backend.py,925,function,"Instantiates a variable and returns it. Arguments: value: Numpy array, initial value of the tensor. @@ -27990,9 +33424,9 @@ Examples: " -4543,track_tf_optimizer,tensorflow/tensorflow/python/keras/backend.py,974,function,Tracks the given TF optimizer for initialization of its variables. -4544,track_variable,tensorflow/tensorflow/python/keras/backend.py,982,function,Tracks the given variable for initialization. -4545,unique_object_name,tensorflow/tensorflow/python/keras/backend.py,990,function,"Makes a object name (or arbitrary string) unique within a TensorFlow graph. +4562,track_tf_optimizer,tensorflow/tensorflow/python/keras/backend.py,974,function,Tracks the given TF optimizer for initialization of its variables. +4563,track_variable,tensorflow/tensorflow/python/keras/backend.py,982,function,Tracks the given variable for initialization. +4564,unique_object_name,tensorflow/tensorflow/python/keras/backend.py,990,function,"Makes a object name (or arbitrary string) unique within a TensorFlow graph. Arguments: name: String name to make unique. @@ -28014,9 +33448,7 @@ Example: unique_object_name('dense') # dense_1 unique_object_name('dense') # dense_2" -4546,_get_variables,tensorflow/tensorflow/python/keras/backend.py,1039,function,Returns variables corresponding to the given graph for initialization. -4547,_initialize_variables,tensorflow/tensorflow/python/keras/backend.py,1048,function,Utility to initialize uninitialized variables on the fly. -4548,constant,tensorflow/tensorflow/python/keras/backend.py,1076,function,"Creates a constant tensor. +4565,constant,tensorflow/tensorflow/python/keras/backend.py,1076,function,"Creates a constant tensor. Arguments: value: A constant value (or list) @@ -28026,7 +33458,7 @@ Arguments: Returns: A Constant Tensor." -4549,is_keras_tensor,tensorflow/tensorflow/python/keras/backend.py,1095,function,"Returns whether `x` is a Keras tensor. +4566,is_keras_tensor,tensorflow/tensorflow/python/keras/backend.py,1095,function,"Returns whether `x` is a Keras tensor. A ""Keras tensor"" is a tensor that was returned by a Keras layer, (`Layer` class) or by `Input`. @@ -28065,7 +33497,7 @@ True >>> # Any Keras layer output is a Keras tensor. >>> tf.keras.backend.is_keras_tensor(keras_layer_output) True" -4550,placeholder,tensorflow/tensorflow/python/keras/backend.py,1149,function,"Instantiates a placeholder tensor and returns it. +4567,placeholder,tensorflow/tensorflow/python/keras/backend.py,1149,function,"Instantiates a placeholder tensor and returns it. Arguments: shape: Shape of the placeholder @@ -28094,14 +33526,14 @@ Examples: >>> input_ph = tf.keras.backend.placeholder(shape=(2, 4, 5)) >>> input_ph " -4551,is_placeholder,tensorflow/tensorflow/python/keras/backend.py,1244,function,"Returns whether `x` is a placeholder. +4568,is_placeholder,tensorflow/tensorflow/python/keras/backend.py,1244,function,"Returns whether `x` is a placeholder. Arguments: x: A candidate placeholder. Returns: Boolean." -4552,shape,tensorflow/tensorflow/python/keras/backend.py,1267,function,"Returns the symbolic shape of a tensor or variable. +4569,shape,tensorflow/tensorflow/python/keras/backend.py,1267,function,"Returns the symbolic shape of a tensor or variable. Arguments: x: A tensor or variable. @@ -28118,7 +33550,7 @@ Examples: >>> input = tf.keras.backend.placeholder(shape=(2, 4, 5)) >>> tf.keras.backend.shape(input) " -4553,int_shape,tensorflow/tensorflow/python/keras/backend.py,1291,function,"Returns the shape of tensor or variable as a tuple of int or None entries. +4570,int_shape,tensorflow/tensorflow/python/keras/backend.py,1291,function,"Returns the shape of tensor or variable as a tuple of int or None entries. Arguments: x: Tensor or variable. @@ -28135,7 +33567,7 @@ Examples: >>> kvar = tf.keras.backend.variable(value=val) >>> tf.keras.backend.int_shape(kvar) (2, 2)" -4554,ndim,tensorflow/tensorflow/python/keras/backend.py,1321,function,"Returns the number of axes in a tensor, as an integer. +4571,ndim,tensorflow/tensorflow/python/keras/backend.py,1321,function,"Returns the number of axes in a tensor, as an integer. Arguments: x: Tensor or variable. @@ -28153,7 +33585,7 @@ Examples: 3 >>> tf.keras.backend.ndim(kvar) 2" -4555,dtype,tensorflow/tensorflow/python/keras/backend.py,1350,function,"Returns the dtype of a Keras tensor or variable, as a string. +4572,dtype,tensorflow/tensorflow/python/keras/backend.py,1350,function,"Returns the dtype of a Keras tensor or variable, as a string. Arguments: x: Tensor or variable. @@ -28178,7 +33610,7 @@ Examples: ... dtype='float32') >>> tf.keras.backend.dtype(kvar) 'float32'" -4556,eval,tensorflow/tensorflow/python/keras/backend.py,1382,function,"Evaluates the value of a variable. +4573,eval,tensorflow/tensorflow/python/keras/backend.py,1382,function,"Evaluates the value of a variable. Arguments: x: A variable. @@ -28193,7 +33625,7 @@ Examples: >>> tf.keras.backend.eval(kvar) array([[1., 2.], [3., 4.]], dtype=float32)" -4557,zeros,tensorflow/tensorflow/python/keras/backend.py,1404,function,"Instantiates an all-zeros variable and returns it. +4574,zeros,tensorflow/tensorflow/python/keras/backend.py,1404,function,"Instantiates an all-zeros variable and returns it. Arguments: shape: Tuple or list of integers, shape of returned Keras variable @@ -28223,7 +33655,7 @@ array([0, 0, 0], dtype=int32) >>> tf.keras.backend.eval(kvar4) array([[0., 0., 0.], [0., 0., 0.]], dtype=float32)" -4558,ones,tensorflow/tensorflow/python/keras/backend.py,1449,function,"Instantiates an all-ones variable and returns it. +4575,ones,tensorflow/tensorflow/python/keras/backend.py,1449,function,"Instantiates an all-ones variable and returns it. Arguments: shape: Tuple of integers, shape of returned Keras variable. @@ -28243,7 +33675,7 @@ Example: array([[1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.]], dtype=float32)" -4559,eye,tensorflow/tensorflow/python/keras/backend.py,1484,function,"Instantiate an identity matrix and returns it. +4576,eye,tensorflow/tensorflow/python/keras/backend.py,1484,function,"Instantiate an identity matrix and returns it. Arguments: size: Integer, number of rows/columns. @@ -28261,7 +33693,7 @@ Example: array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]], dtype=float32)" -4560,zeros_like,tensorflow/tensorflow/python/keras/backend.py,1513,function,"Instantiates an all-zeros variable of the same shape as another tensor. +4577,zeros_like,tensorflow/tensorflow/python/keras/backend.py,1513,function,"Instantiates an all-zeros variable of the same shape as another tensor. Arguments: x: Keras variable or Keras tensor. @@ -28280,7 +33712,7 @@ kvar = K.variable(np.random.random((2,3))) kvar_zeros = K.zeros_like(kvar) K.eval(kvar_zeros) # array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32)" -4561,ones_like,tensorflow/tensorflow/python/keras/backend.py,1541,function,"Instantiates an all-ones variable of the same shape as another tensor. +4578,ones_like,tensorflow/tensorflow/python/keras/backend.py,1541,function,"Instantiates an all-ones variable of the same shape as another tensor. Arguments: x: Keras variable or tensor. @@ -28298,7 +33730,7 @@ Example: >>> tf.keras.backend.eval(kvar_ones) array([[1., 1., 1.], [1., 1., 1.]], dtype=float32)" -4562,identity,tensorflow/tensorflow/python/keras/backend.py,1565,function,"Returns a tensor with the same content as the input tensor. +4579,identity,tensorflow/tensorflow/python/keras/backend.py,1565,function,"Returns a tensor with the same content as the input tensor. Arguments: x: The input tensor. @@ -28306,7 +33738,7 @@ Arguments: Returns: A tensor of the same shape, type and content." -4563,random_uniform_variable,tensorflow/tensorflow/python/keras/backend.py,1579,function,"Instantiates a variable with values drawn from a uniform distribution. +4580,random_uniform_variable,tensorflow/tensorflow/python/keras/backend.py,1579,function,"Instantiates a variable with values drawn from a uniform distribution. Arguments: shape: Tuple of integers, shape of returned Keras variable. @@ -28326,7 +33758,7 @@ Example: >>> kvar " -4564,random_normal_variable,tensorflow/tensorflow/python/keras/backend.py,1613,function,"Instantiates a variable with values drawn from a normal distribution. +4581,random_normal_variable,tensorflow/tensorflow/python/keras/backend.py,1613,function,"Instantiates a variable with values drawn from a normal distribution. Arguments: shape: Tuple of integers, shape of returned Keras variable. @@ -28346,7 +33778,7 @@ Example: >>> kvar " -4565,count_params,tensorflow/tensorflow/python/keras/backend.py,1648,function,"Returns the static number of elements in a variable or tensor. +4582,count_params,tensorflow/tensorflow/python/keras/backend.py,1648,function,"Returns the static number of elements in a variable or tensor. Arguments: x: Variable or tensor. @@ -28362,7 +33794,7 @@ Example: >>> tf.keras.backend.eval(kvar) array([[0., 0., 0.], [0., 0., 0.]], dtype=float32)" -4566,cast,tensorflow/tensorflow/python/keras/backend.py,1672,function,"Casts a tensor to a different dtype and returns it. +4583,cast,tensorflow/tensorflow/python/keras/backend.py,1672,function,"Casts a tensor to a different dtype and returns it. You can cast a Keras variable but it still returns a Keras tensor. @@ -28383,8 +33815,8 @@ numpy=array([[1., 1., 1.]], dtype=float32)> >>> cast_input = tf.keras.backend.cast(input, dtype='float64') >>> print(cast_input) tf.Tensor([[1. 1. 1.]], shape=(1, 3), dtype=float64)" -4567,update,tensorflow/tensorflow/python/keras/backend.py,1703,function, -4568,update_add,tensorflow/tensorflow/python/keras/backend.py,1708,function,"Update the value of `x` by adding `increment`. +4584,update,tensorflow/tensorflow/python/keras/backend.py,1703,function, +4585,update_add,tensorflow/tensorflow/python/keras/backend.py,1708,function,"Update the value of `x` by adding `increment`. Arguments: x: A Variable. @@ -28392,7 +33824,7 @@ Arguments: Returns: The variable `x` updated." -4569,update_sub,tensorflow/tensorflow/python/keras/backend.py,1722,function,"Update the value of `x` by subtracting `decrement`. +4586,update_sub,tensorflow/tensorflow/python/keras/backend.py,1722,function,"Update the value of `x` by subtracting `decrement`. Arguments: x: A Variable. @@ -28400,7 +33832,7 @@ Arguments: Returns: The variable `x` updated." -4570,moving_average_update,tensorflow/tensorflow/python/keras/backend.py,1736,function,"Compute the exponential moving average of a value. +4587,moving_average_update,tensorflow/tensorflow/python/keras/backend.py,1736,function,"Compute the exponential moving average of a value. The moving average 'x' is updated with 'value' following: @@ -28435,7 +33867,7 @@ Arguments: Returns: The updated variable." -4571,dot,tensorflow/tensorflow/python/keras/backend.py,1783,function,"Multiplies 2 tensors (and/or variables) and returns a tensor. +4588,dot,tensorflow/tensorflow/python/keras/backend.py,1783,function,"Multiplies 2 tensors (and/or variables) and returns a tensor. Arguments: x: Tensor or variable. @@ -28463,7 +33895,7 @@ Examples: >>> xy = tf.keras.backend.dot(x, y) >>> tf.keras.backend.int_shape(xy) (2, 4, 5)" -4572,batch_dot,tensorflow/tensorflow/python/keras/backend.py,1844,function,"Batchwise dot product. +4589,batch_dot,tensorflow/tensorflow/python/keras/backend.py,1844,function,"Batchwise dot product. `batch_dot` is used to compute dot product of `x` and `y` when `x` and `y` are data in batch, i.e. in a shape of @@ -28505,7 +33937,7 @@ Shape inference: * `y.shape[2]` : 20 : do not append to output shape, dimension 2 of `y` has been summed over. (`dot_axes[1]` = 2) `output_shape` = `(100, 30)`" -4573,transpose,tensorflow/tensorflow/python/keras/backend.py,2033,function,"Transposes a tensor and returns it. +4590,transpose,tensorflow/tensorflow/python/keras/backend.py,2033,function,"Transposes a tensor and returns it. Arguments: x: Tensor or variable. @@ -28530,7 +33962,7 @@ array([[1., 4.], >>> input_transposed = tf.keras.backend.transpose(input) >>> input_transposed " -4574,gather,tensorflow/tensorflow/python/keras/backend.py,2065,function,"Retrieves the elements of indices `indices` in the tensor `reference`. +4591,gather,tensorflow/tensorflow/python/keras/backend.py,2065,function,"Retrieves the elements of indices `indices` in the tensor `reference`. Arguments: reference: A tensor. @@ -28556,7 +33988,7 @@ array([[4., 5., 6.]], dtype=float32) array([[1., 2., 3.], [4., 5., 6.], [1., 2., 3.]], dtype=float32)" -4575,max,tensorflow/tensorflow/python/keras/backend.py,2101,function,"Maximum value in a tensor. +4592,max,tensorflow/tensorflow/python/keras/backend.py,2101,function,"Maximum value in a tensor. Arguments: x: A tensor or variable. @@ -28568,7 +34000,7 @@ Arguments: Returns: A tensor with maximum values of `x`." -4576,min,tensorflow/tensorflow/python/keras/backend.py,2120,function,"Minimum value in a tensor. +4593,min,tensorflow/tensorflow/python/keras/backend.py,2120,function,"Minimum value in a tensor. Arguments: x: A tensor or variable. @@ -28580,7 +34012,7 @@ Arguments: Returns: A tensor with minimum values of `x`." -4577,sum,tensorflow/tensorflow/python/keras/backend.py,2139,function,"Sum of the values in a tensor, alongside the specified axis. +4594,sum,tensorflow/tensorflow/python/keras/backend.py,2139,function,"Sum of the values in a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28592,7 +34024,7 @@ Arguments: Returns: A tensor with sum of `x`." -4578,prod,tensorflow/tensorflow/python/keras/backend.py,2158,function,"Multiplies the values in a tensor, alongside the specified axis. +4595,prod,tensorflow/tensorflow/python/keras/backend.py,2158,function,"Multiplies the values in a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28604,7 +34036,7 @@ Arguments: Returns: A tensor with the product of elements of `x`." -4579,cumsum,tensorflow/tensorflow/python/keras/backend.py,2177,function,"Cumulative sum of the values in a tensor, alongside the specified axis. +4596,cumsum,tensorflow/tensorflow/python/keras/backend.py,2177,function,"Cumulative sum of the values in a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28612,7 +34044,7 @@ Arguments: Returns: A tensor of the cumulative sum of values of `x` along `axis`." -4580,cumprod,tensorflow/tensorflow/python/keras/backend.py,2192,function,"Cumulative product of the values in a tensor, alongside the specified axis. +4597,cumprod,tensorflow/tensorflow/python/keras/backend.py,2192,function,"Cumulative product of the values in a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28620,7 +34052,7 @@ Arguments: Returns: A tensor of the cumulative product of values of `x` along `axis`." -4581,var,tensorflow/tensorflow/python/keras/backend.py,2206,function,"Variance of a tensor, alongside the specified axis. +4598,var,tensorflow/tensorflow/python/keras/backend.py,2206,function,"Variance of a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28632,7 +34064,7 @@ Arguments: Returns: A tensor with the variance of elements of `x`." -4582,std,tensorflow/tensorflow/python/keras/backend.py,2227,function,"Standard deviation of a tensor, alongside the specified axis. +4599,std,tensorflow/tensorflow/python/keras/backend.py,2227,function,"Standard deviation of a tensor, alongside the specified axis. It is an alias to `tf.math.reduce_std`. @@ -28650,7 +34082,7 @@ Arguments: Returns: A tensor with the standard deviation of elements of `x` with same dtype. Boolean type input will be converted to float." -4583,mean,tensorflow/tensorflow/python/keras/backend.py,2254,function,"Mean of a tensor, alongside the specified axis. +4600,mean,tensorflow/tensorflow/python/keras/backend.py,2254,function,"Mean of a tensor, alongside the specified axis. Arguments: x: A tensor or variable. @@ -28662,7 +34094,7 @@ Arguments: Returns: A tensor with the mean of elements of `x`." -4584,any,tensorflow/tensorflow/python/keras/backend.py,2275,function,"Bitwise reduction (logical OR). +4601,any,tensorflow/tensorflow/python/keras/backend.py,2275,function,"Bitwise reduction (logical OR). Arguments: x: Tensor or variable. @@ -28671,7 +34103,7 @@ Arguments: Returns: A uint8 tensor (0s and 1s)." -4585,all,tensorflow/tensorflow/python/keras/backend.py,2292,function,"Bitwise reduction (logical AND). +4602,all,tensorflow/tensorflow/python/keras/backend.py,2292,function,"Bitwise reduction (logical AND). Arguments: x: Tensor or variable. @@ -28680,7 +34112,7 @@ Arguments: Returns: A uint8 tensor (0s and 1s)." -4586,argmax,tensorflow/tensorflow/python/keras/backend.py,2309,function,"Returns the index of the maximum value along an axis. +4603,argmax,tensorflow/tensorflow/python/keras/backend.py,2309,function,"Returns the index of the maximum value along an axis. Arguments: x: Tensor or variable. @@ -28688,7 +34120,7 @@ Arguments: Returns: A tensor." -4587,argmin,tensorflow/tensorflow/python/keras/backend.py,2324,function,"Returns the index of the minimum value along an axis. +4604,argmin,tensorflow/tensorflow/python/keras/backend.py,2324,function,"Returns the index of the minimum value along an axis. Arguments: x: Tensor or variable. @@ -28696,42 +34128,42 @@ Arguments: Returns: A tensor." -4588,square,tensorflow/tensorflow/python/keras/backend.py,2339,function,"Element-wise square. +4605,square,tensorflow/tensorflow/python/keras/backend.py,2339,function,"Element-wise square. Arguments: x: Tensor or variable. Returns: A tensor." -4589,abs,tensorflow/tensorflow/python/keras/backend.py,2353,function,"Element-wise absolute value. +4606,abs,tensorflow/tensorflow/python/keras/backend.py,2353,function,"Element-wise absolute value. Arguments: x: Tensor or variable. Returns: A tensor." -4590,sqrt,tensorflow/tensorflow/python/keras/backend.py,2367,function,"Element-wise square root. +4607,sqrt,tensorflow/tensorflow/python/keras/backend.py,2367,function,"Element-wise square root. Arguments: x: Tensor or variable. Returns: A tensor." -4591,exp,tensorflow/tensorflow/python/keras/backend.py,2384,function,"Element-wise exponential. +4608,exp,tensorflow/tensorflow/python/keras/backend.py,2384,function,"Element-wise exponential. Arguments: x: Tensor or variable. Returns: A tensor." -4592,log,tensorflow/tensorflow/python/keras/backend.py,2398,function,"Element-wise log. +4609,log,tensorflow/tensorflow/python/keras/backend.py,2398,function,"Element-wise log. Arguments: x: Tensor or variable. Returns: A tensor." -4593,logsumexp,tensorflow/tensorflow/python/keras/backend.py,2410,function,"Computes log(sum(exp(elements across dimensions of a tensor))). +4610,logsumexp,tensorflow/tensorflow/python/keras/backend.py,2410,function,"Computes log(sum(exp(elements across dimensions of a tensor))). This function is more numerically stable than log(sum(exp(x))). It avoids overflows caused by taking the exp of large inputs and @@ -28747,7 +34179,7 @@ Arguments: Returns: The reduced tensor." -4594,round,tensorflow/tensorflow/python/keras/backend.py,2433,function,"Element-wise rounding to the closest integer. +4611,round,tensorflow/tensorflow/python/keras/backend.py,2433,function,"Element-wise rounding to the closest integer. In case of tie, the rounding mode used is ""half to even"". @@ -28756,14 +34188,14 @@ Arguments: Returns: A tensor." -4595,sign,tensorflow/tensorflow/python/keras/backend.py,2449,function,"Element-wise sign. +4612,sign,tensorflow/tensorflow/python/keras/backend.py,2449,function,"Element-wise sign. Arguments: x: Tensor or variable. Returns: A tensor." -4596,pow,tensorflow/tensorflow/python/keras/backend.py,2463,function,"Element-wise exponentiation. +4613,pow,tensorflow/tensorflow/python/keras/backend.py,2463,function,"Element-wise exponentiation. Arguments: x: Tensor or variable. @@ -28771,7 +34203,7 @@ Arguments: Returns: A tensor." -4597,clip,tensorflow/tensorflow/python/keras/backend.py,2478,function,"Element-wise value clipping. +4614,clip,tensorflow/tensorflow/python/keras/backend.py,2478,function,"Element-wise value clipping. Arguments: x: Tensor or variable. @@ -28780,7 +34212,7 @@ Arguments: Returns: A tensor." -4598,equal,tensorflow/tensorflow/python/keras/backend.py,2502,function,"Element-wise equality between two tensors. +4615,equal,tensorflow/tensorflow/python/keras/backend.py,2502,function,"Element-wise equality between two tensors. Arguments: x: Tensor or variable. @@ -28788,7 +34220,7 @@ Arguments: Returns: A bool tensor." -4599,not_equal,tensorflow/tensorflow/python/keras/backend.py,2517,function,"Element-wise inequality between two tensors. +4616,not_equal,tensorflow/tensorflow/python/keras/backend.py,2517,function,"Element-wise inequality between two tensors. Arguments: x: Tensor or variable. @@ -28796,7 +34228,7 @@ Arguments: Returns: A bool tensor." -4600,greater,tensorflow/tensorflow/python/keras/backend.py,2532,function,"Element-wise truth value of (x > y). +4617,greater,tensorflow/tensorflow/python/keras/backend.py,2532,function,"Element-wise truth value of (x > y). Arguments: x: Tensor or variable. @@ -28804,7 +34236,7 @@ Arguments: Returns: A bool tensor." -4601,greater_equal,tensorflow/tensorflow/python/keras/backend.py,2547,function,"Element-wise truth value of (x >= y). +4618,greater_equal,tensorflow/tensorflow/python/keras/backend.py,2547,function,"Element-wise truth value of (x >= y). Arguments: x: Tensor or variable. @@ -28812,7 +34244,7 @@ Arguments: Returns: A bool tensor." -4602,less,tensorflow/tensorflow/python/keras/backend.py,2562,function,"Element-wise truth value of (x < y). +4619,less,tensorflow/tensorflow/python/keras/backend.py,2562,function,"Element-wise truth value of (x < y). Arguments: x: Tensor or variable. @@ -28820,7 +34252,7 @@ Arguments: Returns: A bool tensor." -4603,less_equal,tensorflow/tensorflow/python/keras/backend.py,2577,function,"Element-wise truth value of (x <= y). +4620,less_equal,tensorflow/tensorflow/python/keras/backend.py,2577,function,"Element-wise truth value of (x <= y). Arguments: x: Tensor or variable. @@ -28828,7 +34260,7 @@ Arguments: Returns: A bool tensor." -4604,maximum,tensorflow/tensorflow/python/keras/backend.py,2592,function,"Element-wise maximum of two tensors. +4621,maximum,tensorflow/tensorflow/python/keras/backend.py,2592,function,"Element-wise maximum of two tensors. Arguments: x: Tensor or variable. @@ -28846,7 +34278,7 @@ Examples: " -4605,minimum,tensorflow/tensorflow/python/keras/backend.py,2617,function,"Element-wise minimum of two tensors. +4622,minimum,tensorflow/tensorflow/python/keras/backend.py,2617,function,"Element-wise minimum of two tensors. Arguments: x: Tensor or variable. @@ -28854,21 +34286,21 @@ Arguments: Returns: A tensor." -4606,sin,tensorflow/tensorflow/python/keras/backend.py,2632,function,"Computes sin of x element-wise. +4623,sin,tensorflow/tensorflow/python/keras/backend.py,2632,function,"Computes sin of x element-wise. Arguments: x: Tensor or variable. Returns: A tensor." -4607,cos,tensorflow/tensorflow/python/keras/backend.py,2646,function,"Computes cos of x element-wise. +4624,cos,tensorflow/tensorflow/python/keras/backend.py,2646,function,"Computes cos of x element-wise. Arguments: x: Tensor or variable. Returns: A tensor." -4608,_regular_normalize_batch_in_training,tensorflow/tensorflow/python/keras/backend.py,2658,function,"Non-fused version of `normalize_batch_in_training`. +4625,normalize_batch_in_training,tensorflow/tensorflow/python/keras/backend.py,2761,function,"Computes mean and std for batch then apply batch_normalization on batch. Arguments: x: Input tensor or variable. @@ -28880,43 +34312,7 @@ Arguments: Returns: A tuple length of 3, `(normalized_tensor, mean, variance)`." -4609,_broadcast_normalize_batch_in_training,tensorflow/tensorflow/python/keras/backend.py,2681,function,"Non-fused, broadcast version of `normalize_batch_in_training`. - -Arguments: - x: Input tensor or variable. - gamma: Tensor by which to scale the input. - beta: Tensor with which to center the input. - reduction_axes: iterable of integers, - axes over which to normalize. - epsilon: Fuzz factor. - -Returns: - A tuple length of 3, `(normalized_tensor, mean, variance)`." -4610,_fused_normalize_batch_in_training,tensorflow/tensorflow/python/keras/backend.py,2724,function,"Fused version of `normalize_batch_in_training`. - -Arguments: - x: Input tensor or variable. - gamma: Tensor by which to scale the input. - beta: Tensor with which to center the input. - reduction_axes: iterable of integers, - axes over which to normalize. - epsilon: Fuzz factor. - -Returns: - A tuple length of 3, `(normalized_tensor, mean, variance)`." -4611,normalize_batch_in_training,tensorflow/tensorflow/python/keras/backend.py,2761,function,"Computes mean and std for batch then apply batch_normalization on batch. - -Arguments: - x: Input tensor or variable. - gamma: Tensor by which to scale the input. - beta: Tensor with which to center the input. - reduction_axes: iterable of integers, - axes over which to normalize. - epsilon: Fuzz factor. - -Returns: - A tuple length of 3, `(normalized_tensor, mean, variance)`." -4612,batch_normalization,tensorflow/tensorflow/python/keras/backend.py,2792,function,"Applies batch normalization on x given mean, var, beta and gamma. +4626,batch_normalization,tensorflow/tensorflow/python/keras/backend.py,2792,function,"Applies batch normalization on x given mean, var, beta and gamma. I.e. returns: `output = (x - mean) / (sqrt(var) + epsilon) * gamma + beta` @@ -28933,7 +34329,7 @@ Arguments: Returns: A tensor." -4613,concatenate,tensorflow/tensorflow/python/keras/backend.py,2855,function,"Concatenates a list of tensors alongside the specified axis. +4627,concatenate,tensorflow/tensorflow/python/keras/backend.py,2855,function,"Concatenates a list of tensors alongside the specified axis. Arguments: tensors: list of tensors to concatenate. @@ -28951,7 +34347,7 @@ Example: array([[ 1, 2, 3, 10, 20, 30], [ 4, 5, 6, 40, 50, 60], [ 7, 8, 9, 70, 80, 90]], dtype=int32)>" -4614,reshape,tensorflow/tensorflow/python/keras/backend.py,2893,function,"Reshapes a tensor to the specified shape. +4628,reshape,tensorflow/tensorflow/python/keras/backend.py,2893,function,"Reshapes a tensor to the specified shape. Arguments: x: Tensor or variable. @@ -28973,7 +34369,7 @@ Example: " -4615,permute_dimensions,tensorflow/tensorflow/python/keras/backend.py,2923,function,"Permutes axes in a tensor. +4629,permute_dimensions,tensorflow/tensorflow/python/keras/backend.py,2923,function,"Permutes axes in a tensor. Arguments: x: Tensor or variable. @@ -28997,7 +34393,7 @@ Example: array([[ 1, 4, 7, 10], [ 2, 5, 8, 11], [ 3, 6, 9, 12]], dtype=int32)>" -4616,resize_images,tensorflow/tensorflow/python/keras/backend.py,2955,function,"Resizes the images contained in a 4D tensor. +4630,resize_images,tensorflow/tensorflow/python/keras/backend.py,2955,function,"Resizes the images contained in a 4D tensor. Arguments: x: Tensor or variable to resize. @@ -29012,7 +34408,7 @@ Returns: Raises: ValueError: in case of incorrect value for `data_format` or `interpolation`." -4617,resize_volumes,tensorflow/tensorflow/python/keras/backend.py,3019,function,"Resizes the volume contained in a 5D tensor. +4631,resize_volumes,tensorflow/tensorflow/python/keras/backend.py,3019,function,"Resizes the volume contained in a 5D tensor. Arguments: x: Tensor or variable to resize. @@ -29027,7 +34423,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4618,repeat_elements,tensorflow/tensorflow/python/keras/backend.py,3052,function,"Repeats the elements of a tensor along an axis, like `np.repeat`. +4632,repeat_elements,tensorflow/tensorflow/python/keras/backend.py,3052,function,"Repeats the elements of a tensor along an axis, like `np.repeat`. If `x` has shape `(s1, s2, s3)` and `axis` is `1`, the output will have shape `(s1, s2 * rep, s3)`. @@ -29046,7 +34442,7 @@ Example: >>> tf.keras.backend.repeat_elements(b, rep=2, axis=0) " -4619,repeat,tensorflow/tensorflow/python/keras/backend.py,3114,function,"Repeats a 2D tensor. +4633,repeat,tensorflow/tensorflow/python/keras/backend.py,3114,function,"Repeats a 2D tensor. if `x` has shape (samples, dim) and `n` is `2`, the output will have shape `(samples, 2, dim)`. @@ -29071,7 +34467,7 @@ Example: [1, 2]], [[3, 4], [3, 4]]], dtype=int32)>" -4620,arange,tensorflow/tensorflow/python/keras/backend.py,3150,function,"Creates a 1D tensor containing a sequence of integers. +4634,arange,tensorflow/tensorflow/python/keras/backend.py,3150,function,"Creates a 1D tensor containing a sequence of integers. The function arguments use the same convention as Theano's arange: if only one argument is provided, @@ -29094,7 +34490,7 @@ Example: >>> tf.keras.backend.arange(start=0, stop=10, step=1.5) " -4621,tile,tensorflow/tensorflow/python/keras/backend.py,3189,function,"Creates a tensor by tiling `x` by `n`. +4635,tile,tensorflow/tensorflow/python/keras/backend.py,3189,function,"Creates a tensor by tiling `x` by `n`. Arguments: x: A tensor or variable @@ -29103,7 +34499,7 @@ Arguments: Returns: A tiled tensor." -4622,flatten,tensorflow/tensorflow/python/keras/backend.py,3207,function,"Flatten a tensor. +4636,flatten,tensorflow/tensorflow/python/keras/backend.py,3207,function,"Flatten a tensor. Arguments: x: A tensor or variable. @@ -29121,7 +34517,7 @@ Example: >>> tf.keras.backend.flatten(b) " -4623,batch_flatten,tensorflow/tensorflow/python/keras/backend.py,3233,function,"Turn a nD tensor into a 2D tensor with same 0th dimension. +4637,batch_flatten,tensorflow/tensorflow/python/keras/backend.py,3233,function,"Turn a nD tensor into a 2D tensor with same 0th dimension. In other words, it flattens each data samples of a batch. @@ -29138,7 +34534,7 @@ Examples: >>> x_batch_flatten = batch_flatten(x_batch) >>> tf.keras.backend.int_shape(x_batch_flatten) (2, 60)" -4624,expand_dims,tensorflow/tensorflow/python/keras/backend.py,3259,function,"Adds a 1-sized dimension at index ""axis"". +4638,expand_dims,tensorflow/tensorflow/python/keras/backend.py,3259,function,"Adds a 1-sized dimension at index ""axis"". Arguments: x: A tensor or variable. @@ -29146,7 +34542,7 @@ Arguments: Returns: A tensor with expanded dimensions." -4625,squeeze,tensorflow/tensorflow/python/keras/backend.py,3274,function,"Removes a 1-dimension from the tensor at index ""axis"". +4639,squeeze,tensorflow/tensorflow/python/keras/backend.py,3274,function,"Removes a 1-dimension from the tensor at index ""axis"". Arguments: x: A tensor or variable. @@ -29154,7 +34550,7 @@ Arguments: Returns: A tensor with the same data as `x` but reduced dimensions." -4626,temporal_padding,tensorflow/tensorflow/python/keras/backend.py,3289,function,"Pads the middle dimension of a 3D tensor. +4640,temporal_padding,tensorflow/tensorflow/python/keras/backend.py,3289,function,"Pads the middle dimension of a 3D tensor. Arguments: x: Tensor or variable. @@ -29163,7 +34559,7 @@ Arguments: Returns: A padded 3D tensor." -4627,spatial_2d_padding,tensorflow/tensorflow/python/keras/backend.py,3307,function,"Pads the 2nd and 3rd dimensions of a 4D tensor. +4641,spatial_2d_padding,tensorflow/tensorflow/python/keras/backend.py,3307,function,"Pads the 2nd and 3rd dimensions of a 4D tensor. Arguments: x: Tensor or variable. @@ -29176,7 +34572,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4628,spatial_3d_padding,tensorflow/tensorflow/python/keras/backend.py,3339,function,"Pads 5D tensor with zeros along the depth, height, width dimensions. +4642,spatial_3d_padding,tensorflow/tensorflow/python/keras/backend.py,3339,function,"Pads 5D tensor with zeros along the depth, height, width dimensions. Pads these dimensions with respectively ""padding[0]"", ""padding[1]"" and ""padding[2]"" zeros left and right. @@ -29197,7 +34593,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4629,stack,tensorflow/tensorflow/python/keras/backend.py,3384,function,"Stacks a list of rank `R` tensors into a rank `R+1` tensor. +4643,stack,tensorflow/tensorflow/python/keras/backend.py,3384,function,"Stacks a list of rank `R` tensors into a rank `R+1` tensor. Arguments: x: List of tensors. @@ -29216,7 +34612,7 @@ Example: [ 3, 4]], [[10, 20], [30, 40]]], dtype=int32)>" -4630,one_hot,tensorflow/tensorflow/python/keras/backend.py,3411,function,"Computes the one-hot representation of an integer tensor. +4644,one_hot,tensorflow/tensorflow/python/keras/backend.py,3411,function,"Computes the one-hot representation of an integer tensor. Arguments: indices: nD integer tensor of shape @@ -29229,7 +34625,7 @@ Returns: Returns: The one-hot tensor." -4631,reverse,tensorflow/tensorflow/python/keras/backend.py,3431,function,"Reverse a tensor along the specified axes. +4645,reverse,tensorflow/tensorflow/python/keras/backend.py,3431,function,"Reverse a tensor along the specified axes. Arguments: x: Tensor to reverse. @@ -29238,7 +34634,7 @@ Arguments: Returns: A tensor." -4632,get_value,tensorflow/tensorflow/python/keras/backend.py,3477,function,"Returns the value of a variable. +4646,get_value,tensorflow/tensorflow/python/keras/backend.py,3477,function,"Returns the value of a variable. `backend.get_value` is the compliment of `backend.set_value`, and provides a generic interface for reading from variables while abstracting away the @@ -29251,7 +34647,7 @@ Arguments: Returns: A Numpy array." -4633,batch_get_value,tensorflow/tensorflow/python/keras/backend.py,3512,function,"Returns the value of more than one tensor variable. +4647,batch_get_value,tensorflow/tensorflow/python/keras/backend.py,3512,function,"Returns the value of more than one tensor variable. Arguments: tensors: list of ops to run. @@ -29261,7 +34657,7 @@ Returns: Raises: RuntimeError: If this method is called inside defun." -4634,set_value,tensorflow/tensorflow/python/keras/backend.py,3535,function,"Sets the value of a variable, from a Numpy array. +4648,set_value,tensorflow/tensorflow/python/keras/backend.py,3535,function,"Sets the value of a variable, from a Numpy array. `backend.set_value` is the compliment of `backend.get_value`, and provides a generic interface for assigning to variables while abstracting away the @@ -29273,12 +34669,12 @@ Arguments: x: Variable to set to a new value. value: Value to set the tensor to, as a Numpy array (of the same shape)." -4635,batch_set_value,tensorflow/tensorflow/python/keras/backend.py,3574,function,"Sets the values of many tensor variables at once. +4649,batch_set_value,tensorflow/tensorflow/python/keras/backend.py,3574,function,"Sets the values of many tensor variables at once. Arguments: tuples: a list of tuples `(tensor, value)`. `value` should be a Numpy array." -4636,print_tensor,tensorflow/tensorflow/python/keras/backend.py,3617,function,"Prints `message` and the tensor value when evaluated. +4650,print_tensor,tensorflow/tensorflow/python/keras/backend.py,3617,function,"Prints `message` and the tensor value when evaluated. Note that `print_tensor` returns a new tensor identical to `x` which should be used in the following code. Otherwise the @@ -29298,7 +34694,7 @@ Arguments: Returns: The same tensor `x`, unchanged." -4637,GraphExecutionFunction,tensorflow/tensorflow/python/keras/backend.py,3651,class,"Runs a computation graph. +4651,GraphExecutionFunction,tensorflow/tensorflow/python/keras/backend.py,3651,class,"Runs a computation graph. It's possible to pass arguments to `tf.Session.run()` via `session_kwargs`. In particular additional operations via `fetches` argument and additional @@ -29315,7 +34711,7 @@ Arguments: name: A name to help users identify what this function does. session_kwargs: Arguments to `tf.Session.run()`: `fetches`, `feed_dict`, `options`, `run_metadata`." -4638,eval_in_eager_or_function,tensorflow/tensorflow/python/keras/backend.py,3847,function,"Method to evaluate a tensor in eager or in a tf.function. +4652,eval_in_eager_or_function,tensorflow/tensorflow/python/keras/backend.py,3847,function,"Method to evaluate a tensor in eager or in a tf.function. In the case of a tf.function, it will lift the tensor out of the function and try to evaluate that piece of the graph. @@ -29329,7 +34725,7 @@ Arguments: outputs: tensors to fetch. Returns: The value of the tensors (as numpy arrays)." -4639,function,tensorflow/tensorflow/python/keras/backend.py,3918,function,"Instantiates a Keras function. +4653,function,tensorflow/tensorflow/python/keras/backend.py,3918,function,"Instantiates a Keras function. Arguments: inputs: List of placeholder tensors. @@ -29343,7 +34739,7 @@ Returns: Raises: ValueError: if invalid kwargs are passed in or if in eager execution." -4640,gradients,tensorflow/tensorflow/python/keras/backend.py,3965,function,"Returns the gradients of `loss` w.r.t. `variables`. +4654,gradients,tensorflow/tensorflow/python/keras/backend.py,3965,function,"Returns the gradients of `loss` w.r.t. `variables`. Arguments: loss: Scalar tensor to minimize. @@ -29351,7 +34747,7 @@ Arguments: Returns: A gradients tensor." -4641,stop_gradient,tensorflow/tensorflow/python/keras/backend.py,3981,function,"Returns `variables` but with zero gradient w.r.t. every other variable. +4655,stop_gradient,tensorflow/tensorflow/python/keras/backend.py,3981,function,"Returns `variables` but with zero gradient w.r.t. every other variable. Arguments: variables: Tensor or list of tensors to consider constant with respect @@ -29361,7 +34757,7 @@ Arguments: Returns: A single tensor or a list of tensors (depending on the passed argument) that has no gradient with respect to any other variable." -4642,rnn,tensorflow/tensorflow/python/keras/backend.py,4003,function,"Iterates over the time dimension of a tensor. +4656,rnn,tensorflow/tensorflow/python/keras/backend.py,4003,function,"Iterates over the time dimension of a tensor. Arguments: step_function: RNN step function. @@ -29419,7 +34815,7 @@ Raises: number. ValueError: if `mask` is provided (not `None`) but states is not provided (`len(states)` == 0)." -4643,switch,tensorflow/tensorflow/python/keras/backend.py,4398,function,"Switches between two operations depending on a scalar value. +4657,switch,tensorflow/tensorflow/python/keras/backend.py,4398,function,"Switches between two operations depending on a scalar value. Note that both `then_expression` and `else_expression` should be symbolic tensors of the *same shape*. @@ -29434,7 +34830,7 @@ Returns: Raises: ValueError: If rank of `condition` is greater than rank of expressions." -4644,in_train_phase,tensorflow/tensorflow/python/keras/backend.py,4462,function,"Selects `x` in train phase, and `alt` otherwise. +4658,in_train_phase,tensorflow/tensorflow/python/keras/backend.py,4462,function,"Selects `x` in train phase, and `alt` otherwise. Note that `alt` should have the *same shape* as `x`. @@ -29450,22 +34846,7 @@ Arguments: Returns: Either `x` or `alt` based on the `training` flag. the `training` flag defaults to `K.learning_phase()`." -4645,in_test_phase,tensorflow/tensorflow/python/keras/backend.py,4507,function,"Selects `x` in test phase, and `alt` otherwise. - -Note that `alt` should have the *same shape* as `x`. - -Arguments: - x: What to return in test phase - (tensor or callable that returns a tensor). - alt: What to return otherwise - (tensor or callable that returns a tensor). - training: Optional scalar tensor - (or Python boolean, or Python integer) - specifying the learning phase. - -Returns: - Either `x` or `alt` based on `K.learning_phase`." -4646,relu,tensorflow/tensorflow/python/keras/backend.py,4532,function,"Rectified linear unit. +4659,relu,tensorflow/tensorflow/python/keras/backend.py,4532,function,"Rectified linear unit. With default values, it returns element-wise `max(x, 0)`. @@ -29482,7 +34863,7 @@ Arguments: Returns: A tensor." -4647,elu,tensorflow/tensorflow/python/keras/backend.py,4589,function,"Exponential linear unit. +4660,elu,tensorflow/tensorflow/python/keras/backend.py,4589,function,"Exponential linear unit. Arguments: x: A tensor or variable to compute the activation function for. @@ -29490,7 +34871,7 @@ Arguments: Returns: A tensor." -4648,softmax,tensorflow/tensorflow/python/keras/backend.py,4608,function,"Softmax of a tensor. +4661,softmax,tensorflow/tensorflow/python/keras/backend.py,4608,function,"Softmax of a tensor. Arguments: x: A tensor or variable. @@ -29499,21 +34880,21 @@ Arguments: Returns: A tensor." -4649,softplus,tensorflow/tensorflow/python/keras/backend.py,4624,function,"Softplus of a tensor. +4662,softplus,tensorflow/tensorflow/python/keras/backend.py,4624,function,"Softplus of a tensor. Arguments: x: A tensor or variable. Returns: A tensor." -4650,softsign,tensorflow/tensorflow/python/keras/backend.py,4638,function,"Softsign of a tensor. +4663,softsign,tensorflow/tensorflow/python/keras/backend.py,4638,function,"Softsign of a tensor. Arguments: x: A tensor or variable. Returns: A tensor." -4651,categorical_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4652,function,"Categorical crossentropy between an output tensor and a target tensor. +4664,categorical_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4652,function,"Categorical crossentropy between an output tensor and a target tensor. Arguments: target: A tensor of the same shape as `output`. @@ -29552,7 +34933,7 @@ tf.Tensor( >>> loss = tf.keras.backend.categorical_crossentropy(a, a) >>> print(np.around(loss, 5)) [0. 0. 0.]" -4652,sparse_categorical_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4723,function,"Categorical crossentropy with integer targets. +4665,sparse_categorical_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4723,function,"Categorical crossentropy with integer targets. Arguments: target: An integer tensor. @@ -29570,7 +34951,7 @@ Returns: Raises: ValueError: if `axis` is neither -1 nor one of the axes of `output`." -4653,binary_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4807,function,"Binary crossentropy between an output tensor and a target tensor. +4666,binary_crossentropy,tensorflow/tensorflow/python/keras/backend.py,4807,function,"Binary crossentropy between an output tensor and a target tensor. Arguments: target: A tensor with the same shape as `output`. @@ -29581,14 +34962,14 @@ Arguments: Returns: A tensor." -4654,sigmoid,tensorflow/tensorflow/python/keras/backend.py,4846,function,"Element-wise sigmoid. +4667,sigmoid,tensorflow/tensorflow/python/keras/backend.py,4846,function,"Element-wise sigmoid. Arguments: x: A tensor or variable. Returns: A tensor." -4655,hard_sigmoid,tensorflow/tensorflow/python/keras/backend.py,4860,function,"Segment-wise linear approximation of sigmoid. +4668,hard_sigmoid,tensorflow/tensorflow/python/keras/backend.py,4860,function,"Segment-wise linear approximation of sigmoid. Faster than sigmoid. Returns `0.` if `x < -2.5`, `1.` if `x > 2.5`. @@ -29599,14 +34980,14 @@ Arguments: Returns: A tensor." -4656,tanh,tensorflow/tensorflow/python/keras/backend.py,4883,function,"Element-wise tanh. +4669,tanh,tensorflow/tensorflow/python/keras/backend.py,4883,function,"Element-wise tanh. Arguments: x: A tensor or variable. Returns: A tensor." -4657,dropout,tensorflow/tensorflow/python/keras/backend.py,4897,function,"Sets entries in `x` to zero at random, while scaling the entire tensor. +4670,dropout,tensorflow/tensorflow/python/keras/backend.py,4897,function,"Sets entries in `x` to zero at random, while scaling the entire tensor. Arguments: x: tensor @@ -29618,7 +34999,7 @@ Arguments: Returns: A tensor." -4658,l2_normalize,tensorflow/tensorflow/python/keras/backend.py,4918,function,"Normalizes a tensor wrt the L2 norm alongside the specified axis. +4671,l2_normalize,tensorflow/tensorflow/python/keras/backend.py,4918,function,"Normalizes a tensor wrt the L2 norm alongside the specified axis. Arguments: x: Tensor or variable. @@ -29626,7 +35007,7 @@ Arguments: Returns: A tensor." -4659,in_top_k,tensorflow/tensorflow/python/keras/backend.py,4933,function,"Returns whether the `targets` are in the top `k` `predictions`. +4672,in_top_k,tensorflow/tensorflow/python/keras/backend.py,4933,function,"Returns whether the `targets` are in the top `k` `predictions`. Arguments: predictions: A tensor of shape `(batch_size, classes)` and type `float32`. @@ -29637,45 +35018,7 @@ Returns: A 1D tensor of length `batch_size` and type `bool`. `output[i]` is `True` if `predictions[i, targets[i]]` is within top-`k` values of `predictions[i]`." -4660,_preprocess_conv1d_input,tensorflow/tensorflow/python/keras/backend.py,4952,function,"Transpose and cast the input before the conv1d. - -Arguments: - x: input tensor. - data_format: string, `""channels_last""` or `""channels_first""`. - -Returns: - A tensor." -4661,_preprocess_conv2d_input,tensorflow/tensorflow/python/keras/backend.py,4971,function,"Transpose and cast the input before the conv2d. - -Arguments: - x: input tensor. - data_format: string, `""channels_last""` or `""channels_first""`. - force_transpose: Boolean. If True, the input will always be transposed - from NCHW to NHWC if `data_format` is `""channels_first""`. - If False, the transposition only occurs on CPU (GPU ops are - assumed to support NCHW). - -Returns: - A tensor." -4662,_preprocess_conv3d_input,tensorflow/tensorflow/python/keras/backend.py,4994,function,"Transpose and cast the input before the conv3d. - -Arguments: - x: input tensor. - data_format: string, `""channels_last""` or `""channels_first""`. - -Returns: - A tensor." -4663,_preprocess_padding,tensorflow/tensorflow/python/keras/backend.py,5013,function,"Convert keras' padding to TensorFlow's padding. - -Arguments: - padding: string, one of 'same' , 'valid' - -Returns: - a string, one of 'SAME', 'VALID'. - -Raises: - ValueError: if invalid `padding'`" -4664,conv1d,tensorflow/tensorflow/python/keras/backend.py,5036,function,"1D convolution. +4673,conv1d,tensorflow/tensorflow/python/keras/backend.py,5036,function,"1D convolution. Arguments: x: Tensor or variable. @@ -29691,7 +35034,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4665,conv2d,tensorflow/tensorflow/python/keras/backend.py,5087,function,"2D convolution. +4674,conv2d,tensorflow/tensorflow/python/keras/backend.py,5087,function,"2D convolution. Arguments: x: Tensor or variable. @@ -29707,7 +35050,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4666,conv2d_transpose,tensorflow/tensorflow/python/keras/backend.py,5131,function,"2D deconvolution (i.e. +4675,conv2d_transpose,tensorflow/tensorflow/python/keras/backend.py,5131,function,"2D deconvolution (i.e. transposed convolution). @@ -29726,7 +35069,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4667,separable_conv1d,tensorflow/tensorflow/python/keras/backend.py,5203,function,"1D convolution with separable filters. +4676,separable_conv1d,tensorflow/tensorflow/python/keras/backend.py,5203,function,"1D convolution with separable filters. Arguments: x: input tensor @@ -29743,7 +35086,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4668,separable_conv2d,tensorflow/tensorflow/python/keras/backend.py,5272,function,"2D convolution with separable filters. +4677,separable_conv2d,tensorflow/tensorflow/python/keras/backend.py,5272,function,"2D convolution with separable filters. Arguments: x: input tensor @@ -29762,7 +35105,7 @@ Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`. ValueError: if `strides` is not a tuple of 2 integers." -4669,depthwise_conv2d,tensorflow/tensorflow/python/keras/backend.py,5330,function,"2D convolution with separable filters. +4678,depthwise_conv2d,tensorflow/tensorflow/python/keras/backend.py,5330,function,"2D convolution with separable filters. Arguments: x: input tensor @@ -29779,7 +35122,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4670,conv3d,tensorflow/tensorflow/python/keras/backend.py,5380,function,"3D convolution. +4679,conv3d,tensorflow/tensorflow/python/keras/backend.py,5380,function,"3D convolution. Arguments: x: Tensor or variable. @@ -29795,7 +35138,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4671,conv3d_transpose,tensorflow/tensorflow/python/keras/backend.py,5422,function,"3D deconvolution (i.e. +4680,conv3d_transpose,tensorflow/tensorflow/python/keras/backend.py,5422,function,"3D deconvolution (i.e. transposed convolution). @@ -29813,7 +35156,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` or `channels_first`." -4672,pool2d,tensorflow/tensorflow/python/keras/backend.py,5483,function,"2D Pooling. +4681,pool2d,tensorflow/tensorflow/python/keras/backend.py,5483,function,"2D Pooling. Arguments: x: Tensor or variable. @@ -29832,7 +35175,7 @@ Raises: ValueError: if `pool_size` is not a tuple of 2 integers. ValueError: if `strides` is not a tuple of 2 integers. ValueError: if `pool_mode` is neither `""max""` or `""avg""`." -4673,pool3d,tensorflow/tensorflow/python/keras/backend.py,5543,function,"3D Pooling. +4682,pool3d,tensorflow/tensorflow/python/keras/backend.py,5543,function,"3D Pooling. Arguments: x: Tensor or variable. @@ -29849,7 +35192,7 @@ Raises: ValueError: if `data_format` is neither `""channels_last""` or `""channels_first""`. ValueError: if `pool_mode` is neither `""max""` or `""avg""`." -4674,local_conv,tensorflow/tensorflow/python/keras/backend.py,5595,function,"Apply N-D convolution with un-shared weights. +4683,local_conv,tensorflow/tensorflow/python/keras/backend.py,5595,function,"Apply N-D convolution with un-shared weights. Arguments: inputs: (N+2)-D tensor with shape @@ -29879,7 +35222,7 @@ Returns: Raises: ValueError: if `data_format` is neither `channels_last` nor `channels_first`." -4675,local_conv1d,tensorflow/tensorflow/python/keras/backend.py,5674,function,"Apply 1D conv with un-shared weights. +4684,local_conv1d,tensorflow/tensorflow/python/keras/backend.py,5674,function,"Apply 1D conv with un-shared weights. Arguments: inputs: 3D tensor with shape: @@ -29902,7 +35245,7 @@ Returns: or 3D tensor with shape: (batch_size, filters, output_length) if data_format='channels_last'." -4676,local_conv2d,tensorflow/tensorflow/python/keras/backend.py,5710,function,"Apply 2D conv with un-shared weights. +4685,local_conv2d,tensorflow/tensorflow/python/keras/backend.py,5710,function,"Apply 2D conv with un-shared weights. Arguments: inputs: 4D tensor with shape: @@ -29927,7 +35270,7 @@ Returns: or 4D tensor with shape: (batch_size, new_rows, new_cols, filters) if data_format='channels_last'." -4677,bias_add,tensorflow/tensorflow/python/keras/backend.py,5752,function,"Adds a bias vector to a tensor. +4686,bias_add,tensorflow/tensorflow/python/keras/backend.py,5752,function,"Adds a bias vector to a tensor. Arguments: x: Tensor or variable. @@ -29943,7 +35286,7 @@ Raises: 2. invalid bias shape. the bias should be either a vector or a tensor with ndim(x) - 1 dimension" -4678,random_normal,tensorflow/tensorflow/python/keras/backend.py,5797,function,"Returns a tensor with normal distribution of values. +4687,random_normal,tensorflow/tensorflow/python/keras/backend.py,5797,function,"Returns a tensor with normal distribution of values. It is an alias to `tf.random.normal`. @@ -29968,7 +35311,7 @@ Example: >>> random_normal_tensor " -4679,random_uniform,tensorflow/tensorflow/python/keras/backend.py,5834,function,"Returns a tensor with uniform distribution of values. +4688,random_uniform,tensorflow/tensorflow/python/keras/backend.py,5834,function,"Returns a tensor with uniform distribution of values. Arguments: shape: A tuple of integers, the shape of tensor to create. @@ -29989,7 +35332,7 @@ Example: >>> random_uniform_tensor " -4680,random_binomial,tensorflow/tensorflow/python/keras/backend.py,5868,function,"Returns a tensor with random binomial distribution of values. +4689,random_binomial,tensorflow/tensorflow/python/keras/backend.py,5868,function,"Returns a tensor with random binomial distribution of values. DEPRECATED, use `tf.keras.backend.random_bernoulli` instead. @@ -30013,7 +35356,7 @@ Example: >>> random_binomial_tensor " -4681,random_bernoulli,tensorflow/tensorflow/python/keras/backend.py,5905,function,"Returns a tensor with random bernoulli distribution of values. +4690,random_bernoulli,tensorflow/tensorflow/python/keras/backend.py,5905,function,"Returns a tensor with random bernoulli distribution of values. Arguments: shape: A tuple of integers, the shape of tensor to create. @@ -30023,7 +35366,7 @@ Arguments: Returns: A tensor." -4682,truncated_normal,tensorflow/tensorflow/python/keras/backend.py,5922,function,"Returns a tensor with truncated random normal distribution of values. +4691,truncated_normal,tensorflow/tensorflow/python/keras/backend.py,5922,function,"Returns a tensor with truncated random normal distribution of values. The generated values follow a normal distribution with specified mean and standard deviation, @@ -30039,7 +35382,7 @@ Arguments: Returns: A tensor." -4683,ctc_label_dense_to_sparse,tensorflow/tensorflow/python/keras/backend.py,5957,function,"Converts CTC labels from dense to sparse. +4692,ctc_label_dense_to_sparse,tensorflow/tensorflow/python/keras/backend.py,5957,function,"Converts CTC labels from dense to sparse. Arguments: labels: dense CTC labels. @@ -30047,7 +35390,7 @@ Arguments: Returns: A sparse tensor representation of the labels." -4684,ctc_batch_cost,tensorflow/tensorflow/python/keras/backend.py,6004,function,"Runs CTC loss algorithm on each batch element. +4693,ctc_batch_cost,tensorflow/tensorflow/python/keras/backend.py,6004,function,"Runs CTC loss algorithm on each batch element. Arguments: y_true: tensor `(samples, max_string_length)` @@ -30062,7 +35405,7 @@ Arguments: Returns: Tensor with shape (samples,1) containing the CTC loss of each element." -4685,ctc_decode,tensorflow/tensorflow/python/keras/backend.py,6037,function,"Decodes the output of a softmax. +4694,ctc_decode,tensorflow/tensorflow/python/keras/backend.py,6037,function,"Decodes the output of a softmax. Can use either greedy search (also known as best path) or a constrained dictionary search. @@ -30089,7 +35432,7 @@ Returns: Important: blank labels are returned as `-1`. Tensor `(top_paths, )` that contains the log probability of each decoded sequence." -4686,map_fn,tensorflow/tensorflow/python/keras/backend.py,6093,function,"Map the function fn over the elements elems and return the outputs. +4695,map_fn,tensorflow/tensorflow/python/keras/backend.py,6093,function,"Map the function fn over the elements elems and return the outputs. Arguments: fn: Callable that will be called upon each element in elems @@ -30099,7 +35442,7 @@ Arguments: Returns: Tensor with dtype `dtype`." -4687,foldl,tensorflow/tensorflow/python/keras/backend.py,6109,function,"Reduce elems using fn to combine them from left to right. +4696,foldl,tensorflow/tensorflow/python/keras/backend.py,6109,function,"Reduce elems using fn to combine them from left to right. Arguments: fn: Callable that will be called upon each element in elems and an @@ -30110,7 +35453,7 @@ Arguments: Returns: Tensor with same type and shape as `initializer`." -4688,foldr,tensorflow/tensorflow/python/keras/backend.py,6126,function,"Reduce elems using fn to combine them from right to left. +4697,foldr,tensorflow/tensorflow/python/keras/backend.py,6126,function,"Reduce elems using fn to combine them from right to left. Arguments: fn: Callable that will be called upon each element in elems and an @@ -30121,13 +35464,12 @@ Arguments: Returns: Same type and shape as initializer" -4689,configure_and_create_distributed_session,tensorflow/tensorflow/python/keras/backend.py,6190,function,Configure session config and create a session with it. -4690,is_tpu_strategy,tensorflow/tensorflow/python/keras/backend.py,6235,function,We're executing TPU Strategy. -4691,cast_variables_to_tensor,tensorflow/tensorflow/python/keras/backend.py,6241,function, -4692,_is_symbolic_tensor,tensorflow/tensorflow/python/keras/backend.py,6251,function, -4693,convert_inputs_if_ragged,tensorflow/tensorflow/python/keras/backend.py,6255,function,Converts any ragged tensors to dense. -4694,maybe_convert_to_ragged,tensorflow/tensorflow/python/keras/backend.py,6278,function,Converts any ragged input back to its initial structure. -4695,ContextValueCache,tensorflow/tensorflow/python/keras/backend.py,6286,class,"Container that caches (possibly tensor) values based on the context. +4698,configure_and_create_distributed_session,tensorflow/tensorflow/python/keras/backend.py,6190,function,Configure session config and create a session with it. +4699,is_tpu_strategy,tensorflow/tensorflow/python/keras/backend.py,6235,function,We're executing TPU Strategy. +4700,cast_variables_to_tensor,tensorflow/tensorflow/python/keras/backend.py,6241,function, +4701,convert_inputs_if_ragged,tensorflow/tensorflow/python/keras/backend.py,6255,function,Converts any ragged tensors to dense. +4702,maybe_convert_to_ragged,tensorflow/tensorflow/python/keras/backend.py,6278,function,Converts any ragged input back to its initial structure. +4703,ContextValueCache,tensorflow/tensorflow/python/keras/backend.py,6286,class,"Container that caches (possibly tensor) values based on the context. This class is similar to defaultdict, where values may be produced by the default factory specified during initialization. This class also has a default @@ -30170,7 +35512,8 @@ g = tf.get_default_graph() value = cache.setdefault(key=g, kwargs={'x': 3}) assert cache[g] == 4 ```" -4696,epsilon,tensorflow/tensorflow/python/keras/backend_config.py,35,function,"Returns the value of the fuzz factor used in numeric expressions. +4704,setdefault,tensorflow/tensorflow/python/keras/backend.py,6386,method,"Sets the default value if key is not in dict, and returns the value." +4705,epsilon,tensorflow/tensorflow/python/keras/backend_config.py,35,function,"Returns the value of the fuzz factor used in numeric expressions. Returns: A float. @@ -30178,7 +35521,7 @@ Returns: Example: >>> tf.keras.backend.epsilon() 1e-07" -4697,set_epsilon,tensorflow/tensorflow/python/keras/backend_config.py,49,function,"Sets the value of the fuzz factor used in numeric expressions. +4706,set_epsilon,tensorflow/tensorflow/python/keras/backend_config.py,49,function,"Sets the value of the fuzz factor used in numeric expressions. Arguments: value: float. New value of epsilon. @@ -30190,7 +35533,7 @@ Example: >>> tf.keras.backend.epsilon() 1e-05 >>> tf.keras.backend.set_epsilon(1e-7)" -4698,floatx,tensorflow/tensorflow/python/keras/backend_config.py,68,function,"Returns the default float type, as a string. +4707,floatx,tensorflow/tensorflow/python/keras/backend_config.py,68,function,"Returns the default float type, as a string. E.g. `'float16'`, `'float32'`, `'float64'`. @@ -30200,7 +35543,7 @@ Returns: Example: >>> tf.keras.backend.floatx() 'float32'" -4699,set_floatx,tensorflow/tensorflow/python/keras/backend_config.py,84,function,"Sets the default float type. +4708,set_floatx,tensorflow/tensorflow/python/keras/backend_config.py,84,function,"Sets the default float type. Note: It is not recommended to set this to float16 for training, as this will likely cause numeric stability issues. Instead, mixed precision, which is @@ -30222,7 +35565,7 @@ Example: Raises: ValueError: In case of invalid value." -4700,image_data_format,tensorflow/tensorflow/python/keras/backend_config.py,116,function,"Returns the default image data format convention. +4709,image_data_format,tensorflow/tensorflow/python/keras/backend_config.py,116,function,"Returns the default image data format convention. Returns: A string, either `'channels_first'` or `'channels_last'` @@ -30230,7 +35573,7 @@ Returns: Example: >>> tf.keras.backend.image_data_format() 'channels_last'" -4701,set_image_data_format,tensorflow/tensorflow/python/keras/backend_config.py,130,function,"Sets the value of the image data format convention. +4710,set_image_data_format,tensorflow/tensorflow/python/keras/backend_config.py,130,function,"Sets the value of the image data format convention. Arguments: data_format: string. `'channels_first'` or `'channels_last'`. @@ -30245,23 +35588,9 @@ Example: Raises: ValueError: In case of invalid `data_format` value." -4702,BackendConfigTest,tensorflow/tensorflow/python/keras/backend_config_test.py,27,class, -4703,compare_single_input_op_to_numpy,tensorflow/tensorflow/python/keras/backend_test.py,46,function, -4704,compare_two_inputs_op_to_numpy,tensorflow/tensorflow/python/keras/backend_test.py,74,function, -4705,BackendResetTest,tensorflow/tensorflow/python/keras/backend_test.py,103,class, -4706,BackendUtilsTest,tensorflow/tensorflow/python/keras/backend_test.py,146,class, -4707,BackendVariableTest,tensorflow/tensorflow/python/keras/backend_test.py,294,class, -4708,BackendLinearAlgebraTest,tensorflow/tensorflow/python/keras/backend_test.py,357,class, -4709,BackendShapeOpsTest,tensorflow/tensorflow/python/keras/backend_test.py,562,class, -4710,BackendNNOpsTest,tensorflow/tensorflow/python/keras/backend_test.py,748,class, -4711,BackendCrossEntropyLossesTest,tensorflow/tensorflow/python/keras/backend_test.py,1583,class, -4712,TestCTC,tensorflow/tensorflow/python/keras/backend_test.py,1735,class, -4713,TestRandomOps,tensorflow/tensorflow/python/keras/backend_test.py,1841,class, -4714,FunctionTest,tensorflow/tensorflow/python/keras/backend_test.py,1875,class, -4715,BackendGraphTests,tensorflow/tensorflow/python/keras/backend_test.py,1940,class, -4716,ControlOpsTests,tensorflow/tensorflow/python/keras/backend_test.py,2108,class, -4717,ContextValueCacheTest,tensorflow/tensorflow/python/keras/backend_test.py,2142,class, -4718,configure_callbacks,tensorflow/tensorflow/python/keras/callbacks.py,71,function,"Configures callbacks for use in various training loops. +4711,compare_single_input_op_to_numpy,tensorflow/tensorflow/python/keras/backend_test.py,46,function, +4712,compare_two_inputs_op_to_numpy,tensorflow/tensorflow/python/keras/backend_test.py,74,function, +4713,configure_callbacks,tensorflow/tensorflow/python/keras/callbacks.py,71,function,"Configures callbacks for use in various training loops. Arguments: callbacks: List of Callbacks. @@ -30278,7 +35607,7 @@ Arguments: Returns: Instance of CallbackList used to control all Callbacks." -4719,set_callback_parameters,tensorflow/tensorflow/python/keras/callbacks.py,133,function,"Sets callback parameters. +4714,set_callback_parameters,tensorflow/tensorflow/python/keras/callbacks.py,133,function,"Sets callback parameters. Arguments: callback_list: CallbackList instance. @@ -30291,10 +35620,75 @@ Arguments: verbose: int, 0 or 1. Keras logging verbosity to pass to ProgbarLogger. mode: String. One of ModeKeys.TRAIN, ModeKeys.TEST, or ModeKeys.PREDICT. Which loop mode to configure callbacks for." -4720,_is_generator_like,tensorflow/tensorflow/python/keras/callbacks.py,181,function,"Checks if data is a generator, Sequence, or Iterator." -4721,make_logs,tensorflow/tensorflow/python/keras/callbacks.py,187,function,Computes logs for sending to `on_batch_end` methods. -4722,CallbackList,tensorflow/tensorflow/python/keras/callbacks.py,199,class,Container abstracting a list of callbacks. -4723,Callback,tensorflow/tensorflow/python/keras/callbacks.py,591,class,"Abstract base class used to build new callbacks. +4715,make_logs,tensorflow/tensorflow/python/keras/callbacks.py,187,function,Computes logs for sending to `on_batch_end` methods. +4716,CallbackList,tensorflow/tensorflow/python/keras/callbacks.py,199,class,Container abstracting a list of callbacks. +4717,append,tensorflow/tensorflow/python/keras/callbacks.py,266,method, +4718,set_params,tensorflow/tensorflow/python/keras/callbacks.py,269,method, +4719,set_model,tensorflow/tensorflow/python/keras/callbacks.py,274,method, +4720,on_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,369,method, +4721,on_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,373,method, +4722,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,377,method,"Calls the `on_epoch_begin` methods of its callbacks. + +This function should only be called during TRAIN mode. + +Arguments: + epoch: Integer, index of epoch. + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4723,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,397,method,"Calls the `on_epoch_end` methods of its callbacks. + +This function should only be called during TRAIN mode. + +Arguments: + epoch: Integer, index of epoch. + logs: Dict, metric results for this training epoch, and for the + validation epoch if validation is performed. Validation result keys + are prefixed with `val_`." +4724,on_train_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,418,method,"Calls the `on_train_batch_begin` methods of its callbacks. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict, contains the return value of `model.train_step`. Typically, + the values of the `Model`'s metrics are returned. Example: + `{'loss': 0.2, 'accuracy': 0.7}`." +4725,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,430,method,"Calls the `on_train_batch_end` methods of its callbacks. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict. Aggregated metric results up until this batch." +4726,on_predict_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,462,method,"Calls the `on_predict_batch_begin` methods of its callbacks. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict, contains the return value of `model.predict_step`, + it typically returns a dict with a key 'outputs' containing + the model's outputs." +4727,on_predict_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,474,method,"Calls the `on_predict_batch_end` methods of its callbacks. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict. Aggregated metric results up until this batch." +4728,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,484,method,"Calls the `on_train_begin` methods of its callbacks. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4729,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,501,method,"Calls the `on_train_end` methods of its callbacks. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4730,on_predict_begin,tensorflow/tensorflow/python/keras/callbacks.py,552,method,"Calls the 'on_predict_begin` methods of its callbacks. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4731,on_predict_end,tensorflow/tensorflow/python/keras/callbacks.py,569,method,"Calls the `on_predict_end` methods of its callbacks. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4732,Callback,tensorflow/tensorflow/python/keras/callbacks.py,591,class,"Abstract base class used to build new callbacks. Attributes: params: Dict. Training parameters @@ -30305,7 +35699,91 @@ Attributes: The `logs` dictionary that callback methods take as argument will contain keys for quantities relevant to the current batch or epoch (see method-specific docstrings)." -4724,BaseLogger,tensorflow/tensorflow/python/keras/callbacks.py,832,class,"Callback that accumulates epoch averages of metrics. +4733,set_params,tensorflow/tensorflow/python/keras/callbacks.py,614,method, +4734,set_model,tensorflow/tensorflow/python/keras/callbacks.py,617,method, +4735,on_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,622,method,A backwards compatibility alias for `on_train_batch_begin`. +4736,on_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,627,method,A backwards compatibility alias for `on_train_batch_end`. +4737,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,631,method,"Called at the start of an epoch. + +Subclasses should override for any actions to run. This function should only +be called during TRAIN mode. + +Arguments: + epoch: Integer, index of epoch. + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4738,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,644,method,"Called at the end of an epoch. + +Subclasses should override for any actions to run. This function should only +be called during TRAIN mode. + +Arguments: + epoch: Integer, index of epoch. + logs: Dict, metric results for this training epoch, and for the + validation epoch if validation is performed. Validation result keys + are prefixed with `val_`." +4739,on_train_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,659,method,"Called at the beginning of a training batch in `fit` methods. + +Subclasses should override for any actions to run. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict, contains the return value of `model.train_step`. Typically, + the values of the `Model`'s metrics are returned. Example: + `{'loss': 0.2, 'accuracy': 0.7}`." +4740,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,675,method,"Called at the end of a training batch in `fit` methods. + +Subclasses should override for any actions to run. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict. Aggregated metric results up until this batch." +4741,on_predict_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,721,method,"Called at the beginning of a batch in `predict` methods. + +Subclasses should override for any actions to run. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict, contains the return value of `model.predict_step`, + it typically returns a dict with a key 'outputs' containing + the model's outputs." +4742,on_predict_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,735,method,"Called at the end of a batch in `predict` methods. + +Subclasses should override for any actions to run. + +Arguments: + batch: Integer, index of batch within the current epoch. + logs: Dict. Aggregated metric results up until this batch." +4743,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,746,method,"Called at the beginning of training. + +Subclasses should override for any actions to run. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4744,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,757,method,"Called at the end of training. + +Subclasses should override for any actions to run. + +Arguments: + logs: Dict. Currently the output of the last call to `on_epoch_end()` + is passed to this argument for this method but that may change in + the future." +4745,on_predict_begin,tensorflow/tensorflow/python/keras/callbacks.py,792,method,"Called at the beginning of prediction. + +Subclasses should override for any actions to run. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4746,on_predict_end,tensorflow/tensorflow/python/keras/callbacks.py,803,method,"Called at the end of prediction. + +Subclasses should override for any actions to run. + +Arguments: + logs: Dict. Currently no data is passed to this argument for this method + but that may change in the future." +4747,BaseLogger,tensorflow/tensorflow/python/keras/callbacks.py,832,class,"Callback that accumulates epoch averages of metrics. This callback is automatically applied to every Keras model. @@ -30314,9 +35792,13 @@ Arguments: should *not* be averaged over an epoch. Metrics in this list will be logged as-is in `on_epoch_end`. All others will be averaged in `on_epoch_end`." -4725,TerminateOnNaN,tensorflow/tensorflow/python/keras/callbacks.py,881,class,"Callback that terminates training when a NaN loss is encountered. +4748,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,848,method, +4749,on_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,852,method, +4750,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,869,method, +4751,TerminateOnNaN,tensorflow/tensorflow/python/keras/callbacks.py,881,class,"Callback that terminates training when a NaN loss is encountered. " -4726,ProgbarLogger,tensorflow/tensorflow/python/keras/callbacks.py,895,class,"Callback that prints metrics to stdout. +4752,on_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,885,method, +4753,ProgbarLogger,tensorflow/tensorflow/python/keras/callbacks.py,895,class,"Callback that prints metrics to stdout. Arguments: count_mode: One of `""steps""` or `""samples""`. @@ -30330,12 +35812,22 @@ Arguments: Raises: ValueError: In case of invalid `count_mode`." -4727,History,tensorflow/tensorflow/python/keras/callbacks.py,1054,class,"Callback that records events into a `History` object. +4754,set_params,tensorflow/tensorflow/python/keras/callbacks.py,935,method, +4755,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,954,method, +4756,on_predict_begin,tensorflow/tensorflow/python/keras/callbacks.py,963,method, +4757,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,967,method, +4758,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,973,method, +4759,on_predict_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,980,method, +4760,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,984,method, +4761,on_predict_end,tensorflow/tensorflow/python/keras/callbacks.py,991,method, +4762,History,tensorflow/tensorflow/python/keras/callbacks.py,1054,class,"Callback that records events into a `History` object. This callback is automatically applied to every Keras model. The `History` object gets returned by the `fit` method of models." -4728,ModelCheckpoint,tensorflow/tensorflow/python/keras/callbacks.py,1081,class,"Callback to save the Keras model or model weights at some frequency. +4763,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,1066,method, +4764,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1069,method, +4765,ModelCheckpoint,tensorflow/tensorflow/python/keras/callbacks.py,1081,class,"Callback to save the Keras model or model weights at some frequency. `ModelCheckpoint` callback is used in conjunction with training using `model.fit()` to save a model or weights (in a checkpoint file) at some @@ -30408,7 +35900,12 @@ Arguments: object if `save_weights_only` is false. **kwargs: Additional arguments for backwards compatibility. Possible key is `period`." -4729,BackupAndRestore,tensorflow/tensorflow/python/keras/callbacks.py,1484,class,"Callback to back up and restore the training state. +4766,set_model,tensorflow/tensorflow/python/keras/callbacks.py,1239,method, +4767,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,1247,method, +4768,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,1276,method, +4769,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,1280,method, +4770,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1283,method, +4771,BackupAndRestore,tensorflow/tensorflow/python/keras/callbacks.py,1484,class,"Callback to back up and restore the training state. `BackupAndRestore` callback is intended to recover from interruptions that happened in the middle of a model.fit execution by backing up the @@ -30460,7 +35957,11 @@ Arguments: terminated unexpectedly. The directory cannot be reused elsewhere to store other checkpoints, e.g. by BackupAndRestore callback of another training, or by another callback (ModelCheckpoint) of the same training." -4730,EarlyStopping,tensorflow/tensorflow/python/keras/callbacks.py,1597,class,"Stop training when a monitored metric has stopped improving. +4772,set_model,tensorflow/tensorflow/python/keras/callbacks.py,1563,method, +4773,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,1566,method, +4774,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,1581,method, +4775,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1591,method, +4776,EarlyStopping,tensorflow/tensorflow/python/keras/callbacks.py,1597,class,"Stop training when a monitored metric has stopped improving. Assuming the goal of a training is to minimize the loss. With this, the metric to be monitored would be `'loss'`, and mode would be `'min'`. A @@ -30508,7 +36009,11 @@ Example: ... verbose=0) >>> len(history.history['loss']) # Only 4 epochs are run. 4" -4731,RemoteMonitor,tensorflow/tensorflow/python/keras/callbacks.py,1732,class,"Callback used to stream events to a server. +4777,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,1688,method, +4778,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1698,method, +4779,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,1717,method, +4780,get_monitor_value,tensorflow/tensorflow/python/keras/callbacks.py,1721,method, +4781,RemoteMonitor,tensorflow/tensorflow/python/keras/callbacks.py,1732,class,"Callback used to stream events to a server. Requires the `requests` library. Events are sent to `root + '/publish/epoch/end/'` by default. Calls are @@ -30527,7 +36032,8 @@ Arguments: headers: Dictionary; optional custom HTTP headers. send_as_json: Boolean; whether the request should be sent as `""application/json""`." -4732,LearningRateScheduler,tensorflow/tensorflow/python/keras/callbacks.py,1795,class,"Learning rate scheduler. +4782,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1768,method, +4783,LearningRateScheduler,tensorflow/tensorflow/python/keras/callbacks.py,1795,class,"Learning rate scheduler. At the beginning of every epoch, this callback gets the updated learning rate value from `schedule` function provided at `__init__`, with the current epoch @@ -30560,7 +36066,9 @@ Example: ... epochs=15, callbacks=[callback], verbose=0) >>> round(model.optimizer.lr.numpy(), 5) 0.00607" -4733,TensorBoard,tensorflow/tensorflow/python/keras/callbacks.py,1861,class,"Enable visualizations for TensorBoard. +4784,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,1837,method, +4785,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,1855,method, +4786,TensorBoard,tensorflow/tensorflow/python/keras/callbacks.py,1861,class,"Enable visualizations for TensorBoard. TensorBoard is a visualization tool provided with TensorFlow. @@ -30638,7 +36146,14 @@ Arguments: Raises: ValueError: If histogram_freq is set and no validation data is provided." -4734,ReduceLROnPlateau,tensorflow/tensorflow/python/keras/callbacks.py,2324,class,"Reduce learning rate when a metric has stopped improving. +4787,set_model,tensorflow/tensorflow/python/keras/callbacks.py,2004,method,Sets Keras model and writes graph if specified. +4788,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,2187,method, +4789,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,2191,method, +4790,on_train_batch_begin,tensorflow/tensorflow/python/keras/callbacks.py,2209,method, +4791,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks.py,2217,method, +4792,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks.py,2227,method, +4793,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,2231,method,Runs metrics and histogram summaries at epoch end. +4794,ReduceLROnPlateau,tensorflow/tensorflow/python/keras/callbacks.py,2324,class,"Reduce learning rate when a metric has stopped improving. Models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates. This callback monitors a @@ -30671,7 +36186,10 @@ Arguments: cooldown: number of epochs to wait before resuming normal operation after lr has been reduced. min_lr: lower bound on the learning rate." -4735,CSVLogger,tensorflow/tensorflow/python/keras/callbacks.py,2448,class,"Callback that streams epoch results to a CSV file. +4795,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,2409,method, +4796,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,2412,method, +4797,in_cooldown,tensorflow/tensorflow/python/keras/callbacks.py,2443,method, +4798,CSVLogger,tensorflow/tensorflow/python/keras/callbacks.py,2448,class,"Callback that streams epoch results to a CSV file. Supports all values that can be represented as a string, including 1D iterables such as `np.ndarray`. @@ -30688,7 +36206,11 @@ Arguments: separator: String used to separate elements in the CSV file. append: Boolean. True: append if file exists (useful for continuing training). False: overwrite existing file." -4736,LambdaCallback,tensorflow/tensorflow/python/keras/callbacks.py,2541,class,"Callback for creating simple, custom callbacks on-the-fly. +4799,on_train_begin,tensorflow/tensorflow/python/keras/callbacks.py,2483,method, +4800,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks.py,2495,method, +4801,on_train_end,tensorflow/tensorflow/python/keras/callbacks.py,2535,method, +4802,handle_value,tensorflow/tensorflow/python/keras/callbacks.py,2498,method, +4803,LambdaCallback,tensorflow/tensorflow/python/keras/callbacks.py,2541,class,"Callback for creating simple, custom callbacks on-the-fly. This callback is constructed with anonymous functions that will be called at the appropriate time. Note that the callbacks expects positional @@ -30737,20 +36259,13 @@ model.fit(..., json_logging_callback, cleanup_callback]) ```" -4737,Counter,tensorflow/tensorflow/python/keras/callbacks_test.py,77,class,"Counts the number of times each callback method was run. +4804,Counter,tensorflow/tensorflow/python/keras/callbacks_test.py,77,class,"Counts the number of times each callback method was run. Attributes: method_counts: dict. Contains the counts of time each callback method was run." -4738,_get_numpy,tensorflow/tensorflow/python/keras/callbacks_test.py,107,function, -4739,_get_sequence,tensorflow/tensorflow/python/keras/callbacks_test.py,111,function, -4740,CallbackCountsTest,tensorflow/tensorflow/python/keras/callbacks_test.py,126,class, -4741,KerasCallbacksTest,tensorflow/tensorflow/python/keras/callbacks_test.py,250,class, -4742,_SummaryFile,tensorflow/tensorflow/python/keras/callbacks_test.py,1758,class,"A record of summary tags and the files to which they were written. - -Fields `scalars`, `images`, `histograms`, and `tensors` are sets -containing `_ObservedSummary` values." -4743,list_summaries,tensorflow/tensorflow/python/keras/callbacks_test.py,1773,function,"Read all summaries under the logdir into a `_SummaryFile`. +4805,wrap_with_counts,tensorflow/tensorflow/python/keras/callbacks_test.py,98,method, +4806,list_summaries,tensorflow/tensorflow/python/keras/callbacks_test.py,1773,function,"Read all summaries under the logdir into a `_SummaryFile`. Args: logdir: A path to a directory that contains zero or more event @@ -30765,10 +36280,7 @@ Returns: Raises: ValueError: If an event file contains an summary of unexpected kind." -4744,TestTensorBoardV2,tensorflow/tensorflow/python/keras/callbacks_test.py,1829,class, -4745,TestTensorBoardV2NonParameterizedTest,tensorflow/tensorflow/python/keras/callbacks_test.py,2182,class, -4746,MostRecentlyModifiedFileMatchingPatternTest,tensorflow/tensorflow/python/keras/callbacks_test.py,2462,class, -4747,TensorBoard,tensorflow/tensorflow/python/keras/callbacks_v1.py,42,class,"Enable visualizations for TensorBoard. +4807,TensorBoard,tensorflow/tensorflow/python/keras/callbacks_v1.py,42,class,"Enable visualizations for TensorBoard. TensorBoard is a visualization tool provided with TensorFlow. @@ -30838,8 +36350,18 @@ Using the `TensorBoard` callback will work when eager execution is enabled, with the restriction that outputting histogram summaries of weights and gradients is not supported. Consequently, `histogram_freq` will be ignored. @end_compatibility" -4748,TestTensorBoardV1,tensorflow/tensorflow/python/keras/callbacks_v1_test.py,51,class, -4749,keras_mode_combinations,tensorflow/tensorflow/python/keras/combinations.py,31,function,"Returns the default test combinations for tf.keras tests. +4808,set_model,tensorflow/tensorflow/python/keras/callbacks_v1.py,234,method,Sets Keras model and creates summary ops. +4809,on_train_batch_begin,tensorflow/tensorflow/python/keras/callbacks_v1.py,347,method, +4810,on_train_batch_end,tensorflow/tensorflow/python/keras/callbacks_v1.py,353,method, +4811,on_batch_end,tensorflow/tensorflow/python/keras/callbacks_v1.py,362,method,"Writes scalar summaries for metrics on every training batch. + +Performs profiling if current batch is in profiler_batches." +4812,on_train_begin,tensorflow/tensorflow/python/keras/callbacks_v1.py,383,method, +4813,on_epoch_begin,tensorflow/tensorflow/python/keras/callbacks_v1.py,386,method,"Add histogram op to Model eval_function callbacks, reset batch count." +4814,on_epoch_end,tensorflow/tensorflow/python/keras/callbacks_v1.py,401,method,"Checks if summary ops should run next epoch, logs scalar summaries." +4815,on_train_end,tensorflow/tensorflow/python/keras/callbacks_v1.py,465,method, +4816,is_indexed_slices,tensorflow/tensorflow/python/keras/callbacks_v1.py,218,method, +4817,keras_mode_combinations,tensorflow/tensorflow/python/keras/combinations.py,31,function,"Returns the default test combinations for tf.keras tests. Note that if tf2 is enabled, then v1 session test will be skipped. @@ -30854,26 +36376,32 @@ Args: Returns: A list contains all the combinations to be used to generate test cases." -4750,keras_model_type_combinations,tensorflow/tensorflow/python/keras/combinations.py,60,function, -4751,keras_tensor_combinations,tensorflow/tensorflow/python/keras/combinations.py,64,function, -4752,KerasModeCombination,tensorflow/tensorflow/python/keras/combinations.py,68,class,"Combination for Keras test mode. +4818,keras_model_type_combinations,tensorflow/tensorflow/python/keras/combinations.py,60,function, +4819,keras_tensor_combinations,tensorflow/tensorflow/python/keras/combinations.py,64,function, +4820,KerasModeCombination,tensorflow/tensorflow/python/keras/combinations.py,68,class,"Combination for Keras test mode. It by default includes v1_session, v2_eager and v2_tf_function." -4753,KerasModelTypeCombination,tensorflow/tensorflow/python/keras/combinations.py,86,class,"Combination for Keras model types when doing model test. +4821,context_managers,tensorflow/tensorflow/python/keras/combinations.py,74,method, +4822,parameter_modifiers,tensorflow/tensorflow/python/keras/combinations.py,82,method, +4823,KerasModelTypeCombination,tensorflow/tensorflow/python/keras/combinations.py,86,class,"Combination for Keras model types when doing model test. It by default includes 'functional', 'subclass', 'sequential'. Various methods in `testing_utils` to get models will auto-generate a model of the currently active Keras model type. This allows unittests to confirm the equivalence between different Keras models." -4754,KerasTensorCombination,tensorflow/tensorflow/python/keras/combinations.py,107,class,"Combination for whether KerasTensors are being used or not. +4824,context_managers,tensorflow/tensorflow/python/keras/combinations.py,96,method, +4825,parameter_modifiers,tensorflow/tensorflow/python/keras/combinations.py,103,method, +4826,KerasTensorCombination,tensorflow/tensorflow/python/keras/combinations.py,107,class,"Combination for whether KerasTensors are being used or not. It by default includes `True` and `False`: running Keras's functional API with KerasTensors as the inputs, and without." -4755,CombinationsTest,tensorflow/tensorflow/python/keras/combinations_test.py,33,class, -4756,Constraint,tensorflow/tensorflow/python/keras/constraints.py,36,class, -4757,MaxNorm,tensorflow/tensorflow/python/keras/constraints.py,46,class,"MaxNorm weight constraint. +4827,context_managers,tensorflow/tensorflow/python/keras/combinations.py,115,method, +4828,parameter_modifiers,tensorflow/tensorflow/python/keras/combinations.py,123,method, +4829,Constraint,tensorflow/tensorflow/python/keras/constraints.py,36,class, +4830,get_config,tensorflow/tensorflow/python/keras/constraints.py,41,method, +4831,MaxNorm,tensorflow/tensorflow/python/keras/constraints.py,46,class,"MaxNorm weight constraint. Constrains the weights incident to each hidden unit to have a norm less than or equal to a desired value. @@ -30893,10 +36421,11 @@ Arguments: set `axis` to `[0, 1, 2]` to constrain the weights of each filter tensor of size `(rows, cols, input_depth)`." -4758,NonNeg,tensorflow/tensorflow/python/keras/constraints.py,87,class,"Constrains the weights to be non-negative. +4832,get_config,tensorflow/tensorflow/python/keras/constraints.py,82,method, +4833,NonNeg,tensorflow/tensorflow/python/keras/constraints.py,87,class,"Constrains the weights to be non-negative. Also available via the shortcut function `tf.keras.constraints.non_neg`." -4759,UnitNorm,tensorflow/tensorflow/python/keras/constraints.py,98,class,"Constrains the weights incident to each hidden unit to have unit norm. +4834,UnitNorm,tensorflow/tensorflow/python/keras/constraints.py,98,class,"Constrains the weights incident to each hidden unit to have unit norm. Also available via the shortcut function `tf.keras.constraints.unit_norm`. @@ -30912,7 +36441,8 @@ Arguments: set `axis` to `[0, 1, 2]` to constrain the weights of each filter tensor of size `(rows, cols, input_depth)`." -4760,MinMaxNorm,tensorflow/tensorflow/python/keras/constraints.py,133,class,"MinMaxNorm weight constraint. +4835,get_config,tensorflow/tensorflow/python/keras/constraints.py,128,method, +4836,MinMaxNorm,tensorflow/tensorflow/python/keras/constraints.py,133,class,"MinMaxNorm weight constraint. Constrains the weights incident to each hidden unit to have the norm between a lower bound and an upper bound. @@ -30940,7 +36470,8 @@ Arguments: set `axis` to `[0, 1, 2]` to constrain the weights of each filter tensor of size `(rows, cols, input_depth)`." -4761,RadialConstraint,tensorflow/tensorflow/python/keras/constraints.py,191,class,"Constrains `Conv2D` kernel weights to be the same for each radius. +4837,get_config,tensorflow/tensorflow/python/keras/constraints.py,180,method, +4838,RadialConstraint,tensorflow/tensorflow/python/keras/constraints.py,191,class,"Constrains `Conv2D` kernel weights to be the same for each radius. Also available via the shortcut function `tf.keras.constraints.radial_constraint`. @@ -30967,16 +36498,13 @@ This constraint can be applied to any `Conv2D` layer version, including `Conv2DTranspose` and `SeparableConv2D`, and with either `""channels_last""` or `""channels_first""` data format. The method assumes the weight tensor is of shape `(rows, cols, input_depth, output_depth)`." -4762,serialize,tensorflow/tensorflow/python/keras/constraints.py,286,function, -4763,deserialize,tensorflow/tensorflow/python/keras/constraints.py,291,function, -4764,get,tensorflow/tensorflow/python/keras/constraints.py,300,function, -4765,get_test_values,tensorflow/tensorflow/python/keras/constraints_test.py,31,function, -4766,get_example_array,tensorflow/tensorflow/python/keras/constraints_test.py,35,function, -4767,get_example_kernel,tensorflow/tensorflow/python/keras/constraints_test.py,42,function, -4768,KerasConstraintsTest,tensorflow/tensorflow/python/keras/constraints_test.py,49,class, -4769,KerasInitializersTest,tensorflow/tensorflow/python/keras/initializers_test.py,36,class, -4770,TestCase,tensorflow/tensorflow/python/keras/keras_parameterized.py,42,class, -4771,run_with_all_saved_model_formats,tensorflow/tensorflow/python/keras/keras_parameterized.py,49,function,"Execute the decorated test with all Keras saved model formats). +4839,body_fn,tensorflow/tensorflow/python/keras/constraints.py,256,method, +4840,serialize,tensorflow/tensorflow/python/keras/constraints.py,286,function, +4841,deserialize,tensorflow/tensorflow/python/keras/constraints.py,291,function, +4842,get,tensorflow/tensorflow/python/keras/constraints.py,300,function, +4843,get_example_array,tensorflow/tensorflow/python/keras/constraints_test.py,35,function, +4844,get_example_kernel,tensorflow/tensorflow/python/keras/constraints_test.py,42,function, +4845,run_with_all_saved_model_formats,tensorflow/tensorflow/python/keras/keras_parameterized.py,49,function,"Execute the decorated test with all Keras saved model formats). This decorator is intended to be applied either to individual test methods in a `keras_parameterized.TestCase` class, or directly to a test class that @@ -31057,9 +36585,7 @@ Returns: Raises: ImportError: If abseil parameterized is not installed or not included as a target dependency." -4772,_test_h5_saved_model_format,tensorflow/tensorflow/python/keras/keras_parameterized.py,160,function, -4773,_test_tf_saved_model_format,tensorflow/tensorflow/python/keras/keras_parameterized.py,165,function, -4774,run_with_all_model_types,tensorflow/tensorflow/python/keras/keras_parameterized.py,172,function,"Execute the decorated test with all Keras model types. +4846,run_with_all_model_types,tensorflow/tensorflow/python/keras/keras_parameterized.py,172,function,"Execute the decorated test with all Keras model types. This decorator is intended to be applied either to individual test methods in a `keras_parameterized.TestCase` class, or directly to a test class that @@ -31147,10 +36673,7 @@ Returns: Raises: ImportError: If abseil parameterized is not installed or not included as a target dependency." -4775,_test_functional_model_type,tensorflow/tensorflow/python/keras/keras_parameterized.py,288,function, -4776,_test_subclass_model_type,tensorflow/tensorflow/python/keras/keras_parameterized.py,293,function, -4777,_test_sequential_model_type,tensorflow/tensorflow/python/keras/keras_parameterized.py,298,function, -4778,run_all_keras_modes,tensorflow/tensorflow/python/keras/keras_parameterized.py,303,function,"Execute the decorated test with all keras execution modes. +4847,run_all_keras_modes,tensorflow/tensorflow/python/keras/keras_parameterized.py,303,function,"Execute the decorated test with all keras execution modes. This decorator is intended to be applied either to individual test methods in a `keras_parameterized.TestCase` class, or directly to a test class that @@ -31217,33 +36740,7 @@ Returns: Raises: ImportError: If abseil parameterized is not installed or not included as a target dependency." -4779,_v1_session_test,tensorflow/tensorflow/python/keras/keras_parameterized.py,413,function, -4780,_v2_eager_test,tensorflow/tensorflow/python/keras/keras_parameterized.py,420,function, -4781,_v2_function_test,tensorflow/tensorflow/python/keras/keras_parameterized.py,426,function, -4782,_v2_function_and_kerastensors_test,tensorflow/tensorflow/python/keras/keras_parameterized.py,432,function, -4783,_test_or_class_decorator,tensorflow/tensorflow/python/keras/keras_parameterized.py,439,function,"Decorate a test or class with a decorator intended for one method. - -If the test_or_class is a class: - This will apply the decorator to all test methods in the class. - -If the test_or_class is an iterable of already-parameterized test cases: - This will apply the decorator to all the cases, and then flatten the - resulting cross-product of test cases. This allows stacking the Keras - parameterized decorators w/ each other, and to apply them to test methods - that have already been marked with an absl parameterized decorator. - -Otherwise, treat the obj as a single method and apply the decorator directly. - -Args: - test_or_class: A test method (that may have already been decorated with a - parameterized decorator, or a test class that extends - keras_parameterized.TestCase - single_method_decorator: - A parameterized decorator intended for a single test method. -Returns: - The decorated result." -4784,KerasParameterizedTest,tensorflow/tensorflow/python/keras/keras_parameterized_test.py,34,class, -4785,Loss,tensorflow/tensorflow/python/keras/losses.py,46,class,"Loss base class. +4848,Loss,tensorflow/tensorflow/python/keras/losses.py,46,class,"Loss base class. To be implemented by subclasses: * `call()`: Contains the logic for loss calculation using `y_true`, `y_pred`. @@ -31277,8 +36774,35 @@ with strategy.scope(): loss = (tf.reduce_sum(loss_obj(labels, predictions)) * (1. / global_batch_size)) ```" -4786,LossFunctionWrapper,tensorflow/tensorflow/python/keras/losses.py,209,class,Wraps a loss function in the `Loss` class. -4787,MeanSquaredError,tensorflow/tensorflow/python/keras/losses.py,263,class,"Computes the mean of squares of errors between labels and predictions. +4849,from_config,tensorflow/tensorflow/python/keras/losses.py,153,method,"Instantiates a `Loss` from its config (output of `get_config()`). + +Args: + config: Output of `get_config()`. + +Returns: + A `Loss` instance." +4850,get_config,tensorflow/tensorflow/python/keras/losses.py,164,method,Returns the config dictionary for a `Loss` instance. +4851,call,tensorflow/tensorflow/python/keras/losses.py,170,method,"Invokes the `Loss` instance. + +Args: + y_true: Ground truth values. shape = `[batch_size, d0, .. dN]`, except + sparse loss functions such as sparse categorical crossentropy where + shape = `[batch_size, d0, .. dN-1]` + y_pred: The predicted values. shape = `[batch_size, d0, .. dN]` + +Returns: + Loss values with the shape `[batch_size, d0, .. dN-1]`." +4852,LossFunctionWrapper,tensorflow/tensorflow/python/keras/losses.py,209,class,Wraps a loss function in the `Loss` class. +4853,call,tensorflow/tensorflow/python/keras/losses.py,238,method,"Invokes the `LossFunctionWrapper` instance. + +Args: + y_true: Ground truth values. + y_pred: The predicted values. + +Returns: + Loss values per sample." +4854,get_config,tensorflow/tensorflow/python/keras/losses.py,254,method, +4855,MeanSquaredError,tensorflow/tensorflow/python/keras/losses.py,263,class,"Computes the mean of squares of errors between labels and predictions. `loss = square(y_true - y_pred)` @@ -31312,7 +36836,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.MeanSquaredError()) ```" -4788,MeanAbsoluteError,tensorflow/tensorflow/python/keras/losses.py,322,class,"Computes the mean of absolute difference between labels and predictions. +4856,MeanAbsoluteError,tensorflow/tensorflow/python/keras/losses.py,322,class,"Computes the mean of absolute difference between labels and predictions. `loss = abs(y_true - y_pred)` @@ -31346,7 +36870,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.MeanAbsoluteError()) ```" -4789,MeanAbsolutePercentageError,tensorflow/tensorflow/python/keras/losses.py,381,class,"Computes the mean absolute percentage error between `y_true` and `y_pred`. +4857,MeanAbsolutePercentageError,tensorflow/tensorflow/python/keras/losses.py,381,class,"Computes the mean absolute percentage error between `y_true` and `y_pred`. `loss = 100 * abs(y_true - y_pred) / y_true` @@ -31381,7 +36905,7 @@ Usage with the `compile()` API: model.compile(optimizer='sgd', loss=tf.keras.losses.MeanAbsolutePercentageError()) ```" -4790,MeanSquaredLogarithmicError,tensorflow/tensorflow/python/keras/losses.py,442,class,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. +4858,MeanSquaredLogarithmicError,tensorflow/tensorflow/python/keras/losses.py,442,class,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. `loss = square(log(y_true + 1.) - log(y_pred + 1.))` @@ -31416,7 +36940,7 @@ Usage with the `compile()` API: model.compile(optimizer='sgd', loss=tf.keras.losses.MeanSquaredLogarithmicError()) ```" -4791,BinaryCrossentropy,tensorflow/tensorflow/python/keras/losses.py,503,class,"Computes the cross-entropy loss between true labels and predicted labels. +4859,BinaryCrossentropy,tensorflow/tensorflow/python/keras/losses.py,503,class,"Computes the cross-entropy loss between true labels and predicted labels. Use this cross-entropy loss when there are only two label classes (assumed to be 0 and 1). For each example, there should be a single floating-point value @@ -31456,7 +36980,7 @@ Usage with the `tf.keras` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.BinaryCrossentropy()) ```" -4792,CategoricalCrossentropy,tensorflow/tensorflow/python/keras/losses.py,583,class,"Computes the crossentropy loss between the labels and predictions. +4860,CategoricalCrossentropy,tensorflow/tensorflow/python/keras/losses.py,583,class,"Computes the crossentropy loss between the labels and predictions. Use this crossentropy loss function when there are two or more label classes. We expect labels to be provided in a `one_hot` representation. If you want to @@ -31497,7 +37021,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.CategoricalCrossentropy()) ```" -4793,SparseCategoricalCrossentropy,tensorflow/tensorflow/python/keras/losses.py,662,class,"Computes the crossentropy loss between the labels and predictions. +4861,SparseCategoricalCrossentropy,tensorflow/tensorflow/python/keras/losses.py,662,class,"Computes the crossentropy loss between the labels and predictions. Use this crossentropy loss function when there are two or more label classes. We expect labels to be provided as integers. If you want to provide labels @@ -31541,7 +37065,7 @@ Usage with the `compile()` API: model.compile(optimizer='sgd', loss=tf.keras.losses.SparseCategoricalCrossentropy()) ```" -4794,Hinge,tensorflow/tensorflow/python/keras/losses.py,739,class,"Computes the hinge loss between `y_true` and `y_pred`. +4862,Hinge,tensorflow/tensorflow/python/keras/losses.py,739,class,"Computes the hinge loss between `y_true` and `y_pred`. `loss = maximum(1 - y_true * y_pred, 0)` @@ -31578,7 +37102,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.Hinge()) ```" -4795,SquaredHinge,tensorflow/tensorflow/python/keras/losses.py,798,class,"Computes the squared hinge loss between `y_true` and `y_pred`. +4863,SquaredHinge,tensorflow/tensorflow/python/keras/losses.py,798,class,"Computes the squared hinge loss between `y_true` and `y_pred`. `loss = square(maximum(1 - y_true * y_pred, 0))` @@ -31615,7 +37139,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.SquaredHinge()) ```" -4796,CategoricalHinge,tensorflow/tensorflow/python/keras/losses.py,860,class,"Computes the categorical hinge loss between `y_true` and `y_pred`. +4864,CategoricalHinge,tensorflow/tensorflow/python/keras/losses.py,860,class,"Computes the categorical hinge loss between `y_true` and `y_pred`. `loss = maximum(neg - pos + 1, 0)` where `neg=maximum((1-y_true)*y_pred) and pos=sum(y_true*y_pred)` @@ -31650,7 +37174,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.CategoricalHinge()) ```" -4797,Poisson,tensorflow/tensorflow/python/keras/losses.py,920,class,"Computes the Poisson loss between `y_true` and `y_pred`. +4865,Poisson,tensorflow/tensorflow/python/keras/losses.py,920,class,"Computes the Poisson loss between `y_true` and `y_pred`. `loss = y_pred - y_true * log(y_pred)` @@ -31684,7 +37208,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.Poisson()) ```" -4798,LogCosh,tensorflow/tensorflow/python/keras/losses.py,976,class,"Computes the logarithm of the hyperbolic cosine of the prediction error. +4866,LogCosh,tensorflow/tensorflow/python/keras/losses.py,976,class,"Computes the logarithm of the hyperbolic cosine of the prediction error. `logcosh = log((exp(x) + exp(-x))/2)`, where x is the error `y_pred - y_true`. @@ -31719,7 +37243,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.LogCosh()) ```" -4799,KLDivergence,tensorflow/tensorflow/python/keras/losses.py,1033,class,"Computes Kullback-Leibler divergence loss between `y_true` and `y_pred`. +4867,KLDivergence,tensorflow/tensorflow/python/keras/losses.py,1033,class,"Computes Kullback-Leibler divergence loss between `y_true` and `y_pred`. `loss = y_true * log(y_true / y_pred)` @@ -31755,7 +37279,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.KLDivergence()) ```" -4800,Huber,tensorflow/tensorflow/python/keras/losses.py,1094,class,"Computes the Huber loss between `y_true` and `y_pred`. +4868,Huber,tensorflow/tensorflow/python/keras/losses.py,1094,class,"Computes the Huber loss between `y_true` and `y_pred`. For each value x in `error = y_true - y_pred`: @@ -31795,7 +37319,7 @@ Usage with the `compile()` API: ```python model.compile(optimizer='sgd', loss=tf.keras.losses.Huber()) ```" -4801,mean_squared_error,tensorflow/tensorflow/python/keras/losses.py,1168,function,"Computes the mean squared error between labels and predictions. +4869,mean_squared_error,tensorflow/tensorflow/python/keras/losses.py,1168,function,"Computes the mean squared error between labels and predictions. After computing the squared distance between the inputs, the mean value over the last dimension is returned. @@ -31817,7 +37341,7 @@ Args: Returns: Mean squared error values. shape = `[batch_size, d0, .. dN-1]`." -4802,mean_absolute_error,tensorflow/tensorflow/python/keras/losses.py,1204,function,"Computes the mean absolute error between labels and predictions. +4870,mean_absolute_error,tensorflow/tensorflow/python/keras/losses.py,1204,function,"Computes the mean absolute error between labels and predictions. `loss = mean(abs(y_true - y_pred), axis=-1)` @@ -31836,7 +37360,7 @@ Args: Returns: Mean absolute error values. shape = `[batch_size, d0, .. dN-1]`." -4803,mean_absolute_percentage_error,tensorflow/tensorflow/python/keras/losses.py,1237,function,"Computes the mean absolute percentage error between `y_true` and `y_pred`. +4871,mean_absolute_percentage_error,tensorflow/tensorflow/python/keras/losses.py,1237,function,"Computes the mean absolute percentage error between `y_true` and `y_pred`. `loss = 100 * mean(abs((y_true - y_pred) / y_true), axis=-1)` @@ -31857,7 +37381,7 @@ Args: Returns: Mean absolute percentage error values. shape = `[batch_size, d0, .. dN-1]`." -4804,mean_squared_logarithmic_error,tensorflow/tensorflow/python/keras/losses.py,1274,function,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. +4872,mean_squared_logarithmic_error,tensorflow/tensorflow/python/keras/losses.py,1274,function,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. `loss = mean(square(log(y_true + 1) - log(y_pred + 1)), axis=-1)` @@ -31880,8 +37404,7 @@ Args: Returns: Mean squared logarithmic error values. shape = `[batch_size, d0, .. dN-1]`." -4805,_maybe_convert_labels,tensorflow/tensorflow/python/keras/losses.py,1306,function,Converts binary labels into -1/1. -4806,squared_hinge,tensorflow/tensorflow/python/keras/losses.py,1323,function,"Computes the squared hinge loss between `y_true` and `y_pred`. +4873,squared_hinge,tensorflow/tensorflow/python/keras/losses.py,1323,function,"Computes the squared hinge loss between `y_true` and `y_pred`. `loss = mean(square(maximum(1 - y_true * y_pred, 0)), axis=-1)` @@ -31903,7 +37426,7 @@ Args: Returns: Squared hinge loss values. shape = `[batch_size, d0, .. dN-1]`." -4807,hinge,tensorflow/tensorflow/python/keras/losses.py,1356,function,"Computes the hinge loss between `y_true` and `y_pred`. +4874,hinge,tensorflow/tensorflow/python/keras/losses.py,1356,function,"Computes the hinge loss between `y_true` and `y_pred`. `loss = mean(maximum(1 - y_true * y_pred, 0), axis=-1)` @@ -31925,7 +37448,7 @@ Args: Returns: Hinge loss values. shape = `[batch_size, d0, .. dN-1]`." -4808,categorical_hinge,tensorflow/tensorflow/python/keras/losses.py,1388,function,"Computes the categorical hinge loss between `y_true` and `y_pred`. +4875,categorical_hinge,tensorflow/tensorflow/python/keras/losses.py,1388,function,"Computes the categorical hinge loss between `y_true` and `y_pred`. `loss = maximum(neg - pos + 1, 0)` where `neg=maximum((1-y_true)*y_pred) and pos=sum(y_true*y_pred)` @@ -31947,7 +37470,7 @@ Args: Returns: Categorical hinge loss values." -4809,huber,tensorflow/tensorflow/python/keras/losses.py,1422,function,"Computes Huber loss value. +4876,huber,tensorflow/tensorflow/python/keras/losses.py,1422,function,"Computes Huber loss value. For each value x in `error = y_true - y_pred`: @@ -31965,7 +37488,7 @@ Args: Returns: Tensor with one scalar loss entry per sample." -4810,log_cosh,tensorflow/tensorflow/python/keras/losses.py,1457,function,"Logarithm of the hyperbolic cosine of the prediction error. +4877,log_cosh,tensorflow/tensorflow/python/keras/losses.py,1457,function,"Logarithm of the hyperbolic cosine of the prediction error. `log(cosh(x))` is approximately equal to `(x ** 2) / 2` for small `x` and to `abs(x) - log(2)` for large `x`. This means that 'logcosh' works mostly @@ -31990,7 +37513,7 @@ Args: Returns: Logcosh error values. shape = `[batch_size, d0, .. dN-1]`." -4811,categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1496,function,"Computes the categorical crossentropy loss. +4878,categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1496,function,"Computes the categorical crossentropy loss. Standalone usage: @@ -32010,7 +37533,7 @@ Args: Returns: Categorical crossentropy loss value." -4812,sparse_categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1537,function,"Computes the sparse categorical crossentropy loss. +4879,sparse_categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1537,function,"Computes the sparse categorical crossentropy loss. Standalone usage: @@ -32031,7 +37554,7 @@ Args: Returns: Sparse categorical crossentropy loss value." -4813,binary_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1569,function,"Computes the binary crossentropy loss. +4880,binary_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1569,function,"Computes the binary crossentropy loss. Standalone usage: @@ -32051,7 +37574,7 @@ Args: Returns: Binary crossentropy loss value. shape = `[batch_size, d0, .. dN-1]`." -4814,kl_divergence,tensorflow/tensorflow/python/keras/losses.py,1613,function,"Computes Kullback-Leibler divergence loss between `y_true` and `y_pred`. +4881,kl_divergence,tensorflow/tensorflow/python/keras/losses.py,1613,function,"Computes Kullback-Leibler divergence loss between `y_true` and `y_pred`. `loss = y_true * log(y_true / y_pred)` @@ -32077,7 +37600,7 @@ Returns: Raises: TypeError: If `y_true` cannot be cast to the `y_pred.dtype`." -4815,poisson,tensorflow/tensorflow/python/keras/losses.py,1650,function,"Computes the Poisson loss between y_true and y_pred. +4882,poisson,tensorflow/tensorflow/python/keras/losses.py,1650,function,"Computes the Poisson loss between y_true and y_pred. The Poisson loss is the mean of the elements of the `Tensor` `y_pred - y_true * log(y_pred)`. @@ -32102,7 +37625,7 @@ Returns: Raises: InvalidArgumentError: If `y_true` and `y_pred` have incompatible shapes." -4816,cosine_similarity,tensorflow/tensorflow/python/keras/losses.py,1692,function,"Computes the cosine similarity between labels and predictions. +4883,cosine_similarity,tensorflow/tensorflow/python/keras/losses.py,1692,function,"Computes the cosine similarity between labels and predictions. Note that it is a number between -1 and 1. When it is a negative number between -1 and 0, 0 indicates orthogonality and values closer to -1 @@ -32130,7 +37653,7 @@ Args: Returns: Cosine similarity tensor." -4817,CosineSimilarity,tensorflow/tensorflow/python/keras/losses.py,1728,class,"Computes the cosine similarity between labels and predictions. +4884,CosineSimilarity,tensorflow/tensorflow/python/keras/losses.py,1728,class,"Computes the cosine similarity between labels and predictions. Note that it is a negative quantity between -1 and 0, where 0 indicates orthogonality and values closer to -1 indicate greater similarity. This makes @@ -32190,15 +37713,15 @@ Args: (https://www.tensorflow.org/tutorials/distribute/custom_training) for more details. name: Optional name for the op." -4818,is_categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1811,function, -4819,serialize,tensorflow/tensorflow/python/keras/losses.py,1822,function,"Serializes loss function or `Loss` instance. +4885,is_categorical_crossentropy,tensorflow/tensorflow/python/keras/losses.py,1811,function, +4886,serialize,tensorflow/tensorflow/python/keras/losses.py,1822,function,"Serializes loss function or `Loss` instance. Arguments: loss: A Keras `Loss` instance or a loss function. Returns: Loss configuration dictionary." -4820,deserialize,tensorflow/tensorflow/python/keras/losses.py,1835,function,"Deserializes a serialized loss class/function instance. +4887,deserialize,tensorflow/tensorflow/python/keras/losses.py,1835,function,"Deserializes a serialized loss class/function instance. Arguments: name: Loss configuration. @@ -32207,7 +37730,7 @@ Arguments: Returns: A Keras `Loss` instance or a loss function." -4821,get,tensorflow/tensorflow/python/keras/losses.py,1854,function,"Retrieves a Keras loss as a `function`/`Loss` class instance. +4888,get,tensorflow/tensorflow/python/keras/losses.py,1854,function,"Retrieves a Keras loss as a `function`/`Loss` class instance. The `identifier` may be the string name of a loss function or `Loss` class. @@ -32238,25 +37761,9 @@ Returns: Raises: ValueError: If `identifier` cannot be interpreted." -4822,KerasLossesTest,tensorflow/tensorflow/python/keras/losses_test.py,46,class, -4823,MeanSquaredErrorTest,tensorflow/tensorflow/python/keras/losses_test.py,245,class, -4824,MeanAbsoluteErrorTest,tensorflow/tensorflow/python/keras/losses_test.py,337,class, -4825,MeanAbsolutePercentageErrorTest,tensorflow/tensorflow/python/keras/losses_test.py,429,class, -4826,MeanSquaredLogarithmicErrorTest,tensorflow/tensorflow/python/keras/losses_test.py,505,class, -4827,CosineSimilarityTest,tensorflow/tensorflow/python/keras/losses_test.py,562,class, -4828,BinaryCrossentropyTest,tensorflow/tensorflow/python/keras/losses_test.py,647,class, -4829,CategoricalCrossentropyTest,tensorflow/tensorflow/python/keras/losses_test.py,813,class, -4830,SparseCategoricalCrossentropyTest,tensorflow/tensorflow/python/keras/losses_test.py,920,class, -4831,HingeTest,tensorflow/tensorflow/python/keras/losses_test.py,1003,class, -4832,SquaredHingeTest,tensorflow/tensorflow/python/keras/losses_test.py,1103,class, -4833,CategoricalHingeTest,tensorflow/tensorflow/python/keras/losses_test.py,1212,class, -4834,LogCoshTest,tensorflow/tensorflow/python/keras/losses_test.py,1278,class, -4835,PoissonTest,tensorflow/tensorflow/python/keras/losses_test.py,1359,class, -4836,KLDivergenceTest,tensorflow/tensorflow/python/keras/losses_test.py,1440,class, -4837,HuberLossTest,tensorflow/tensorflow/python/keras/losses_test.py,1520,class, -4838,BinaryTruePositivesViaControlFlow,tensorflow/tensorflow/python/keras/losses_test.py,1631,class, -4839,CustomLossTest,tensorflow/tensorflow/python/keras/losses_test.py,1649,class, -4840,Metric,tensorflow/tensorflow/python/keras/metrics.py,82,class,"Encapsulates metric logic and state. +4889,BinaryTruePositivesViaControlFlow,tensorflow/tensorflow/python/keras/losses_test.py,1631,class, +4890,call,tensorflow/tensorflow/python/keras/losses_test.py,1636,method, +4891,Metric,tensorflow/tensorflow/python/keras/metrics.py,82,class,"Encapsulates metric logic and state. Args: name: (Optional) string name of the metric instance. @@ -32325,13 +37832,51 @@ class BinaryTruePositives(tf.keras.metrics.Metric): def result(self): return self.true_positives ```" -4841,Reduce,tensorflow/tensorflow/python/keras/metrics.py,323,class,"Encapsulates metrics that perform a reduce operation on the values. +4892,dtype,tensorflow/tensorflow/python/keras/metrics.py,240,method, +4893,get_config,tensorflow/tensorflow/python/keras/metrics.py,243,method,Returns the serializable config of the metric. +4894,reset_states,tensorflow/tensorflow/python/keras/metrics.py,247,method,"Resets all of the metric state variables. + +This function is called between epochs/steps, +when a metric is evaluated during training." +4895,update_state,tensorflow/tensorflow/python/keras/metrics.py,256,method,"Accumulates statistics for the metric. + +Note: This function is executed as a graph function in graph mode. +This means: + a) Operations on the same resource are executed in textual order. + This should make it easier to do things like add the updated + value of a variable to another, for example. + b) You don't need to worry about collecting the update ops to execute. + All update ops added to the graph by this function will be executed. + As a result, code should generally work the same way with graph or + eager execution. + +Args: + *args: + **kwargs: A mini-batch of inputs to the Metric." +4896,result,tensorflow/tensorflow/python/keras/metrics.py,276,method,"Computes and returns the metric value tensor. + +Result computation is an idempotent operation that simply calculates the +metric value using the state variables." +4897,add_weight,tensorflow/tensorflow/python/keras/metrics.py,286,method,Adds state variable. Only for use by subclasses. +4898,result_fn,tensorflow/tensorflow/python/keras/metrics.py,189,method, +4899,replica_local_fn,tensorflow/tensorflow/python/keras/metrics.py,210,method,Updates the state of the metric in a replica-local context. +4900,update_state_fn,tensorflow/tensorflow/python/keras/metrics.py,174,method, +4901,Reduce,tensorflow/tensorflow/python/keras/metrics.py,323,class,"Encapsulates metrics that perform a reduce operation on the values. Args: reduction: a `tf.keras.metrics.Reduction` enum value. name: string name of the metric instance. dtype: (Optional) data type of the metric result." -4842,Sum,tensorflow/tensorflow/python/keras/metrics.py,414,class,"Computes the (weighted) sum of the given values. +4902,update_state,tensorflow/tensorflow/python/keras/metrics.py,342,method,"Accumulates statistics for computing the metric. + +Args: + values: Per-example value. + sample_weight: Optional weighting of each example. Defaults to 1. + +Returns: + Update op." +4903,result,tensorflow/tensorflow/python/keras/metrics.py,400,method, +4904,Sum,tensorflow/tensorflow/python/keras/metrics.py,414,class,"Computes the (weighted) sum of the given values. For example, if values is [1, 3, 5, 7] then the sum is 16. If the weights were specified as [1, 1, 0, 0] then the sum would be 4. @@ -32359,7 +37904,7 @@ Usage with `compile()` API: model.add_metric(tf.keras.metrics.Sum(name='sum_1')(outputs)) model.compile(optimizer='sgd', loss='mse') ```" -4843,Mean,tensorflow/tensorflow/python/keras/metrics.py,451,class,"Computes the (weighted) mean of the given values. +4905,Mean,tensorflow/tensorflow/python/keras/metrics.py,451,class,"Computes the (weighted) mean of the given values. For example, if values is [1, 3, 5, 7] then the mean is 4. If the weights were specified as [1, 1, 0, 0] then the mean would be 2. @@ -32392,7 +37937,7 @@ Usage with `compile()` API: model.add_metric(tf.keras.metrics.Mean(name='mean_1')(outputs)) model.compile(optimizer='sgd', loss='mse') ```" -4844,MeanRelativeError,tensorflow/tensorflow/python/keras/metrics.py,493,class,"Computes the mean relative error by normalizing with the given values. +4906,MeanRelativeError,tensorflow/tensorflow/python/keras/metrics.py,493,class,"Computes the mean relative error by normalizing with the given values. This metric creates two local variables, `total` and `count` that are used to compute the mean relative error. This is weighted by `sample_weight`, and @@ -32426,7 +37971,19 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanRelativeError(normalizer=[1, 3])]) ```" -4845,MeanMetricWrapper,tensorflow/tensorflow/python/keras/metrics.py,572,class,"Wraps a stateless metric function with the Mean metric. +4907,update_state,tensorflow/tensorflow/python/keras/metrics.py,535,method,"Accumulates metric statistics. + +Args: + y_true: The ground truth values. + y_pred: The predicted values. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4908,get_config,tensorflow/tensorflow/python/keras/metrics.py,565,method, +4909,MeanMetricWrapper,tensorflow/tensorflow/python/keras/metrics.py,572,class,"Wraps a stateless metric function with the Mean metric. Args: fn: The metric function to wrap, with signature `fn(y_true, y_pred, @@ -32434,7 +37991,28 @@ Args: name: (Optional) string name of the metric instance. dtype: (Optional) data type of the metric result. **kwargs: The keyword arguments that are passed on to `fn`." -4846,Accuracy,tensorflow/tensorflow/python/keras/metrics.py,646,class,"Calculates how often predictions equals labels. +4910,update_state,tensorflow/tensorflow/python/keras/metrics.py,588,method,"Accumulates metric statistics. + +`y_true` and `y_pred` should have the same shape. + +Args: + y_true: Ground truth values. shape = `[batch_size, d0, .. dN]`. + y_pred: The predicted values. shape = `[batch_size, d0, .. dN]`. + sample_weight: Optional `sample_weight` acts as a + coefficient for the metric. If a scalar is provided, then the metric is + simply scaled by the given value. If `sample_weight` is a tensor of size + `[batch_size]`, then the metric for each sample of the batch is rescaled + by the corresponding element in the `sample_weight` vector. If the shape + of `sample_weight` is `[batch_size, d0, .. dN-1]` (or can be broadcasted + to this shape), then each metric element of `y_pred` is scaled by the + corresponding value of `sample_weight`. (Note on `dN-1`: all metric + functions reduce by 1 dimension, usually the last axis (-1)). + +Returns: + Update op." +4911,get_config,tensorflow/tensorflow/python/keras/metrics.py,622,method, +4912,from_config,tensorflow/tensorflow/python/keras/metrics.py,636,method, +4913,Accuracy,tensorflow/tensorflow/python/keras/metrics.py,646,class,"Calculates how often predictions equals labels. This metric creates two local variables, `total` and `count` that are used to compute the frequency with which `y_pred` matches `y_true`. This frequency is @@ -32468,7 +38046,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.Accuracy()]) ```" -4847,BinaryAccuracy,tensorflow/tensorflow/python/keras/metrics.py,688,class,"Calculates how often predictions matches binary labels. +4914,BinaryAccuracy,tensorflow/tensorflow/python/keras/metrics.py,688,class,"Calculates how often predictions matches binary labels. This metric creates two local variables, `total` and `count` that are used to compute the frequency with which `y_pred` matches `y_true`. This frequency is @@ -32504,7 +38082,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.BinaryAccuracy()]) ```" -4848,CategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,733,class,"Calculates how often predictions matches one-hot labels. +4915,CategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,733,class,"Calculates how often predictions matches one-hot labels. You can provide logits of classes as `y_pred`, since argmax of logits and probabilities are same. @@ -32547,7 +38125,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.CategoricalAccuracy()]) ```" -4849,SparseCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,785,class,"Calculates how often predictions matches integer labels. +4916,SparseCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,785,class,"Calculates how often predictions matches integer labels. ```python acc = np.dot(sample_weight, np.equal(y_true, np.argmax(y_pred, axis=1)) @@ -32589,7 +38167,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SparseCategoricalAccuracy()]) ```" -4850,TopKCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,836,class,"Computes how often targets are in the top `K` predictions. +4917,TopKCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,836,class,"Computes how often targets are in the top `K` predictions. Args: k: (Optional) Number of top elements to look at for computing accuracy. @@ -32619,7 +38197,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.TopKCategoricalAccuracy()]) ```" -4851,SparseTopKCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,875,class,"Computes how often integer targets are in the top `K` predictions. +4918,SparseTopKCategoricalAccuracy,tensorflow/tensorflow/python/keras/metrics.py,875,class,"Computes how often integer targets are in the top `K` predictions. Args: k: (Optional) Number of top elements to look at for computing accuracy. @@ -32648,18 +38226,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SparseTopKCategoricalAccuracy()]) ```" -4852,_ConfusionMatrixConditionCount,tensorflow/tensorflow/python/keras/metrics.py,912,class,"Calculates the number of the given confusion matrix condition. - -Args: - confusion_matrix_cond: One of `metrics_utils.ConfusionMatrix` conditions. - thresholds: (Optional) Defaults to 0.5. A float value or a python list/tuple - of float threshold values in [0, 1]. A threshold is compared with - prediction values to determine the truth value of predictions (i.e., above - the threshold is `true`, below is `false`). One metric value is generated - for each threshold value. - name: (Optional) string name of the metric instance. - dtype: (Optional) data type of the metric result." -4853,FalsePositives,tensorflow/tensorflow/python/keras/metrics.py,980,class,"Calculates the number of false positives. +4919,FalsePositives,tensorflow/tensorflow/python/keras/metrics.py,980,class,"Calculates the number of false positives. If `sample_weight` is given, calculates the sum of the weights of false positives. This metric creates one local variable, `accumulator` @@ -32696,7 +38263,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.FalsePositives()]) ```" -4854,FalseNegatives,tensorflow/tensorflow/python/keras/metrics.py,1029,class,"Calculates the number of false negatives. +4920,FalseNegatives,tensorflow/tensorflow/python/keras/metrics.py,1029,class,"Calculates the number of false negatives. If `sample_weight` is given, calculates the sum of the weights of false negatives. This metric creates one local variable, `accumulator` @@ -32733,7 +38300,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.FalseNegatives()]) ```" -4855,TrueNegatives,tensorflow/tensorflow/python/keras/metrics.py,1078,class,"Calculates the number of true negatives. +4921,TrueNegatives,tensorflow/tensorflow/python/keras/metrics.py,1078,class,"Calculates the number of true negatives. If `sample_weight` is given, calculates the sum of the weights of true negatives. This metric creates one local variable, `accumulator` @@ -32770,7 +38337,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.TrueNegatives()]) ```" -4856,TruePositives,tensorflow/tensorflow/python/keras/metrics.py,1127,class,"Calculates the number of true positives. +4922,TruePositives,tensorflow/tensorflow/python/keras/metrics.py,1127,class,"Calculates the number of true positives. If `sample_weight` is given, calculates the sum of the weights of true positives. This metric creates one local variable, `true_positives` @@ -32807,7 +38374,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.TruePositives()]) ```" -4857,Precision,tensorflow/tensorflow/python/keras/metrics.py,1176,class,"Computes the precision of the predictions with respect to the labels. +4923,Precision,tensorflow/tensorflow/python/keras/metrics.py,1176,class,"Computes the precision of the predictions with respect to the labels. The metric creates two local variables, `true_positives` and `false_positives` that are used to compute the precision. This value is ultimately returned as @@ -32872,7 +38439,22 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.Precision()]) ```" -4858,Recall,tensorflow/tensorflow/python/keras/metrics.py,1314,class,"Computes the recall of the predictions with respect to the labels. +4924,update_state,tensorflow/tensorflow/python/keras/metrics.py,1267,method,"Accumulates true positive and false positive statistics. + +Args: + y_true: The ground truth values, with the same dimensions as `y_pred`. + Will be cast to `bool`. + y_pred: The predicted values. Each element must be in the range `[0, 1]`. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4925,result,tensorflow/tensorflow/python/keras/metrics.py,1293,method, +4926,reset_states,tensorflow/tensorflow/python/keras/metrics.py,1298,method, +4927,get_config,tensorflow/tensorflow/python/keras/metrics.py,1303,method, +4928,Recall,tensorflow/tensorflow/python/keras/metrics.py,1314,class,"Computes the recall of the predictions with respect to the labels. This metric creates two local variables, `true_positives` and `false_negatives`, that are used to compute the recall. This value is @@ -32924,11 +38506,39 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.Recall()]) ```" -4859,SensitivitySpecificityBase,tensorflow/tensorflow/python/keras/metrics.py,1439,class,"Abstract base class for computing sensitivity and specificity. +4929,update_state,tensorflow/tensorflow/python/keras/metrics.py,1392,method,"Accumulates true positive and false negative statistics. + +Args: + y_true: The ground truth values, with the same dimensions as `y_pred`. + Will be cast to `bool`. + y_pred: The predicted values. Each element must be in the range `[0, 1]`. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4930,result,tensorflow/tensorflow/python/keras/metrics.py,1418,method, +4931,reset_states,tensorflow/tensorflow/python/keras/metrics.py,1423,method, +4932,get_config,tensorflow/tensorflow/python/keras/metrics.py,1428,method, +4933,SensitivitySpecificityBase,tensorflow/tensorflow/python/keras/metrics.py,1439,class,"Abstract base class for computing sensitivity and specificity. For additional information about specificity and sensitivity, see [the following](https://en.wikipedia.org/wiki/Sensitivity_and_specificity)." -4860,SensitivityAtSpecificity,tensorflow/tensorflow/python/keras/metrics.py,1531,class,"Computes best sensitivity where specificity is >= specified value. +4934,update_state,tensorflow/tensorflow/python/keras/metrics.py,1476,method,"Accumulates confusion matrix statistics. + +Args: + y_true: The ground truth values. + y_pred: The predicted values. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4935,reset_states,tensorflow/tensorflow/python/keras/metrics.py,1501,method, +4936,get_max,tensorflow/tensorflow/python/keras/metrics.py,1524,method, +4937,SensitivityAtSpecificity,tensorflow/tensorflow/python/keras/metrics.py,1531,class,"Computes best sensitivity where specificity is >= specified value. the sensitivity at a given specificity. @@ -32976,7 +38586,9 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SensitivityAtSpecificity()]) ```" -4861,SpecificityAtSensitivity,tensorflow/tensorflow/python/keras/metrics.py,1608,class,"Computes best specificity where sensitivity is >= specified value. +4938,result,tensorflow/tensorflow/python/keras/metrics.py,1590,method, +4939,get_config,tensorflow/tensorflow/python/keras/metrics.py,1598,method, +4940,SpecificityAtSensitivity,tensorflow/tensorflow/python/keras/metrics.py,1608,class,"Computes best specificity where sensitivity is >= specified value. `Sensitivity` measures the proportion of actual positives that are correctly identified as such (tp / (tp + fn)). @@ -33022,7 +38634,9 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SpecificityAtSensitivity()]) ```" -4862,PrecisionAtRecall,tensorflow/tensorflow/python/keras/metrics.py,1683,class,"Computes best precision where recall is >= specified value. +4941,result,tensorflow/tensorflow/python/keras/metrics.py,1665,method, +4942,get_config,tensorflow/tensorflow/python/keras/metrics.py,1673,method, +4943,PrecisionAtRecall,tensorflow/tensorflow/python/keras/metrics.py,1683,class,"Computes best precision where recall is >= specified value. This metric creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` that are used to compute the @@ -33060,7 +38674,9 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.PrecisionAtRecall(recall=0.8)]) ```" -4863,RecallAtPrecision,tensorflow/tensorflow/python/keras/metrics.py,1750,class,"Computes best recall where precision is >= specified value. +4944,result,tensorflow/tensorflow/python/keras/metrics.py,1735,method, +4945,get_config,tensorflow/tensorflow/python/keras/metrics.py,1743,method, +4946,RecallAtPrecision,tensorflow/tensorflow/python/keras/metrics.py,1750,class,"Computes best recall where precision is >= specified value. For a given score-label-distribution the required precision might not be achievable, in this case 0.0 is returned as recall. @@ -33101,7 +38717,9 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.RecallAtPrecision(precision=0.8)]) ```" -4864,AUC,tensorflow/tensorflow/python/keras/metrics.py,1821,class,"Computes the approximate AUC (Area under the curve) via a Riemann sum. +4947,result,tensorflow/tensorflow/python/keras/metrics.py,1805,method, +4948,get_config,tensorflow/tensorflow/python/keras/metrics.py,1813,method, +4949,AUC,tensorflow/tensorflow/python/keras/metrics.py,1821,class,"Computes the approximate AUC (Area under the curve) via a Riemann sum. This metric creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` that are used to compute the AUC. @@ -33189,7 +38807,64 @@ Usage with `compile()` API: ```python model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.AUC()]) ```" -4865,CosineSimilarity,tensorflow/tensorflow/python/keras/metrics.py,2256,class,"Computes the cosine similarity between the labels and predictions. +4950,thresholds,tensorflow/tensorflow/python/keras/metrics.py,1987,method,The thresholds used for evaluating AUC. +4951,update_state,tensorflow/tensorflow/python/keras/metrics.py,2033,method,"Accumulates confusion matrix statistics. + +Args: + y_true: The ground truth values. + y_pred: The predicted values. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4952,interpolate_pr_auc,tensorflow/tensorflow/python/keras/metrics.py,2093,method,"Interpolation formula inspired by section 4 of Davis & Goadrich 2006. + +https://www.biostat.wisc.edu/~page/rocpr.pdf + +Note here we derive & use a closed formula not present in the paper +as follows: + + Precision = TP / (TP + FP) = TP / P + +Modeling all of TP (true positive), FP (false positive) and their sum +P = TP + FP (predicted positive) as varying linearly within each interval +[A, B] between successive thresholds, we get + + Precision slope = dTP / dP + = (TP_B - TP_A) / (P_B - P_A) + = (TP - TP_A) / (P - P_A) + Precision = (TP_A + slope * (P - P_A)) / P + +The area within the interval is (slope / total_pos_weight) times + + int_A^B{Precision.dP} = int_A^B{(TP_A + slope * (P - P_A)) * dP / P} + int_A^B{Precision.dP} = int_A^B{slope * dP + intercept * dP / P} + +where intercept = TP_A - slope * P_A = TP_B - slope * P_B, resulting in + + int_A^B{Precision.dP} = TP_B - TP_A + intercept * log(P_B / P_A) + +Bringing back the factor (slope / total_pos_weight) we'd put aside, we get + + slope * [dTP + intercept * log(P_B / P_A)] / total_pos_weight + +where dTP == TP_B - TP_A. + +Note that when P_A == 0 the above calculation simplifies into + + int_A^B{Precision.dTP} = int_A^B{slope * dTP} = slope * (TP_B - TP_A) + +which is really equivalent to imputing constant precision throughout the +first bucket having >0 true positives. + +Returns: + pr_auc: an approximation of the area under the P-R curve." +4953,result,tensorflow/tensorflow/python/keras/metrics.py,2174,method, +4954,reset_states,tensorflow/tensorflow/python/keras/metrics.py,2226,method, +4955,get_config,tensorflow/tensorflow/python/keras/metrics.py,2235,method, +4956,CosineSimilarity,tensorflow/tensorflow/python/keras/metrics.py,2256,class,"Computes the cosine similarity between the labels and predictions. `cosine similarity = (a . b) / ||a|| ||b||` @@ -33230,7 +38905,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.CosineSimilarity(axis=1)]) ```" -4866,MeanAbsoluteError,tensorflow/tensorflow/python/keras/metrics.py,2306,class,"Computes the mean absolute error between the labels and predictions. +4957,MeanAbsoluteError,tensorflow/tensorflow/python/keras/metrics.py,2306,class,"Computes the mean absolute error between the labels and predictions. Args: name: (Optional) string name of the metric instance. @@ -33257,7 +38932,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanAbsoluteError()]) ```" -4867,MeanAbsolutePercentageError,tensorflow/tensorflow/python/keras/metrics.py,2342,class,"Computes the mean absolute percentage error between `y_true` and `y_pred`. +4958,MeanAbsolutePercentageError,tensorflow/tensorflow/python/keras/metrics.py,2342,class,"Computes the mean absolute percentage error between `y_true` and `y_pred`. Args: name: (Optional) string name of the metric instance. @@ -33284,7 +38959,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanAbsolutePercentageError()]) ```" -4868,MeanSquaredError,tensorflow/tensorflow/python/keras/metrics.py,2378,class,"Computes the mean squared error between `y_true` and `y_pred`. +4959,MeanSquaredError,tensorflow/tensorflow/python/keras/metrics.py,2378,class,"Computes the mean squared error between `y_true` and `y_pred`. Args: name: (Optional) string name of the metric instance. @@ -33311,7 +38986,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanSquaredError()]) ```" -4869,MeanSquaredLogarithmicError,tensorflow/tensorflow/python/keras/metrics.py,2414,class,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. +4960,MeanSquaredLogarithmicError,tensorflow/tensorflow/python/keras/metrics.py,2414,class,"Computes the mean squared logarithmic error between `y_true` and `y_pred`. Args: name: (Optional) string name of the metric instance. @@ -33338,7 +39013,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanSquaredLogarithmicError()]) ```" -4870,Hinge,tensorflow/tensorflow/python/keras/metrics.py,2450,class,"Computes the hinge metric between `y_true` and `y_pred`. +4961,Hinge,tensorflow/tensorflow/python/keras/metrics.py,2450,class,"Computes the hinge metric between `y_true` and `y_pred`. `y_true` values are expected to be -1 or 1. If binary (0 or 1) labels are provided we will convert them to -1 or 1. @@ -33365,7 +39040,7 @@ Usage with `compile()` API: ```python model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.Hinge()]) ```" -4871,SquaredHinge,tensorflow/tensorflow/python/keras/metrics.py,2485,class,"Computes the squared hinge metric between `y_true` and `y_pred`. +4962,SquaredHinge,tensorflow/tensorflow/python/keras/metrics.py,2485,class,"Computes the squared hinge metric between `y_true` and `y_pred`. `y_true` values are expected to be -1 or 1. If binary (0 or 1) labels are provided we will convert them to -1 or 1. @@ -33395,7 +39070,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SquaredHinge()]) ```" -4872,CategoricalHinge,tensorflow/tensorflow/python/keras/metrics.py,2523,class,"Computes the categorical hinge metric between `y_true` and `y_pred`. +4963,CategoricalHinge,tensorflow/tensorflow/python/keras/metrics.py,2523,class,"Computes the categorical hinge metric between `y_true` and `y_pred`. Args: name: (Optional) string name of the metric instance. @@ -33422,7 +39097,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.CategoricalHinge()]) ```" -4873,RootMeanSquaredError,tensorflow/tensorflow/python/keras/metrics.py,2558,class,"Computes root mean squared error metric between `y_true` and `y_pred`. +4964,RootMeanSquaredError,tensorflow/tensorflow/python/keras/metrics.py,2558,class,"Computes root mean squared error metric between `y_true` and `y_pred`. Standalone usage: @@ -33445,7 +39120,19 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.RootMeanSquaredError()]) ```" -4874,LogCoshError,tensorflow/tensorflow/python/keras/metrics.py,2613,class,"Computes the logarithm of the hyperbolic cosine of the prediction error. +4965,update_state,tensorflow/tensorflow/python/keras/metrics.py,2587,method,"Accumulates root mean squared error statistics. + +Args: + y_true: The ground truth values. + y_pred: The predicted values. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4966,result,tensorflow/tensorflow/python/keras/metrics.py,2608,method, +4967,LogCoshError,tensorflow/tensorflow/python/keras/metrics.py,2613,class,"Computes the logarithm of the hyperbolic cosine of the prediction error. `logcosh = log((exp(x) + exp(-x))/2)`, where x is the error (y_pred - y_true) @@ -33473,7 +39160,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.LogCoshError()]) ```" -4875,Poisson,tensorflow/tensorflow/python/keras/metrics.py,2649,class,"Computes the Poisson metric between `y_true` and `y_pred`. +4968,Poisson,tensorflow/tensorflow/python/keras/metrics.py,2649,class,"Computes the Poisson metric between `y_true` and `y_pred`. `metric = y_pred - y_true * log(y_pred)` @@ -33501,7 +39188,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.Poisson()]) ```" -4876,KLDivergence,tensorflow/tensorflow/python/keras/metrics.py,2685,class,"Computes Kullback-Leibler divergence metric between `y_true` and `y_pred`. +4969,KLDivergence,tensorflow/tensorflow/python/keras/metrics.py,2685,class,"Computes Kullback-Leibler divergence metric between `y_true` and `y_pred`. `metric = y_true * log(y_true / y_pred)` @@ -33529,7 +39216,7 @@ model.compile(optimizer='sgd', loss='mse', metrics=[tf.keras.metrics.KLDivergence()]) ```" -4877,MeanIoU,tensorflow/tensorflow/python/keras/metrics.py,2722,class,"Computes the mean Intersection-Over-Union metric. +4970,MeanIoU,tensorflow/tensorflow/python/keras/metrics.py,2722,class,"Computes the mean Intersection-Over-Union metric. Mean Intersection-Over-Union is a common evaluation metric for semantic image segmentation, which first computes the IOU for each semantic class and then @@ -33574,7 +39261,21 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.MeanIoU(num_classes=2)]) ```" -4878,MeanTensor,tensorflow/tensorflow/python/keras/metrics.py,2854,class,"Computes the element-wise (weighted) mean of the given tensors. +4971,update_state,tensorflow/tensorflow/python/keras/metrics.py,2782,method,"Accumulates the confusion matrix statistics. + +Args: + y_true: The ground truth values. + y_pred: The predicted values. + sample_weight: Optional weighting of each example. Defaults to 1. Can be a + `Tensor` whose rank is either 0, or the same rank as `y_true`, and must + be broadcastable to `y_true`. + +Returns: + Update op." +4972,result,tensorflow/tensorflow/python/keras/metrics.py,2820,method,Compute the mean intersection-over-union via the confusion matrix. +4973,reset_states,tensorflow/tensorflow/python/keras/metrics.py,2844,method, +4974,get_config,tensorflow/tensorflow/python/keras/metrics.py,2847,method, +4975,MeanTensor,tensorflow/tensorflow/python/keras/metrics.py,2854,class,"Computes the element-wise (weighted) mean of the given tensors. `MeanTensor` returns a tensor with the same shape of the input tensors. The mean value is updated by keeping local variables `total` and `count`. The @@ -33596,7 +39297,19 @@ array([2., 3., 4., 5.], dtype=float32) >>> m.update_state([12, 10, 8, 6], sample_weight= [0, 0.2, 0.5, 1]) >>> m.result().numpy() array([2. , 3.6363635, 4.8 , 5.3333335], dtype=float32)" -4879,BinaryCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,2965,class,"Computes the crossentropy metric between the labels and predictions. +4976,total,tensorflow/tensorflow/python/keras/metrics.py,2900,method, +4977,count,tensorflow/tensorflow/python/keras/metrics.py,2904,method, +4978,update_state,tensorflow/tensorflow/python/keras/metrics.py,2907,method,"Accumulates statistics for computing the element-wise mean. + +Args: + values: Per-example value. + sample_weight: Optional weighting of each example. Defaults to 1. + +Returns: + Update op." +4979,result,tensorflow/tensorflow/python/keras/metrics.py,2950,method, +4980,reset_states,tensorflow/tensorflow/python/keras/metrics.py,2958,method, +4981,BinaryCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,2965,class,"Computes the crossentropy metric between the labels and predictions. This is the crossentropy metric class to be used when there are only two label classes (0 and 1). @@ -33632,7 +39345,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.BinaryCrossentropy()]) ```" -4880,CategoricalCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,3018,class,"Computes the crossentropy metric between the labels and predictions. +4982,CategoricalCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,3018,class,"Computes the crossentropy metric between the labels and predictions. This is the crossentropy metric class to be used when there are multiple label classes (2 or more). Here we assume that labels are given as a `one_hot` @@ -33679,7 +39392,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.CategoricalCrossentropy()]) ```" -4881,SparseCategoricalCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,3082,class,"Computes the crossentropy metric between the labels and predictions. +4983,SparseCategoricalCrossentropy,tensorflow/tensorflow/python/keras/metrics.py,3082,class,"Computes the crossentropy metric between the labels and predictions. Use this crossentropy metric when there are two or more label classes. We expect labels to be provided as integers. If you want to provide labels @@ -33733,7 +39446,7 @@ model.compile( loss='mse', metrics=[tf.keras.metrics.SparseCategoricalCrossentropy()]) ```" -4882,SumOverBatchSize,tensorflow/tensorflow/python/keras/metrics.py,3152,class,"Computes the weighted sum over batch size of the given values. +4984,SumOverBatchSize,tensorflow/tensorflow/python/keras/metrics.py,3152,class,"Computes the weighted sum over batch size of the given values. For example, if values is [1, 3, 5, 7] then the metric value is 4. If the weights were specified as [1, 1, 0, 0] then the value would be 1. @@ -33745,9 +39458,11 @@ by `count`. If `sample_weight` is `None`, weights default to 1. Use `sample_weight` of 0 to mask values." -4883,SumOverBatchSizeMetricWrapper,tensorflow/tensorflow/python/keras/metrics.py,3174,class,Wraps a function with the `SumOverBatchSizeMetricWrapper` metric. -4884,accuracy,tensorflow/tensorflow/python/keras/metrics.py,3210,function, -4885,binary_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3222,function,"Calculates how often predictions matches binary labels. +4985,SumOverBatchSizeMetricWrapper,tensorflow/tensorflow/python/keras/metrics.py,3174,class,Wraps a function with the `SumOverBatchSizeMetricWrapper` metric. +4986,update_state,tensorflow/tensorflow/python/keras/metrics.py,3191,method, +4987,get_config,tensorflow/tensorflow/python/keras/metrics.py,3202,method, +4988,accuracy,tensorflow/tensorflow/python/keras/metrics.py,3210,function, +4989,binary_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3222,function,"Calculates how often predictions matches binary labels. Standalone usage: >>> y_true = [[1], [1], [0], [0]] @@ -33765,7 +39480,7 @@ Args: Returns: Binary accuracy values. shape = `[batch_size, d0, .. dN-1]`" -4886,categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3250,function,"Calculates how often predictions matches one-hot labels. +4990,categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3250,function,"Calculates how often predictions matches one-hot labels. Standalone usage: >>> y_true = [[0, 0, 1], [0, 1, 0]] @@ -33784,7 +39499,7 @@ Args: Returns: Categorical accuracy values." -4887,sparse_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3279,function,"Calculates how often predictions matches integer labels. +4991,sparse_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3279,function,"Calculates how often predictions matches integer labels. Standalone usage: >>> y_true = [2, 1] @@ -33803,7 +39518,7 @@ Args: Returns: Sparse categorical accuracy values." -4888,top_k_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3320,function,"Computes how often targets are in the top `K` predictions. +4992,top_k_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3320,function,"Computes how often targets are in the top `K` predictions. Standalone usage: >>> y_true = [[0, 0, 1], [0, 1, 0]] @@ -33821,7 +39536,7 @@ Args: Returns: Top K categorical accuracy value." -4889,sparse_top_k_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3346,function,"Computes how often integer targets are in the top `K` predictions. +4993,sparse_top_k_categorical_accuracy,tensorflow/tensorflow/python/keras/metrics.py,3346,function,"Computes how often integer targets are in the top `K` predictions. Standalone usage: >>> y_true = [2, 1] @@ -33840,7 +39555,7 @@ Args: Returns: Sparse top K categorical accuracy value." -4890,cosine_proximity,tensorflow/tensorflow/python/keras/metrics.py,3380,function,"Computes the cosine similarity between labels and predictions. +4994,cosine_proximity,tensorflow/tensorflow/python/keras/metrics.py,3380,function,"Computes the cosine similarity between labels and predictions. Args: y_true: The ground truth values. @@ -33850,16 +39565,16 @@ Args: Returns: Cosine similarity value." -4891,clone_metric,tensorflow/tensorflow/python/keras/metrics.py,3407,function,"Returns a clone of the metric if stateful, otherwise returns it as is." -4892,clone_metrics,tensorflow/tensorflow/python/keras/metrics.py,3415,function,Clones the given metric list/dict. -4893,serialize,tensorflow/tensorflow/python/keras/metrics.py,3421,function,"Serializes metric function or `Metric` instance. +4995,clone_metric,tensorflow/tensorflow/python/keras/metrics.py,3407,function,"Returns a clone of the metric if stateful, otherwise returns it as is." +4996,clone_metrics,tensorflow/tensorflow/python/keras/metrics.py,3415,function,Clones the given metric list/dict. +4997,serialize,tensorflow/tensorflow/python/keras/metrics.py,3421,function,"Serializes metric function or `Metric` instance. Arguments: metric: A Keras `Metric` instance or a metric function. Returns: Metric configuration dictionary." -4894,deserialize,tensorflow/tensorflow/python/keras/metrics.py,3434,function,"Deserializes a serialized metric class/function instance. +4998,deserialize,tensorflow/tensorflow/python/keras/metrics.py,3434,function,"Deserializes a serialized metric class/function instance. Arguments: config: Metric configuration. @@ -33868,7 +39583,7 @@ Arguments: Returns: A Keras `Metric` instance or a metric function." -4895,get,tensorflow/tensorflow/python/keras/metrics.py,3453,function,"Retrieves a Keras metric as a `function`/`Metric` class instance. +4999,get,tensorflow/tensorflow/python/keras/metrics.py,3453,function,"Retrieves a Keras metric as a `function`/`Metric` class instance. The `identifier` may be the string name of a metric function or class. @@ -33899,148 +39614,17 @@ Returns: Raises: ValueError: If `identifier` cannot be interpreted." -4896,is_built_in,tensorflow/tensorflow/python/keras/metrics.py,3497,function, -4897,FalsePositivesTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,41,class, -4898,FalseNegativesTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,121,class, -4899,TrueNegativesTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,189,class, -4900,TruePositivesTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,257,class, -4901,PrecisionTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,324,class, -4902,RecallTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,529,class, -4903,SensitivityAtSpecificityTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,733,class, -4904,SpecificityAtSensitivityTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,830,class, -4905,PrecisionAtRecallTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,926,class, -4906,RecallAtPrecisionTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,1025,class, -4907,AUCTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,1140,class, -4908,MultiAUCTest,tensorflow/tensorflow/python/keras/metrics_confusion_matrix_test.py,1414,class, -4909,get_multi_io_model,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,34,function, -4910,custom_generator_multi_io,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,48,function, -4911,TestMetricsCorrectnessMultiIO,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,71,class, -4912,TestMetricsCorrectnessSingleIO,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,348,class, -4913,TestOutputLossMetrics,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,564,class, -4914,KerasFunctionalMetricsTest,tensorflow/tensorflow/python/keras/metrics_functional_test.py,29,class, -4915,KerasSumTest,tensorflow/tensorflow/python/keras/metrics_test.py,53,class, -4916,MeanTest,tensorflow/tensorflow/python/keras/metrics_test.py,170,class, -4917,KerasAccuracyTest,tensorflow/tensorflow/python/keras/metrics_test.py,363,class, -4918,CosineSimilarityTest,tensorflow/tensorflow/python/keras/metrics_test.py,607,class, -4919,MeanAbsoluteErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,668,class, -4920,MeanAbsolutePercentageErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,706,class, -4921,MeanSquaredErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,746,class, -4922,MeanSquaredLogarithmicErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,784,class, -4923,HingeTest,tensorflow/tensorflow/python/keras/metrics_test.py,824,class, -4924,SquaredHingeTest,tensorflow/tensorflow/python/keras/metrics_test.py,879,class, -4925,CategoricalHingeTest,tensorflow/tensorflow/python/keras/metrics_test.py,940,class, -4926,RootMeanSquaredErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,980,class, -4927,TopKCategoricalAccuracyTest,tensorflow/tensorflow/python/keras/metrics_test.py,1014,class, -4928,SparseTopKCategoricalAccuracyTest,tensorflow/tensorflow/python/keras/metrics_test.py,1061,class, -4929,LogCoshErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,1108,class, -4930,PoissonTest,tensorflow/tensorflow/python/keras/metrics_test.py,1151,class, -4931,KLDivergenceTest,tensorflow/tensorflow/python/keras/metrics_test.py,1197,class, -4932,MeanRelativeErrorTest,tensorflow/tensorflow/python/keras/metrics_test.py,1244,class, -4933,MeanIoUTest,tensorflow/tensorflow/python/keras/metrics_test.py,1300,class, -4934,MeanTensorTest,tensorflow/tensorflow/python/keras/metrics_test.py,1382,class, -4935,BinaryCrossentropyTest,tensorflow/tensorflow/python/keras/metrics_test.py,1535,class, -4936,CategoricalCrossentropyTest,tensorflow/tensorflow/python/keras/metrics_test.py,1655,class, -4937,SparseCategoricalCrossentropyTest,tensorflow/tensorflow/python/keras/metrics_test.py,1781,class, -4938,BinaryTruePositives,tensorflow/tensorflow/python/keras/metrics_test.py,1931,class, -4939,BinaryTruePositivesViaControlFlow,tensorflow/tensorflow/python/keras/metrics_test.py,1955,class, -4940,CustomMetricsTest,tensorflow/tensorflow/python/keras/metrics_test.py,1980,class, -4941,_get_model,tensorflow/tensorflow/python/keras/metrics_test.py,2066,function, -4942,ResetStatesTest,tensorflow/tensorflow/python/keras/metrics_test.py,2082,class, -4943,share_weights,tensorflow/tensorflow/python/keras/models.py,56,function, -4944,_clone_layer,tensorflow/tensorflow/python/keras/models.py,60,function, -4945,_insert_ancillary_layers,tensorflow/tensorflow/python/keras/models.py,64,function,Inserts ancillary layers into the model with the proper order. -4946,_make_new_nodes,tensorflow/tensorflow/python/keras/models.py,77,function,"Uses the layers in `layer_map` to make new nodes based on `nodes_by_depth`. - -Args: - nodes_by_depth: Provides structure information to create new nodes. - layer_fn: Function to clone layers. - layer_map: Map from layers in `model` to new layers. - tensor_map: Map from tensors in `model` to newly compute tensors. - -Returns: - A set of new nodes. `layer_map` and `tensor_map` are updated." -4947,_clone_functional_model,tensorflow/tensorflow/python/keras/models.py,133,function,"Clone a functional `Model` instance. - -Model cloning is similar to calling a model on new inputs, -except that it creates new layers (and thus new weights) instead -of sharing the weights of the existing layers. - -Input layers are always cloned. - -Arguments: - model: Instance of `Model`. - input_tensors: optional list of input tensors - to build the model upon. If not provided, - placeholders will be created. - layer_fn: callable to be applied on non-input layers in the model. By - default it clones the layer. Another example is to preserve the layer - to share the weights. This is required when we create a per-replica - copy of the model with distribution strategy; we want the weights to - be shared but still feed inputs separately so we create new input - layers. - -Returns: - An instance of `Model` reproducing the behavior - of the original model, on top of new inputs tensors, - using newly instantiated weights. - -Raises: - ValueError: in case of invalid `model` argument value or `layer_fn` - argument value." -4948,_clone_layers_and_model_config,tensorflow/tensorflow/python/keras/models.py,219,function,"Clones all layers, and returns the model config without serializing layers. - -This function ensures that only the node graph is retrieved when getting the -model config. The `layer_fn` used to clone layers might not rely on -`layer.get_config()`, so some custom layers do not define `get_config`. -Trying to retrieve the config results in errors. - -Args: - model: A Functional model. - input_layers: Dictionary mapping input layers in `model` to new input layers - layer_fn: Function used to clone all non-input layers. - -Returns: - Model config object, and a dictionary of newly created layers." -4949,_remove_ancillary_layers,tensorflow/tensorflow/python/keras/models.py,252,function,"Removes and returns any ancillary layers from `layers` based on `model`. - -Ancillary layers are part of the model topology but not used to compute the -model outputs, e.g., layers from `add_loss` and `add_metric`. - -Args: - model: A Keras Model. - layer_map: A map to from layers in the `model` to those in `layers`. - layers: A list of all layers. - -Returns: - Two lists of layers: (1) `layers` with the ancillary layers removed, and (2) - the ancillary layers." -4950,_clone_sequential_model,tensorflow/tensorflow/python/keras/models.py,281,function,"Clone a `Sequential` model instance. - -Model cloning is similar to calling a model on new inputs, -except that it creates new layers (and thus new weights) instead -of sharing the weights of the existing layers. - -Arguments: - model: Instance of `Sequential`. - input_tensors: optional list of input tensors - to build the model upon. If not provided, - placeholders will be created. - layer_fn: callable to be applied on non-input layers in the model. By - default it clones the layer. Another example is to preserve the layer - to share the weights. This is required when we create a per-replica - copy of the model with distribution strategy; we want the weights to - be shared but still feed inputs separately so we create new input - layers. - -Returns: - An instance of `Sequential` reproducing the behavior - of the original model, on top of new inputs tensors, - using newly instantiated weights. - -Raises: - ValueError: in case of invalid `model` argument value or `layer_fn` - argument value." -4951,clone_model,tensorflow/tensorflow/python/keras/models.py,387,function,"Clone any `Model` instance. +5000,is_built_in,tensorflow/tensorflow/python/keras/metrics.py,3497,function, +5001,get_multi_io_model,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,34,function, +5002,custom_generator_multi_io,tensorflow/tensorflow/python/keras/metrics_correctness_test.py,48,function, +5003,BinaryTruePositives,tensorflow/tensorflow/python/keras/metrics_test.py,1931,class, +5004,update_state,tensorflow/tensorflow/python/keras/metrics_test.py,1937,method, +5005,result,tensorflow/tensorflow/python/keras/metrics_test.py,1951,method, +5006,BinaryTruePositivesViaControlFlow,tensorflow/tensorflow/python/keras/metrics_test.py,1955,class, +5007,update_state,tensorflow/tensorflow/python/keras/metrics_test.py,1961,method, +5008,result,tensorflow/tensorflow/python/keras/metrics_test.py,1973,method, +5009,share_weights,tensorflow/tensorflow/python/keras/models.py,56,function, +5010,clone_model,tensorflow/tensorflow/python/keras/models.py,387,function,"Clone any `Model` instance. Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead @@ -34072,37 +39656,7 @@ Returns: Raises: ValueError: in case of invalid `model` argument value." -4952,_in_place_subclassed_model_reset,tensorflow/tensorflow/python/keras/models.py,433,function,"Substitute for model cloning that works for subclassed models. - -Subclassed models cannot be cloned because their topology is not serializable. -To ""instantiate"" an identical model in a new TF graph, we reuse the original -model object, but we clear its state. - -After calling this function on a model instance, you can use the model -instance as if it were a model clone (in particular you can use it in a new -graph). - -This method clears the state of the input model. It is thus destructive. -However the original state can be restored fully by calling -`_in_place_subclassed_model_state_restoration`. - -Args: - model: Instance of a Keras model created via subclassing. - -Raises: - ValueError: In case the model uses a subclassed model as inner layer." -4953,_reset_build_compile_trackers,tensorflow/tensorflow/python/keras/models.py,533,function,"Reset state trackers for model. - -Note that we do not actually zero out attributes such as optimizer, -but instead rely on the expectation that all of the attrs will be -over-written on calling build/compile/etc. This is somewhat fragile, -insofar as we check elsewhere for the presence of these attributes as -evidence of having been built/compiled/etc. Pending a better way to do this, -we reset key attributes here to allow building and compiling. - -Args: - model: the model that is being reset" -4954,in_place_subclassed_model_state_restoration,tensorflow/tensorflow/python/keras/models.py,557,function,"Restores the original state of a model after it was ""reset"". +5011,in_place_subclassed_model_state_restoration,tensorflow/tensorflow/python/keras/models.py,557,function,"Restores the original state of a model after it was ""reset"". This undoes this action of `_in_place_subclassed_model_reset`, which is called in `clone_and_build_model` if `in_place_reset` is set to True. @@ -34110,7 +39664,7 @@ in `clone_and_build_model` if `in_place_reset` is set to True. Args: model: Instance of a Keras model created via subclassing, on which `_in_place_subclassed_model_reset` was previously called." -4955,clone_and_build_model,tensorflow/tensorflow/python/keras/models.py,589,function,"Clone a `Model` and build/compile it with the same settings used before. +5012,clone_and_build_model,tensorflow/tensorflow/python/keras/models.py,589,function,"Clone a `Model` and build/compile it with the same settings used before. This function can be be run in the same graph or in a separate graph from the model. When using a separate graph, `in_place_reset` must be `False`. @@ -34149,15 +39703,7 @@ Raises: ValueError: Cloning fails in the following cases - cloning a subclassed model with `in_place_reset` set to False. - compiling the clone when the original model has not been compiled." -4956,TestModel,tensorflow/tensorflow/python/keras/models_test.py,43,class,A model subclass. -4957,_get_layers,tensorflow/tensorflow/python/keras/models_test.py,56,function, -4958,_get_model,tensorflow/tensorflow/python/keras/models_test.py,73,function, -4959,TestModelCloning,tensorflow/tensorflow/python/keras/models_test.py,79,class, -4960,_has_placeholder,tensorflow/tensorflow/python/keras/models_test.py,307,function, -4961,CheckpointingTests,tensorflow/tensorflow/python/keras/models_test.py,312,class, -4962,TestModelBackend,tensorflow/tensorflow/python/keras/models_test.py,338,class, -4963,TestCloneAndBuildModel,tensorflow/tensorflow/python/keras/models_test.py,356,class, -4964,Optimizer,tensorflow/tensorflow/python/keras/optimizers.py,47,class,"Abstract optimizer base class. +5013,Optimizer,tensorflow/tensorflow/python/keras/optimizers.py,47,class,"Abstract optimizer base class. Note: this is the parent class of all optimizers, not an actual optimizer that can be used for training models. @@ -34168,7 +39714,38 @@ All Keras optimizers support the following keyword arguments: when their L2 norm exceeds this value. clipvalue: float >= 0. Gradients will be clipped when their absolute value exceeds this value." -4965,SGD,tensorflow/tensorflow/python/keras/optimizers.py,174,class,"Stochastic gradient descent optimizer. +5014,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,90,method, +5015,get_gradients,tensorflow/tensorflow/python/keras/optimizers.py,93,method,"Returns gradients of `loss` with respect to `params`. + +Arguments: + loss: Loss tensor. + params: List of variables. + +Returns: + List of gradient tensors. + +Raises: + ValueError: In case any gradient cannot be computed (e.g. if gradient + function not implemented)." +5016,set_weights,tensorflow/tensorflow/python/keras/optimizers.py,123,method,"Sets the weights of the optimizer, from Numpy arrays. + +Should only be called after computing the gradients +(otherwise the optimizer has no weights). + +Arguments: + weights: a list of Numpy arrays. The number of arrays and their shape + must match number of the dimensions of the weights of the optimizer + (i.e. it should match the output of `get_weights`). + +Raises: + ValueError: in case of incompatible weight shapes." +5017,get_weights,tensorflow/tensorflow/python/keras/optimizers.py,153,method,"Returns the current value of the weights of the optimizer. + +Returns: + A list of numpy arrays." +5018,get_config,tensorflow/tensorflow/python/keras/optimizers.py,161,method, +5019,from_config,tensorflow/tensorflow/python/keras/optimizers.py,170,method, +5020,SGD,tensorflow/tensorflow/python/keras/optimizers.py,174,class,"Stochastic gradient descent optimizer. Includes support for momentum, learning rate decay, and Nesterov momentum. @@ -34179,7 +39756,9 @@ Arguments: direction and dampens oscillations. decay: float >= 0. Learning rate decay over each update. nesterov: boolean. Whether to apply Nesterov momentum." -4966,RMSprop,tensorflow/tensorflow/python/keras/optimizers.py,243,class,"RMSProp optimizer. +5021,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,204,method, +5022,get_config,tensorflow/tensorflow/python/keras/optimizers.py,232,method, +5023,RMSprop,tensorflow/tensorflow/python/keras/optimizers.py,243,class,"RMSProp optimizer. It is recommended to leave the parameters of this optimizer at their default values @@ -34190,7 +39769,9 @@ Arguments: rho: float >= 0. epsilon: float >= 0. Fuzz factor. If `None`, defaults to `K.epsilon()`. decay: float >= 0. Learning rate decay over each update." -4967,Adagrad,tensorflow/tensorflow/python/keras/optimizers.py,310,class,"Adagrad optimizer. +5024,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,274,method, +5025,get_config,tensorflow/tensorflow/python/keras/optimizers.py,299,method, +5026,Adagrad,tensorflow/tensorflow/python/keras/optimizers.py,310,class,"Adagrad optimizer. Adagrad is an optimizer with parameter-specific learning rates, which are adapted relative to how frequently a parameter gets @@ -34208,7 +39789,9 @@ at their default values. # References - [Adaptive Subgradient Methods for Online Learning and Stochastic Optimization](http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)" -4968,Adadelta,tensorflow/tensorflow/python/keras/optimizers.py,383,class,"Adadelta optimizer. +5027,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,348,method, +5028,get_config,tensorflow/tensorflow/python/keras/optimizers.py,373,method, +5029,Adadelta,tensorflow/tensorflow/python/keras/optimizers.py,383,class,"Adadelta optimizer. Adadelta is a more robust extension of Adagrad that adapts learning rates based on a moving window of gradient updates, @@ -34232,7 +39815,9 @@ at their default values. # References - [Adadelta - an adaptive learning rate method](http://arxiv.org/abs/1212.5701)" -4969,Adam,tensorflow/tensorflow/python/keras/optimizers.py,472,class,"Adam optimizer. +5030,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,429,method, +5031,get_config,tensorflow/tensorflow/python/keras/optimizers.py,461,method, +5032,Adam,tensorflow/tensorflow/python/keras/optimizers.py,472,class,"Adam optimizer. Default parameters follow those provided in the original paper. @@ -34244,7 +39829,9 @@ Arguments: decay: float >= 0. Learning rate decay over each update. amsgrad: boolean. Whether to apply the AMSGrad variant of this algorithm from the paper ""On the Convergence of Adam and Beyond""." -4970,Adamax,tensorflow/tensorflow/python/keras/optimizers.py,570,class,"Adamax optimizer from Adam paper's Section 7. +5033,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,518,method, +5034,get_config,tensorflow/tensorflow/python/keras/optimizers.py,557,method, +5035,Adamax,tensorflow/tensorflow/python/keras/optimizers.py,570,class,"Adamax optimizer from Adam paper's Section 7. It is a variant of Adam based on the infinity norm. Default parameters follow those provided in the paper. @@ -34254,7 +39841,9 @@ Arguments: beta_1/beta_2: floats, 0 < beta < 1. Generally close to 1. epsilon: float >= 0. Fuzz factor. If `None`, defaults to `K.epsilon()`. decay: float >= 0. Learning rate decay over each update." -4971,Nadam,tensorflow/tensorflow/python/keras/optimizers.py,658,class,"Nesterov Adam optimizer. +5036,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,612,method, +5037,get_config,tensorflow/tensorflow/python/keras/optimizers.py,646,method, +5038,Nadam,tensorflow/tensorflow/python/keras/optimizers.py,658,class,"Nesterov Adam optimizer. Much like Adam is essentially RMSprop with momentum, Nadam is Adam RMSprop with Nesterov momentum. @@ -34267,9 +39856,17 @@ Arguments: lr: float >= 0. Learning rate. beta_1/beta_2: floats, 0 < beta < 1. Generally close to 1. epsilon: float >= 0. Fuzz factor. If `None`, defaults to `K.epsilon()`." -4972,TFOptimizer,tensorflow/tensorflow/python/keras/optimizers.py,756,class,Wrapper class for native TensorFlow optimizers. -4973,serialize,tensorflow/tensorflow/python/keras/optimizers.py,831,function, -4974,deserialize,tensorflow/tensorflow/python/keras/optimizers.py,836,function,"Inverse of the `serialize` function. +5039,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,701,method, +5040,get_config,tensorflow/tensorflow/python/keras/optimizers.py,744,method, +5041,TFOptimizer,tensorflow/tensorflow/python/keras/optimizers.py,756,class,Wrapper class for native TensorFlow optimizers. +5042,apply_gradients,tensorflow/tensorflow/python/keras/optimizers.py,774,method, +5043,get_grads,tensorflow/tensorflow/python/keras/optimizers.py,777,method, +5044,get_updates,tensorflow/tensorflow/python/keras/optimizers.py,780,method, +5045,weights,tensorflow/tensorflow/python/keras/optimizers.py,809,method, +5046,get_config,tensorflow/tensorflow/python/keras/optimizers.py,812,method, +5047,from_config,tensorflow/tensorflow/python/keras/optimizers.py,815,method, +5048,serialize,tensorflow/tensorflow/python/keras/optimizers.py,831,function, +5049,deserialize,tensorflow/tensorflow/python/keras/optimizers.py,836,function,"Inverse of the `serialize` function. Arguments: config: Optimizer configuration dictionary. @@ -34278,7 +39875,7 @@ Arguments: Returns: A Keras Optimizer instance." -4975,get,tensorflow/tensorflow/python/keras/optimizers.py,873,function,"Retrieves a Keras Optimizer instance. +5050,get,tensorflow/tensorflow/python/keras/optimizers.py,873,function,"Retrieves a Keras Optimizer instance. Arguments: identifier: Optimizer identifier, one of @@ -34292,11 +39889,7 @@ Returns: Raises: ValueError: If `identifier` cannot be interpreted." -4976,_get_model,tensorflow/tensorflow/python/keras/optimizers_test.py,37,function, -4977,KerasOptimizersTest,tensorflow/tensorflow/python/keras/optimizers_test.py,47,class, -4978,_check_penalty_number,tensorflow/tensorflow/python/keras/regularizers.py,33,function,"check penalty number availability, raise ValueError if failed." -4979,_none_to_default,tensorflow/tensorflow/python/keras/regularizers.py,46,function, -4980,Regularizer,tensorflow/tensorflow/python/keras/regularizers.py,51,class,"Regularizer base class. +5051,Regularizer,tensorflow/tensorflow/python/keras/regularizers.py,51,class,"Regularizer base class. Regularizers allow you to apply penalties on layer parameters or layer activity during optimization. These penalties are summed into the loss @@ -34412,7 +40005,38 @@ and registered your custom regularizer. beyond. In earlier versions of TensorFlow you must pass your custom regularizer to the `custom_objects` argument of methods that expect custom regularizers to be registered as serializable." -4981,L1L2,tensorflow/tensorflow/python/keras/regularizers.py,216,class,"A regularizer that applies both L1 and L2 regularization penalties. +5052,from_config,tensorflow/tensorflow/python/keras/regularizers.py,175,method,"Creates a regularizer from its config. + +This method is the reverse of `get_config`, +capable of instantiating the same regularizer from the config +dictionary. + +This method is used by Keras `model_to_estimator`, saving and +loading models to HDF5 formats, Keras model cloning, some visualization +utilities, and exporting models to and from JSON. + +Arguments: + config: A Python dictionary, typically the output of get_config. + +Returns: + A regularizer instance." +5053,get_config,tensorflow/tensorflow/python/keras/regularizers.py,194,method,"Returns the config of the regularizer. + +An regularizer config is a Python dictionary (serializable) +containing all configuration parameters of the regularizer. +The same regularizer can be reinstantiated later +(without any saved state) from this configuration. + +This method is optional if you are just training and executing models, +exporting to and from SavedModels, or using weight checkpoints. + +This method is required for Keras `model_to_estimator`, saving and +loading models to HDF5 formats, Keras model cloning, some visualization +utilities, and exporting models to and from JSON. + +Returns: + Python dictionary." +5054,L1L2,tensorflow/tensorflow/python/keras/regularizers.py,216,class,"A regularizer that applies both L1 and L2 regularization penalties. The L1 regularization penalty is computed as: `loss = l1 * reduce_sum(abs(x))` @@ -34429,7 +40053,8 @@ In this case, the default values used are `l1=0.01` and `l2=0.01`. Attributes: l1: Float; L1 regularization factor. l2: Float; L2 regularization factor." -4982,L1,tensorflow/tensorflow/python/keras/regularizers.py,261,class,"A regularizer that applies a L1 regularization penalty. +5055,get_config,tensorflow/tensorflow/python/keras/regularizers.py,256,method, +5056,L1,tensorflow/tensorflow/python/keras/regularizers.py,261,class,"A regularizer that applies a L1 regularization penalty. The L1 regularization penalty is computed as: `loss = l1 * reduce_sum(abs(x))` @@ -34442,7 +40067,8 @@ In this case, the default value used is `l1=0.01`. Attributes: l1: Float; L1 regularization factor." -4983,L2,tensorflow/tensorflow/python/keras/regularizers.py,295,class,"A regularizer that applies a L2 regularization penalty. +5057,get_config,tensorflow/tensorflow/python/keras/regularizers.py,290,method, +5058,L2,tensorflow/tensorflow/python/keras/regularizers.py,295,class,"A regularizer that applies a L2 regularization penalty. The L2 regularization penalty is computed as: `loss = l2 * reduce_sum(square(x))` @@ -34455,7 +40081,8 @@ In this case, the default value used is `l2=0.01`. Attributes: l2: Float; L2 regularization factor." -4984,l1_l2,tensorflow/tensorflow/python/keras/regularizers.py,329,function,"Create a regularizer that applies both L1 and L2 penalties. +5059,get_config,tensorflow/tensorflow/python/keras/regularizers.py,324,method, +5060,l1_l2,tensorflow/tensorflow/python/keras/regularizers.py,329,function,"Create a regularizer that applies both L1 and L2 penalties. The L1 regularization penalty is computed as: `loss = l1 * reduce_sum(abs(x))` @@ -34469,52 +40096,10 @@ Arguments: Returns: An L1L2 Regularizer with the given regularization factors." -4985,serialize,tensorflow/tensorflow/python/keras/regularizers.py,354,function, -4986,deserialize,tensorflow/tensorflow/python/keras/regularizers.py,359,function, -4987,get,tensorflow/tensorflow/python/keras/regularizers.py,372,function,Retrieve a regularizer instance from a config or identifier. -4988,KerasRegularizersTest,tensorflow/tensorflow/python/keras/regularizers_test.py,38,class, -4989,string_test,tensorflow/tensorflow/python/keras/testing_utils.py,51,function, -4990,numeric_test,tensorflow/tensorflow/python/keras/testing_utils.py,55,function, -4991,get_test_data,tensorflow/tensorflow/python/keras/testing_utils.py,59,function,"Generates test data to train a model on. - -Arguments: - train_samples: Integer, how many training samples to generate. - test_samples: Integer, how many test samples to generate. - input_shape: Tuple of integers, shape of the inputs. - num_classes: Integer, number of classes for the data and targets. - random_seed: Integer, random seed used by numpy to generate data. - -Returns: - A tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`." -4992,layer_test,tensorflow/tensorflow/python/keras/testing_utils.py,89,function,"Test routine for a layer with a single input and single output. - -Arguments: - layer_cls: Layer class object. - kwargs: Optional dictionary of keyword arguments for instantiating the - layer. - input_shape: Input shape tuple. - input_dtype: Data type of the input data. - input_data: Numpy array of input data. - expected_output: Numpy array of the expected output. - expected_output_dtype: Data type expected for the output. - expected_output_shape: Shape tuple for the expected shape of the output. - validate_training: Whether to attempt to validate training on this layer. - This might be set to False for non-differentiable layers that output - string or integer values. - adapt_data: Optional data for an 'adapt' call. If None, adapt() will not - be tested for this layer. This is only relevant for PreprocessingLayers. - custom_objects: Optional dictionary mapping name strings to custom objects - in the layer class. This is helpful for testing custom layers. - test_harness: The Tensorflow test, if any, that this function is being - called in. - -Returns: - The output data (Numpy array) returned by the layer, for additional - checks to be done by the calling code. - -Raises: - ValueError: if `input_shape is None`." -4993,model_type_scope,tensorflow/tensorflow/python/keras/testing_utils.py,307,function,"Provides a scope within which the model type to test is equal to `value`. +5061,serialize,tensorflow/tensorflow/python/keras/regularizers.py,354,function, +5062,deserialize,tensorflow/tensorflow/python/keras/regularizers.py,359,function, +5063,get,tensorflow/tensorflow/python/keras/regularizers.py,372,function,Retrieve a regularizer instance from a config or identifier. +5064,model_type_scope,tensorflow/tensorflow/python/keras/testing_utils.py,307,function,"Provides a scope within which the model type to test is equal to `value`. The model type gets restored to its original value upon exiting the scope. @@ -34523,7 +40108,7 @@ Arguments: Yields: The provided value." -4994,run_eagerly_scope,tensorflow/tensorflow/python/keras/testing_utils.py,328,function,"Provides a scope within which we compile models to run eagerly or not. +5065,run_eagerly_scope,tensorflow/tensorflow/python/keras/testing_utils.py,328,function,"Provides a scope within which we compile models to run eagerly or not. The boolean gets restored to its original value upon exiting the scope. @@ -34533,7 +40118,7 @@ Arguments: Yields: The provided value." -4995,use_keras_tensors_scope,tensorflow/tensorflow/python/keras/testing_utils.py,350,function,"Provides a scope within which we use KerasTensors in the func. API or not. +5066,use_keras_tensors_scope,tensorflow/tensorflow/python/keras/testing_utils.py,350,function,"Provides a scope within which we use KerasTensors in the func. API or not. The boolean gets restored to its original value upon exiting the scope. @@ -34544,8 +40129,8 @@ Arguments: Yields: The provided value." -4996,should_run_eagerly,tensorflow/tensorflow/python/keras/testing_utils.py,372,function,Returns whether the models we are testing should be run eagerly. -4997,saved_model_format_scope,tensorflow/tensorflow/python/keras/testing_utils.py,383,function,"Provides a scope within which the savde model format to test is `value`. +5067,should_run_eagerly,tensorflow/tensorflow/python/keras/testing_utils.py,372,function,Returns whether the models we are testing should be run eagerly. +5068,saved_model_format_scope,tensorflow/tensorflow/python/keras/testing_utils.py,383,function,"Provides a scope within which the savde model format to test is `value`. The saved model format gets restored to its original value upon exiting the scope. @@ -34555,18 +40140,16 @@ Arguments: Yields: The provided value." -4998,get_save_format,tensorflow/tensorflow/python/keras/testing_utils.py,404,function, -4999,get_model_type,tensorflow/tensorflow/python/keras/testing_utils.py,413,function,Gets the model type that should be tested. -5000,get_small_sequential_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,423,function, -5001,get_small_functional_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,434,function, -5002,SmallSubclassMLP,tensorflow/tensorflow/python/keras/testing_utils.py,442,class,A subclass model based small MLP. -5003,_SmallSubclassMLPCustomBuild,tensorflow/tensorflow/python/keras/testing_utils.py,467,class,A subclass model small MLP that uses a custom build method. -5004,get_small_subclass_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,487,function, -5005,get_small_subclass_mlp_with_custom_build,tensorflow/tensorflow/python/keras/testing_utils.py,491,function, -5006,get_small_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,495,function,Get a small mlp of the model type specified by `get_model_type`. -5007,_SubclassModel,tensorflow/tensorflow/python/keras/testing_utils.py,509,class,A Keras subclass model. -5008,_SubclassModelCustomBuild,tensorflow/tensorflow/python/keras/testing_utils.py,545,class,A Keras subclass model that uses a custom build method. -5009,get_model_from_layers,tensorflow/tensorflow/python/keras/testing_utils.py,566,function,"Builds a model from a sequence of layers. +5069,get_save_format,tensorflow/tensorflow/python/keras/testing_utils.py,404,function, +5070,get_model_type,tensorflow/tensorflow/python/keras/testing_utils.py,413,function,Gets the model type that should be tested. +5071,get_small_sequential_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,423,function, +5072,get_small_functional_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,434,function, +5073,SmallSubclassMLP,tensorflow/tensorflow/python/keras/testing_utils.py,442,class,A subclass model based small MLP. +5074,call,tensorflow/tensorflow/python/keras/testing_utils.py,458,method, +5075,get_small_subclass_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,487,function, +5076,get_small_subclass_mlp_with_custom_build,tensorflow/tensorflow/python/keras/testing_utils.py,491,function, +5077,get_small_mlp,tensorflow/tensorflow/python/keras/testing_utils.py,495,function,Get a small mlp of the model type specified by `get_model_type`. +5078,get_model_from_layers,tensorflow/tensorflow/python/keras/testing_utils.py,566,function,"Builds a model from a sequence of layers. Args: model_layers: The layers used to build the network. @@ -34578,10 +40161,10 @@ Args: Returns: A Keras model." -5010,Bias,tensorflow/tensorflow/python/keras/testing_utils.py,631,class, -5011,_MultiIOSubclassModel,tensorflow/tensorflow/python/keras/testing_utils.py,640,class,Multi IO Keras subclass model. -5012,_MultiIOSubclassModelCustomBuild,tensorflow/tensorflow/python/keras/testing_utils.py,676,class,Multi IO Keras subclass model that uses a custom build method. -5013,get_multi_io_model,tensorflow/tensorflow/python/keras/testing_utils.py,724,function,"Builds a multi-io model that contains two branches. +5079,Bias,tensorflow/tensorflow/python/keras/testing_utils.py,631,class, +5080,build,tensorflow/tensorflow/python/keras/testing_utils.py,633,method, +5081,call,tensorflow/tensorflow/python/keras/testing_utils.py,636,method, +5082,get_multi_io_model,tensorflow/tensorflow/python/keras/testing_utils.py,724,function,"Builds a multi-io model that contains two branches. The produced model will be of the type specified by `get_model_type`. @@ -34657,7 +40240,7 @@ Args: Returns: A multi-io model of the type specified by `get_model_type`, specified by the different branches." -5014,get_v2_optimizer,tensorflow/tensorflow/python/keras/testing_utils.py,866,function,"Get the v2 optimizer requested. +5083,get_v2_optimizer,tensorflow/tensorflow/python/keras/testing_utils.py,866,function,"Get the v2 optimizer requested. This is only necessary until v2 are the default, as we are testing in Eager, and Eager + v1 optimizers fail tests. When we are in v2, the strings alone @@ -34672,17 +40255,12 @@ Returns: Raises: ValueError: if an unknown name was passed." -5015,get_expected_metric_variable_names,tensorflow/tensorflow/python/keras/testing_utils.py,891,function,Returns expected metric variable names given names and prefix/suffix. -5016,enable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/testing_utils.py,900,function,Decorator for enabling the layer V2 dtype behavior on a test. -5017,disable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/testing_utils.py,905,function,Decorator for disabling the layer V2 dtype behavior on a test. -5018,_set_v2_dtype_behavior,tensorflow/tensorflow/python/keras/testing_utils.py,910,function,Returns version of 'fn' that runs with v2 dtype behavior on or off. -5019,device,tensorflow/tensorflow/python/keras/testing_utils.py,925,function,Uses gpu when requested and available. -5020,use_gpu,tensorflow/tensorflow/python/keras/testing_utils.py,936,function,Uses gpu when requested and available. -5021,_get_elephant,tensorflow/tensorflow/python/keras/applications/applications_load_weight_test.py,78,function, -5022,ApplicationsLoadWeightTest,tensorflow/tensorflow/python/keras/applications/applications_load_weight_test.py,91,class, -5023,ApplicationsTest,tensorflow/tensorflow/python/keras/applications/applications_test.py,74,class, -5024,_get_output_shape,tensorflow/tensorflow/python/keras/applications/applications_test.py,135,function, -5025,dense_block,tensorflow/tensorflow/python/keras/applications/densenet.py,57,function,"A dense block. +5084,get_expected_metric_variable_names,tensorflow/tensorflow/python/keras/testing_utils.py,891,function,Returns expected metric variable names given names and prefix/suffix. +5085,enable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/testing_utils.py,900,function,Decorator for enabling the layer V2 dtype behavior on a test. +5086,disable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/testing_utils.py,905,function,Decorator for disabling the layer V2 dtype behavior on a test. +5087,device,tensorflow/tensorflow/python/keras/testing_utils.py,925,function,Uses gpu when requested and available. +5088,use_gpu,tensorflow/tensorflow/python/keras/testing_utils.py,936,function,Uses gpu when requested and available. +5089,dense_block,tensorflow/tensorflow/python/keras/applications/densenet.py,57,function,"A dense block. Arguments: x: input tensor. @@ -34691,7 +40269,7 @@ Arguments: Returns: Output tensor for the block." -5026,transition_block,tensorflow/tensorflow/python/keras/applications/densenet.py,73,function,"A transition block. +5090,transition_block,tensorflow/tensorflow/python/keras/applications/densenet.py,73,function,"A transition block. Arguments: x: input tensor. @@ -34700,7 +40278,7 @@ Arguments: Returns: output tensor for the block." -5027,conv_block,tensorflow/tensorflow/python/keras/applications/densenet.py,99,function,"A building block for a dense block. +5091,conv_block,tensorflow/tensorflow/python/keras/applications/densenet.py,99,function,"A building block for a dense block. Arguments: x: input tensor. @@ -34709,7 +40287,7 @@ Arguments: Returns: Output tensor for the block." -5028,DenseNet,tensorflow/tensorflow/python/keras/applications/densenet.py,129,function,"Instantiates the DenseNet architecture. +5092,DenseNet,tensorflow/tensorflow/python/keras/applications/densenet.py,129,function,"Instantiates the DenseNet architecture. Reference: - [Densely Connected Convolutional Networks]( @@ -34765,12 +40343,12 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5029,DenseNet121,tensorflow/tensorflow/python/keras/applications/densenet.py,322,function,Instantiates the Densenet121 architecture. -5030,DenseNet169,tensorflow/tensorflow/python/keras/applications/densenet.py,335,function,Instantiates the Densenet169 architecture. -5031,DenseNet201,tensorflow/tensorflow/python/keras/applications/densenet.py,348,function,Instantiates the Densenet201 architecture. -5032,preprocess_input,tensorflow/tensorflow/python/keras/applications/densenet.py,360,function, -5033,decode_predictions,tensorflow/tensorflow/python/keras/applications/densenet.py,366,function, -5034,EfficientNet,tensorflow/tensorflow/python/keras/applications/efficientnet.py,194,function,"Instantiates the EfficientNet architecture using given scaling coefficients. +5093,DenseNet121,tensorflow/tensorflow/python/keras/applications/densenet.py,322,function,Instantiates the Densenet121 architecture. +5094,DenseNet169,tensorflow/tensorflow/python/keras/applications/densenet.py,335,function,Instantiates the Densenet169 architecture. +5095,DenseNet201,tensorflow/tensorflow/python/keras/applications/densenet.py,348,function,Instantiates the Densenet201 architecture. +5096,preprocess_input,tensorflow/tensorflow/python/keras/applications/densenet.py,360,function, +5097,decode_predictions,tensorflow/tensorflow/python/keras/applications/densenet.py,366,function, +5098,EfficientNet,tensorflow/tensorflow/python/keras/applications/efficientnet.py,194,function,"Instantiates the EfficientNet architecture using given scaling coefficients. Reference: - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks]( @@ -34827,7 +40405,7 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5035,block,tensorflow/tensorflow/python/keras/applications/efficientnet.py,413,function,"An inverted residual block. +5099,block,tensorflow/tensorflow/python/keras/applications/efficientnet.py,413,function,"An inverted residual block. Arguments: inputs: input tensor. @@ -34844,17 +40422,17 @@ Arguments: Returns: output tensor for the block." -5036,EfficientNetB0,tensorflow/tensorflow/python/keras/applications/efficientnet.py,519,function, -5037,EfficientNetB1,tensorflow/tensorflow/python/keras/applications/efficientnet.py,545,function, -5038,EfficientNetB2,tensorflow/tensorflow/python/keras/applications/efficientnet.py,571,function, -5039,EfficientNetB3,tensorflow/tensorflow/python/keras/applications/efficientnet.py,597,function, -5040,EfficientNetB4,tensorflow/tensorflow/python/keras/applications/efficientnet.py,623,function, -5041,EfficientNetB5,tensorflow/tensorflow/python/keras/applications/efficientnet.py,649,function, -5042,EfficientNetB6,tensorflow/tensorflow/python/keras/applications/efficientnet.py,675,function, -5043,EfficientNetB7,tensorflow/tensorflow/python/keras/applications/efficientnet.py,701,function, -5044,preprocess_input,tensorflow/tensorflow/python/keras/applications/efficientnet.py,736,function, -5045,decode_predictions,tensorflow/tensorflow/python/keras/applications/efficientnet.py,741,function, -5046,write_ckpt_to_h5,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,51,function,"Map the weights in checkpoint file (tf) to h5 file (keras). +5100,EfficientNetB0,tensorflow/tensorflow/python/keras/applications/efficientnet.py,519,function, +5101,EfficientNetB1,tensorflow/tensorflow/python/keras/applications/efficientnet.py,545,function, +5102,EfficientNetB2,tensorflow/tensorflow/python/keras/applications/efficientnet.py,571,function, +5103,EfficientNetB3,tensorflow/tensorflow/python/keras/applications/efficientnet.py,597,function, +5104,EfficientNetB4,tensorflow/tensorflow/python/keras/applications/efficientnet.py,623,function, +5105,EfficientNetB5,tensorflow/tensorflow/python/keras/applications/efficientnet.py,649,function, +5106,EfficientNetB6,tensorflow/tensorflow/python/keras/applications/efficientnet.py,675,function, +5107,EfficientNetB7,tensorflow/tensorflow/python/keras/applications/efficientnet.py,701,function, +5108,preprocess_input,tensorflow/tensorflow/python/keras/applications/efficientnet.py,736,function, +5109,decode_predictions,tensorflow/tensorflow/python/keras/applications/efficientnet.py,741,function, +5110,write_ckpt_to_h5,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,51,function,"Map the weights in checkpoint file (tf) to h5 file (keras). Args: path_h5: str, path to output hdf5 file to write weights loaded from ckpt @@ -34865,16 +40443,16 @@ Args: keras_model: keras model, built from keras.applications efficientnet functions (e.g. EfficientNetB0) use_ema: Bool, whether to use ExponentialMovingAverage result or not" -5047,get_variable_names_from_ckpt,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,121,function,"Get list of tensor names from checkpoint. +5111,get_variable_names_from_ckpt,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,121,function,"Get list of tensor names from checkpoint. Args: path_ckpt: str, path to the ckpt files use_ema: Bool, whether to use ExponentialMovingAverage result or not. Returns: List of variable names from checkpoint." -5048,get_tf_blocks,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,145,function,Extract the block names from list of full weight names. -5049,get_keras_blocks,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,154,function,Extract the block names from list of full weight names. -5050,keras_name_to_tf_name_stem_top,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,161,function,"Mapping name in h5 to ckpt that is in stem or top (head). +5112,get_tf_blocks,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,145,function,Extract the block names from list of full weight names. +5113,get_keras_blocks,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,154,function,Extract the block names from list of full weight names. +5114,keras_name_to_tf_name_stem_top,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,161,function,"Mapping name in h5 to ckpt that is in stem or top (head). we map name keras_name that points to a weight in h5 file to a name of weight in ckpt file. @@ -34889,7 +40467,7 @@ Returns: Raises: KeyError: if we cannot parse the keras_name." -5051,keras_name_to_tf_name_block,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,213,function,"Mapping name in h5 to ckpt that belongs to a block. +5115,keras_name_to_tf_name_block,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,213,function,"Mapping name in h5 to ckpt that belongs to a block. we map name keras_name that points to a weight in h5 file to a name of weight in ckpt file. @@ -34906,7 +40484,7 @@ Returns: Raises: ValueError if keras_block does not show up in keras_name" -5052,check_match,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,300,function,"Check if the weights in h5 and ckpt match. +5116,check_match,tensorflow/tensorflow/python/keras/applications/efficientnet_weight_update_util.py,300,function,"Check if the weights in h5 and ckpt match. we match each name from keras_weight_names that is in keras_block and check if there is 1-1 correspondence to names from tf_weight_names @@ -34918,8 +40496,8 @@ Args: keras_weight_names: list of str, weight names in keras implementation tf_weight_names: list of str, weight names in tf implementation model_name_tf: str, the name of model in ckpt." -5053,preprocess_input,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,104,function,Preprocesses a tensor or Numpy array encoding a batch of images. -5054,decode_predictions,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,129,function,"Decodes the prediction of an ImageNet model. +5117,preprocess_input,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,104,function,Preprocesses a tensor or Numpy array encoding a batch of images. +5118,decode_predictions,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,129,function,"Decodes the prediction of an ImageNet model. Arguments: preds: Numpy array encoding a batch of predictions. @@ -34933,43 +40511,7 @@ Returns: Raises: ValueError: In case of invalid shape of the `pred` array (must be 2D)." -5055,_preprocess_numpy_input,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,169,function,"Preprocesses a Numpy array encoding a batch of images. - -Arguments: - x: Input array, 3D or 4D. - data_format: Data format of the image array. - mode: One of ""caffe"", ""tf"" or ""torch"". - - caffe: will convert the images from RGB to BGR, - then will zero-center each color channel with - respect to the ImageNet dataset, - without scaling. - - tf: will scale pixels between -1 and 1, - sample-wise. - - torch: will scale pixels between 0 and 1 and then - will normalize each channel with respect to the - ImageNet dataset. - -Returns: - Preprocessed Numpy array." -5056,_preprocess_symbolic_input,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,242,function,"Preprocesses a tensor encoding a batch of images. - -Arguments: - x: Input tensor, 3D or 4D. - data_format: Data format of the image tensor. - mode: One of ""caffe"", ""tf"" or ""torch"". - - caffe: will convert the images from RGB to BGR, - then will zero-center each color channel with - respect to the ImageNet dataset, - without scaling. - - tf: will scale pixels between -1 and 1, - sample-wise. - - torch: will scale pixels between 0 and 1 and then - will normalize each channel with respect to the - ImageNet dataset. - -Returns: - Preprocessed tensor." -5057,obtain_input_shape,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,296,function,"Internal utility to compute/validate a model's input shape. +5119,obtain_input_shape,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,296,function,"Internal utility to compute/validate a model's input shape. Arguments: input_shape: Either None (will return the default network input shape), @@ -34988,7 +40530,7 @@ Returns: Raises: ValueError: In case of invalid argument values." -5058,correct_pad,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,388,function,"Returns a tuple for zero-padding for 2D convolution with downsampling. +5120,correct_pad,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,388,function,"Returns a tuple for zero-padding for 2D convolution with downsampling. Arguments: inputs: Input tensor. @@ -34996,7 +40538,7 @@ Arguments: Returns: A tuple." -5059,validate_activation,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,411,function,"validates that the classifer_activation is compatible with the weights. +5121,validate_activation,tensorflow/tensorflow/python/keras/applications/imagenet_utils.py,411,function,"validates that the classifer_activation is compatible with the weights. Args: classifier_activation: str or callable activation function @@ -35005,8 +40547,7 @@ Args: Raises: ValueError: if an activation other than `None` or `softmax` are used with pretrained weights." -5060,TestImageNetUtils,tensorflow/tensorflow/python/keras/applications/imagenet_utils_test.py,29,class, -5061,InceptionResNetV2,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,45,function,"Instantiates the Inception-ResNet v2 architecture. +5122,InceptionResNetV2,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,45,function,"Instantiates the Inception-ResNet v2 architecture. Reference: - [Inception-v4, Inception-ResNet and the Impact of @@ -35060,7 +40601,7 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5062,conv2d_bn,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,251,function,"Utility function to apply conv + BN. +5123,conv2d_bn,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,251,function,"Utility function to apply conv + BN. Arguments: x: input tensor. @@ -35075,7 +40616,7 @@ Arguments: Returns: Output tensor after applying `Conv2D` and `BatchNormalization`." -5063,inception_resnet_block,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,293,function,"Adds an Inception-ResNet block. +5124,inception_resnet_block,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,293,function,"Adds an Inception-ResNet block. This function builds 3 types of Inception-ResNet blocks mentioned in the paper, controlled by the `block_type` argument (which is the @@ -35108,9 +40649,9 @@ Returns: Raises: ValueError: if `block_type` is not one of `'block35'`, `'block17'` or `'block8'`." -5064,preprocess_input,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,377,function, -5065,decode_predictions,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,382,function, -5066,InceptionV3,tensorflow/tensorflow/python/keras/applications/inception_v3.py,48,function,"Instantiates the Inception v3 architecture. +5125,preprocess_input,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,377,function, +5126,decode_predictions,tensorflow/tensorflow/python/keras/applications/inception_resnet_v2.py,382,function, +5127,InceptionV3,tensorflow/tensorflow/python/keras/applications/inception_v3.py,48,function,"Instantiates the Inception v3 architecture. Reference: - [Rethinking the Inception Architecture for Computer Vision]( @@ -35164,7 +40705,7 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5067,conv2d_bn,tensorflow/tensorflow/python/keras/applications/inception_v3.py,362,function,"Utility function to apply conv + BN. +5128,conv2d_bn,tensorflow/tensorflow/python/keras/applications/inception_v3.py,362,function,"Utility function to apply conv + BN. Arguments: x: input tensor. @@ -35179,9 +40720,9 @@ Arguments: Returns: Output tensor after applying `Conv2D` and `BatchNormalization`." -5068,preprocess_input,tensorflow/tensorflow/python/keras/applications/inception_v3.py,408,function, -5069,decode_predictions,tensorflow/tensorflow/python/keras/applications/inception_v3.py,413,function, -5070,MobileNet,tensorflow/tensorflow/python/keras/applications/mobilenet.py,85,function,"Instantiates the MobileNet architecture. +5129,preprocess_input,tensorflow/tensorflow/python/keras/applications/inception_v3.py,408,function, +5130,decode_predictions,tensorflow/tensorflow/python/keras/applications/inception_v3.py,413,function, +5131,MobileNet,tensorflow/tensorflow/python/keras/applications/mobilenet.py,85,function,"Instantiates the MobileNet architecture. Reference: - [MobileNets: Efficient Convolutional Neural Networks @@ -35244,82 +40785,9 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5071,_conv_block,tensorflow/tensorflow/python/keras/applications/mobilenet.py,314,function,"Adds an initial convolution layer (with batch normalization and relu6). - -Arguments: - inputs: Input tensor of shape `(rows, cols, 3)` (with `channels_last` - data format) or (3, rows, cols) (with `channels_first` data format). - It should have exactly 3 inputs channels, and width and height should - be no smaller than 32. E.g. `(224, 224, 3)` would be one valid value. - filters: Integer, the dimensionality of the output space (i.e. the - number of output filters in the convolution). - alpha: controls the width of the network. - If `alpha` < 1.0, - proportionally decreases the number of filters in each layer. - If - `alpha` > 1.0, proportionally increases the number of filters in each - layer. - If `alpha` = 1, default number of filters from the paper are - used at each layer. - kernel: An integer or tuple/list of 2 integers, specifying the width and - height of the 2D convolution window. Can be a single integer to - specify the same value for all spatial dimensions. - strides: An integer or tuple/list of 2 integers, specifying the strides - of the convolution along the width and height. Can be a single integer - to specify the same value for all spatial dimensions. Specifying any - stride value != 1 is incompatible with specifying any `dilation_rate` - value != 1. # Input shape - 4D tensor with shape: `(samples, channels, rows, cols)` if - data_format='channels_first' - or 4D tensor with shape: `(samples, rows, cols, channels)` if - data_format='channels_last'. # Output shape - 4D tensor with shape: `(samples, filters, new_rows, new_cols)` if - data_format='channels_first' - or 4D tensor with shape: `(samples, new_rows, new_cols, filters)` if - data_format='channels_last'. `rows` and `cols` values might have - changed due to stride. - -Returns: - Output tensor of block." -5072,_depthwise_conv_block,tensorflow/tensorflow/python/keras/applications/mobilenet.py,365,function,"Adds a depthwise convolution block. - -A depthwise convolution block consists of a depthwise conv, -batch normalization, relu6, pointwise convolution, -batch normalization and relu6 activation. - -Arguments: - inputs: Input tensor of shape `(rows, cols, channels)` (with - `channels_last` data format) or (channels, rows, cols) (with - `channels_first` data format). - pointwise_conv_filters: Integer, the dimensionality of the output space - (i.e. the number of output filters in the pointwise convolution). - alpha: controls the width of the network. - If `alpha` < 1.0, - proportionally decreases the number of filters in each layer. - If - `alpha` > 1.0, proportionally increases the number of filters in each - layer. - If `alpha` = 1, default number of filters from the paper are - used at each layer. - depth_multiplier: The number of depthwise convolution output channels - for each input channel. The total number of depthwise convolution - output channels will be equal to `filters_in * depth_multiplier`. - strides: An integer or tuple/list of 2 integers, specifying the strides - of the convolution along the width and height. Can be a single integer - to specify the same value for all spatial dimensions. Specifying any - stride value != 1 is incompatible with specifying any `dilation_rate` - value != 1. - block_id: Integer, a unique identification designating the block number. - # Input shape - 4D tensor with shape: `(batch, channels, rows, cols)` if - data_format='channels_first' - or 4D tensor with shape: `(batch, rows, cols, channels)` if - data_format='channels_last'. # Output shape - 4D tensor with shape: `(batch, filters, new_rows, new_cols)` if - data_format='channels_first' - or 4D tensor with shape: `(batch, new_rows, new_cols, filters)` if - data_format='channels_last'. `rows` and `cols` values might have - changed due to stride. - -Returns: - Output tensor of block." -5073,preprocess_input,tensorflow/tensorflow/python/keras/applications/mobilenet.py,445,function, -5074,decode_predictions,tensorflow/tensorflow/python/keras/applications/mobilenet.py,450,function, -5075,MobileNetV2,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,97,function,"Instantiates the MobileNetV2 architecture. +5132,preprocess_input,tensorflow/tensorflow/python/keras/applications/mobilenet.py,445,function, +5133,decode_predictions,tensorflow/tensorflow/python/keras/applications/mobilenet.py,450,function, +5134,MobileNetV2,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,97,function,"Instantiates the MobileNetV2 architecture. Reference: - [MobileNetV2: Inverted Residuals and Linear Bottlenecks]( @@ -35388,11 +40856,9 @@ Raises: weights='imagenet' ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5076,_inverted_res_block,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,417,function,Inverted ResNet block. -5077,_make_divisible,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,490,function, -5078,preprocess_input,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,501,function, -5079,decode_predictions,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,506,function, -5080,NASNet,tensorflow/tensorflow/python/keras/applications/nasnet.py,65,function,"Instantiates a NASNet model. +5135,preprocess_input,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,501,function, +5136,decode_predictions,tensorflow/tensorflow/python/keras/applications/mobilenet_v2.py,506,function, +5137,NASNet,tensorflow/tensorflow/python/keras/applications/nasnet.py,65,function,"Instantiates a NASNet model. Reference: - [Learning Transferable Architectures for Scalable Image Recognition]( @@ -35465,7 +40931,7 @@ Raises: invalid input shape or invalid `penultimate_filters` value. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5081,NASNetMobile,tensorflow/tensorflow/python/keras/applications/nasnet.py,327,function,"Instantiates a Mobile NASNet model in ImageNet mode. +5138,NASNetMobile,tensorflow/tensorflow/python/keras/applications/nasnet.py,327,function,"Instantiates a Mobile NASNet model in ImageNet mode. Reference: - [Learning Transferable Architectures for Scalable Image Recognition]( @@ -35517,7 +40983,7 @@ Raises: or invalid input shape. RuntimeError: If attempting to run this model with a backend that does not support separable convolutions." -5082,NASNetLarge,tensorflow/tensorflow/python/keras/applications/nasnet.py,403,function,"Instantiates a NASNet model in ImageNet mode. +5139,NASNetLarge,tensorflow/tensorflow/python/keras/applications/nasnet.py,403,function,"Instantiates a NASNet model in ImageNet mode. Reference: - [Learning Transferable Architectures for Scalable Image Recognition]( @@ -35569,52 +41035,9 @@ Raises: or invalid input shape. RuntimeError: If attempting to run this model with a backend that does not support separable convolutions." -5083,_separable_conv_block,tensorflow/tensorflow/python/keras/applications/nasnet.py,477,function,"Adds 2 blocks of [relu-separable conv-batchnorm]. - -Arguments: - ip: Input tensor - filters: Number of output filters per layer - kernel_size: Kernel size of separable convolutions - strides: Strided convolution for downsampling - block_id: String block_id - -Returns: - A Keras tensor" -5084,_adjust_block,tensorflow/tensorflow/python/keras/applications/nasnet.py,538,function,"Adjusts the input `previous path` to match the shape of the `input`. - -Used in situations where the output number of filters needs to be changed. - -Arguments: - p: Input tensor which needs to be modified - ip: Input tensor whose shape needs to be matched - filters: Number of output filters to be matched - block_id: String block_id - -Returns: - Adjusted Keras tensor" -5085,_normal_a_cell,tensorflow/tensorflow/python/keras/applications/nasnet.py,623,function,"Adds a Normal cell for NASNet-A (Fig. 4 in the paper). - -Arguments: - ip: Input tensor `x` - p: Input tensor `p` - filters: Number of output filters - block_id: String block_id - -Returns: - A Keras tensor" -5086,_reduction_a_cell,tensorflow/tensorflow/python/keras/applications/nasnet.py,702,function,"Adds a Reduction cell for NASNet-A (Fig. 4 in the paper). - -Arguments: - ip: Input tensor `x` - p: Input tensor `p` - filters: Number of output filters - block_id: String block_id - -Returns: - A Keras tensor" -5087,preprocess_input,tensorflow/tensorflow/python/keras/applications/nasnet.py,803,function, -5088,decode_predictions,tensorflow/tensorflow/python/keras/applications/nasnet.py,808,function, -5089,ResNet,tensorflow/tensorflow/python/keras/applications/resnet.py,60,function,"Instantiates the ResNet, ResNetV2, and ResNeXt architecture. +5140,preprocess_input,tensorflow/tensorflow/python/keras/applications/nasnet.py,803,function, +5141,decode_predictions,tensorflow/tensorflow/python/keras/applications/nasnet.py,808,function, +5142,ResNet,tensorflow/tensorflow/python/keras/applications/resnet.py,60,function,"Instantiates the ResNet, ResNetV2, and ResNeXt architecture. Reference: - [Deep Residual Learning for Image Recognition]( @@ -35674,7 +41097,7 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5090,block1,tensorflow/tensorflow/python/keras/applications/resnet.py,229,function,"A residual block. +5143,block1,tensorflow/tensorflow/python/keras/applications/resnet.py,229,function,"A residual block. Arguments: x: input tensor. @@ -35687,7 +41110,7 @@ Arguments: Returns: Output tensor for the residual block." -5091,stack1,tensorflow/tensorflow/python/keras/applications/resnet.py,274,function,"A set of stacked residual blocks. +5144,stack1,tensorflow/tensorflow/python/keras/applications/resnet.py,274,function,"A set of stacked residual blocks. Arguments: x: input tensor. @@ -35698,7 +41121,7 @@ Arguments: Returns: Output tensor for the stacked blocks." -5092,block2,tensorflow/tensorflow/python/keras/applications/resnet.py,293,function,"A residual block. +5145,block2,tensorflow/tensorflow/python/keras/applications/resnet.py,293,function,"A residual block. Arguments: x: input tensor. @@ -35711,7 +41134,7 @@ Arguments: Returns: Output tensor for the residual block." -5093,stack2,tensorflow/tensorflow/python/keras/applications/resnet.py,342,function,"A set of stacked residual blocks. +5146,stack2,tensorflow/tensorflow/python/keras/applications/resnet.py,342,function,"A set of stacked residual blocks. Arguments: x: input tensor. @@ -35722,7 +41145,7 @@ Arguments: Returns: Output tensor for the stacked blocks." -5094,block3,tensorflow/tensorflow/python/keras/applications/resnet.py,362,function,"A residual block. +5147,block3,tensorflow/tensorflow/python/keras/applications/resnet.py,362,function,"A residual block. Arguments: x: input tensor. @@ -35736,7 +41159,7 @@ Arguments: Returns: Output tensor for the residual block." -5095,stack3,tensorflow/tensorflow/python/keras/applications/resnet.py,431,function,"A set of stacked residual blocks. +5148,stack3,tensorflow/tensorflow/python/keras/applications/resnet.py,431,function,"A set of stacked residual blocks. Arguments: x: input tensor. @@ -35748,17 +41171,17 @@ Arguments: Returns: Output tensor for the stacked blocks." -5096,ResNet50,tensorflow/tensorflow/python/keras/applications/resnet.py,459,function,Instantiates the ResNet50 architecture. -5097,ResNet101,tensorflow/tensorflow/python/keras/applications/resnet.py,480,function,Instantiates the ResNet101 architecture. -5098,ResNet152,tensorflow/tensorflow/python/keras/applications/resnet.py,501,function,Instantiates the ResNet152 architecture. -5099,preprocess_input,tensorflow/tensorflow/python/keras/applications/resnet.py,522,function, -5100,decode_predictions,tensorflow/tensorflow/python/keras/applications/resnet.py,529,function, -5101,ResNet50V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,33,function,Instantiates the ResNet50V2 architecture. -5102,ResNet101V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,64,function,Instantiates the ResNet101V2 architecture. -5103,ResNet152V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,95,function,Instantiates the ResNet152V2 architecture. -5104,preprocess_input,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,125,function, -5105,decode_predictions,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,131,function, -5106,VGG16,tensorflow/tensorflow/python/keras/applications/vgg16.py,46,function,"Instantiates the VGG16 model. +5149,ResNet50,tensorflow/tensorflow/python/keras/applications/resnet.py,459,function,Instantiates the ResNet50 architecture. +5150,ResNet101,tensorflow/tensorflow/python/keras/applications/resnet.py,480,function,Instantiates the ResNet101 architecture. +5151,ResNet152,tensorflow/tensorflow/python/keras/applications/resnet.py,501,function,Instantiates the ResNet152 architecture. +5152,preprocess_input,tensorflow/tensorflow/python/keras/applications/resnet.py,522,function, +5153,decode_predictions,tensorflow/tensorflow/python/keras/applications/resnet.py,529,function, +5154,ResNet50V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,33,function,Instantiates the ResNet50V2 architecture. +5155,ResNet101V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,64,function,Instantiates the ResNet101V2 architecture. +5156,ResNet152V2,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,95,function,Instantiates the ResNet152V2 architecture. +5157,preprocess_input,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,125,function, +5158,decode_predictions,tensorflow/tensorflow/python/keras/applications/resnet_v2.py,131,function, +5159,VGG16,tensorflow/tensorflow/python/keras/applications/vgg16.py,46,function,"Instantiates the VGG16 model. Reference: - [Very Deep Convolutional Networks for Large-Scale Image Recognition]( @@ -35819,9 +41242,9 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5107,preprocess_input,tensorflow/tensorflow/python/keras/applications/vgg16.py,229,function, -5108,decode_predictions,tensorflow/tensorflow/python/keras/applications/vgg16.py,235,function, -5109,VGG19,tensorflow/tensorflow/python/keras/applications/vgg19.py,46,function,"Instantiates the VGG19 architecture. +5160,preprocess_input,tensorflow/tensorflow/python/keras/applications/vgg16.py,229,function, +5161,decode_predictions,tensorflow/tensorflow/python/keras/applications/vgg16.py,235,function, +5162,VGG19,tensorflow/tensorflow/python/keras/applications/vgg19.py,46,function,"Instantiates the VGG19 architecture. Reference: - [Very Deep Convolutional Networks for Large-Scale Image Recognition]( @@ -35882,9 +41305,9 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5110,preprocess_input,tensorflow/tensorflow/python/keras/applications/vgg19.py,234,function, -5111,decode_predictions,tensorflow/tensorflow/python/keras/applications/vgg19.py,240,function, -5112,Xception,tensorflow/tensorflow/python/keras/applications/xception.py,52,function,"Instantiates the Xception architecture. +5163,preprocess_input,tensorflow/tensorflow/python/keras/applications/vgg19.py,234,function, +5164,decode_predictions,tensorflow/tensorflow/python/keras/applications/vgg19.py,240,function, +5165,Xception,tensorflow/tensorflow/python/keras/applications/xception.py,52,function,"Instantiates the Xception architecture. Reference: - [Xception: Deep Learning with Depthwise Separable Convolutions]( @@ -35939,10 +41362,13 @@ Raises: or invalid input shape. ValueError: if `classifier_activation` is not `softmax` or `None` when using a pretrained top layer." -5113,preprocess_input,tensorflow/tensorflow/python/keras/applications/xception.py,318,function, -5114,decode_predictions,tensorflow/tensorflow/python/keras/applications/xception.py,323,function, -5115,TimerCallBack,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,28,class,Callback for logging time in each epoch or batch. -5116,measure_performance,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,49,function,"Run models and measure the performance. +5166,preprocess_input,tensorflow/tensorflow/python/keras/applications/xception.py,318,function, +5167,decode_predictions,tensorflow/tensorflow/python/keras/applications/xception.py,323,function, +5168,TimerCallBack,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,28,class,Callback for logging time in each epoch or batch. +5169,on_epoch_begin,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,37,method, +5170,on_epoch_end,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,40,method, +5171,on_batch_end,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,43,method, +5172,measure_performance,tensorflow/tensorflow/python/keras/benchmarks/benchmark_util.py,49,function,"Run models and measure the performance. Arguments: model_fn: Model function to be benchmarked. @@ -35976,29 +41402,7 @@ Returns: Raise: ValueError: If `x` is none or if `optimizer` is not provided or if `loss` is not provided or if `num_gpus` is negative." -5117,_collective_communication,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,32,function,"Return a CollectiveCommunication based on all_reduce_alg. - -Args: - all_reduce_alg: a string specifying which collective communication to pick, - or None. - -Returns: - tf.distribute.experimental.CollectiveCommunication object - -Raises: - ValueError: if `all_reduce_alg` not in [None, ""ring"", ""nccl""]" -5118,_mirrored_cross_device_ops,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,58,function,"Return a CrossDeviceOps based on all_reduce_alg and num_packs. - -Args: - all_reduce_alg: a string specifying which cross device op to pick, or None. - num_packs: an integer specifying number of packs for the cross device op. - -Returns: - tf.distribute.CrossDeviceOps object or None. - -Raises: - ValueError: if `all_reduce_alg` not in [None, ""nccl"", ""hierarchical_copy""]." -5119,get_distribution_strategy,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,86,function,"Return a DistributionStrategy for running the model. +5173,get_distribution_strategy,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,86,function,"Return a DistributionStrategy for running the model. Args: distribution_strategy: a string specifying which distribution strategy to @@ -36012,19 +41416,31 @@ Returns: Raises: ValueError: if `distribution_strategy` is ""off"" or ""one_device"" and `num_gpus` is larger than 1; or `num_gpus` is negative." -5120,configure_cluster,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,141,function,"Set multi-worker cluster spec in TF_CONFIG environment variable. +5174,configure_cluster,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,141,function,"Set multi-worker cluster spec in TF_CONFIG environment variable. Args: worker_hosts: comma-separated list of worker ip:port pairs. Returns: Number of workers in the cluster." -5121,get_strategy_scope,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,175,function, -5122,DummyContextManager,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,184,class, -5123,_run_benchmark,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,30,function, -5124,MicroBenchmarksBase,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,47,class,Run and report benchmark results. -5125,KerasLayerCallOverheadBenchmarks,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,144,class, -5126,KerasModelCPUBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_cpu_benchmark_test.py,33,class,"Required Arguments for measure_performance. +5175,get_strategy_scope,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,175,function, +5176,DummyContextManager,tensorflow/tensorflow/python/keras/benchmarks/distribution_util.py,184,class, +5177,MicroBenchmarksBase,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,47,class,Run and report benchmark results. +5178,run_report,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,50,method,Run and report benchmark results. +5179,benchmark_layers_call_overhead,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,88,method, +5180,benchmark_op_layer_call_overhead,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,103,method, +5181,benchmark_model_predict_tensorlike_overhead,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,118,method, +5182,benchmark_layers_embeddings_embedding_overhead,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,133,method, +5183,fn,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,98,method, +5184,fn,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,112,method, +5185,fn,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,128,method, +5186,fn,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,138,method, +5187,call,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,92,method, +5188,call,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,122,method, +5189,KerasLayerCallOverheadBenchmarks,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,144,class, +5190,benchmark_layer,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,190,method, +5191,fn,tensorflow/tensorflow/python/keras/benchmarks/eager_microbenchmarks_test.py,194,method, +5192,KerasModelCPUBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_cpu_benchmark_test.py,33,class,"Required Arguments for measure_performance. x: Input data, it could be Numpy or load from tfds. y: Target data. If `x` is a dataset, generator instance, @@ -36033,36 +41449,104 @@ loss: Loss function for model. optimizer: Optimizer for model. Other details can see in `measure_performance()` method of benchmark_util." -5127,SubclassedKerasModel,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,32,class, -5128,make_keras_model,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,55,function, -5129,make_sequential_keras_model,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,70,function, -5130,run_benchmark,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,86,function, -5131,KerasComponentsBenchmarks,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,103,class, -5132,_imdb_lstm_model,tensorflow/tensorflow/python/keras/benchmarks/model_memory_profile.py,46,function,LSTM model. -5133,main,tensorflow/tensorflow/python/keras/benchmarks/model_memory_profile.py,62,function, -5134,AntirectifierBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,25,class,Benchmarks for Antirectifier using `tf.test.Benchmark`. -5135,Antirectifier,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,108,class,Build simple custome layer. -5136,BidirectionalLSTMBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py,25,class,Benchmarks for Bidirectional LSTM using `tf.test.Benchmark`. -5137,Cifar10CNNBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py,25,class,Benchmarks for CNN using `tf.test.Benchmark`. -5138,ConvMnistBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py,27,class,Benchmarks for Convnet using `tf.test.Benchmark`. -5139,HierarchicalRNNBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py,25,class,Benchmarks for Hierarchical RNN using `tf.test.Benchmark`. -5140,IRNNMnistBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py,25,class,Benchmarks for IRNN using `tf.test.Benchmark`. -5141,MLPReutersBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py,27,class,Benchmarks for MLP using `tf.test.Benchmark`. -5142,TextWithTransformerBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,25,class,"Benchmarks for Text classification with Transformer +5193,benchmark_mnist_mlp,tensorflow/tensorflow/python/keras/benchmarks/keras_cpu_benchmark_test.py,94,method,Benchmark for MLP model on synthetic mnist data. +5194,benchmark_mnist_convnet,tensorflow/tensorflow/python/keras/benchmarks/keras_cpu_benchmark_test.py,109,method,Benchmark for Convnet model on synthetic mnist data. +5195,benchmark_imdb_lstm,tensorflow/tensorflow/python/keras/benchmarks/keras_cpu_benchmark_test.py,124,method,Benchmark for LSTM model on synthetic imdb review dataset. +5196,SubclassedKerasModel,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,32,class, +5197,call,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,47,method, +5198,make_keras_model,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,55,function, +5199,make_sequential_keras_model,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,70,function, +5200,run_benchmark,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,86,function, +5201,KerasComponentsBenchmarks,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,103,class, +5202,benchmark_keras_model_subclassed,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,118,method, +5203,benchmark_keras_model_functional,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,133,method, +5204,benchmark_keras_model_sequential,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,142,method, +5205,benchmark_keras_model_subclassed_fit,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,189,method, +5206,benchmark_keras_model_subclassed_fit_graph_mode,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,193,method, +5207,benchmark_keras_model_subclassed_fit_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,198,method, +5208,benchmark_keras_model_functional_fit,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,202,method, +5209,benchmark_keras_model_functional_fit_graph_mode,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,206,method, +5210,benchmark_keras_model_functional_fit_graph_mode_with_profiler,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,211,method, +5211,benchmark_keras_model_functional_fit_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,219,method, +5212,benchmark_keras_model_functional_fit_run_model_eagerly_with_profiler,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,223,method, +5213,benchmark_keras_model_sequential_fit,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,231,method, +5214,benchmark_keras_model_sequential_fit_graph_mode,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,235,method, +5215,benchmark_keras_model_sequential_fit_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,240,method, +5216,benchmark_keras_model_subclassed_evaluate,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,244,method, +5217,benchmark_keras_model_subclassed_evaluate_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,248,method, +5218,benchmark_keras_model_functional_evaluate,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,252,method, +5219,benchmark_keras_model_functional_evaluate_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,256,method, +5220,benchmark_keras_model_sequential_evaluate,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,260,method, +5221,benchmark_keras_model_sequential_evaluate_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,264,method, +5222,benchmark_keras_model_subclassed_predict,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,268,method, +5223,benchmark_keras_model_subclassed_predict_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,272,method, +5224,benchmark_keras_model_functional_predict,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,276,method, +5225,benchmark_keras_model_functional_predict_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,280,method, +5226,benchmark_keras_model_sequential_predict,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,284,method, +5227,benchmark_keras_model_sequential_predict_run_model_eagerly,tensorflow/tensorflow/python/keras/benchmarks/model_components_benchmarks_test.py,288,method, +5228,AntirectifierBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,25,class,Benchmarks for Antirectifier using `tf.test.Benchmark`. +5229,benchmark_pixel_cnn_bs_128,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,56,method,Measure performance with batch_size=128 and run_iters=2. +5230,benchmark_pixel_cnn_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,73,method,Measure performance with batch_size=256 and run_iters=3. +5231,benchmark_pixel_cnn_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,90,method,Measure performance with batch_size=512 and run_iters=4. +5232,Antirectifier,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,108,class,Build simple custome layer. +5233,build,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,115,method, +5234,call,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,124,method, +5235,get_config,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/antirectifier_benchmark_test.py,132,method, +5236,BidirectionalLSTMBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py,25,class,Benchmarks for Bidirectional LSTM using `tf.test.Benchmark`. +5237,benchmark_bidirect_lstm_imdb_bs_128,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py,58,method,Measure performance with batch_size=128 and run_iters=3. +5238,benchmark_bidirect_lstm_imdb_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py,75,method,Measure performance with batch_size=256 and run_iters=2. +5239,benchmark_bidirect_lstm_imdb_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/bidirectional_lstm_benchmark_test.py,92,method,Measure performance with batch_size=512 and run_iters=4. +5240,Cifar10CNNBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py,25,class,Benchmarks for CNN using `tf.test.Benchmark`. +5241,benchmark_cnn_cifar10_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py,72,method,Measure performance with batch_size=256 and run_iters=3. +5242,benchmark_cnn_cifar10_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py,90,method,Measure performance with batch_size=512 and run_iters=3. +5243,benchmark_cnn_cifar10_bs_1024,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py,108,method,Measure performance with batch_size=1024 and run_iters=2. +5244,ConvMnistBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py,27,class,Benchmarks for Convnet using `tf.test.Benchmark`. +5245,benchmark_conv_mnist_bs_128,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py,63,method,Measure performance with batch_size=128 and run_iters=2. +5246,benchmark_conv_mnist_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py,81,method,Measure performance with batch_size=256 and run_iters=3. +5247,benchmark_conv_mnist_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_conv_benchmark_test.py,99,method,Measure performance with batch_size=512 and run_iters=3. +5248,HierarchicalRNNBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py,25,class,Benchmarks for Hierarchical RNN using `tf.test.Benchmark`. +5249,benchmark_hrnn_mnist_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py,64,method,Measure performance with batch_size=256 and run_iters=4. +5250,benchmark_hrnn_mnist_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py,81,method,Measure performance with batch_size=512 and run_iters=5. +5251,benchmark_hrnn_mnist_bs_1024,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py,98,method,Measure performance with batch_size=1024 and run_iters=3. +5252,IRNNMnistBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py,25,class,Benchmarks for IRNN using `tf.test.Benchmark`. +5253,benchmark_irnn_mnist_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py,64,method,Measure performance with batch_size=256 and run_iters=4. +5254,benchmark_irnn_mnist_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py,81,method,Measure performance with batch_size=512 and run_iters=3. +5255,benchmark_irnn_mnist_bs_1024,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_irnn_benchmark_test.py,98,method,Measure performance with batch_size=1024 and run_iters=3. +5256,MLPReutersBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py,27,class,Benchmarks for MLP using `tf.test.Benchmark`. +5257,benchmark_mlp_reuters_bs_128,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py,63,method,Measure performance with batch_size=128 and run_iters=2. +5258,benchmark_mlp_reuters_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py,81,method,Measure performance with batch_size=256 and run_iters=3. +5259,benchmark_mlp_reuters_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/reuters_mlp_benchmark_test.py,99,method,Measure performance with batch_size=512 and run_iters=4. +5260,TextWithTransformerBenchmark,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,25,class,"Benchmarks for Text classification with Transformer using `tf.test.Benchmark`." -5143,MultiHeadSelfAttention,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,120,class,Implement multi head self attention as a Keras layer. -5144,TransformerBlock,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,172,class,Implement a Transformer block as a layer. -5145,TokenAndPositionEmbedding,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,196,class,Implement embedding layer. -5146,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py,25,class, -5147,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py,25,class, -5148,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py,25,class, -5149,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py,25,class, -5150,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py,25,class, -5151,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py,25,class, -5152,save_and_load_benchmark,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py,30,function,Util for saved model benchmarks. -5153,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py,25,class, -5154,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py,25,class, -5155,load_data,tensorflow/tensorflow/python/keras/datasets/boston_housing.py,28,function,"Loads the Boston Housing dataset. +5261,benchmark_text_classification_bs_128,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,68,method,Measure performance with batch_size=128 and run_iters=3. +5262,benchmark_text_classification_bs_512,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,85,method,Measure performance with batch_size=512 and run_iters=4. +5263,benchmark_text_classification_bs_256,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,102,method,Measure performance with batch_size=256 and run_iters=3. +5264,MultiHeadSelfAttention,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,120,class,Implement multi head self attention as a Keras layer. +5265,attention,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,136,method, +5266,separate_heads,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,144,method, +5267,call,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,148,method, +5268,TransformerBlock,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,172,class,Implement a Transformer block as a layer. +5269,call,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,187,method, +5270,TokenAndPositionEmbedding,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,196,class,Implement embedding layer. +5271,call,tensorflow/tensorflow/python/keras/benchmarks/keras_examples_benchmarks/text_classification_transformer_benchmark_test.py,206,method, +5272,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py,25,class, +5273,benchmark_save_and_load_densenet_201,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/densenet_benchmark_test.py,27,method, +5274,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py,25,class, +5275,benchmark_save_and_load_efficient_net_b7,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/efficientnet_benchmark_test.py,27,method, +5276,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py,25,class, +5277,benchmark_save_and_load_inception_resnet_v2,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/inception_resnet_v2_benchmark_test.py,27,method, +5278,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py,25,class, +5279,benchmark_save_and_load_mobilenet_v2,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/mobilenet_benchmark_test.py,27,method, +5280,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py,25,class, +5281,benchmark_save_and_load_nasnet_large,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/nasnet_large_benchmark_test.py,27,method, +5282,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py,25,class, +5283,benchmark_save_and_load_resnet152_v2,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/resnet152_v2_benchmark_test.py,27,method, +5284,save_and_load_benchmark,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/saved_model_benchmark_util.py,30,function,Util for saved model benchmarks. +5285,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py,25,class, +5286,benchmark_save_and_load_vgg19,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/vgg_benchmark_test.py,27,method, +5287,BenchmarkSaveApplications,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py,25,class, +5288,benchmark_save_and_load_xception,tensorflow/tensorflow/python/keras/benchmarks/saved_model_benchmarks/xception_benchmark_test.py,27,method, +5289,load_data,tensorflow/tensorflow/python/keras/datasets/boston_housing.py,28,function,"Loads the Boston Housing dataset. This is a dataset taken from the StatLib library which is maintained at Carnegie Mellon University. @@ -36091,7 +41575,7 @@ Returns: **y_train, y_test**: numpy arrays of shape `(num_samples,)` containing the target scalars. The targets are float scalars typically between 10 and 50 that represent the home prices in k$." -5156,load_batch,tensorflow/tensorflow/python/keras/datasets/cifar.py,26,function,"Internal utility for parsing CIFAR data. +5290,load_batch,tensorflow/tensorflow/python/keras/datasets/cifar.py,26,function,"Internal utility for parsing CIFAR data. Arguments: fpath: path the file to parse. @@ -36100,7 +41584,7 @@ Arguments: Returns: A tuple `(data, labels)`." -5157,load_data,tensorflow/tensorflow/python/keras/datasets/cifar10.py,32,function,"Loads [CIFAR10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). +5291,load_data,tensorflow/tensorflow/python/keras/datasets/cifar10.py,32,function,"Loads [CIFAR10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). This is a dataset of 50,000 32x32 color training images and 10,000 test images, labeled over 10 categories. See more info at the @@ -36116,7 +41600,7 @@ Returns: **y_train, y_test**: uint8 arrays of category labels (integers in range 0-9) each with shape (num_samples, 1)." -5158,load_data,tensorflow/tensorflow/python/keras/datasets/cifar100.py,32,function,"Loads [CIFAR100 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). +5292,load_data,tensorflow/tensorflow/python/keras/datasets/cifar100.py,32,function,"Loads [CIFAR100 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). This is a dataset of 50,000 32x32 color training images and 10,000 test images, labeled over 100 fine-grained classes that are @@ -36141,7 +41625,7 @@ Returns: Raises: ValueError: in case of invalid `label_mode`." -5159,load_data,tensorflow/tensorflow/python/keras/datasets/fashion_mnist.py,31,function,"Loads the Fashion-MNIST dataset. +5293,load_data,tensorflow/tensorflow/python/keras/datasets/fashion_mnist.py,31,function,"Loads the Fashion-MNIST dataset. This is a dataset of 60,000 28x28 grayscale images of 10 fashion categories, along with a test set of 10,000 images. This dataset can be used as @@ -36173,7 +41657,7 @@ License: The copyright for Fashion-MNIST is held by Zalando SE. Fashion-MNIST is licensed under the [MIT license]( https://github.com/zalandoresearch/fashion-mnist/blob/master/LICENSE)." -5160,load_data,tensorflow/tensorflow/python/keras/datasets/imdb.py,32,function,"Loads the [IMDB dataset](https://ai.stanford.edu/~amaas/data/sentiment/). +5294,load_data,tensorflow/tensorflow/python/keras/datasets/imdb.py,32,function,"Loads the [IMDB dataset](https://ai.stanford.edu/~amaas/data/sentiment/). This is a dataset of 25,000 movies reviews from IMDB, labeled by sentiment (positive/negative). Reviews have been preprocessed, and each review is @@ -36229,14 +41713,14 @@ words that were present in the training set but are not included because they're not making the `num_words` cut here. Words that were not seen in the training set but are in the test set have simply been skipped." -5161,get_word_index,tensorflow/tensorflow/python/keras/datasets/imdb.py,166,function,"Retrieves a dict mapping words to their index in the IMDB dataset. +5295,get_word_index,tensorflow/tensorflow/python/keras/datasets/imdb.py,166,function,"Retrieves a dict mapping words to their index in the IMDB dataset. Arguments: path: where to cache the data (relative to `~/.keras/dataset`). Returns: The word index dictionary. Keys are word strings, values are their index." -5162,load_data,tensorflow/tensorflow/python/keras/datasets/mnist.py,28,function,"Loads the [MNIST dataset](http://yann.lecun.com/exdb/mnist/). +5296,load_data,tensorflow/tensorflow/python/keras/datasets/mnist.py,28,function,"Loads the [MNIST dataset](http://yann.lecun.com/exdb/mnist/). This is a dataset of 60,000 28x28 grayscale images of the 10 digits, along with a test set of 10,000 images. @@ -36263,7 +41747,7 @@ License: MNIST dataset is made available under the terms of the [Creative Commons Attribution-Share Alike 3.0 license.]( https://creativecommons.org/licenses/by-sa/3.0/)" -5163,load_data,tensorflow/tensorflow/python/keras/datasets/reuters.py,32,function,"Loads the Reuters newswire classification dataset. +5297,load_data,tensorflow/tensorflow/python/keras/datasets/reuters.py,32,function,"Loads the Reuters newswire classification dataset. This is a dataset of 11,228 newswires from Reuters, labeled over 46 topics. @@ -36325,63 +41809,51 @@ words that were present in the training set but are not included because they're not making the `num_words` cut here. Words that were not seen in the training set but are in the test set have simply been skipped." -5164,get_word_index,tensorflow/tensorflow/python/keras/datasets/reuters.py,155,function,"Retrieves a dict mapping words to their index in the Reuters dataset. +5298,get_word_index,tensorflow/tensorflow/python/keras/datasets/reuters.py,155,function,"Retrieves a dict mapping words to their index in the Reuters dataset. Arguments: path: where to cache the data (relative to `~/.keras/dataset`). Returns: The word index dictionary. Keys are word strings, values are their index." -5165,TrainingCheckpointTests,tensorflow/tensorflow/python/keras/distribute/checkpointing_test.py,36,class, -5166,create_test_objects,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,54,function, -5167,CollectiveAllReduceStrategyTestBase,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,81,class, -5168,DistributedCollectiveAllReduceStrategyTest,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,242,class, -5169,DistributedCollectiveAllReduceStrategyTestWithChief,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,272,class, -5170,LocalCollectiveAllReduceStrategy,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,300,class, -5171,MaybeStrategyScope,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,48,class,Provides a context allowing no distribution strategy. -5172,get_model,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,66,function, -5173,get_data,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,81,function, -5174,compute_loss,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,91,function, -5175,iteration_inside_func,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,99,function,Helper function to test iterating over data inside a tf.function. -5176,iteration_outside_func,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,163,function,Helper function to test iterating over data outside a tf.function. -5177,TestDistributionStrategyDnnCorrectness,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,217,class,Test custom training loop correctness with a simple DNN model. -5178,KerasMetricsTest,tensorflow/tensorflow/python/keras/distribute/custom_training_loop_metrics_test.py,33,class, -5179,CustomModel,tensorflow/tensorflow/python/keras/distribute/custom_training_loop_models_test.py,39,class, -5180,KerasModelsTest,tensorflow/tensorflow/python/keras/distribute/custom_training_loop_models_test.py,55,class, -5181,OptimizerTest,tensorflow/tensorflow/python/keras/distribute/custom_training_loop_optimizer_test.py,33,class, -5182,simple_sequential_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,70,function, -5183,simple_subclassed_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,78,function, -5184,simple_multi_inputs_multi_outputs_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,92,function, -5185,get_multi_inputs_multi_outputs_data,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,104,function, -5186,batch_wrapper,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,147,function, -5187,get_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,159,function, -5188,get_sample_weights_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,166,function, -5189,get_dataset,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,175,function, -5190,get_predict_dataset,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,184,function, -5191,convert_numpy_to_dataset_with_unknown_cardinality,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,192,function, -5192,multi_input_output_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,206,function, -5193,strategy_minus_tpu_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,245,function, -5194,tpu_strategy_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,250,function, -5195,tpu_strategy_combinations_graph_only,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,255,function, -5196,all_strategy_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,259,function, -5197,all_strategy_minus_default_and_tpu_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,263,function, -5198,all_strategy_combinations_minus_default,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,274,function, -5199,strategy_and_optimizer_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,279,function, -5200,BatchCountingCB,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,322,class, -5201,TestDistributionStrategyWithNumpyArrays,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,352,class, -5202,TestDistributionStrategyWithDatasets,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,862,class, -5203,TestRegularizerLoss,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,1552,class, -5204,TestDistributionStrategyWithKerasModels,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,1607,class, -5205,_functional_with_add_loss_and_metric,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2280,function, -5206,_sequential_with_add_loss_and_metric,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2306,function, -5207,_functional_with_layer_reuse,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2336,function, -5208,TestDistributionStrategyWithMultipleAddLossAndMetricCalls,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2366,class,Tests complex models with multiple add loss and metric calls. -5209,DeterministicModel,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2416,class,"Deterministic Model that always outputs the same initial result. +5299,LocalCollectiveAllReduceStrategy,tensorflow/tensorflow/python/keras/distribute/collective_all_reduce_strategy_test.py,300,class, +5300,MaybeStrategyScope,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,48,class,Provides a context allowing no distribution strategy. +5301,get_model,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,66,function, +5302,get_data,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,81,function, +5303,compute_loss,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,91,function, +5304,iteration_inside_func,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,99,function,Helper function to test iterating over data inside a tf.function. +5305,iteration_outside_func,tensorflow/tensorflow/python/keras/distribute/ctl_correctness_test.py,163,function,Helper function to test iterating over data outside a tf.function. +5306,CustomModel,tensorflow/tensorflow/python/keras/distribute/custom_training_loop_models_test.py,39,class, +5307,simple_sequential_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,70,function, +5308,simple_subclassed_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,78,function, +5309,simple_multi_inputs_multi_outputs_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,92,function, +5310,get_multi_inputs_multi_outputs_data,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,104,function, +5311,batch_wrapper,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,147,function, +5312,get_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,159,function, +5313,get_sample_weights_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,166,function, +5314,get_dataset,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,175,function, +5315,get_predict_dataset,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,184,function, +5316,convert_numpy_to_dataset_with_unknown_cardinality,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,192,function, +5317,multi_input_output_model,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,206,function, +5318,strategy_minus_tpu_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,245,function, +5319,tpu_strategy_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,250,function, +5320,tpu_strategy_combinations_graph_only,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,255,function, +5321,all_strategy_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,259,function, +5322,all_strategy_minus_default_and_tpu_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,263,function, +5323,all_strategy_combinations_minus_default,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,274,function, +5324,strategy_and_optimizer_combinations,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,279,function, +5325,BatchCountingCB,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,322,class, +5326,on_train_batch_begin,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,333,method, +5327,on_train_batch_end,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,336,method, +5328,on_predict_batch_begin,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,345,method, +5329,on_predict_batch_end,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,348,method, +5330,DeterministicModel,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2416,class,"Deterministic Model that always outputs the same initial result. It verifies the `call` method is run inside the same distribution strategy that the model was initially passed." -5210,TestModelCapturesStrategy,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2438,class,Tests that model creation captures the strategy. -5211,set_weights,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,55,function,"Sets the weights of the replicated models. +5331,build,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2428,method, +5332,call,tensorflow/tensorflow/python/keras/distribute/distribute_strategy_test.py,2431,method, +5333,set_weights,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,55,function,"Sets the weights of the replicated models. The weights of the replicated models are set to the weights of the original model. The weights of the replicated model are Mirrored variables and hence @@ -36392,7 +41864,7 @@ Args: and validation. dist_model: The replicated models on the different devices. weights: The weights of the original model." -5212,unwrap_values,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,83,function,"Unwrap the list of values contained in the PerReplica parameters. +5334,unwrap_values,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,83,function,"Unwrap the list of values contained in the PerReplica parameters. This function calls `flatten_per_replica_values` to parse each of the input parameters into a list of values on the different devices. If we set @@ -36415,8 +41887,8 @@ Args: Returns: Values of each of the PerReplica parameters." -5213,unwrap_output_dict,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,140,function,Unwrap the list of outputs contained in the PerReplica parameters. -5214,unwrap_outputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,172,function,"Unwrap the list of outputs contained in the PerReplica parameters. +5335,unwrap_output_dict,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,140,function,Unwrap the list of outputs contained in the PerReplica parameters. +5336,unwrap_outputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,172,function,"Unwrap the list of outputs contained in the PerReplica parameters. This function calls `flatten_per_replica_values` to parse each of the input parameters into a list of outputs on the different devices. If we set @@ -36433,7 +41905,7 @@ Args: Returns: Values of each of the PerReplica outputs." -5215,flatten_per_replica_values,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,216,function,"Unwraps and flattens a nest of PerReplica parameters. +5337,flatten_per_replica_values,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,216,function,"Unwraps and flattens a nest of PerReplica parameters. PerReplica values have one value associated with each device. Each entry in the PerReplica dict has a device `key` and the corresponding value on the @@ -36447,7 +41919,7 @@ Args: Returns: List of values of all the PerReplica objects." -5216,validate_callbacks,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,240,function,"Validate whether given callbacks are supported by DistributionStrategy. +5338,validate_callbacks,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,240,function,"Validate whether given callbacks are supported by DistributionStrategy. Args: input_callbacks: List of callbacks passed by the user to fit. @@ -36458,7 +41930,7 @@ Raises: callbacks passed. ValueError: If `write_grads` is one of the parameters passed as part of the TensorBoard callback." -5217,validate_distributed_dataset_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,275,function,"Validate all the components of a DistributedValue Dataset input. +5339,validate_distributed_dataset_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,275,function,"Validate all the components of a DistributedValue Dataset input. Args: distribution_strategy: The current DistributionStrategy used to call @@ -36482,7 +41954,7 @@ Raises: ValueError: If x and y do not have support for being evaluated as tensors. or if x and y contain elements that are not tensors or if x and y contain elements that have a shape or dtype mismatch." -5218,validate_per_replica_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,325,function,"Validates PerReplica dataset input list. +5340,validate_per_replica_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,325,function,"Validates PerReplica dataset input list. Args: distribution_strategy: The current DistributionStrategy used to call @@ -36496,11 +41968,10 @@ Returns: Raises: ValueError: If any of the objects in the `per_replica_list` is not a tensor." -5219,validate_all_tensor_types,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,362,function, -5220,validate_all_tensor_shapes,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,370,function, -5221,_wait_for_variable_initialization,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,379,function,Utility to wait for variables to be initialized. -5222,init_restore_or_wait_for_variables,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,402,function,Initialize or restore variables or wait for variables to be initialized. -5223,validate_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,413,function,"Validate inputs when using DistributionStrategy. +5341,validate_all_tensor_types,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,362,function, +5342,validate_all_tensor_shapes,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,370,function, +5343,init_restore_or_wait_for_variables,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,402,function,Initialize or restore variables or wait for variables to be initialized. +5344,validate_inputs,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,413,function,"Validate inputs when using DistributionStrategy. Args: x: Model Inputs. @@ -36509,11 +41980,11 @@ Args: Raises: ValueError: if input is not a Dataset or a numpy array(when we use MirroredStrategy)." -5224,global_batch_size_supported,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,434,function, -5225,is_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,439,function,We're executing TPU Strategy. -5226,is_dataset_shape_fully_defined,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,445,function,Returns whether a dataset contains a final partial batch. -5227,process_batch_and_step_size,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,452,function,Process the batch size and step size based on input and dist strategy. -5228,get_input_params,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,472,function,"Calculate the number of batches and steps/steps_per_epoch. +5345,global_batch_size_supported,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,434,function, +5346,is_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,439,function,We're executing TPU Strategy. +5347,is_dataset_shape_fully_defined,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,445,function,Returns whether a dataset contains a final partial batch. +5348,process_batch_and_step_size,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,452,function,Process the batch size and step size based on input and dist strategy. +5349,get_input_params,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,472,function,"Calculate the number of batches and steps/steps_per_epoch. Args: distribution_strategy: The DistributionStrategy used to compile the model. @@ -36534,22 +42005,10 @@ Returns: Raises: ValueError: If the number of batches or steps evaluates to 0." -5229,get_batch_dimension,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,576,function, -5230,get_iterator,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,584,function, -5231,initialize_iterator,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,591,function, -5232,_get_input_from_iterator,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,598,function,Get elements from the iterator and verify the input shape and type. -5233,_prepare_feed_values,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,623,function,"Prepare feed values to the model execution function. - -Arguments: - model: Model to prepare feed values for. - inputs: List or dict of model inputs. - targets: Optional list of model targets. - sample_weights: Optional list of sample weight arrays. - mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT. - -Returns: - Feed values for the model in the given mode." -5234,is_distributing_by_cloning,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,672,function,"Decide whether this model is going to be distributed via cloning. +5350,get_batch_dimension,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,576,function, +5351,get_iterator,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,584,function, +5352,initialize_iterator,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,591,function, +5353,is_distributing_by_cloning,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,672,function,"Decide whether this model is going to be distributed via cloning. We are going to distribute the model by cloning in graph mode. @@ -36559,51 +42018,13 @@ Args: Returns: True if the `model` is going to be distributed using cloning and False otherwise." -5235,_custom_compile_for_predict,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,692,function,Custom compile for TPU predict mode. -5236,_build_network_on_replica,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,706,function,"Build an updated model on replicas. - -We create a new Keras model while sharing the variables from the old graph. -Building a new sub-graph is required since the original keras model creates -placeholders for the input and the output that are not accessible till we -call iterator.get_next() inside the step_fn for `fit`/`evaluate`/`predict`. - -The sharing of weights and layers between the old and the new model guarantee -that we're using Strategy variables and any updates on either model are -reflected correctly in callbacks and loop iterations. - -We need to make sure we share the optimizers between the old and the new model -as well so that optimizer state is not lost if the user is running fit -multiple times. - -Args: - model: Model to be replicated across Replicas - mode: Which of fit/eval/predict is building the distributed network - inputs: Input variables to be passed to the model - targets: Target tensor to be passed to model.compile - -Returns: - A new model with shared layers with the old model." -5237,_build_distributed_network,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,776,function,Create a cloned model on each replica. -5238,_clone_and_build_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,786,function,Clone and build the given keras_model. -5239,clone_model_on_replicas,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,828,function,Create a cloned model on each replica. -5240,_make_execution_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,838,function,Makes or reuses function to run one step of distributed model execution. -5241,_make_execution_function_without_cloning,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,852,function,Creates a function to run one step of distributed model execution. -5242,_make_replica_execution_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,883,function,A single step of the distributed execution on a replica. -5243,_make_replicated_models_with_cloning,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,905,function,Build models on each replica. -5244,_make_execution_function_with_cloning,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,916,function,Clones or re-uses models to run one step of distributed model execution. -5245,_make_graph_execution_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,950,function,Makes function to run one step of distributed model in graph mode. -5246,_make_eager_execution_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,991,function,Makes function to run one step of distributed model eager execution. -5247,_copy_weights_to_distributed_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1031,function,Copies weights from original model to distributed models. -5248,_copy_weights_to_original_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1043,function,Copies weights from first distributed model back to original model. -5249,_per_replica_aggregate_batch,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1052,function,Aggregates the per-replica batch-level outputs from a distributed step. -5250,_reset_metrics,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1065,function, -5251,get_distributed_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1074,function, -5252,set_distributed_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1079,function, -5253,get_distributed_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1084,function, -5254,set_distributed_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1089,function, -5255,_generate_cache_key,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1094,function, -5256,distributed_scope,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1100,function, -5257,call_replica_local_fn,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1105,function,"Call a function that uses replica-local variables. +5354,clone_model_on_replicas,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,828,function,Create a cloned model on each replica. +5355,get_distributed_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1074,function, +5356,set_distributed_model,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1079,function, +5357,get_distributed_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1084,function, +5358,set_distributed_function,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1089,function, +5359,distributed_scope,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1100,function, +5360,call_replica_local_fn,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1105,function,"Call a function that uses replica-local variables. This function correctly handles calling `fn` in a cross-replica context. @@ -36615,8 +42036,8 @@ Arguments: Returns: The result of calling `fn`." -5258,is_current_worker_chief,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1136,function, -5259,filter_distributed_callbacks,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1140,function,"Filter Callbacks based on the worker context when running multi-worker. +5361,is_current_worker_chief,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1136,function, +5362,filter_distributed_callbacks,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1140,function,"Filter Callbacks based on the worker context when running multi-worker. Arguments: callbacks_list: A list of `Callback` instances. @@ -36624,103 +42045,61 @@ Arguments: Returns: The list of `Callback` instances that should be run on this worker." -5260,_update_sample_weight_modes,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1174,function,Update sample_weight_mode of the distributed model. -5261,concat_along_batch_dimension,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1195,function,Concats prediction outputs along the batch dimension. -5262,DistributedTrainingUtilsTest,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils_test.py,28,class, -5263,eager_mode_test_configuration,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,57,function, -5264,graph_mode_test_configuration,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,62,function, -5265,all_strategy_and_input_config_combinations,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,67,function, -5266,strategy_minus_tpu_and_input_config_combinations_eager,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,74,function, -5267,strategies_for_embedding_models,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,81,function,"Returns distribution strategies to test for embedding models. +5363,concat_along_batch_dimension,tensorflow/tensorflow/python/keras/distribute/distributed_training_utils.py,1195,function,Concats prediction outputs along the batch dimension. +5364,all_strategy_and_input_config_combinations,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,67,function, +5365,strategy_minus_tpu_and_input_config_combinations_eager,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,74,function, +5366,strategies_for_embedding_models,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,81,function,"Returns distribution strategies to test for embedding models. Since embedding models take longer to train, we disregard DefaultStrategy in order to prevent testing timeouts." -5268,test_combinations_for_embedding_model,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,94,function, -5269,test_combinations_with_tpu_strategies,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,109,function, -5270,MaybeDistributionScope,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,120,class,Provides a context allowing no distribution strategy. -5271,batch_wrapper,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,138,function, -5272,get_batch_size,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,144,function, -5273,get_data_size,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,155,function,"Gets the size of data in list, tuple, dict, or a numpy array." -5274,get_shapes,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,168,function, -5275,get_correctness_test_inputs,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,175,function,Generates the inputs for correctness check when enable Keras with DS. -5276,fit_eval_and_predict,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,246,function,Generates results for fit/predict/evaluate for given model. -5277,compare_results,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,289,function,Compares results of model compiled with/without distribution strategy. -5278,should_skip_tpu_with_eager,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,356,function, -5279,LearningRateBatchScheduler,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,362,class,Scheduler that dynamically sets the learning rate of model. -5280,TestDistributionStrategyCorrectnessBase,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,377,class,Model agnostic testing infra to test correctness of Keras models. -5281,TestDistributionStrategyEmbeddingModelCorrectnessBase,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,588,class,Base class to test correctness of Keras models with embedding layers. -5282,all_strategy_combinations_with_eager_and_graph_modes,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,33,function, -5283,all_strategy_combinations_with_graph_mode,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,39,function, -5284,is_default_strategy,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,45,function, -5285,TestDistributionStrategyDnnCorrectness,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,50,class, -5286,TestDistributionStrategyDnnMetricCorrectness,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,132,class, -5287,TestDistributionStrategyDnnMetricEvalCorrectness,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,171,class, -5288,SubclassedModel,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,219,class, -5289,TestDistributionStrategyDnnCorrectnessWithSubclassedModel,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,243,class, -5290,DistributionStrategyEmbeddingModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_embedding_model_correctness_test.py,28,class, -5291,DistributionStrategySiameseEmbeddingModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_embedding_model_correctness_test.py,74,class, -5292,DistributionStrategyCnnCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_image_model_correctness_test.py,29,class, -5293,_labeled_dataset_fn,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,30,function, -5294,_boolean_dataset_fn,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,41,function, -5295,_threshold_dataset_fn,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,54,function, -5296,_regression_dataset_fn,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,67,function, -5297,all_combinations,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,73,function, -5298,tpu_combinations,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,84,function, -5299,KerasMetricsTest,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,92,class, -5300,get_model,tensorflow/tensorflow/python/keras/distribute/keras_optimizer_v2_test.py,39,function, -5301,MirroredStrategyOptimizerV2Test,tensorflow/tensorflow/python/keras/distribute/keras_optimizer_v2_test.py,46,class, -5302,_replica_id,tensorflow/tensorflow/python/keras/distribute/keras_optimizer_v2_test.py,136,function, -5303,strategy_combinations_eager_data_fn,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,34,function, -5304,get_numpy,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,47,function, -5305,get_dataset,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,53,function, -5306,KerasPremadeModelsTest,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,60,class, -5307,_DistributionStrategyRnnModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_rnn_model_correctness_test.py,35,class, -5308,DistributionStrategyGruModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_rnn_model_correctness_test.py,72,class, -5309,DistributionStrategyLstmModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_rnn_model_correctness_test.py,91,class, -5310,KerasSaveLoadTest,tensorflow/tensorflow/python/keras/distribute/keras_save_load_test.py,27,class, -5311,strategies_for_stateful_embedding_model,tensorflow/tensorflow/python/keras/distribute/keras_stateful_lstm_model_correctness_test.py,29,function,Returns TPUStrategy with single core device assignment. -5312,test_combinations_for_stateful_embedding_model,tensorflow/tensorflow/python/keras/distribute/keras_stateful_lstm_model_correctness_test.py,38,function, -5313,DistributionStrategyStatefulLstmModelCorrectnessTest,tensorflow/tensorflow/python/keras/distribute/keras_stateful_lstm_model_correctness_test.py,46,class, -5314,Counter,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,43,class,"Counts the number of times each callback method was run. +5367,MaybeDistributionScope,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,120,class,Provides a context allowing no distribution strategy. +5368,batch_wrapper,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,138,function, +5369,get_batch_size,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,144,function, +5370,get_data_size,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,155,function,"Gets the size of data in list, tuple, dict, or a numpy array." +5371,get_shapes,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,168,function, +5372,fit_eval_and_predict,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,246,function,Generates results for fit/predict/evaluate for given model. +5373,compare_results,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,289,function,Compares results of model compiled with/without distribution strategy. +5374,should_skip_tpu_with_eager,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,356,function, +5375,LearningRateBatchScheduler,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,362,class,Scheduler that dynamically sets the learning rate of model. +5376,on_batch_begin,tensorflow/tensorflow/python/keras/distribute/keras_correctness_test_base.py,368,method, +5377,all_strategy_combinations_with_eager_and_graph_modes,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,33,function, +5378,all_strategy_combinations_with_graph_mode,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,39,function, +5379,is_default_strategy,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,45,function, +5380,SubclassedModel,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,219,class, +5381,call,tensorflow/tensorflow/python/keras/distribute/keras_dnn_correctness_test.py,236,method, +5382,all_combinations,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,73,function, +5383,tpu_combinations,tensorflow/tensorflow/python/keras/distribute/keras_metrics_test.py,84,function, +5384,get_model,tensorflow/tensorflow/python/keras/distribute/keras_optimizer_v2_test.py,39,function, +5385,strategy_combinations_eager_data_fn,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,34,function, +5386,get_numpy,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,47,function, +5387,get_dataset,tensorflow/tensorflow/python/keras/distribute/keras_premade_models_test.py,53,function, +5388,strategies_for_stateful_embedding_model,tensorflow/tensorflow/python/keras/distribute/keras_stateful_lstm_model_correctness_test.py,29,function,Returns TPUStrategy with single core device assignment. +5389,Counter,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,43,class,"Counts the number of times each callback method was run. Attributes: method_counts: dict. Contains the counts of time each callback method was run." -5315,TestDistributionStrategyWithCallbacks,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,73,class, -5316,TestDistributionStrategyErrorCases,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,182,class, -5317,TestDistributionStrategyWithLossMasking,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,356,class, -5318,TestDistributionStrategyWithNormalizationLayer,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,391,class, -5319,TestDistributionStrategySaveLoadWeights,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,436,class, -5320,TestDistributionStrategyValidation,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,499,class, -5321,TestDistributionStrategyWithStaticShapes,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,536,class, -5322,MinimizeLossStepTest,tensorflow/tensorflow/python/keras/distribute/minimize_loss_test.py,67,class, -5323,MiniModel,tensorflow/tensorflow/python/keras/distribute/mirrored_strategy_test.py,37,class,"Minimal model for mnist. +5390,wrap_with_counts,tensorflow/tensorflow/python/keras/distribute/keras_utils_test.py,64,method, +5391,MiniModel,tensorflow/tensorflow/python/keras/distribute/mirrored_strategy_test.py,37,class,"Minimal model for mnist. Useful for testing and debugging on slow TPU simulators." -5324,MirroredStrategyDefunTest,tensorflow/tensorflow/python/keras/distribute/mirrored_strategy_test.py,59,class, -5325,_mimic_two_cpus,tensorflow/tensorflow/python/keras/distribute/mirrored_variable_test.py,33,function, -5326,MirroredVariableCreationTest,tensorflow/tensorflow/python/keras/distribute/mirrored_variable_test.py,55,class,"Base class that tests mirrored variable creator. - -Currently it assumes all strategy objects have two replicas." -5327,ModelAndInput,tensorflow/tensorflow/python/keras/distribute/model_collection_base.py,21,class,Base class to provide model and its corresponding inputs. -5328,checkpoint_exists,tensorflow/tensorflow/python/keras/distribute/multi_worker_callback_tf2_test.py,37,function,Returns whether the checkpoint `filepath` refers to exists. -5329,_model_setup,tensorflow/tensorflow/python/keras/distribute/multi_worker_callback_tf2_test.py,46,function,"Set up a MNIST Keras model for testing purposes. - -This function builds a MNIST Keras model and returns relevant information -for testing. - -Args: - test_obj: The `TestCase` testing object. - file_format: File format for checkpoints. 'tf' or 'h5'. +5392,call,tensorflow/tensorflow/python/keras/distribute/mirrored_strategy_test.py,48,method, +5393,ModelAndInput,tensorflow/tensorflow/python/keras/distribute/model_collection_base.py,21,class,Base class to provide model and its corresponding inputs. +5394,get_model,tensorflow/tensorflow/python/keras/distribute/model_collection_base.py,24,method,"Returns a compiled keras model object, together with output name. Returns: - A tuple of (model, saving_filepath, train_ds, steps) where train_ds is - the training dataset." -5330,_get_task_config,tensorflow/tensorflow/python/keras/distribute/multi_worker_callback_tf2_test.py,75,function, -5331,KerasCallbackMultiProcessTest,tensorflow/tensorflow/python/keras/distribute/multi_worker_callback_tf2_test.py,79,class, -5332,ParameterServerStrategy,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,52,class,Temporarily mock the original strategy to bypass cluster_spec check. -5333,_clone_and_build_model,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,67,function, -5334,MultiWorkerVerificationCallback,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,96,class,"MultiWorkerVerificationCallback verifies the callbacks in multi-worker scheme. + model: a keras model object + output_name: a string for the name of the output layer" +5395,get_data,tensorflow/tensorflow/python/keras/distribute/model_collection_base.py,33,method,"Returns data for training and predicting. + +Returns: + x_train: data used for training + y_train: label used for training + x_predict: data used for predicting" +5396,get_batch_size,tensorflow/tensorflow/python/keras/distribute/model_collection_base.py,43,method,Returns the batch_size used by the model. +5397,checkpoint_exists,tensorflow/tensorflow/python/keras/distribute/multi_worker_callback_tf2_test.py,37,function,Returns whether the checkpoint `filepath` refers to exists. +5398,ParameterServerStrategy,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,52,class,Temporarily mock the original strategy to bypass cluster_spec check. +5399,MultiWorkerVerificationCallback,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,96,class,"MultiWorkerVerificationCallback verifies the callbacks in multi-worker scheme. This Callback is intended to be used for verifying the callback is indeed called the correct number of times in various task types. @@ -36751,41 +42130,79 @@ Attributes: } indicates the ps task has 'on_epoch_begin' called twice on each of the two indices, and likewise for worker task." -5335,KerasMultiWorkerTestIndependentWorker,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,203,class, -5336,mnist_synthetic_dataset,tensorflow/tensorflow/python/keras/distribute/multi_worker_testing_utils.py,28,function,Generate synthetic MNIST dataset for testing. -5337,get_mnist_model,tensorflow/tensorflow/python/keras/distribute/multi_worker_testing_utils.py,52,function,Define a deterministically-initialized CNN model for MNIST testing. -5338,MultiWorkerTutorialTest,tensorflow/tensorflow/python/keras/distribute/multi_worker_tutorial_test.py,44,class,Test multi-worker training flow demo'ed in go/multi-worker-with-keras. -5339,distributions_and_v1_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,81,function,A common set of combination with DistributionStrategies and Optimizers. -5340,distributions_and_v2_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,92,function,A common set of combination with DistributionStrategies and Optimizers. -5341,distributions_and_v1_and_v2_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,103,function,A common set of combination with DistributionStrategies and Optimizers. -5342,SavedModelSaveAndLoadTest,tensorflow/tensorflow/python/keras/distribute/saved_model_mixed_api_test.py,35,class, -5343,SavedModelKerasModelTest,tensorflow/tensorflow/python/keras/distribute/saved_model_save_load_test.py,35,class, -5344,SavedModelTFModuleTest,tensorflow/tensorflow/python/keras/distribute/saved_model_save_load_test.py,94,class, -5345,is_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,66,function, -5346,get_tolerance,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,71,function, -5347,simple_models_with_strategies,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,78,function, -5348,simple_models_with_strategy_pairs,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,85,function, -5349,tfmodule_models_with_strategies,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,93,function, -5350,tfmodule_models_with_strategy_pairs,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,100,function, -5351,load_and_run_with_saved_model_api,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,108,function,"Loads a saved_model using tf.saved_model API, and runs it." -5352,TestSavedModelBase,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,130,class,Base class for testing saving/loading with DS. -5353,_get_data_for_simple_models,tensorflow/tensorflow/python/keras/distribute/simple_models.py,35,function, -5354,SimpleFunctionalModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,44,class,A simple functional model and its inputs. -5355,SimpleSequentialModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,69,class,A simple sequential model and its inputs. -5356,_SimpleModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,94,class, -5357,SimpleSubclassModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,104,class,A simple subclass model and its data. -5358,_SimpleModule,tensorflow/tensorflow/python/keras/distribute/simple_models.py,125,class, -5359,SimpleTFModuleModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,135,class,A simple model based on tf.Module and its data. -5360,SingleLossStepTest,tensorflow/tensorflow/python/keras/distribute/step_fn_test.py,34,class, -5361,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/distribute/tpu_strategy_test_utils.py,34,function, -5362,get_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/tpu_strategy_test_utils.py,43,function, -5363,WorkerTrainingState,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,40,class,"Training state management class. +5400,is_between_graph,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,152,method, +5401,is_between_graph,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,156,method, +5402,wrap_methods,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,159,method,"Wrap methods so that the counts of calls are tracked. + +Args: + method_names: A list of names of methods to track calls." +5403,verify,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,178,method, +5404,wrapped_method,tensorflow/tensorflow/python/keras/distribute/multi_worker_test.py,168,method, +5405,mnist_synthetic_dataset,tensorflow/tensorflow/python/keras/distribute/multi_worker_testing_utils.py,28,function,Generate synthetic MNIST dataset for testing. +5406,get_mnist_model,tensorflow/tensorflow/python/keras/distribute/multi_worker_testing_utils.py,52,function,Define a deterministically-initialized CNN model for MNIST testing. +5407,distributions_and_v1_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,81,function,A common set of combination with DistributionStrategies and Optimizers. +5408,distributions_and_v2_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,92,function,A common set of combination with DistributionStrategies and Optimizers. +5409,distributions_and_v1_and_v2_optimizers,tensorflow/tensorflow/python/keras/distribute/optimizer_combinations.py,103,function,A common set of combination with DistributionStrategies and Optimizers. +5410,is_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,66,function, +5411,get_tolerance,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,71,function, +5412,simple_models_with_strategies,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,78,function, +5413,simple_models_with_strategy_pairs,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,85,function, +5414,tfmodule_models_with_strategies,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,93,function, +5415,tfmodule_models_with_strategy_pairs,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,100,function, +5416,load_and_run_with_saved_model_api,tensorflow/tensorflow/python/keras/distribute/saved_model_test_base.py,108,function,"Loads a saved_model using tf.saved_model API, and runs it." +5417,SimpleFunctionalModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,44,class,A simple functional model and its inputs. +5418,get_model,tensorflow/tensorflow/python/keras/distribute/simple_models.py,47,method, +5419,get_data,tensorflow/tensorflow/python/keras/distribute/simple_models.py,62,method, +5420,get_batch_size,tensorflow/tensorflow/python/keras/distribute/simple_models.py,65,method, +5421,SimpleSequentialModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,69,class,A simple sequential model and its inputs. +5422,get_model,tensorflow/tensorflow/python/keras/distribute/simple_models.py,72,method, +5423,get_data,tensorflow/tensorflow/python/keras/distribute/simple_models.py,87,method, +5424,get_batch_size,tensorflow/tensorflow/python/keras/distribute/simple_models.py,90,method, +5425,SimpleSubclassModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,104,class,A simple subclass model and its data. +5426,get_model,tensorflow/tensorflow/python/keras/distribute/simple_models.py,107,method, +5427,get_data,tensorflow/tensorflow/python/keras/distribute/simple_models.py,118,method, +5428,get_batch_size,tensorflow/tensorflow/python/keras/distribute/simple_models.py,121,method, +5429,SimpleTFModuleModel,tensorflow/tensorflow/python/keras/distribute/simple_models.py,135,class,A simple model based on tf.Module and its data. +5430,get_model,tensorflow/tensorflow/python/keras/distribute/simple_models.py,138,method, +5431,get_data,tensorflow/tensorflow/python/keras/distribute/simple_models.py,142,method, +5432,get_batch_size,tensorflow/tensorflow/python/keras/distribute/simple_models.py,145,method, +5433,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/distribute/tpu_strategy_test_utils.py,34,function, +5434,get_tpu_strategy,tensorflow/tensorflow/python/keras/distribute/tpu_strategy_test_utils.py,43,function, +5435,WorkerTrainingState,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,40,class,"Training state management class. This class provides apis for backing up and restoring the training state. This allows model and epoch information to be saved periodically and restore for fault-tolerance, also known as preemption-recovery purpose." -5364,ModelCheckpointTest,tensorflow/tensorflow/python/keras/distribute/worker_training_state_test.py,33,class, -5365,Layer,tensorflow/tensorflow/python/keras/engine/base_layer.py,103,class,"This is the class from which all layers inherit. +5436,back_up,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,87,method,"Back up the current state of training into a checkpoint file. + +Arguments: + epoch: The current epoch information to be saved." +5437,restore,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,100,method,"Restore the training state from the backed up checkpoint file. + +Returns: + True if the training state is successfully restored. False if the training + state doesn't need to be restored, or error occurred so it can't." +5438,delete_backup,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,115,method,"Delete the backup directories. + +Delete the backup directories which should not exist after `fit()` +successfully finishes." +5439,maybe_load_initial_epoch_from_ckpt,tensorflow/tensorflow/python/keras/distribute/worker_training_state.py,129,method,"Maybe load initial epoch from ckpt considering possible worker recovery. + +When `_ckpt_saved_epoch` attribute exists and is not +`CKPT_SAVED_EPOCH_UNUSED_VALUE`, this is under multi-worker training setting +and indicates the worker is recovering from previous failure. In this case, +infer `initial_epoch` from `self._ckpt_saved_epoch` to continue previous +unfinished training from certain epoch. + +Arguments: + initial_epoch: The original initial_epoch user passes in in `fit()`. + mode: The mode for running `model.fit()`. + +Returns: + If the training is recovering from previous failure under multi-worker + training setting, return the epoch the training is supposed to continue + at. Otherwise, return the `initial_epoch` the user passes in." +5440,Layer,tensorflow/tensorflow/python/keras/engine/base_layer.py,103,class,"This is the class from which all layers inherit. A layer is a callable object that takes as input one or more tensors and that outputs one or more tensors. It involves *computation*, defined @@ -36954,7 +42371,649 @@ layers will cast their inputs to the layer's dtype in TensorFlow 2. When mixed precision is used, layers may have different computation and variable dtypes. See `tf.keras.mixed_precision.experimental.Policy` for details on layer dtypes." -5366,TensorFlowOpLayer,tensorflow/tensorflow/python/keras/engine/base_layer.py,3042,class,"Wraps a TensorFlow Operation in a Layer. +5441,build,tensorflow/tensorflow/python/keras/engine/base_layer.py,425,method,"Creates the variables of the layer (optional, for subclass implementers). + +This is a method that implementers of subclasses of `Layer` or `Model` +can override if they need a state-creation step in-between +layer instantiation and layer call. + +This is typically used to create the weights of `Layer` subclasses. + +Arguments: + input_shape: Instance of `TensorShape`, or list of instances of + `TensorShape` if the layer expects a list of inputs + (one instance per input)." +5442,call,tensorflow/tensorflow/python/keras/engine/base_layer.py,445,method,"This is where the layer's logic lives. + +Note here that `call()` method in `tf.keras` is little bit different +from `keras` API. In `keras` API, you can pass support masking for +layers as additional arguments. Whereas `tf.keras` has `compute_mask()` +method to support masking. + +Arguments: + inputs: Input tensor, or list/tuple of input tensors. + **kwargs: Additional keyword arguments. Currently unused. + +Returns: + A tensor or list/tuple of tensors." +5443,add_weight,tensorflow/tensorflow/python/keras/engine/base_layer.py,483,method,"Adds a new variable to the layer. + +Arguments: + name: Variable name. + shape: Variable shape. Defaults to scalar if unspecified. + dtype: The type of the variable. Defaults to `self.dtype` or `float32`. + initializer: Initializer instance (callable). + regularizer: Regularizer instance (callable). + trainable: Boolean, whether the variable should be part of the layer's + ""trainable_variables"" (e.g. variables, biases) + or ""non_trainable_variables"" (e.g. BatchNorm mean and variance). + Note that `trainable` cannot be `True` if `synchronization` + is set to `ON_READ`. + constraint: Constraint instance (callable). + use_resource: Whether to use `ResourceVariable`. + synchronization: Indicates when a distributed a variable will be + aggregated. Accepted values are constants defined in the class + `tf.VariableSynchronization`. By default the synchronization is set to + `AUTO` and the current `DistributionStrategy` chooses + when to synchronize. If `synchronization` is set to `ON_READ`, + `trainable` must not be set to `True`. + aggregation: Indicates how a distributed variable will be aggregated. + Accepted values are constants defined in the class + `tf.VariableAggregation`. + **kwargs: Additional keyword arguments. Accepted values are `getter`, + `collections`, `experimental_autocast` and `caching_device`. + +Returns: + The variable created. + +Raises: + ValueError: When giving unsupported dtype and no initializer or when + trainable has been set to True with synchronization set as `ON_READ`." +5444,get_config,tensorflow/tensorflow/python/keras/engine/base_layer.py,638,method,"Returns the config of the layer. + +A layer config is a Python dictionary (serializable) +containing the configuration of a layer. +The same layer can be reinstantiated later +(without its trained weights) from this configuration. + +The config of a layer does not include connectivity +information, nor the layer class name. These are handled +by `Network` (one layer of abstraction above). + +Returns: + Python dictionary." +5445,from_config,tensorflow/tensorflow/python/keras/engine/base_layer.py,679,method,"Creates a layer from its config. + +This method is the reverse of `get_config`, +capable of instantiating the same layer from the config +dictionary. It does not handle layer connectivity +(handled by Network), nor weights (handled by `set_weights`). + +Arguments: + config: A Python dictionary, typically the + output of get_config. + +Returns: + A layer instance." +5446,compute_output_shape,tensorflow/tensorflow/python/keras/engine/base_layer.py,696,method,"Computes the output shape of the layer. + +If the layer has not been built, this method will call `build` on the +layer. This assumes that the layer will later be used with inputs that +match the input shape provided here. + +Arguments: + input_shape: Shape tuple (tuple of integers) + or list of shape tuples (one per output tensor of the layer). + Shape tuples can include None for free dimensions, + instead of an integer. + +Returns: + An input shape tuple." +5447,compute_output_signature,tensorflow/tensorflow/python/keras/engine/base_layer.py,743,method,"Compute the output tensor signature of the layer based on the inputs. + +Unlike a TensorShape object, a TensorSpec object contains both shape +and dtype information for a tensor. This method allows layers to provide +output dtype information if it is different from the input dtype. +For any layer that doesn't implement this function, +the framework will fall back to use `compute_output_shape`, and will +assume that the output dtype matches the input dtype. + +Args: + input_signature: Single TensorSpec or nested structure of TensorSpec + objects, describing a candidate input for the layer. + +Returns: + Single TensorSpec or nested structure of TensorSpec objects, describing + how the layer would transform the provided input. + +Raises: + TypeError: If input_signature contains a non-TensorSpec object." +5448,compute_mask,tensorflow/tensorflow/python/keras/engine/base_layer.py,854,method,"Computes an output mask tensor. + +Arguments: + inputs: Tensor or list of tensors. + mask: Tensor or list of tensors. + +Returns: + None or a tensor (or list of tensors, + one per output tensor of the layer)." +5449,dtype,tensorflow/tensorflow/python/keras/engine/base_layer.py,1214,method,"Dtype used by the weights of the layer, set in the constructor." +5450,name,tensorflow/tensorflow/python/keras/engine/base_layer.py,1219,method,"Name of the layer (string), set in the constructor." +5451,supports_masking,tensorflow/tensorflow/python/keras/engine/base_layer.py,1224,method,Whether this layer supports computing a mask using `compute_mask`. +5452,supports_masking,tensorflow/tensorflow/python/keras/engine/base_layer.py,1229,method, +5453,dynamic,tensorflow/tensorflow/python/keras/engine/base_layer.py,1233,method,Whether the layer is dynamic (eager-only); set in the constructor. +5454,stateful,tensorflow/tensorflow/python/keras/engine/base_layer.py,1239,method, +5455,stateful,tensorflow/tensorflow/python/keras/engine/base_layer.py,1243,method, +5456,trainable,tensorflow/tensorflow/python/keras/engine/base_layer.py,1247,method, +5457,trainable,tensorflow/tensorflow/python/keras/engine/base_layer.py,1251,method, +5458,activity_regularizer,tensorflow/tensorflow/python/keras/engine/base_layer.py,1256,method,Optional regularizer function for the output of this layer. +5459,activity_regularizer,tensorflow/tensorflow/python/keras/engine/base_layer.py,1261,method,Optional regularizer function for the output of this layer. +5460,input_spec,tensorflow/tensorflow/python/keras/engine/base_layer.py,1266,method,"`InputSpec` instance(s) describing the input format for this layer. + +When you create a layer subclass, you can set `self.input_spec` to enable +the layer to run input compatibility checks when it is called. +Consider a `Conv2D` layer: it can only be called on a single input tensor +of rank 4. As such, you can set, in `__init__()`: + +```python +self.input_spec = tf.keras.layers.InputSpec(ndim=4) +``` + +Now, if you try to call the layer on an input that isn't rank 4 +(for instance, an input of shape `(2,)`, it will raise a nicely-formatted +error: + +``` +ValueError: Input 0 of layer conv2d is incompatible with the layer: +expected ndim=4, found ndim=1. Full shape received: [2] +``` + +Input checks that can be specified via `input_spec` include: +- Structure (e.g. a single input, a list of 2 inputs, etc) +- Shape +- Rank (ndim) +- Dtype + +For more information, see `tf.keras.layers.InputSpec`. + +Returns: + A `tf.keras.layers.InputSpec` instance, or nested structure thereof." +5461,input_spec,tensorflow/tensorflow/python/keras/engine/base_layer.py,1304,method, +5462,trainable_weights,tensorflow/tensorflow/python/keras/engine/base_layer.py,1312,method,"List of all trainable weights tracked by this layer. + +Trainable weights are updated via gradient descent during training. + +Returns: + A list of trainable variables." +5463,non_trainable_weights,tensorflow/tensorflow/python/keras/engine/base_layer.py,1327,method,"List of all non-trainable weights tracked by this layer. + +Non-trainable weights are *not* updated during training. They are expected +to be updated manually in `call()`. + +Returns: + A list of non-trainable variables." +5464,weights,tensorflow/tensorflow/python/keras/engine/base_layer.py,1348,method,"Returns the list of all layer variables/weights. + +Returns: + A list of variables." +5465,updates,tensorflow/tensorflow/python/keras/engine/base_layer.py,1362,method, +5466,losses,tensorflow/tensorflow/python/keras/engine/base_layer.py,1379,method,"List of losses added using the `add_loss()` API. + +Variable regularization tensors are created when this property is accessed, +so it is eager safe: accessing `losses` under a `tf.GradientTape` will +propagate gradients back to the corresponding variables. + +Examples: + +>>> class MyLayer(tf.keras.layers.Layer): +... def call(self, inputs): +... self.add_loss(tf.abs(tf.reduce_mean(inputs))) +... return inputs +>>> l = MyLayer() +>>> l(np.ones((10, 1))) +>>> l.losses +[1.0] + +>>> inputs = tf.keras.Input(shape=(10,)) +>>> x = tf.keras.layers.Dense(10)(inputs) +>>> outputs = tf.keras.layers.Dense(1)(x) +>>> model = tf.keras.Model(inputs, outputs) +>>> # Activity regularization. +>>> len(model.losses) +0 +>>> model.add_loss(tf.abs(tf.reduce_mean(x))) +>>> len(model.losses) +1 + +>>> inputs = tf.keras.Input(shape=(10,)) +>>> d = tf.keras.layers.Dense(10, kernel_initializer='ones') +>>> x = d(inputs) +>>> outputs = tf.keras.layers.Dense(1)(x) +>>> model = tf.keras.Model(inputs, outputs) +>>> # Weight regularization. +>>> model.add_loss(lambda: tf.reduce_mean(d.kernel)) +>>> model.losses +[] + +Returns: + A list of tensors." +5467,add_loss,tensorflow/tensorflow/python/keras/engine/base_layer.py,1440,method,"Add loss tensor(s), potentially dependent on layer inputs. + +Some losses (for instance, activity regularization losses) may be dependent +on the inputs passed when calling a layer. Hence, when reusing the same +layer on different inputs `a` and `b`, some entries in `layer.losses` may +be dependent on `a` and some on `b`. This method automatically keeps track +of dependencies. + +This method can be used inside a subclassed layer or model's `call` +function, in which case `losses` should be a Tensor or list of Tensors. + +Example: + +```python +class MyLayer(tf.keras.layers.Layer): + def call(self, inputs): + self.add_loss(tf.abs(tf.reduce_mean(inputs))) + return inputs +``` + +This method can also be called directly on a Functional Model during +construction. In this case, any loss Tensors passed to this Model must +be symbolic and be able to be traced back to the model's `Input`s. These +losses become part of the model's topology and are tracked in `get_config`. + +Example: + +```python +inputs = tf.keras.Input(shape=(10,)) +x = tf.keras.layers.Dense(10)(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +# Activity regularization. +model.add_loss(tf.abs(tf.reduce_mean(x))) +``` + +If this is not the case for your loss (if, for example, your loss references +a `Variable` of one of the model's layers), you can wrap your loss in a +zero-argument lambda. These losses are not tracked as part of the model's +topology since they can't be serialized. + +Example: + +```python +inputs = tf.keras.Input(shape=(10,)) +d = tf.keras.layers.Dense(10) +x = d(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +# Weight regularization. +model.add_loss(lambda: tf.reduce_mean(d.kernel)) +``` + +Arguments: + losses: Loss tensor, or list/tuple of tensors. Rather than tensors, losses + may also be zero-argument callables which create a loss tensor. + **kwargs: Additional keyword arguments for backward compatibility. + Accepted values: + inputs - Deprecated, will be automatically inferred." +5468,metrics,tensorflow/tensorflow/python/keras/engine/base_layer.py,1572,method,"List of metrics added using the `add_metric()` API. + +Example: + +>>> input = tf.keras.layers.Input(shape=(3,)) +>>> d = tf.keras.layers.Dense(2) +>>> output = d(input) +>>> d.add_metric(tf.reduce_max(output), name='max') +>>> d.add_metric(tf.reduce_min(output), name='min') +>>> [m.name for m in d.metrics] +['max', 'min'] + +Returns: + A list of tensors." +5469,add_metric,tensorflow/tensorflow/python/keras/engine/base_layer.py,1594,method,"Adds metric tensor to the layer. + +This method can be used inside the `call()` method of a subclassed layer +or model. + +```python +class MyMetricLayer(tf.keras.layers.Layer): + def __init__(self): + super(MyMetricLayer, self).__init__(name='my_metric_layer') + self.mean = metrics_module.Mean(name='metric_1') + + def call(self, inputs): + self.add_metric(self.mean(x)) + self.add_metric(math_ops.reduce_sum(x), name='metric_2') + return inputs +``` + +This method can also be called directly on a Functional Model during +construction. In this case, any tensor passed to this Model must +be symbolic and be able to be traced back to the model's `Input`s. These +metrics become part of the model's topology and are tracked when you +save the model via `save()`. + +```python +inputs = tf.keras.Input(shape=(10,)) +x = tf.keras.layers.Dense(10)(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +model.add_metric(math_ops.reduce_sum(x), name='metric_1') +``` + +Note: Calling `add_metric()` with the result of a metric object on a +Functional Model, as shown in the example below, is not supported. This is +because we cannot trace the metric result tensor back to the model's inputs. + +```python +inputs = tf.keras.Input(shape=(10,)) +x = tf.keras.layers.Dense(10)(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +model.add_metric(tf.keras.metrics.Mean()(x), name='metric_1') +``` + +Args: + value: Metric tensor. + name: String metric name. + **kwargs: Additional keyword arguments for backward compatibility. + Accepted values: + `aggregation` - When the `value` tensor provided is not the result of + calling a `keras.Metric` instance, it will be aggregated by default + using a `keras.Metric.Mean`." +5470,add_update,tensorflow/tensorflow/python/keras/engine/base_layer.py,1720,method,"Add update op(s), potentially dependent on layer inputs. + +Weight updates (for instance, the updates of the moving mean and variance +in a BatchNormalization layer) may be dependent on the inputs passed +when calling a layer. Hence, when reusing the same layer on +different inputs `a` and `b`, some entries in `layer.updates` may be +dependent on `a` and some on `b`. This method automatically keeps track +of dependencies. + +This call is ignored when eager execution is enabled (in that case, variable +updates are run on the fly and thus do not need to be tracked for later +execution). + +Arguments: + updates: Update op, or list/tuple of update ops, or zero-arg callable + that returns an update op. A zero-arg callable should be passed in + order to disable running the updates by setting `trainable=False` + on this Layer, when executing in Eager mode. + inputs: Deprecated, will be automatically inferred." +5471,set_weights,tensorflow/tensorflow/python/keras/engine/base_layer.py,1756,method,"Sets the weights of the layer, from Numpy arrays. + +The weights of a layer represent the state of the layer. This function +sets the weight values from numpy arrays. The weight values should be +passed in the order they are created by the layer. Note that the layer's +weights must be instantiated before calling this function by calling +the layer. + +For example, a Dense layer returns a list of two values-- per-output +weights and the bias value. These can be used to set the weights of another +Dense layer: + +>>> a = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(1.)) +>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]])) +>>> a.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] +>>> b = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(2.)) +>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]])) +>>> b.get_weights() +[array([[2.], + [2.], + [2.]], dtype=float32), array([0.], dtype=float32)] +>>> b.set_weights(a.get_weights()) +>>> b.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] + +Arguments: + weights: a list of Numpy arrays. The number + of arrays and their shape must match + number of the dimensions of the weights + of the layer (i.e. it should match the + output of `get_weights`). + +Raises: + ValueError: If the provided weights list does not match the + layer's specifications." +5472,get_weights,tensorflow/tensorflow/python/keras/engine/base_layer.py,1836,method,"Returns the current weights of the layer. + +The weights of a layer represent the state of the layer. This function +returns both trainable and non-trainable weight values associated with this +layer as a list of Numpy arrays, which can in turn be used to load state +into similarly parameterized layers. + +For example, a Dense layer returns a list of two values-- per-output +weights and the bias value. These can be used to set the weights of another +Dense layer: + +>>> a = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(1.)) +>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]])) +>>> a.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] +>>> b = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(2.)) +>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]])) +>>> b.get_weights() +[array([[2.], + [2.], + [2.]], dtype=float32), array([0.], dtype=float32)] +>>> b.set_weights(a.get_weights()) +>>> b.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] + +Returns: + Weights values as a list of numpy arrays." +5473,get_updates_for,tensorflow/tensorflow/python/keras/engine/base_layer.py,1883,method,"Deprecated, do NOT use! + +Retrieves updates relevant to a specific set of inputs. + +Arguments: + inputs: Input tensor or list/tuple of input tensors. + +Returns: + List of update ops of the layer that depend on `inputs`." +5474,get_losses_for,tensorflow/tensorflow/python/keras/engine/base_layer.py,1899,method,"Deprecated, do NOT use! + +Retrieves losses relevant to a specific set of inputs. + +Arguments: + inputs: Input tensor or list/tuple of input tensors. + +Returns: + List of loss tensors of the layer that depend on `inputs`." +5475,get_input_mask_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,1913,method,"Retrieves the input mask tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A mask tensor + (or list of tensors if the layer has multiple inputs)." +5476,get_output_mask_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,1933,method,"Retrieves the output mask tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A mask tensor + (or list of tensors if the layer has multiple outputs)." +5477,input_mask,tensorflow/tensorflow/python/keras/engine/base_layer.py,1954,method,"Retrieves the input mask tensor(s) of a layer. + +Only applicable if the layer has exactly one inbound node, +i.e. if it is connected to one incoming layer. + +Returns: + Input mask tensor (potentially None) or list of input + mask tensors. + +Raises: + AttributeError: if the layer is connected to + more than one incoming layers." +5478,output_mask,tensorflow/tensorflow/python/keras/engine/base_layer.py,1976,method,"Retrieves the output mask tensor(s) of a layer. + +Only applicable if the layer has exactly one inbound node, +i.e. if it is connected to one incoming layer. + +Returns: + Output mask tensor (potentially None) or list of output + mask tensors. + +Raises: + AttributeError: if the layer is connected to + more than one incoming layers." +5479,get_input_shape_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,1997,method,"Retrieves the input shape(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A shape tuple + (or list of shape tuples if the layer has multiple inputs). + +Raises: + RuntimeError: If called in Eager mode." +5480,get_output_shape_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,2017,method,"Retrieves the output shape(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A shape tuple + (or list of shape tuples if the layer has multiple outputs). + +Raises: + RuntimeError: If called in Eager mode." +5481,get_input_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,2037,method,"Retrieves the input tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A tensor (or list of tensors if the layer has multiple inputs). + +Raises: + RuntimeError: If called in Eager mode." +5482,get_output_at,tensorflow/tensorflow/python/keras/engine/base_layer.py,2056,method,"Retrieves the output tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A tensor (or list of tensors if the layer has multiple outputs). + +Raises: + RuntimeError: If called in Eager mode." +5483,input,tensorflow/tensorflow/python/keras/engine/base_layer.py,2075,method,"Retrieves the input tensor(s) of a layer. + +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer. + +Returns: + Input tensor or list of input tensors. + +Raises: + RuntimeError: If called in Eager mode. + AttributeError: If no inbound nodes are found." +5484,output,tensorflow/tensorflow/python/keras/engine/base_layer.py,2094,method,"Retrieves the output tensor(s) of a layer. + +Only applicable if the layer has exactly one output, +i.e. if it is connected to one incoming layer. + +Returns: + Output tensor or list of output tensors. + +Raises: + AttributeError: if the layer is connected to more than one incoming + layers. + RuntimeError: if called in Eager mode." +5485,input_shape,tensorflow/tensorflow/python/keras/engine/base_layer.py,2114,method,"Retrieves the input shape(s) of a layer. + +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer, or if all inputs +have the same shape. + +Returns: + Input shape, as an integer shape tuple + (or list of shape tuples, one tuple per input tensor). + +Raises: + AttributeError: if the layer has no defined input_shape. + RuntimeError: if called in Eager mode." +5486,count_params,tensorflow/tensorflow/python/keras/engine/base_layer.py,2145,method,"Count the total number of scalars composing the weights. + +Returns: + An integer count. + +Raises: + ValueError: if the layer isn't yet built + (in which case its weights aren't yet defined)." +5487,output_shape,tensorflow/tensorflow/python/keras/engine/base_layer.py,2168,method,"Retrieves the output shape(s) of a layer. + +Only applicable if the layer has one output, +or if all outputs have the same shape. + +Returns: + Output shape, as an integer shape tuple + (or list of shape tuples, one tuple per output tensor). + +Raises: + AttributeError: if the layer has no defined output shape. + RuntimeError: if called in Eager mode." +5488,inbound_nodes,tensorflow/tensorflow/python/keras/engine/base_layer.py,2200,method,"Deprecated, do NOT use! Only for compatibility with external Keras." +5489,outbound_nodes,tensorflow/tensorflow/python/keras/engine/base_layer.py,2206,method,"Deprecated, do NOT use! Only for compatibility with external Keras." +5490,apply,tensorflow/tensorflow/python/keras/engine/base_layer.py,2217,method,"Deprecated, do NOT use! + +This is an alias of `self.__call__`. + +Arguments: + inputs: Input tensor(s). + *args: additional positional arguments to be passed to `self.call`. + **kwargs: additional keyword arguments to be passed to `self.call`. + +Returns: + Output tensor(s)." +5491,add_variable,tensorflow/tensorflow/python/keras/engine/base_layer.py,2235,method,"Deprecated, do NOT use! Alias for `add_weight`." +5492,variables,tensorflow/tensorflow/python/keras/engine/base_layer.py,2241,method,"Returns the list of all layer variables/weights. + +Alias of `self.weights`. + +Returns: + A list of variables." +5493,trainable_variables,tensorflow/tensorflow/python/keras/engine/base_layer.py,2253,method, +5494,non_trainable_variables,tensorflow/tensorflow/python/keras/engine/base_layer.py,2258,method, +5495,check_type_return_shape,tensorflow/tensorflow/python/keras/engine/base_layer.py,764,method, +5496,getter,tensorflow/tensorflow/python/keras/engine/base_layer.py,586,method, +5497,TensorFlowOpLayer,tensorflow/tensorflow/python/keras/engine/base_layer.py,3042,class,"Wraps a TensorFlow Operation in a Layer. This class is used internally by the Functional API. When a user uses a raw TensorFlow Operation on symbolic tensors originating @@ -36982,33 +43041,37 @@ Attributes: not supported, and so this parameter has no effect. dtype: The default dtype of this Layer. Inherited from `Layer` and has no effect on this class, however is used in `get_config`." -5367,AddLoss,tensorflow/tensorflow/python/keras/engine/base_layer.py,3165,class,"Adds its inputs as a loss. +5498,call,tensorflow/tensorflow/python/keras/engine/base_layer.py,3103,method, +5499,get_config,tensorflow/tensorflow/python/keras/engine/base_layer.py,3152,method, +5500,AddLoss,tensorflow/tensorflow/python/keras/engine/base_layer.py,3165,class,"Adds its inputs as a loss. Attributes: unconditional: Whether or not the loss should be conditioned on the inputs." -5368,AddMetric,tensorflow/tensorflow/python/keras/engine/base_layer.py,3189,class,"Adds its inputs as a metric. +5501,call,tensorflow/tensorflow/python/keras/engine/base_layer.py,3179,method, +5502,get_config,tensorflow/tensorflow/python/keras/engine/base_layer.py,3183,method, +5503,AddMetric,tensorflow/tensorflow/python/keras/engine/base_layer.py,3189,class,"Adds its inputs as a metric. Attributes: aggregation: 'mean' or None. How the inputs should be aggregated. metric_name: The name to use for this metric." -5369,_in_functional_construction_mode,tensorflow/tensorflow/python/keras/engine/base_layer.py,3215,function,Check the arguments to see if we are constructing a functional model. -5370,_convert_numpy_or_python_types,tensorflow/tensorflow/python/keras/engine/base_layer.py,3244,function, -5371,DynamicLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,64,class, -5372,InvalidLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,80,class, -5373,BaseLayerTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,86,class, -5374,SymbolicSupportTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,768,class, -5375,NestedTrackingTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,903,class, -5376,NameScopingTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1088,class, -5377,AutographControlFlowTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1147,class, -5378,AddLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1402,class,"A layer which adds its input to a variable. +5504,call,tensorflow/tensorflow/python/keras/engine/base_layer.py,3202,method, +5505,get_config,tensorflow/tensorflow/python/keras/engine/base_layer.py,3206,method, +5506,DynamicLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,64,class, +5507,call,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,69,method, +5508,compute_output_shape,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,76,method, +5509,InvalidLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,80,class, +5510,call,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,82,method, +5511,AddLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1402,class,"A layer which adds its input to a variable. Useful for testing a layer with a variable" -5379,IdentityLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1416,class,"A layer that returns its input. +5512,build,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1408,method, +5513,call,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1412,method, +5514,IdentityLayer,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1416,class,"A layer that returns its input. Useful for testing a layer without a variable." -5380,DTypeTest,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1427,class, -5381,create_mean_metric,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,47,function, -5382,make_variable,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,55,function,"Temporary util to create a variable (relies on `variable_scope.variable`). +5515,call,tensorflow/tensorflow/python/keras/engine/base_layer_test.py,1422,method, +5516,create_mean_metric,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,47,function, +5517,make_variable,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,55,function,"Temporary util to create a variable (relies on `variable_scope.variable`). Some reuse-related technicalities prevent us from using `variable_scope.get_variable()` directly, so we use a subcomponent @@ -37051,16 +43114,16 @@ Arguments: Returns: Variable instance." -5383,collect_previous_mask,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,146,function,"Retrieves the output mask(s) of the previous node. +5518,collect_previous_mask,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,146,function,"Retrieves the output mask(s) of the previous node. Arguments: input_tensors: An arbitrary structure of Tensors. Returns: A mask tensor or list of mask tensors." -5384,have_all_keras_metadata,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,162,function, -5385,generate_placeholders_from_shape,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,166,function, -5386,create_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,170,function,"Wraps TensorFlow Operations for compatibility with the Functional API. +5519,have_all_keras_metadata,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,162,function, +5520,generate_placeholders_from_shape,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,166,function, +5521,create_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,170,function,"Wraps TensorFlow Operations for compatibility with the Functional API. This method checks to see if a Tensor in `tensors` is missing Keras metadata and has its origin in a Keras `Input` Layer. If so, this method will replace @@ -37077,20 +43140,8 @@ Arguments: Returns: created_layers: List. The `TensorFlowOpLayer` instances created to wrap the raw Tensorflow operations." -5387,_create_keras_history_helper,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,193,function,"Helper method for `create_keras_history`. - -Arguments: - tensors: A structure of Tensors for which to create Keras metadata. - processed_ops: Set. TensorFlow operations that have already been wrapped in - `TensorFlowOpLayer` instances. - created_layers: List. The `TensorFlowOpLayer` instances created. - -Returns: - Tuple. First element is the updated set of TensorFlow Operations that - have been wrapped in `TensorFlowOpLayer` instances. Second element is - a list of the `TensorFlowOpLayer` instances created." -5388,unnest_if_single_tensor,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,283,function, -5389,needs_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,294,function,"Check if any Tensors need to be wrapped in TensorFlowOpLayers. +5522,unnest_if_single_tensor,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,283,function, +5523,needs_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,294,function,"Check if any Tensors need to be wrapped in TensorFlowOpLayers. This will never return True inside a sublayer, because sublayers do not need to create Keras History. Otherwise, this returns True @@ -37106,10 +43157,10 @@ Arguments: Returns: Bool, whether at least one Tensor needs to be wrapped." -5390,is_in_keras_graph,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,323,function,Returns if currently executing inside of a Keras graph. -5391,is_in_eager_or_tf_function,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,328,function,Returns if in eager mode or inside of a tf.function. -5392,is_in_tf_function,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,333,function,Returns if inside of a tf.function. -5393,uses_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,351,function,"Check if at least one Tensor originates from a `keras.Input`. +5524,is_in_keras_graph,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,323,function,Returns if currently executing inside of a Keras graph. +5525,is_in_eager_or_tf_function,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,328,function,Returns if in eager mode or inside of a tf.function. +5526,is_in_tf_function,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,333,function,Returns if inside of a tf.function. +5527,uses_keras_history,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,351,function,"Check if at least one Tensor originates from a `keras.Input`. This is `True` if at least one Tensor has its origin in a `keras.Input`. Any Tensor that originates from a `keras.Input` will have a dependency @@ -37122,15 +43173,15 @@ Arguments: Returns: Bool, whether at least one Tensor originates from a `keras.Input`." -5394,mark_checked,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,396,function,"Marks that these Tensors should not be tracked. +5528,mark_checked,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,396,function,"Marks that these Tensors should not be tracked. This prevents Layers from attempting to create TensorFlowOpLayers for these Tensors. Arguments: tensors: An arbitrary structure of Tensors." -5395,call_context,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,412,function,Returns currently active `CallContext`. -5396,CallContext,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,424,class,"Keeps track of properties currently inside a Layer/Model's `call`. +5529,call_context,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,412,function,Returns currently active `CallContext`. +5530,CallContext,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,424,class,"Keeps track of properties currently inside a Layer/Model's `call`. Attributes: in_call: Whether currently inside the `call` of a Layer. @@ -37142,11 +43193,29 @@ Attributes: frozen: Whether currently executing inside a `Layer` with `trainable` set to `False`. in_keras_graph: Whether executing inside the Keras Graph." -5397,CallContextManager,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,513,class,Context manager for `CallContext`. -5398,training_arg_passed_to_call,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,546,function,Returns whether a user passed the `training` argument in `__call__`. -5399,is_subclassed,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,554,function,Returns True if the object is a subclassed layer or subclassed model. -5400,from_saved_model,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,560,function,Returns whether the layer is loaded from a SavedModel. -5401,check_graph_consistency,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,565,function,"Checks that tensors passed to `add_*` method match the Keras graph. +5531,enter,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,454,method,"Push a Layer and its inputs and state onto the current call context. + +Arguments: + layer: The `Layer` whose `call` is currently active. + inputs: The inputs to the currently active `Layer`. + build_graph: Whether currently inside a Graph or FuncGraph. + training: Whether currently executing in training or inference mode. + saving: Whether currently saving to SavedModel. + +Returns: + Context manager." +5532,layer,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,477,method, +5533,inputs,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,481,method, +5534,build_graph,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,485,method, +5535,training,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,489,method, +5536,saving,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,493,method, +5537,frozen,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,497,method, +5538,in_keras_graph,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,504,method, +5539,CallContextManager,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,513,class,Context manager for `CallContext`. +5540,training_arg_passed_to_call,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,546,function,Returns whether a user passed the `training` argument in `__call__`. +5541,is_subclassed,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,554,function,Returns True if the object is a subclassed layer or subclassed model. +5542,from_saved_model,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,560,function,Returns whether the layer is loaded from a SavedModel. +5543,check_graph_consistency,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,565,function,"Checks that tensors passed to `add_*` method match the Keras graph. When one of the `add_*` method is called inside a V2 conditional branch, the underlying tensor gets created in a FuncGraph managed by control_flow_v2. @@ -37160,8 +43229,8 @@ Arguments: Raises: RuntimeError: In case of an out-of-graph tensor." -5402,mark_as_return,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,693,function,Marks `outputs` as the return values for automatic control deps. -5403,enable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,723,function,"Enable the V2 dtype behavior for Keras layers. +5544,mark_as_return,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,693,function,Marks `outputs` as the return values for automatic control deps. +5545,enable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,723,function,"Enable the V2 dtype behavior for Keras layers. By default, the V2 dtype behavior is enabled in TensorFlow 2, so this function is only useful if `tf.compat.v1.disable_v2_behavior` has been called. Since @@ -37189,11 +43258,11 @@ floatx part of the V2 behavior. When a global `tf.keras.mixed_precision.experimental.Policy` is set, a Keras layer's dtype will default to the global policy instead of floatx. Layers will automatically cast inputs to the policy's compute_dtype." -5404,disable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,758,function,"Disables the V2 dtype behavior for Keras layers. +5546,disable_v2_dtype_behavior,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,758,function,"Disables the V2 dtype behavior for Keras layers. See `tf.compat.v1.keras.layers.enable_v2_dtype_behavior`." -5405,v2_dtype_behavior_enabled,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,767,function,Returns True if the V2 dtype behavior is enabled. -5406,TrackableWeightHandler,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,774,class,"Keras wrapper for handling tracking.Trackable object saving and restoring. +5547,v2_dtype_behavior_enabled,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,767,function,Returns True if the V2 dtype behavior is enabled. +5548,TrackableWeightHandler,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,774,class,"Keras wrapper for handling tracking.Trackable object saving and restoring. This class handles Trackables in both V1 and V2 modes, ensuring that they can be saved and restored with the correct data and without adding additional ops @@ -37202,12 +43271,13 @@ on every save. Attributes: trackable: The trackable to wrap. num_tensors: The number of tensors that this trackable requires for saving." -5407,no_ragged_support,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,846,function, -5408,is_split_variable,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,854,function,Returns True if `v` is either a PartionedVariable or a SharedVariable. -5409,has_weights,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,859,function, -5410,TrackableWeightHandlerTest,tensorflow/tensorflow/python/keras/engine/base_layer_utils_test.py,38,class, -5411,OpLayerTest,tensorflow/tensorflow/python/keras/engine/base_layer_utils_test.py,79,class, -5412,Layer,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,77,class,"Base layer class. +5549,num_tensors,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,825,method, +5550,set_weights,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,828,method, +5551,get_tensors,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,836,method, +5552,no_ragged_support,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,846,function, +5553,is_split_variable,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,854,function,Returns True if `v` is either a PartionedVariable or a SharedVariable. +5554,has_weights,tensorflow/tensorflow/python/keras/engine/base_layer_utils.py,859,function, +5555,Layer,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,77,class,"Base layer class. This is the class from which all layers inherit. @@ -37268,7 +43338,539 @@ layers will cast their inputs to the layer's dtype in TensorFlow 2. When mixed precision is used, layers may have different computation and variable dtypes. See `tf.keras.mixed_precision.experimental.Policy` for details on layer dtypes." -5413,KerasHistory,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,2406,class,"Tracks the Layer call that created a Tensor, for Keras Graph Networks. +5556,build,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,266,method,"Creates the variables of the layer (optional, for subclass implementers). + +This is a method that implementers of subclasses of `Layer` or `Model` +can override if they need a state-creation step in-between +layer instantiation and layer call. + +This is typically used to create the weights of `Layer` subclasses. + +Arguments: + input_shape: Instance of `TensorShape`, or list of instances of + `TensorShape` if the layer expects a list of inputs + (one instance per input)." +5557,call,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,285,method,"This is where the layer's logic lives. + +Arguments: + inputs: Input tensor, or list/tuple of input tensors. + **kwargs: Additional keyword arguments. + +Returns: + A tensor or list/tuple of tensors." +5558,add_weight,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,318,method,"Adds a new variable to the layer. + +Arguments: + name: Variable name. + shape: Variable shape. Defaults to scalar if unspecified. + dtype: The type of the variable. Defaults to `self.dtype` or `float32`. + initializer: Initializer instance (callable). + regularizer: Regularizer instance (callable). + trainable: Boolean, whether the variable should be part of the layer's + ""trainable_variables"" (e.g. variables, biases) + or ""non_trainable_variables"" (e.g. BatchNorm mean and variance). + Note that `trainable` cannot be `True` if `synchronization` + is set to `ON_READ`. + constraint: Constraint instance (callable). + partitioner: Partitioner to be passed to the `Trackable` API. + use_resource: Whether to use `ResourceVariable`. + synchronization: Indicates when a distributed a variable will be + aggregated. Accepted values are constants defined in the class + `tf.VariableSynchronization`. By default the synchronization is set to + `AUTO` and the current `DistributionStrategy` chooses + when to synchronize. If `synchronization` is set to `ON_READ`, + `trainable` must not be set to `True`. + aggregation: Indicates how a distributed variable will be aggregated. + Accepted values are constants defined in the class + `tf.VariableAggregation`. + **kwargs: Additional keyword arguments. Accepted values are `getter`, + `collections`, `experimental_autocast` and `caching_device`. + +Returns: + The created variable. Usually either a `Variable` or `ResourceVariable` + instance. If `partitioner` is not `None`, a `PartitionedVariable` + instance is returned. + +Raises: + RuntimeError: If called with partitioned variable regularization and + eager execution is enabled. + ValueError: When giving unsupported dtype and no initializer or when + trainable has been set to True with synchronization set as `ON_READ`." +5559,get_config,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,479,method,"Returns the config of the layer. + +A layer config is a Python dictionary (serializable) +containing the configuration of a layer. +The same layer can be reinstantiated later +(without its trained weights) from this configuration. + +The config of a layer does not include connectivity +information, nor the layer class name. These are handled +by `Network` (one layer of abstraction above). + +Returns: + Python dictionary." +5560,from_config,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,516,method,"Creates a layer from its config. + +This method is the reverse of `get_config`, +capable of instantiating the same layer from the config +dictionary. It does not handle layer connectivity +(handled by Network), nor weights (handled by `set_weights`). + +Arguments: + config: A Python dictionary, typically the + output of get_config. + +Returns: + A layer instance." +5561,compute_output_shape,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,533,method,"Computes the output shape of the layer. + +If the layer has not been built, this method will call `build` on the +layer. This assumes that the layer will later be used with inputs that +match the input shape provided here. + +Arguments: + input_shape: Shape tuple (tuple of integers) + or list of shape tuples (one per output tensor of the layer). + Shape tuples can include None for free dimensions, + instead of an integer. + +Returns: + An input shape tuple." +5562,compute_output_signature,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,577,method,"Compute the output tensor signature of the layer based on the inputs. + +Unlike a TensorShape object, a TensorSpec object contains both shape +and dtype information for a tensor. This method allows layers to provide +output dtype information if it is different from the input dtype. +For any layer that doesn't implement this function, +the framework will fall back to use `compute_output_shape`, and will +assume that the output dtype matches the input dtype. + +Args: + input_signature: Single TensorSpec or nested structure of TensorSpec + objects, describing a candidate input for the layer. + +Returns: + Single TensorSpec or nested structure of TensorSpec objects, describing + how the layer would transform the provided input. + +Raises: + TypeError: If input_signature contains a non-TensorSpec object." +5563,compute_mask,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,617,method,"Computes an output mask tensor. + +Arguments: + inputs: Tensor or list of tensors. + mask: Tensor or list of tensors. + +Returns: + None or a tensor (or list of tensors, + one per output tensor of the layer)." +5564,dtype,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,847,method, +5565,name,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,851,method, +5566,dynamic,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,855,method, +5567,stateful,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,860,method, +5568,stateful,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,864,method, +5569,trainable,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,868,method, +5570,trainable,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,872,method, +5571,activity_regularizer,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,878,method,Optional regularizer function for the output of this layer. +5572,activity_regularizer,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,883,method,Optional regularizer function for the output of this layer. +5573,input_spec,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,888,method, +5574,input_spec,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,895,method, +5575,trainable_weights,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,903,method, +5576,non_trainable_weights,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,911,method, +5577,weights,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,924,method,"Returns the list of all layer variables/weights. + +Returns: + A list of variables." +5578,updates,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,933,method, +5579,losses,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,953,method,"Losses which are associated with this `Layer`. + +Variable regularization tensors are created when this property is accessed, +so it is eager safe: accessing `losses` under a `tf.GradientTape` will +propagate gradients back to the corresponding variables. + +Returns: + A list of tensors." +5580,add_loss,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,977,method,"Add loss tensor(s), potentially dependent on layer inputs. + +Some losses (for instance, activity regularization losses) may be dependent +on the inputs passed when calling a layer. Hence, when reusing the same +layer on different inputs `a` and `b`, some entries in `layer.losses` may +be dependent on `a` and some on `b`. This method automatically keeps track +of dependencies. + +This method can be used inside a subclassed layer or model's `call` +function, in which case `losses` should be a Tensor or list of Tensors. + +Example: + +```python +class MyLayer(tf.keras.layers.Layer): + def call(inputs, self): + self.add_loss(tf.abs(tf.reduce_mean(inputs)), inputs=True) + return inputs +``` + +This method can also be called directly on a Functional Model during +construction. In this case, any loss Tensors passed to this Model must +be symbolic and be able to be traced back to the model's `Input`s. These +losses become part of the model's topology and are tracked in `get_config`. + +Example: + +```python +inputs = tf.keras.Input(shape=(10,)) +x = tf.keras.layers.Dense(10)(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +# Actvity regularization. +model.add_loss(tf.abs(tf.reduce_mean(x))) +``` + +If this is not the case for your loss (if, for example, your loss references +a `Variable` of one of the model's layers), you can wrap your loss in a +zero-argument lambda. These losses are not tracked as part of the model's +topology since they can't be serialized. + +Example: + +```python +inputs = tf.keras.Input(shape=(10,)) +x = tf.keras.layers.Dense(10)(inputs) +outputs = tf.keras.layers.Dense(1)(x) +model = tf.keras.Model(inputs, outputs) +# Weight regularization. +model.add_loss(lambda: tf.reduce_mean(x.kernel)) +``` + +The `get_losses_for` method allows to retrieve the losses relevant to a +specific set of inputs. + +Arguments: + losses: Loss tensor, or list/tuple of tensors. Rather than tensors, losses + may also be zero-argument callables which create a loss tensor. + inputs: Ignored when executing eagerly. If anything other than None is + passed, it signals the losses are conditional on some of the layer's + inputs, and thus they should only be run where these inputs are + available. This is the case for activity regularization losses, for + instance. If `None` is passed, the losses are assumed + to be unconditional, and will apply across all dataflows of the layer + (e.g. weight regularization losses)." +5581,metrics,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1092,method, +5582,add_metric,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1099,method,"Adds metric tensor to the layer. + +Args: + value: Metric tensor. + aggregation: Sample-wise metric reduction function. If `aggregation=None`, + it indicates that the metric tensor provided has been aggregated + already. eg, `bin_acc = BinaryAccuracy(name='acc')` followed by + `model.add_metric(bin_acc(y_true, y_pred))`. If aggregation='mean', the + given metric tensor will be sample-wise reduced using `mean` function. + eg, `model.add_metric(tf.reduce_sum(outputs), name='output_mean', + aggregation='mean')`. + name: String metric name. + +Raises: + ValueError: If `aggregation` is anything other than None or `mean`." +5583,add_update,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1167,method,"Add update op(s), potentially dependent on layer inputs. + +Weight updates (for instance, the updates of the moving mean and variance +in a BatchNormalization layer) may be dependent on the inputs passed +when calling a layer. Hence, when reusing the same layer on +different inputs `a` and `b`, some entries in `layer.updates` may be +dependent on `a` and some on `b`. This method automatically keeps track +of dependencies. + +The `get_updates_for` method allows to retrieve the updates relevant to a +specific set of inputs. + +This call is ignored when eager execution is enabled (in that case, variable +updates are run on the fly and thus do not need to be tracked for later +execution). + +Arguments: + updates: Update op, or list/tuple of update ops, or zero-arg callable + that returns an update op. A zero-arg callable should be passed in + order to disable running the updates by setting `trainable=False` + on this Layer, when executing in Eager mode. + inputs: Deprecated, will be automatically inferred." +5584,set_weights,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1239,method,"Sets the weights of the layer, from Numpy arrays. + +The weights of a layer represent the state of the layer. This function +sets the weight values from numpy arrays. The weight values should be +passed in the order they are created by the layer. Note that the layer's +weights must be instantiated before calling this function by calling +the layer. + +For example, a Dense layer returns a list of two values-- per-output +weights and the bias value. These can be used to set the weights of another +Dense layer: + +>>> a = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(1.)) +>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]])) +>>> a.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] +>>> b = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(2.)) +>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]])) +>>> b.get_weights() +[array([[2.], + [2.], + [2.]], dtype=float32), array([0.], dtype=float32)] +>>> b.set_weights(a.get_weights()) +>>> b.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] + +Arguments: + weights: a list of Numpy arrays. The number + of arrays and their shape must match + number of the dimensions of the weights + of the layer (i.e. it should match the + output of `get_weights`). + +Raises: + ValueError: If the provided weights list does not match the + layer's specifications." +5585,get_weights,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1319,method,"Returns the current weights of the layer. + +The weights of a layer represent the state of the layer. This function +returns both trainable and non-trainable weight values associated with this +layer as a list of Numpy arrays, which can in turn be used to load state +into similarly parameterized layers. + +For example, a Dense layer returns a list of two values-- per-output +weights and the bias value. These can be used to set the weights of another +Dense layer: + +>>> a = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(1.)) +>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]])) +>>> a.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] +>>> b = tf.keras.layers.Dense(1, +... kernel_initializer=tf.constant_initializer(2.)) +>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]])) +>>> b.get_weights() +[array([[2.], + [2.], + [2.]], dtype=float32), array([0.], dtype=float32)] +>>> b.set_weights(a.get_weights()) +>>> b.get_weights() +[array([[1.], + [1.], + [1.]], dtype=float32), array([0.], dtype=float32)] + +Returns: + Weights values as a list of numpy arrays." +5586,get_updates_for,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1363,method,"Retrieves updates relevant to a specific set of inputs. + +Arguments: + inputs: Input tensor or list/tuple of input tensors. + +Returns: + List of update ops of the layer that depend on `inputs`." +5587,get_losses_for,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1382,method,"Retrieves losses relevant to a specific set of inputs. + +Arguments: + inputs: Input tensor or list/tuple of input tensors. + +Returns: + List of loss tensors of the layer that depend on `inputs`." +5588,get_input_mask_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1401,method,"Retrieves the input mask tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A mask tensor + (or list of tensors if the layer has multiple inputs)." +5589,get_output_mask_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1420,method,"Retrieves the output mask tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A mask tensor + (or list of tensors if the layer has multiple outputs)." +5590,input_mask,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1440,method,"Retrieves the input mask tensor(s) of a layer. + +Only applicable if the layer has exactly one inbound node, +i.e. if it is connected to one incoming layer. + +Returns: + Input mask tensor (potentially None) or list of input + mask tensors. + +Raises: + AttributeError: if the layer is connected to + more than one incoming layers." +5591,output_mask,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1461,method,"Retrieves the output mask tensor(s) of a layer. + +Only applicable if the layer has exactly one inbound node, +i.e. if it is connected to one incoming layer. + +Returns: + Output mask tensor (potentially None) or list of output + mask tensors. + +Raises: + AttributeError: if the layer is connected to + more than one incoming layers." +5592,get_input_shape_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1481,method,"Retrieves the input shape(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A shape tuple + (or list of shape tuples if the layer has multiple inputs). + +Raises: + RuntimeError: If called in Eager mode." +5593,get_output_shape_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1500,method,"Retrieves the output shape(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A shape tuple + (or list of shape tuples if the layer has multiple outputs). + +Raises: + RuntimeError: If called in Eager mode." +5594,get_input_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1519,method,"Retrieves the input tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A tensor (or list of tensors if the layer has multiple inputs). + +Raises: + RuntimeError: If called in Eager mode." +5595,get_output_at,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1537,method,"Retrieves the output tensor(s) of a layer at a given node. + +Arguments: + node_index: Integer, index of the node + from which to retrieve the attribute. + E.g. `node_index=0` will correspond to the + first time the layer was called. + +Returns: + A tensor (or list of tensors if the layer has multiple outputs). + +Raises: + RuntimeError: If called in Eager mode." +5596,input,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1556,method,"Retrieves the input tensor(s) of a layer. + +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer. + +Returns: + Input tensor or list of input tensors. + +Raises: + RuntimeError: If called in Eager mode. + AttributeError: If no inbound nodes are found." +5597,output,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1575,method,"Retrieves the output tensor(s) of a layer. + +Only applicable if the layer has exactly one output, +i.e. if it is connected to one incoming layer. + +Returns: + Output tensor or list of output tensors. + +Raises: + AttributeError: if the layer is connected to more than one incoming + layers. + RuntimeError: if called in Eager mode." +5598,input_shape,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1594,method,"Retrieves the input shape(s) of a layer. + +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer, or if all inputs +have the same shape. + +Returns: + Input shape, as an integer shape tuple + (or list of shape tuples, one tuple per input tensor). + +Raises: + AttributeError: if the layer has no defined input_shape. + RuntimeError: if called in Eager mode." +5599,count_params,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1625,method,"Count the total number of scalars composing the weights. + +Returns: + An integer count. + +Raises: + ValueError: if the layer isn't yet built + (in which case its weights aren't yet defined)." +5600,output_shape,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1647,method,"Retrieves the output shape(s) of a layer. + +Only applicable if the layer has one output, +or if all outputs have the same shape. + +Returns: + Output shape, as an integer shape tuple + (or list of shape tuples, one tuple per output tensor). + +Raises: + AttributeError: if the layer has no defined output shape. + RuntimeError: if called in Eager mode." +5601,inbound_nodes,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1679,method,"Deprecated, do NOT use! Only for compatibility with external Keras." +5602,outbound_nodes,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1685,method,"Deprecated, do NOT use! Only for compatibility with external Keras." +5603,apply,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1696,method,"Deprecated, do NOT use! + +This is an alias of `self.__call__`. + +Arguments: + inputs: Input tensor(s). + *args: additional positional arguments to be passed to `self.call`. + **kwargs: additional keyword arguments to be passed to `self.call`. + +Returns: + Output tensor(s)." +5604,add_variable,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1714,method,"Deprecated, do NOT use! Alias for `add_weight`." +5605,variables,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1719,method,"Returns the list of all layer variables/weights. + +Alias of `self.weights`. + +Returns: + A list of variables." +5606,trainable_variables,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1730,method, +5607,non_trainable_variables,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1734,method, +5608,check_type_return_shape,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,598,method, +5609,process_update,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1213,method,"Standardize update ops. + +Arguments: + x: Tensor, op, or callable. + +Returns: + An update op." +5610,getter,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,426,method, +5611,f,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,1806,method,Cast a single Tensor or TensorSpec to the compute dtype. +5612,KerasHistory,tensorflow/tensorflow/python/keras/engine/base_layer_v1.py,2406,class,"Tracks the Layer call that created a Tensor, for Keras Graph Networks. During construction of Keras Graph Networks, this metadata is added to each Tensor produced as the output of a Layer, starting with an @@ -37284,8 +43886,18 @@ Attributes: tensor_index: The output index for this Tensor. Always zero if the Layer that produced this Tensor only has one output. Nested structures of Tensors are deterministically assigned an index via `nest.flatten`." -5414,PreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,49,class,Base class for PreprocessingLayers. -5415,CombinerPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,69,class,"Base class for PreprocessingLayers that do computation using a Combiner. +5613,PreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,49,class,Base class for PreprocessingLayers. +5614,adapt,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,53,method,"Fits the state of the preprocessing layer to the data being passed. + +Arguments: + data: The data to train on. It can be passed either as a tf.data + Dataset, or as a numpy array. + reset_state: Optional argument specifying whether to clear the state of + the layer at the start of the call to `adapt`, or whether to start + from the existing state. This argument may not be relevant to all + preprocessing layers: a subclass of PreprocessingLayer may choose to + throw if 'reset_state' is set to False." +5615,CombinerPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,69,class,"Base class for PreprocessingLayers that do computation using a Combiner. This class provides several helper methods to make creating a PreprocessingLayer easier. It assumes that the core of your computation will @@ -37294,8 +43906,17 @@ PreprocessingLayer allows your layer to be compatible with distributed computation. This class is compatible with Tensorflow 2.0+." -5416,convert_to_list,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,246,function,"Convert a TensorLike, CompositeTensor, or ndarray into a Python list." -5417,Combiner,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,285,class,"Functional object that defines a shardable computation. +5616,adapt,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,136,method,"Fits the state of the preprocessing layer to the data being passed. + +Arguments: + data: The data to train on. It can be passed either as a tf.data Dataset, + or as a numpy array. + reset_state: Optional argument specifying whether to clear the state of + the layer at the start of the call to `adapt`, or whether to start from + the existing state. Subclasses may choose to throw if reset_state is set + to 'False'." +5617,convert_to_list,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,246,function,"Convert a TensorLike, CompositeTensor, or ndarray into a Python list." +5618,Combiner,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,285,class,"Functional object that defines a shardable computation. This object defines functions required to create and manipulate data objects. These data objects, referred to below as 'accumulators', are computation- @@ -37314,12 +43935,94 @@ Combiners (thus sharding the computation N ways) without risking any change to the underlying computation. These accumulator objects are uniquely associated with each Combiner; a Combiner defines what the accumulator object should be and will only work with accumulators of that type." -5418,AddingPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,47,class, -5419,AddingPreprocessingLayerV1,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,119,class, -5420,get_layer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,125,function, -5421,PreprocessingLayerTest,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,133,class, -5422,ConvertToListTest,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,403,class, -5423,CombinerPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_v1.py,26,class,"V1-compatible CombinerPreprocessingLayer. +5619,compute,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,312,method,"Compute a step in this computation, returning a new accumulator. + +This method computes a step of the computation described by this Combiner. +If an accumulator is passed, the data in that accumulator is also used; so +compute(batch_values) results in f(batch_values), while +compute(batch_values, accumulator) results in +merge(f(batch_values), accumulator). + +Args: + batch_values: A list of ndarrays representing the values of the inputs for + this step of the computation. + accumulator: the current accumulator. Can be None. + +Returns: + An accumulator that includes the passed batch of inputs." +5620,merge,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,332,method,"Merge several accumulators to a single accumulator. + +This method takes the partial values in several accumulators and combines +them into a single accumulator. This computation must not be order-specific +(that is, merge([a, b]) must return the same result as merge([b, a]). + +Args: + accumulators: the accumulators to merge, as a list. + +Returns: + A merged accumulator." +5621,extract,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,348,method,"Convert an accumulator into a dict of output values. + +Args: + accumulator: The accumulator to convert. + +Returns: + A dict of ndarrays representing the data in this accumulator." +5622,restore,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,360,method,"Create an accumulator based on 'output'. + +This method creates a new accumulator with identical internal state to the +one used to create the data in 'output'. This means that if you do + +output_data = combiner.extract(accumulator_1) +accumulator_2 = combiner.restore(output_data) + +then accumulator_1 and accumulator_2 will have identical internal state, and +computations using either of them will be equivalent. + +Args: + output: The data output from a previous computation. Should be in the same + form as provided by 'extract_output'. + +Returns: + A new accumulator." +5623,serialize,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,382,method,"Serialize an accumulator for a remote call. + +This function serializes an accumulator to be sent to a remote process. + +Args: + accumulator: The accumulator to serialize. + +Returns: + A byte string representing the passed accumulator." +5624,deserialize,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer.py,396,method,"Deserialize an accumulator received from 'serialize()'. + +This function deserializes an accumulator serialized by 'serialize()'. + +Args: + encoded_accumulator: A byte string representing an accumulator. + +Returns: + The accumulator represented by the passed byte_string." +5625,AddingPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,47,class, +5626,build,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,55,method, +5627,set_total,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,63,method,"This is an example of how a subclass would implement a direct setter. + +These methods should generally just create a dict mapping the correct names +to the relevant passed values, and call self._set_state_variables() with the +dict of data. + +Args: + sum_value: The total to set." +5628,call,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,75,method, +5629,compute,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,81,method,"Compute a step in this computation, returning a new accumulator." +5630,merge,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,89,method,Merge several accumulators to a single accumulator. +5631,extract,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,97,method,Convert an accumulator into a dict of output values. +5632,restore,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,103,method,Create an accumulator based on 'output'. +5633,serialize,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,110,method,Serialize an accumulator for a remote call. +5634,deserialize,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,114,method,Deserialize an accumulator received from 'serialize()'. +5635,AddingPreprocessingLayerV1,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,119,class, +5636,get_layer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_test.py,125,function, +5637,CombinerPreprocessingLayer,tensorflow/tensorflow/python/keras/engine/base_preprocessing_layer_v1.py,26,class,"V1-compatible CombinerPreprocessingLayer. This class overrides several methods of the CombinerPreprocessingLayer to make it compatible with V1 execution. End users should not need to worry about @@ -37338,34 +44041,18 @@ Note that the same classname is required for serialization purposes. This is only necessary for internal classes, since any class that inherits from tf.keras.[...].CombinerPreprocessingLayer will get the right symbol." -5424,Container,tensorflow/tensorflow/python/keras/engine/compile_utils.py,33,class,Base Container class. -5425,LossesContainer,tensorflow/tensorflow/python/keras/engine/compile_utils.py,106,class,A container class for losses passed to `Model.compile`. -5426,MetricsContainer,tensorflow/tensorflow/python/keras/engine/compile_utils.py,276,class,A container class for metrics passed to `Model.compile`. -5427,create_pseudo_output_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,493,function,Create pseudo output names for a subclassed Model. -5428,create_pseudo_input_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,498,function,Create pseudo input names for a subclassed Model. -5429,_create_pseudo_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,503,function,"Creates pseudo {input | output} names for subclassed Models. - -Warning: this function should only be used to define default -names for `Metics` and `SavedModel`. No other use cases should -rely on a `Model`'s input or output names. - -Example with dict: - -`{'a': [x1, x2], 'b': x3}` becomes: -`['a_1', 'a_2', 'b']` - -Example with list: - -`[x, y]` becomes: -`['output_1', 'output_2']` - -Arguments: - tensors: `Model`'s outputs or inputs. - prefix: 'output_' for outputs, 'input_' for inputs. - -Returns: - Flattened list of pseudo names." -5430,map_to_output_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,548,function,"Maps a dict to a list using `output_names` as keys. +5638,Container,tensorflow/tensorflow/python/keras/engine/compile_utils.py,33,class,Base Container class. +5639,build,tensorflow/tensorflow/python/keras/engine/compile_utils.py,39,method, +5640,LossesContainer,tensorflow/tensorflow/python/keras/engine/compile_utils.py,106,class,A container class for losses passed to `Model.compile`. +5641,metrics,tensorflow/tensorflow/python/keras/engine/compile_utils.py,123,method,Per-output loss metrics. +5642,build,tensorflow/tensorflow/python/keras/engine/compile_utils.py,133,method,One-time setup of loss objects. +5643,MetricsContainer,tensorflow/tensorflow/python/keras/engine/compile_utils.py,276,class,A container class for metrics passed to `Model.compile`. +5644,metrics,tensorflow/tensorflow/python/keras/engine/compile_utils.py,291,method,Metrics created by this container. +5645,build,tensorflow/tensorflow/python/keras/engine/compile_utils.py,297,method,One-time setup of metric objects. +5646,update_state,tensorflow/tensorflow/python/keras/engine/compile_utils.py,381,method,Updates the state of per-output metrics. +5647,create_pseudo_output_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,493,function,Create pseudo output names for a subclassed Model. +5648,create_pseudo_input_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,498,function,Create pseudo input names for a subclassed Model. +5649,map_to_output_names,tensorflow/tensorflow/python/keras/engine/compile_utils.py,548,function,"Maps a dict to a list using `output_names` as keys. This is a convenience feature only. When a `Model`'s outputs are a list, you can specify per-output losses and metrics as @@ -37390,24 +44077,26 @@ Arguments: Returns: `struct` mapped to a list in same order as `output_names`." -5431,map_missing_dict_keys,tensorflow/tensorflow/python/keras/engine/compile_utils.py,595,function,Replaces missing dict keys in `struct` with `None` placeholders. -5432,match_dtype_and_rank,tensorflow/tensorflow/python/keras/engine/compile_utils.py,605,function,Match dtype and rank of predictions. -5433,get_mask,tensorflow/tensorflow/python/keras/engine/compile_utils.py,625,function,Returns Keras mask from tensor. -5434,apply_mask,tensorflow/tensorflow/python/keras/engine/compile_utils.py,630,function,Applies any mask on predictions to sample weights. -5435,LossesContainerTest,tensorflow/tensorflow/python/keras/engine/compile_utils_test.py,35,class, -5436,MetricsContainerTest,tensorflow/tensorflow/python/keras/engine/compile_utils_test.py,342,class, -5437,ControlFlowLayer1,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,37,class,Layer with an `if` condition in call. -5438,ControlFlowLayer2,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,47,class,Layer with a `for` loop in call. -5439,NestedControlFlowLayer,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,60,class,Layer nested with a control flow layer. -5440,ControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,71,class,Model with an `if` condition in call. -5441,NestedControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,81,class,Model with an `if` condition in call using a control flow layer. -5442,FunctionControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,96,class,Model with control flow where `call` is wrapped in function already. -5443,AutographWrapperTest,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,108,class, -5444,MultiInputSubclassed,tensorflow/tensorflow/python/keras/engine/correctness_test.py,30,class,Subclassed Model that adds its inputs and then adds a bias. -5445,multi_input_functional,tensorflow/tensorflow/python/keras/engine/correctness_test.py,43,function,Functional Model that adds its inputs and then adds a bias. -5446,SimpleBiasTest,tensorflow/tensorflow/python/keras/engine/correctness_test.py,55,class, -5447,MultipleInputTest,tensorflow/tensorflow/python/keras/engine/correctness_test.py,91,class, -5448,DataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,73,class,"Base class for input data adapter. +5650,map_missing_dict_keys,tensorflow/tensorflow/python/keras/engine/compile_utils.py,595,function,Replaces missing dict keys in `struct` with `None` placeholders. +5651,match_dtype_and_rank,tensorflow/tensorflow/python/keras/engine/compile_utils.py,605,function,Match dtype and rank of predictions. +5652,get_mask,tensorflow/tensorflow/python/keras/engine/compile_utils.py,625,function,Returns Keras mask from tensor. +5653,apply_mask,tensorflow/tensorflow/python/keras/engine/compile_utils.py,630,function,Applies any mask on predictions to sample weights. +5654,ControlFlowLayer1,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,37,class,Layer with an `if` condition in call. +5655,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,40,method, +5656,ControlFlowLayer2,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,47,class,Layer with a `for` loop in call. +5657,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,50,method, +5658,NestedControlFlowLayer,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,60,class,Layer nested with a control flow layer. +5659,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,67,method, +5660,ControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,71,class,Model with an `if` condition in call. +5661,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,74,method, +5662,NestedControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,81,class,Model with an `if` condition in call using a control flow layer. +5663,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,88,method, +5664,FunctionControlFlowModel,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,96,class,Model with control flow where `call` is wrapped in function already. +5665,call,tensorflow/tensorflow/python/keras/engine/control_flow_test.py,100,method, +5666,MultiInputSubclassed,tensorflow/tensorflow/python/keras/engine/correctness_test.py,30,class,Subclassed Model that adds its inputs and then adds a bias. +5667,call,tensorflow/tensorflow/python/keras/engine/correctness_test.py,38,method, +5668,multi_input_functional,tensorflow/tensorflow/python/keras/engine/correctness_test.py,43,function,Functional Model that adds its inputs and then adds a bias. +5669,DataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,73,class,"Base class for input data adapter. In TF 2.0, tf.data is the preferred API for user to feed in data. In order to simplify the training code path, all the input data object will be @@ -37431,8 +44120,102 @@ dataset = applicable_adapters[0](x).get_dataset() for data in dataset: # training ```" -5449,TensorLikeDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,232,class,"Adapter that handles Tensor-like objects, e.g. EagerTensor and NumPy." -5450,GenericArrayLikeDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,423,class,"Adapter that handles array-like data without forcing it into memory. +5670,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,101,method,"Whether the current DataAdapter could handle the input x and y. + +Structure wise, x and y can be single object, or list of objects if there +multiple input/output, or dictionary of objects when the intput/output are +named. + +Args: + x: input features. + y: target labels. Note that y could be None in the case of prediction. + +Returns: + boolean" +5671,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,144,method,"Get a dataset instance for the current DataAdapter. + +Note that the dataset returned does not repeat for epoch, so caller might +need to create new iterator for the same dataset at the beginning of the +epoch. This behavior might change in future. + +Returns: + An tf.dataset.Dataset. Caller might use the dataset in different + context, eg iter(dataset) in eager to get the value directly, or in graph + mode, provide the iterator tensor to Keras model function." +5672,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,159,method,"Return the size (number of batches) for the dataset created. + +For certain type of the data input, the number of batches is known, eg for +Numpy data, the size is same as (number_of_element / batch_size). Whereas +for dataset or python generator, the size is unknown since it may or may not +have a end state. + +Returns: + int, the number of batches for the dataset, or None if it is unknown. The + caller could use this to control the loop of training, show progress bar, + or handle unexpected StopIteration error." +5673,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,175,method,"Return the batch size of the dataset created. + +For certain type of the data input, the batch size is known, and even +required, like numpy array. Where as for dataset, the batch is unknown +unless we take a peek. + +Returns: + int, the batch size of the dataset, or None if it is unknown." +5674,representative_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,187,method,"Return a representative size for batches in the dataset. + +This is not guaranteed to be the batch size for all batches in the +dataset. It just needs to be a rough approximation for batch sizes in +the dataset. + +Returns: + int, a representative size for batches found in the dataset, + or None if it is unknown." +5675,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,201,method,Whether the dataset has partial batch at the end. +5676,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,206,method,"The size of the final partial batch for dataset. + +Will return None if has_partial_batch is False or batch_size is None." +5677,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,214,method,Returns whether a new iterator should be created every epoch. +5678,get_samples,tensorflow/tensorflow/python/keras/engine/data_adapter.py,218,method,"Returns number of samples in the data, or `None`." +5679,on_epoch_end,tensorflow/tensorflow/python/keras/engine/data_adapter.py,227,method,A hook called after each epoch. +5680,TensorLikeDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,232,class,"Adapter that handles Tensor-like objects, e.g. EagerTensor and NumPy." +5681,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,236,method, +5682,slice_inputs,tensorflow/tensorflow/python/keras/engine/data_adapter.py,366,method,"Slice inputs into a Dataset of batches. + +Given a Dataset of batch indices and the unsliced inputs, +this step slices the inputs in a parallelized fashion +and produces a dataset of input batches. + +Args: + indices_dataset: A Dataset of batched indices + inputs: A python data structure that contains the inputs, targets, + and possibly sample weights. + +Returns: + A Dataset of input batches matching the batch indices." +5683,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,403,method, +5684,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,406,method, +5685,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,409,method, +5686,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,412,method, +5687,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,415,method, +5688,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,418,method, +5689,permutation,tensorflow/tensorflow/python/keras/engine/data_adapter.py,308,method, +5690,slice_batch_indices,tensorflow/tensorflow/python/keras/engine/data_adapter.py,323,method,"Convert a Tensor of indices into a dataset of batched indices. + +This step can be accomplished in several ways. The most natural is to +slice the Tensor in a Dataset map. (With a condition on the upper index to +handle the partial batch.) However it turns out that coercing the Tensor +into a shape which is divisible by the batch size (and handling the last +partial batch separately) allows for a much more favorable memory access +pattern and improved performance. + +Args: + indices: Tensor which determines the data order for an entire epoch. + +Returns: + A Dataset of batched indices." +5691,grab_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,386,method, +5692,shuffle_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,360,method, +5693,GenericArrayLikeDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,423,class,"Adapter that handles array-like data without forcing it into memory. As an example, this adapter handles `keras.utils.HDF5Matrix` which holds datasets that may be too big to fully fit into memory. @@ -37447,43 +44230,87 @@ handled by the CompositeTensorDataAdapter. It also does not handle lists/tuples of scalars, because those are handled by the ListsOfScalarsDataAdapter." -5451,CompositeTensorDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,519,class,Adapter that handles composite tensor. -5452,ListsOfScalarsDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,607,class,Adapter that handles lists of scalars and lists of lists of scalars. -5453,DatasetAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,671,class,Adapter that handles `tf.data.Dataset`. -5454,GeneratorDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,746,class,Adapter that handles python generators and iterators. -5455,KerasSequenceAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,874,class,Adapter that handles `keras.utils.Sequence`. -5456,select_data_adapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,956,function,Selects a data adapter than can handle a given x and y. -5457,_type_name,tensorflow/tensorflow/python/keras/engine/data_adapter.py,974,function,Generates a description of the type of an object. -5458,_process_tensorlike,tensorflow/tensorflow/python/keras/engine/data_adapter.py,988,function,"Process tensor-like inputs. +5694,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,442,method, +5695,slice_inputs,tensorflow/tensorflow/python/keras/engine/data_adapter.py,471,method,"Slice inputs into a Dataset of batches. -This function: - -(1) Converts `Numpy` arrays to `Tensor`s. -(2) Converts `Scipy` sparse matrices to `SparseTensor`s. -(2) Converts `list`s to `tuple`s (for `tf.data` support). +Given a Dataset of batch indices and the unsliced inputs, +this step slices the inputs in a parallelized fashion +and produces a dataset of input batches. Args: - inputs: Structure of `Tensor`s, `NumPy` arrays, or tensor-like. + indices_dataset: A Dataset of batched indices + inputs: A python data structure that contains the inputs, targets, + and possibly sample weights. Returns: - Structure of `Tensor`s or tensor-like." -5459,is_none_or_empty,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1018,function, -5460,broadcast_sample_weight_modes,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1027,function,Match sample_weight_modes structure with output structure. -5461,DataHandler,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1063,class,Handles iterating over epoch-level `tf.data.Iterator` objects. -5462,_make_class_weight_map_fn,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1274,function,"Applies class weighting to a `Dataset`. + A Dataset of input batches matching the batch indices." +5696,dynamic_shape_like,tensorflow/tensorflow/python/keras/engine/data_adapter.py,487,method, +5697,grab_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,497,method,Grab a batch of data from the inputs. +5698,py_method,tensorflow/tensorflow/python/keras/engine/data_adapter.py,502,method, +5699,slice_array,tensorflow/tensorflow/python/keras/engine/data_adapter.py,503,method, +5700,CompositeTensorDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,519,class,Adapter that handles composite tensor. +5701,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,523,method, +5702,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,588,method, +5703,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,591,method, +5704,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,594,method, +5705,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,597,method, +5706,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,600,method, +5707,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,603,method, +5708,ListsOfScalarsDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,607,class,Adapter that handles lists of scalars and lists of lists of scalars. +5709,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,611,method, +5710,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,652,method, +5711,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,655,method, +5712,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,658,method, +5713,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,661,method, +5714,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,664,method, +5715,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,667,method, +5716,DatasetAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,671,class,Adapter that handles `tf.data.Dataset`. +5717,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,675,method, +5718,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,695,method, +5719,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,698,method, +5720,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,701,method, +5721,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,704,method, +5722,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,707,method, +5723,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,710,method, +5724,GeneratorDataAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,746,class,Adapter that handles python generators and iterators. +5725,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,750,method, +5726,get_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,852,method, +5727,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,855,method, +5728,batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,858,method, +5729,representative_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,861,method, +5730,has_partial_batch,tensorflow/tensorflow/python/keras/engine/data_adapter.py,864,method, +5731,partial_batch_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,867,method, +5732,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,870,method, +5733,wrapped_generator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,806,method, +5734,generator_fn,tensorflow/tensorflow/python/keras/engine/data_adapter.py,843,method, +5735,KerasSequenceAdapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,874,class,Adapter that handles `keras.utils.Sequence`. +5736,can_handle,tensorflow/tensorflow/python/keras/engine/data_adapter.py,878,method, +5737,get_size,tensorflow/tensorflow/python/keras/engine/data_adapter.py,937,method, +5738,should_recreate_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,940,method, +5739,on_epoch_end,tensorflow/tensorflow/python/keras/engine/data_adapter.py,943,method, +5740,generator_fn,tensorflow/tensorflow/python/keras/engine/data_adapter.py,918,method, +5741,generator_fn,tensorflow/tensorflow/python/keras/engine/data_adapter.py,925,method, +5742,select_data_adapter,tensorflow/tensorflow/python/keras/engine/data_adapter.py,956,function,Selects a data adapter than can handle a given x and y. +5743,is_none_or_empty,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1018,function, +5744,broadcast_sample_weight_modes,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1027,function,Match sample_weight_modes structure with output structure. +5745,DataHandler,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1063,class,Handles iterating over epoch-level `tf.data.Iterator` objects. +5746,enumerate_epochs,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1128,method,"Yields `(epoch, tf.data.Iterator)`." +5747,catch_stop_iteration,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1158,method,Catches errors when an iterator runs out of data. +5748,steps,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1177,method,Yields steps for the current epoch. +5749,step_increment,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1206,method,The number to increment the step for `on_batch_end` methods. +5750,inferred_steps,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1211,method,"The inferred steps per epoch of the created `Dataset`. -The `Dataset` is assumed to be in format `(x, y)` or `(x, y, sw)`, where -`y` must be a single `Tensor`. +This will be `None` in the case where: -Arguments: - class_weight: A map where the keys are integer class ids and values are - the class weights, e.g. `{0: 0.2, 1: 0.6, 2: 0.3}` +(1) A `Dataset` of unknown cardinality was passed to the `DataHandler`, and +(2) `steps_per_epoch` was not provided, and +(3) The first epoch of iteration has not yet completed. Returns: - A function that can be used with `tf.data.Dataset.map` to apply class - weighting." -5463,expand_1d,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1330,function,Expands 1-dimensional `Tensor`s into 2-dimensional `Tensor`s. -5464,train_validation_split,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1343,function,"Split arrays into train and validation subsets in deterministic order. + The inferred steps per epoch of the created `Dataset`." +5751,should_sync,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1226,method, +5752,expand_1d,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1330,function,Expands 1-dimensional `Tensor`s into 2-dimensional `Tensor`s. +5753,train_validation_split,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1343,function,"Split arrays into train and validation subsets in deterministic order. The last part of data will become validation data. @@ -37495,7 +44322,7 @@ Arguments: in the training split. Returns: `(train_arrays, validation_arrays)`" -5465,unpack_x_y_sample_weight,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1406,function,"Unpacks user-provided data tuple. +5754,unpack_x_y_sample_weight,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1406,function,"Unpacks user-provided data tuple. This is a convenience utility to be used when overriding `Model.train_step`, `Model.test_step`, or `Model.predict_step`. @@ -37540,7 +44367,7 @@ Arguments: Returns: The unpacked tuple, with `None`s for `y` and `sample_weight` if they are not provided." -5466,pack_x_y_sample_weight,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1468,function,"Packs user-provided data into a tuple. +5755,pack_x_y_sample_weight,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1468,function,"Packs user-provided data into a tuple. This is a convenience utility for packing data into the tuple formats that `Model.fit` uses. @@ -37564,29 +44391,13 @@ Arguments: Returns: Tuple in the format used in `Model.fit`." -5467,single_batch_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1509,function,Creates a single-batch dataset. -5468,_check_data_cardinality,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1531,function, -5469,_scipy_sparse_to_sparse_tensor,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1542,function,Converts a SciPy sparse matrix to a SparseTensor. -5470,_is_distributed_dataset,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1554,function, -5471,DummyArrayLike,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,44,class,Dummy array-like object. -5472,fail_on_convert,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,65,function, -5473,DataAdapterTestBase,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,72,class, -5474,TestSequence,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,98,class, -5475,TensorLikeDataAdapterTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,112,class, -5476,GenericArrayLikeDataAdapterTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,385,class, -5477,DatasetAdapterTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,616,class, -5478,GeneratorDataAdapterTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,659,class, -5479,KerasSequenceAdapterTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,726,class, -5480,DataHandlerTest,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,782,class, -5481,TestValidationSplit,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,1001,class, -5482,TestUtils,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,1055,class, -5483,TestDeferredSequential,tensorflow/tensorflow/python/keras/engine/deferred_sequential_test.py,38,class, -5484,get_model,tensorflow/tensorflow/python/keras/engine/deferred_sequential_test.py,206,function, -5485,TestDNNModel,tensorflow/tensorflow/python/keras/engine/feature_columns_integration_test.py,33,class, -5486,FeatureColumnsIntegrationTest,tensorflow/tensorflow/python/keras/engine/feature_columns_integration_test.py,46,class,"Most Sequential model API tests are covered in `training_test.py`. - - " -5487,Functional,tensorflow/tensorflow/python/keras/engine/functional.py,52,class,"A `Functional` model is a `Model` defined as a directed graph of layers. +5756,single_batch_iterator,tensorflow/tensorflow/python/keras/engine/data_adapter.py,1509,function,Creates a single-batch dataset. +5757,DummyArrayLike,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,44,class,Dummy array-like object. +5758,shape,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,57,method, +5759,dtype,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,61,method, +5760,fail_on_convert,tensorflow/tensorflow/python/keras/engine/data_adapter_test.py,65,function, +5761,get_model,tensorflow/tensorflow/python/keras/engine/deferred_sequential_test.py,206,function, +5762,Functional,tensorflow/tensorflow/python/keras/engine/functional.py,52,class,"A `Functional` model is a `Model` defined as a directed graph of layers. Three types of `Model` exist: subclassed `Model`, `Functional` model, and `Sequential` (a special case of `Functional`). @@ -37630,54 +44441,88 @@ Arguments: outputs: List of outputs tensors. name: String, optional. Name of the model. trainable: Boolean, whether the model's variables should be trainable." -5488,_make_node_key,tensorflow/tensorflow/python/keras/engine/functional.py,817,function, -5489,_map_graph_network,tensorflow/tensorflow/python/keras/engine/functional.py,821,function,"Validates a network's topology and gather its layers and nodes. +5763,input,tensorflow/tensorflow/python/keras/engine/functional.py,218,method,"Retrieves the input tensor(s) of a layer. -Arguments: - inputs: List of input tensors. - outputs: List of outputs tensors. +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer. Returns: - A tuple `(nodes, nodes_by_depth, layers, layers_by_depth)`. - - nodes: list of Node instances. - - nodes_by_depth: dict mapping ints (depth) to lists of node instances. - - layers: list of Layer instances. - - layers_by_depth: dict mapping ints (depth) to lists of layer instances. + Input tensor or list of input tensors. Raises: - ValueError: In case the network is not valid (e.g. disconnected graph)." -5490,_build_map,tensorflow/tensorflow/python/keras/engine/functional.py,943,function,"This method topologically sorts nodes in order from inputs to outputs. + RuntimeError: If called in Eager mode. + AttributeError: If no inbound nodes are found." +5764,input_shape,tensorflow/tensorflow/python/keras/engine/functional.py,234,method,"Retrieves the input shape(s) of a layer. -It uses a depth-first search to topologically sort nodes that appear in the -_keras_history connectivity metadata of `outputs`. - -Args: - outputs: the output tensors whose _keras_history metadata should be walked. - This may be an arbitrary nested structure. +Only applicable if the layer has exactly one input, +i.e. if it is connected to one incoming layer, or if all inputs +have the same shape. Returns: - A tuple like (ordered_nodes, layer_to_first_traversal_index) - ordered_nodes: list of nodes appearing in the keras history, topologically - sorted from original inputs to the `outputs`. - (If outputs have different sets of ancestors, the inputs to one output - may appear after a different output). - layer_to_first_traversal_index: - A dict mapping layer to the traversal index in the DFS where it is - seen. Note: if a layer is shared by several nodes, the dict will only - store the index corresponding to the *first* time the layer seen." -5491,_build_map_helper,tensorflow/tensorflow/python/keras/engine/functional.py,974,function,Recursive helper for `_build_map`. -5492,_map_subgraph_network,tensorflow/tensorflow/python/keras/engine/functional.py,1005,function,"Returns the nodes and layers in the topology from `inputs` to `outputs`. + Input shape, as an integer shape tuple + (or list of shape tuples, one tuple per input tensor). -Args: - inputs: List of input tensors. - outputs: List of output tensors. +Raises: + AttributeError: if the layer has no defined input_shape. + RuntimeError: if called in Eager mode." +5765,output,tensorflow/tensorflow/python/keras/engine/functional.py,252,method,"Retrieves the output tensor(s) of a layer. + +Only applicable if the layer has exactly one output, +i.e. if it is connected to one incoming layer. Returns: - A tuple of List{Node] and List[Layer]." -5493,_should_skip_first_node,tensorflow/tensorflow/python/keras/engine/functional.py,1022,function,Returns True if the first layer node should not be saved or loaded. -5494,_deserialize_keras_tensors,tensorflow/tensorflow/python/keras/engine/functional.py,1032,function,Deserializes Keras Tensors passed to `call`.. -5495,connect_ancillary_layers,tensorflow/tensorflow/python/keras/engine/functional.py,1052,function,Adds layers that are not connected to the outputs to the model. -5496,reconstruct_from_config,tensorflow/tensorflow/python/keras/engine/functional.py,1068,function,"Reconstructs graph from config object. + Output tensor or list of output tensors. + +Raises: + AttributeError: if the layer is connected to more than one incoming + layers. + RuntimeError: if called in Eager mode." +5766,output_shape,tensorflow/tensorflow/python/keras/engine/functional.py,269,method,"Retrieves the output shape(s) of a layer. + +Only applicable if the layer has one output, +or if all outputs have the same shape. + +Returns: + Output shape, as an integer shape tuple + (or list of shape tuples, one tuple per output tensor). + +Raises: + AttributeError: if the layer has no defined output shape. + RuntimeError: if called in Eager mode." +5767,compute_mask,tensorflow/tensorflow/python/keras/engine/functional.py,355,method, +5768,call,tensorflow/tensorflow/python/keras/engine/functional.py,363,method,"Calls the model on new inputs. + +In this case `call` just reapplies +all ops in the graph to the new inputs +(e.g. build a new computational graph from the provided inputs). + +Arguments: + inputs: A tensor or list of tensors. + training: Boolean or boolean scalar tensor, indicating whether to run + the `Network` in training mode or inference mode. + mask: A mask or list of masks. A mask can be + either a tensor or None (no mask). + +Returns: + A tensor if there is a single output, or + a list of tensors if there are more than one outputs." +5769,compute_output_shape,tensorflow/tensorflow/python/keras/engine/functional.py,384,method, +5770,get_config,tensorflow/tensorflow/python/keras/engine/functional.py,593,method, +5771,from_config,tensorflow/tensorflow/python/keras/engine/functional.py,597,method,"Instantiates a Model from its config (output of `get_config()`). + +Arguments: + config: Model config dictionary. + custom_objects: Optional dictionary mapping names + (strings) to custom classes or functions to be + considered during deserialization. + +Returns: + A model instance. + +Raises: + ValueError: In case of improperly formatted config dict." +5772,connect_ancillary_layers,tensorflow/tensorflow/python/keras/engine/functional.py,1052,function,Adds layers that are not connected to the outputs to the model. +5773,reconstruct_from_config,tensorflow/tensorflow/python/keras/engine/functional.py,1068,function,"Reconstructs graph from config object. Args: config: Dictionary returned from Network.get_config() @@ -37690,7 +44535,7 @@ Args: Returns: Tuple of (input tensors, output tensors, dictionary of created layers)" -5497,get_network_config,tensorflow/tensorflow/python/keras/engine/functional.py,1242,function,"Builds the config, which consists of the node graph and serialized layers. +5774,get_network_config,tensorflow/tensorflow/python/keras/engine/functional.py,1242,function,"Builds the config, which consists of the node graph and serialized layers. Args: network: A Network object. @@ -37698,20 +44543,12 @@ Args: Returns: Config dictionary." -5498,NetworkConstructionTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,61,class, -5499,DeferredModeTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,1430,class, -5500,DefaultShapeInferenceBehaviorTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,1481,class, -5501,GraphUtilsTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,1755,class, -5502,NestedNetworkTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,1782,class, -5503,AddLossTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,1918,class, -5504,WeightAccessTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,2009,class, -5505,DTypeTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,2073,class, -5506,AttrTrackingLayer,tensorflow/tensorflow/python/keras/engine/functional_test.py,2103,class,"Count how many times `dynamic` and `stateful` are called. +5775,AttrTrackingLayer,tensorflow/tensorflow/python/keras/engine/functional_test.py,2103,class,"Count how many times `dynamic` and `stateful` are called. These counts are used to test that the attribute cache behaves as expected." -5507,CacheCorrectnessTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,2125,class, -5508,InputsOutputsErrorTest,tensorflow/tensorflow/python/keras/engine/functional_test.py,2325,class, -5509,InputLayer,tensorflow/tensorflow/python/keras/engine/input_layer.py,37,class,"Layer to be used as an entry point into a Network (a graph of layers). +5776,stateful,tensorflow/tensorflow/python/keras/engine/functional_test.py,2114,method, +5777,dynamic,tensorflow/tensorflow/python/keras/engine/functional_test.py,2119,method, +5778,InputLayer,tensorflow/tensorflow/python/keras/engine/input_layer.py,37,class,"Layer to be used as an entry point into a Network (a graph of layers). It can either wrap an existing tensor (pass an `input_tensor` argument) or create a placeholder tensor (pass arguments `input_shape`, and @@ -37762,7 +44599,8 @@ Arguments: [this guide](https://www.tensorflow.org/guide/ragged_tensors). Default to False. name: Optional name of the layer (string)." -5510,Input,tensorflow/tensorflow/python/keras/engine/input_layer.py,211,function,"`Input()` is used to instantiate a Keras tensor. +5779,get_config,tensorflow/tensorflow/python/keras/engine/input_layer.py,195,method, +5780,Input,tensorflow/tensorflow/python/keras/engine/input_layer.py,211,function,"`Input()` is used to instantiate a Keras tensor. A Keras tensor is a TensorFlow symbolic tensor object, which we augment with certain attributes that allow us to build a Keras model @@ -37826,7 +44664,7 @@ Raises: provided. ValueError: If both `shape` and `tensor` are None. ValueError: if any unrecognized parameters are provided." -5511,InputSpec,tensorflow/tensorflow/python/keras/engine/input_spec.py,34,class,"Specifies the rank, dtype and shape of every input to a layer. +5781,InputSpec,tensorflow/tensorflow/python/keras/engine/input_spec.py,34,class,"Specifies the rank, dtype and shape of every input to a layer. Layers can expose (if appropriate) an `input_spec` attribute: an instance of `InputSpec`, or a nested structure of `InputSpec` instances @@ -37846,7 +44684,9 @@ Arguments: min_ndim: Integer, minimum rank of the input. axes: Dictionary mapping integer axes to a specific dimension value." -5512,to_tensor_shape,tensorflow/tensorflow/python/keras/engine/input_spec.py,109,function,"Returns a tf.TensorShape object that matches the shape specifications. +5782,get_config,tensorflow/tensorflow/python/keras/engine/input_spec.py,95,method, +5783,from_config,tensorflow/tensorflow/python/keras/engine/input_spec.py,105,method, +5784,to_tensor_shape,tensorflow/tensorflow/python/keras/engine/input_spec.py,109,function,"Returns a tf.TensorShape object that matches the shape specifications. If the InputSpec's shape or ndim is defined, this method will return a fully or partially-known shape. Otherwise, the returned TensorShape is None. @@ -37856,7 +44696,7 @@ Args: Returns: a tf.TensorShape object" -5513,assert_input_compatibility,tensorflow/tensorflow/python/keras/engine/input_spec.py,132,function,"Checks compatibility between the layer and provided inputs. +5785,assert_input_compatibility,tensorflow/tensorflow/python/keras/engine/input_spec.py,132,function,"Checks compatibility between the layer and provided inputs. This checks that the tensor(s) `inputs` verify the input assumptions of a layer (if any). If not, a clear and actional exception gets raised. @@ -37871,13 +44711,11 @@ Arguments: Raises: ValueError: in case of mismatch between the provided inputs and the expectations of the layer." -5514,to_tensor_spec,tensorflow/tensorflow/python/keras/engine/input_spec.py,237,function,Converts a Keras InputSpec object to a TensorSpec. -5515,InputSpecTest,tensorflow/tensorflow/python/keras/engine/input_spec_test.py,25,class, -5516,InputSpecToTensorShapeTest,tensorflow/tensorflow/python/keras/engine/input_spec_test.py,35,class, -5517,enable_keras_tensors,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,36,function,Enable using KerasTensors in Keras's functional API. -5518,disable_keras_tensors,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,42,function,Disable using KerasTensors in Keras's functional API. -5519,keras_tensors_enabled,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,48,function,Return a bool specifying if KerasTensors are enabled. -5520,KerasTensor,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,53,class,"A representation of a Keras in/output during Functional API construction. +5786,to_tensor_spec,tensorflow/tensorflow/python/keras/engine/input_spec.py,237,function,Converts a Keras InputSpec object to a TensorSpec. +5787,enable_keras_tensors,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,36,function,Enable using KerasTensors in Keras's functional API. +5788,disable_keras_tensors,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,42,function,Disable using KerasTensors in Keras's functional API. +5789,keras_tensors_enabled,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,48,function,Return a bool specifying if KerasTensors are enabled. +5790,KerasTensor,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,53,class,"A representation of a Keras in/output during Functional API construction. `KerasTensor`s are tensor-like objects that represent the symbolic inputs and outputs of Keras layers during Functional model construction. They are @@ -37954,12 +44792,27 @@ Args: name: (optional) string name for this KerasTensor. Names automatically generated by symbolic layer `__call__`s are not guaranteed to be unique, and are subject to implementation details." -5521,_KerasTensorIterator,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,341,class,Iterates over the leading dim of a KerasTensor. Performs 0 error checks. -5522,keras_tensor_to_placeholder,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,362,function,Construct a graph placeholder to represent a KerasTensor when tracing. -5523,UserRegisteredSpec,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,413,class,TypeSpec to represent user-registered symbolic objects. -5524,keras_tensor_from_tensor,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,437,function,Convert a traced (composite)tensor to a representative KerasTensor. -5525,KerasTensorTest,tensorflow/tensorflow/python/keras/engine/keras_tensor_test.py,33,class, -5526,Node,tensorflow/tensorflow/python/keras/engine/node.py,38,class,"A `Node` describes the connectivity between two layers. +5791,type_spec,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,143,method,Returns the `tf.TypeSpec` symbolically inferred for this Keras output. +5792,shape,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,148,method,Returns the `TensorShape` symbolically inferred for this Keras output. +5793,get_shape,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,156,method, +5794,op,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,170,method, +5795,is_tensor_like,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,204,method, +5796,set_shape,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,207,method,Updates the shape of this KerasTensor. Mimics `tf.Tensor.set_shape()`. +5797,dtype,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,269,method,Returns the `dtype` symbolically inferred for this Keras output. +5798,ref,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,277,method,"Returns a hashable reference object to this KerasTensor. + +The primary use case for this API is to put KerasTensors in a +set/dictionary. We can't put tensors in a set/dictionary as +`tensor.__hash__()` is not available and tensor equality (`==`) is supposed +to produce a tensor representing if the two inputs are equal. + +See the documentation of `tf.Tensor.ref()` for more info." +5799,name,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,304,method,"Returns the (non-unique, optional) name of this symbolic Keras value." +5800,keras_tensor_to_placeholder,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,362,function,Construct a graph placeholder to represent a KerasTensor when tracing. +5801,UserRegisteredSpec,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,413,class,TypeSpec to represent user-registered symbolic objects. +5802,value_type,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,433,method, +5803,keras_tensor_from_tensor,tensorflow/tensorflow/python/keras/engine/keras_tensor.py,437,function,Convert a traced (composite)tensor to a representative KerasTensor. +5804,Node,tensorflow/tensorflow/python/keras/engine/node.py,38,class,"A `Node` describes the connectivity between two layers. Each time a layer is connected to some new input, a node is added to `layer._inbound_nodes`. @@ -37971,7 +44824,22 @@ Arguments: call_args: The positional arguments the Layer was called with. call_kwargs: The keyword arguments the Layer was called with. outputs: The outputs of the Layer.__call__" -5527,KerasHistory,tensorflow/tensorflow/python/keras/engine/node.py,249,class,"Tracks the Layer call that created a Tensor, for Keras Graph Networks. +5805,keras_inputs,tensorflow/tensorflow/python/keras/engine/node.py,118,method,Tensors input to this node that can be traced back to a `keras.Input`. +5806,parent_nodes,tensorflow/tensorflow/python/keras/engine/node.py,123,method,Returns all the `Node`s whose output this node immediately depends on. +5807,iterate_inbound,tensorflow/tensorflow/python/keras/engine/node.py,133,method,"Yields tuples representing the data inbound from other nodes. + +Yields: + tuples like: (inbound_layer, node_index, tensor_index, tensor)." +5808,map_arguments,tensorflow/tensorflow/python/keras/engine/node.py,146,method,Maps Keras Tensors to computed Tensors using `tensor_dict`. +5809,serialize,tensorflow/tensorflow/python/keras/engine/node.py,161,method,Serializes `Node` for Functional API's `get_config`. +5810,input_tensors,tensorflow/tensorflow/python/keras/engine/node.py,214,method, +5811,output_tensors,tensorflow/tensorflow/python/keras/engine/node.py,220,method, +5812,input_shapes,tensorflow/tensorflow/python/keras/engine/node.py,226,method, +5813,output_shapes,tensorflow/tensorflow/python/keras/engine/node.py,233,method, +5814,outbound_layer,tensorflow/tensorflow/python/keras/engine/node.py,237,method, +5815,inbound_layers,tensorflow/tensorflow/python/keras/engine/node.py,241,method, +5816,serialize_first_arg_tensor,tensorflow/tensorflow/python/keras/engine/node.py,185,method, +5817,KerasHistory,tensorflow/tensorflow/python/keras/engine/node.py,249,class,"Tracks the Layer call that created a Tensor, for Keras Graph Networks. During construction of Keras Graph Networks, this metadata is added to each Tensor produced as the output of a Layer, starting with an @@ -37987,13 +44855,15 @@ Attributes: tensor_index: The output index for this Tensor. Always zero if the Layer that produced this Tensor only has one output. Nested structures of Tensors are deterministically assigned an index via `nest.flatten`." -5528,is_keras_tensor,tensorflow/tensorflow/python/keras/engine/node.py,274,function, -5529,_serialize_keras_tensor,tensorflow/tensorflow/python/keras/engine/node.py,278,function,Serializes a single Tensor passed to `call`. -5530,DummyTensor,tensorflow/tensorflow/python/keras/engine/node_test.py,27,class, -5531,DummyLayer,tensorflow/tensorflow/python/keras/engine/node_test.py,33,class, -5532,NetworkConstructionTest,tensorflow/tensorflow/python/keras/engine/node_test.py,37,class, -5533,PartialBatchPaddingHandler,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,30,class,A container that holds info about partial batches for `predict()`. -5534,Sequential,tensorflow/tensorflow/python/keras/engine/sequential.py,50,class,"`Sequential` groups a linear stack of layers into a `tf.keras.Model`. +5818,is_keras_tensor,tensorflow/tensorflow/python/keras/engine/node.py,274,function, +5819,DummyTensor,tensorflow/tensorflow/python/keras/engine/node_test.py,27,class, +5820,DummyLayer,tensorflow/tensorflow/python/keras/engine/node_test.py,33,class, +5821,PartialBatchPaddingHandler,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,30,class,A container that holds info about partial batches for `predict()`. +5822,get_real_batch_size,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,38,method,Returns the number of elements in a potentially partial batch. +5823,update_mask,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,56,method,Calculate and cache the amount of padding required for a batch. +5824,pad_batch,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,64,method,Pads out the batch dimension of a tensor to the complete batch size. +5825,apply_mask,tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py,89,method,Removes prediction output that corresponds to padded input. +5826,Sequential,tensorflow/tensorflow/python/keras/engine/sequential.py,50,class,"`Sequential` groups a linear stack of layers into a `tf.keras.Model`. `Sequential` provides training and inference features on this model. @@ -38047,18 +44917,62 @@ model.compile(optimizer='sgd', loss='mse') # This builds the model for the first time: model.fit(x, y, batch_size=32, epochs=10) ```" -5535,_get_shape_tuple,tensorflow/tensorflow/python/keras/engine/sequential.py,518,function, -5536,relax_input_shape,tensorflow/tensorflow/python/keras/engine/sequential.py,527,function, -5537,clear_previously_created_nodes,tensorflow/tensorflow/python/keras/engine/sequential.py,535,function,Remove nodes from `created_nodes` from the layer's inbound_nodes. -5538,track_nodes_created_by_last_call,tensorflow/tensorflow/python/keras/engine/sequential.py,547,function,Adds to `created_nodes` the nodes created by the last call to `layer`. -5539,TestSequential,tensorflow/tensorflow/python/keras/engine/sequential_test.py,37,class,"Most Sequential model API tests are covered in `training_test.py`. - " -5540,TestSequentialEagerIntegration,tensorflow/tensorflow/python/keras/engine/sequential_test.py,449,class, -5541,enable_multi_worker,tensorflow/tensorflow/python/keras/engine/training.py,103,function,Decorator that handles running `method` with multi-worker strategy. -5542,disable_multi_worker,tensorflow/tensorflow/python/keras/engine/training.py,123,function,Decorator that disallows multi-worker use of `method`. -5543,inject_functional_model_class,tensorflow/tensorflow/python/keras/engine/training.py,136,function,Inject `Functional` into the hierarchy of this class if needed. -5544,is_functional_model_init_params,tensorflow/tensorflow/python/keras/engine/training.py,152,function, -5545,Model,tensorflow/tensorflow/python/keras/engine/training.py,159,class,"`Model` groups layers into an object with training and inference features. +5827,layers,tensorflow/tensorflow/python/keras/engine/sequential.py,145,method, +5828,add,tensorflow/tensorflow/python/keras/engine/sequential.py,157,method,"Adds a layer instance on top of the layer stack. + +Arguments: + layer: layer instance. + +Raises: + TypeError: If `layer` is not a layer instance. + ValueError: In case the `layer` argument does not + know its input shape. + ValueError: In case the `layer` argument has + multiple output tensors, or is already connected + somewhere else (forbidden in `Sequential` models)." +5829,pop,tensorflow/tensorflow/python/keras/engine/sequential.py,237,method,"Removes the last layer in the model. + +Raises: + TypeError: if there are no layers in the model." +5830,build,tensorflow/tensorflow/python/keras/engine/sequential.py,339,method, +5831,call,tensorflow/tensorflow/python/keras/engine/sequential.py,352,method, +5832,compute_output_shape,tensorflow/tensorflow/python/keras/engine/sequential.py,395,method, +5833,compute_mask,tensorflow/tensorflow/python/keras/engine/sequential.py,401,method, +5834,predict_proba,tensorflow/tensorflow/python/keras/engine/sequential.py,409,method,"Generates class probability predictions for the input samples. + +The input samples are processed batch by batch. + +Arguments: + x: input data, as a Numpy array or list of Numpy arrays + (if the model has multiple inputs). + batch_size: integer. + verbose: verbosity mode, 0 or 1. + +Returns: + A Numpy array of probability predictions." +5835,predict_classes,tensorflow/tensorflow/python/keras/engine/sequential.py,439,method,"Generate class predictions for the input samples. + +The input samples are processed batch by batch. + +Arguments: + x: input data, as a Numpy array or list of Numpy arrays + (if the model has multiple inputs). + batch_size: integer. + verbose: verbosity mode, 0 or 1. + +Returns: + A numpy array of class predictions." +5836,get_config,tensorflow/tensorflow/python/keras/engine/sequential.py,459,method, +5837,from_config,tensorflow/tensorflow/python/keras/engine/sequential.py,475,method, +5838,input_spec,tensorflow/tensorflow/python/keras/engine/sequential.py,495,method, +5839,relax_input_shape,tensorflow/tensorflow/python/keras/engine/sequential.py,527,function, +5840,clear_previously_created_nodes,tensorflow/tensorflow/python/keras/engine/sequential.py,535,function,Remove nodes from `created_nodes` from the layer's inbound_nodes. +5841,track_nodes_created_by_last_call,tensorflow/tensorflow/python/keras/engine/sequential.py,547,function,Adds to `created_nodes` the nodes created by the last call to `layer`. +5842,enable_multi_worker,tensorflow/tensorflow/python/keras/engine/training.py,103,function,Decorator that handles running `method` with multi-worker strategy. +5843,disable_multi_worker,tensorflow/tensorflow/python/keras/engine/training.py,123,function,Decorator that disallows multi-worker use of `method`. +5844,inject_functional_model_class,tensorflow/tensorflow/python/keras/engine/training.py,136,function,Inject `Functional` into the hierarchy of this class if needed. +5845,is_functional_model_init_params,tensorflow/tensorflow/python/keras/engine/training.py,152,function, +5846,Model,tensorflow/tensorflow/python/keras/engine/training.py,159,class,"`Model` groups layers into an object with training and inference features. Arguments: inputs: The input(s) of the model: a `keras.Input` object or list of @@ -38129,7 +45043,920 @@ model = MyModel() Once the model is created, you can config the model with losses and metrics with `model.compile()`, train the model with `model.fit()`, or use the model to do prediction with `model.predict()`." -5546,reduce_per_replica,tensorflow/tensorflow/python/keras/engine/training.py,2647,function,"Reduce PerReplica objects. +5847,build,tensorflow/tensorflow/python/keras/engine/training.py,345,method,"Builds the model based on input shapes received. + +This is to be used for subclassed models, which do not know at instantiation +time what their inputs look like. + +This method only exists for users who want to call `model.build()` in a +standalone way (as a substitute for calling the model on real data to +build it). It will never be called by the framework (and thus it will +never throw unexpected errors in an unrelated workflow). + +Args: + input_shape: Single tuple, TensorShape, or list of shapes, where shapes + are tuples, integers, or TensorShapes. + +Raises: + ValueError: + 1. In case of invalid user-provided data (not of type tuple, + list, or TensorShape). + 2. If the model requires call arguments that are agnostic + to the input shapes (positional or kwarg in call signature). + 3. If not all layers were properly built. + 4. If float type inputs are not supported within the layers. + + In each of these cases, the user should build their model by calling it + on real tensor data." +5848,call,tensorflow/tensorflow/python/keras/engine/training.py,443,method,"Calls the model on new inputs. + +In this case `call` just reapplies +all ops in the graph to the new inputs +(e.g. build a new computational graph from the provided inputs). + +Arguments: + inputs: A tensor or list of tensors. + training: Boolean or boolean scalar tensor, indicating whether to run + the `Network` in training mode or inference mode. + mask: A mask or list of masks. A mask can be + either a tensor or None (no mask). + +Returns: + A tensor if there is a single output, or + a list of tensors if there are more than one outputs." +5849,compile,tensorflow/tensorflow/python/keras/engine/training.py,464,method,"Configures the model for training. + +Arguments: + optimizer: String (name of optimizer) or optimizer instance. See + `tf.keras.optimizers`. + loss: String (name of objective function), objective function or + `tf.keras.losses.Loss` instance. See `tf.keras.losses`. An objective + function is any callable with the signature `loss = fn(y_true, + y_pred)`, where y_true = ground truth values with shape = + `[batch_size, d0, .. dN]`, except sparse loss functions such as sparse + categorical crossentropy where shape = `[batch_size, d0, .. dN-1]`. + y_pred = predicted values with shape = `[batch_size, d0, .. dN]`. It + returns a weighted loss float tensor. If a custom `Loss` instance is + used and reduction is set to NONE, return value has the shape + [batch_size, d0, .. dN-1] ie. per-sample or per-timestep loss values; + otherwise, it is a scalar. If the model has multiple outputs, you can + use a different loss on each output by passing a dictionary or a list + of losses. The loss value that will be minimized by the model will + then be the sum of all individual losses. + metrics: List of metrics to be evaluated by the model during training + and testing. Each of this can be a string (name of a built-in + function), function or a `tf.keras.metrics.Metric` instance. See + `tf.keras.metrics`. Typically you will use `metrics=['accuracy']`. A + function is any callable with the signature `result = fn(y_true, + y_pred)`. To specify different metrics for different outputs of a + multi-output model, you could also pass a dictionary, such as + `metrics={'output_a': 'accuracy', 'output_b': ['accuracy', 'mse']}`. + You can also pass a list (len = len(outputs)) of lists of metrics + such as `metrics=[['accuracy'], ['accuracy', 'mse']]` or + `metrics=['accuracy', ['accuracy', 'mse']]`. When you pass the + strings 'accuracy' or 'acc', we convert this to one of + `tf.keras.metrics.BinaryAccuracy`, + `tf.keras.metrics.CategoricalAccuracy`, + `tf.keras.metrics.SparseCategoricalAccuracy` based on the loss + function used and the model output shape. We do a similar + conversion for the strings 'crossentropy' and 'ce' as well. + loss_weights: Optional list or dictionary specifying scalar coefficients + (Python floats) to weight the loss contributions of different model + outputs. The loss value that will be minimized by the model will then + be the *weighted sum* of all individual losses, weighted by the + `loss_weights` coefficients. + If a list, it is expected to have a 1:1 mapping to the model's + outputs. If a dict, it is expected to map output names (strings) + to scalar coefficients. + weighted_metrics: List of metrics to be evaluated and weighted by + sample_weight or class_weight during training and testing. + run_eagerly: Bool. Defaults to `False`. If `True`, this `Model`'s + logic will not be wrapped in a `tf.function`. Recommended to leave + this as `None` unless your `Model` cannot be run inside a + `tf.function`. + **kwargs: Any additional arguments. Supported arguments: + - `experimental_steps_per_execution`: Int. The number of batches to + run during each `tf.function` call. Running multiple batches + inside a single `tf.function` call can greatly improve performance + on TPUs or small models with a large Python overhead. Note that if + this value is set to `N`, `Callback.on_batch` methods will only be + called every `N` batches. This currently defaults to `1`. At most, + one full epoch will be run each execution. If a number larger than + the size of the epoch is passed, the execution will be truncated + to the size of the epoch. + - `sample_weight_mode` for backward compatibility. + +Raises: + ValueError: In case of invalid arguments for + `optimizer`, `loss` or `metrics`." +5850,metrics,tensorflow/tensorflow/python/keras/engine/training.py,592,method,"Returns the model's metrics added using `compile`, `add_metric` APIs. + +Note: Metrics passed to `compile()` are available only after a `keras.Model` +has been trained/evaluated on actual data. + +Examples: + +>>> inputs = tf.keras.layers.Input(shape=(3,)) +>>> outputs = tf.keras.layers.Dense(2)(inputs) +>>> model = tf.keras.models.Model(inputs=inputs, outputs=outputs) +>>> model.compile(optimizer=""Adam"", loss=""mse"", metrics=[""mae""]) +>>> [m.name for m in model.metrics] +[] + +>>> x = np.random.random((2, 3)) +>>> y = np.random.randint(0, 2, (2, 2)) +>>> model.fit(x, y) +>>> [m.name for m in model.metrics] +['loss', 'mae'] + +>>> inputs = tf.keras.layers.Input(shape=(3,)) +>>> d = tf.keras.layers.Dense(2, name='out') +>>> output_1 = d(inputs) +>>> output_2 = d(inputs) +>>> model = tf.keras.models.Model( +... inputs=inputs, outputs=[output_1, output_2]) +>>> model.add_metric( +... tf.reduce_sum(output_2), name='mean', aggregation='mean') +>>> model.compile(optimizer=""Adam"", loss=""mse"", metrics=[""mae"", ""acc""]) +>>> model.fit(x, (y, y)) +>>> [m.name for m in model.metrics] +['loss', 'out_loss', 'out_1_loss', 'out_mae', 'out_acc', 'out_1_mae', +'out_1_acc', 'mean']" +5851,metrics_names,tensorflow/tensorflow/python/keras/engine/training.py,642,method,"Returns the model's display labels for all outputs. + +Note: `metrics_names` are available only after a `keras.Model` has been +trained/evaluated on actual data. + +Examples: + +>>> inputs = tf.keras.layers.Input(shape=(3,)) +>>> outputs = tf.keras.layers.Dense(2)(inputs) +>>> model = tf.keras.models.Model(inputs=inputs, outputs=outputs) +>>> model.compile(optimizer=""Adam"", loss=""mse"", metrics=[""mae""]) +>>> model.metrics_names +[] + +>>> x = np.random.random((2, 3)) +>>> y = np.random.randint(0, 2, (2, 2)) +>>> model.fit(x, y) +>>> model.metrics_names +['loss', 'mae'] + +>>> inputs = tf.keras.layers.Input(shape=(3,)) +>>> d = tf.keras.layers.Dense(2, name='out') +>>> output_1 = d(inputs) +>>> output_2 = d(inputs) +>>> model = tf.keras.models.Model( +... inputs=inputs, outputs=[output_1, output_2]) +>>> model.compile(optimizer=""Adam"", loss=""mse"", metrics=[""mae"", ""acc""]) +>>> model.fit(x, (y, y)) +>>> model.metrics_names +['loss', 'out_loss', 'out_1_loss', 'out_mae', 'out_acc', 'out_1_mae', +'out_1_acc']" +5852,distribute_strategy,tensorflow/tensorflow/python/keras/engine/training.py,682,method,The `tf.distribute.Strategy` this model was created under. +5853,run_eagerly,tensorflow/tensorflow/python/keras/engine/training.py,687,method,"Settable attribute indicating whether the model should run eagerly. + +Running eagerly means that your model will be run step by step, +like Python code. Your model might run slower, but it should become easier +for you to debug it by stepping into individual layer calls. + +By default, we will attempt to compile your model to a static graph to +deliver the best execution performance. + +Returns: + Boolean, whether the model should run eagerly." +5854,run_eagerly,tensorflow/tensorflow/python/keras/engine/training.py,716,method, +5855,train_step,tensorflow/tensorflow/python/keras/engine/training.py,719,method,"The logic for one training step. + +This method can be overridden to support custom training logic. +This method is called by `Model.make_train_function`. + +This method should contain the mathemetical logic for one step of training. +This typically includes the forward pass, loss calculation, backpropagation, +and metric updates. + +Configuration details for *how* this logic is run (e.g. `tf.function` and +`tf.distribute.Strategy` settings), should be left to +`Model.make_train_function`, which can also be overridden. + +Arguments: + data: A nested structure of `Tensor`s. + +Returns: + A `dict` containing values that will be passed to + `tf.keras.callbacks.CallbackList.on_train_batch_end`. Typically, the + values of the `Model`'s metrics are returned. Example: + `{'loss': 0.2, 'accuracy': 0.7}`." +5856,make_train_function,tensorflow/tensorflow/python/keras/engine/training.py,765,method,"Creates a function that executes one step of training. + +This method can be overridden to support custom training logic. +This method is called by `Model.fit` and `Model.train_on_batch`. + +Typically, this method directly controls `tf.function` and +`tf.distribute.Strategy` settings, and delegates the actual training +logic to `Model.train_step`. + +This function is cached the first time `Model.fit` or +`Model.train_on_batch` is called. The cache is cleared whenever +`Model.compile` is called. + +Returns: + Function. The function created by this method should accept a + `tf.data.Iterator`, and return a `dict` containing values that will + be passed to `tf.keras.Callbacks.on_train_batch_end`, such as + `{'loss': 0.2, 'accuracy': 0.7}`." +5857,fit,tensorflow/tensorflow/python/keras/engine/training.py,828,method,"Trains the model for a fixed number of epochs (iterations on a dataset). + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + - A `tf.data` dataset. Should return a tuple + of either `(inputs, targets)` or + `(inputs, targets, sample_weights)`. + - A generator or `keras.utils.Sequence` returning `(inputs, targets)` + or `(inputs, targets, sample_weights)`. + A more detailed description of unpacking behavior for iterator types + (Dataset, generator, Sequence) is given below. + y: Target data. Like the input data `x`, + it could be either Numpy array(s) or TensorFlow tensor(s). + It should be consistent with `x` (you cannot have Numpy inputs and + tensor targets, or inversely). If `x` is a dataset, generator, + or `keras.utils.Sequence` instance, `y` should + not be specified (since targets will be obtained from `x`). + batch_size: Integer or `None`. + Number of samples per gradient update. + If unspecified, `batch_size` will default to 32. + Do not specify the `batch_size` if your data is in the + form of datasets, generators, or `keras.utils.Sequence` instances + (since they generate batches). + epochs: Integer. Number of epochs to train the model. + An epoch is an iteration over the entire `x` and `y` + data provided. + Note that in conjunction with `initial_epoch`, + `epochs` is to be understood as ""final epoch"". + The model is not trained for a number of iterations + given by `epochs`, but merely until the epoch + of index `epochs` is reached. + verbose: 0, 1, or 2. Verbosity mode. + 0 = silent, 1 = progress bar, 2 = one line per epoch. + Note that the progress bar is not particularly useful when + logged to a file, so verbose=2 is recommended when not running + interactively (eg, in a production environment). + callbacks: List of `keras.callbacks.Callback` instances. + List of callbacks to apply during training. + See `tf.keras.callbacks`. + validation_split: Float between 0 and 1. + Fraction of the training data to be used as validation data. + The model will set apart this fraction of the training data, + will not train on it, and will evaluate + the loss and any model metrics + on this data at the end of each epoch. + The validation data is selected from the last samples + in the `x` and `y` data provided, before shuffling. This argument is + not supported when `x` is a dataset, generator or + `keras.utils.Sequence` instance. + validation_data: Data on which to evaluate + the loss and any model metrics at the end of each epoch. + The model will not be trained on this data. Thus, note the fact + that the validation loss of data provided using `validation_split` + or `validation_data` is not affected by regularization layers like + noise and dropuout. + `validation_data` will override `validation_split`. + `validation_data` could be: + - tuple `(x_val, y_val)` of Numpy arrays or tensors + - tuple `(x_val, y_val, val_sample_weights)` of Numpy arrays + - dataset + For the first two cases, `batch_size` must be provided. + For the last case, `validation_steps` could be provided. + Note that `validation_data` does not support all the data types that + are supported in `x`, eg, dict, generator or `keras.utils.Sequence`. + shuffle: Boolean (whether to shuffle the training data + before each epoch) or str (for 'batch'). This argument is ignored + when `x` is a generator. 'batch' is a special option for dealing + with the limitations of HDF5 data; it shuffles in batch-sized + chunks. Has no effect when `steps_per_epoch` is not `None`. + class_weight: Optional dictionary mapping class indices (integers) + to a weight (float) value, used for weighting the loss function + (during training only). + This can be useful to tell the model to + ""pay more attention"" to samples from + an under-represented class. + sample_weight: Optional Numpy array of weights for + the training samples, used for weighting the loss function + (during training only). You can either pass a flat (1D) + Numpy array with the same length as the input samples + (1:1 mapping between weights and samples), + or in the case of temporal data, + you can pass a 2D array with shape + `(samples, sequence_length)`, + to apply a different weight to every timestep of every sample. This + argument is not supported when `x` is a dataset, generator, or + `keras.utils.Sequence` instance, instead provide the sample_weights + as the third element of `x`. + initial_epoch: Integer. + Epoch at which to start training + (useful for resuming a previous training run). + steps_per_epoch: Integer or `None`. + Total number of steps (batches of samples) + before declaring one epoch finished and starting the + next epoch. When training with input tensors such as + TensorFlow data tensors, the default `None` is equal to + the number of samples in your dataset divided by + the batch size, or 1 if that cannot be determined. If x is a + `tf.data` dataset, and 'steps_per_epoch' + is None, the epoch will run until the input dataset is exhausted. + When passing an infinitely repeating dataset, you must specify the + `steps_per_epoch` argument. This argument is not supported with + array inputs. + validation_steps: Only relevant if `validation_data` is provided and + is a `tf.data` dataset. Total number of steps (batches of + samples) to draw before stopping when performing validation + at the end of every epoch. If 'validation_steps' is None, validation + will run until the `validation_data` dataset is exhausted. In the + case of an infinitely repeated dataset, it will run into an + infinite loop. If 'validation_steps' is specified and only part of + the dataset will be consumed, the evaluation will start from the + beginning of the dataset at each epoch. This ensures that the same + validation samples are used every time. + validation_batch_size: Integer or `None`. + Number of samples per validation batch. + If unspecified, will default to `batch_size`. + Do not specify the `validation_batch_size` if your data is in the + form of datasets, generators, or `keras.utils.Sequence` instances + (since they generate batches). + validation_freq: Only relevant if validation data is provided. Integer + or `collections_abc.Container` instance (e.g. list, tuple, etc.). + If an integer, specifies how many training epochs to run before a + new validation run is performed, e.g. `validation_freq=2` runs + validation every 2 epochs. If a Container, specifies the epochs on + which to run validation, e.g. `validation_freq=[1, 2, 10]` runs + validation at the end of the 1st, 2nd, and 10th epochs. + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. + If unspecified, `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up + when using process-based threading. If unspecified, `workers` + will default to 1. If 0, will execute the generator on the main + thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to + the generator as they can't be passed easily to children processes. + +Unpacking behavior for iterator-like inputs: + A common pattern is to pass a tf.data.Dataset, generator, or + tf.keras.utils.Sequence to the `x` argument of fit, which will in fact + yield not only features (x) but optionally targets (y) and sample weights. + Keras requires that the output of such iterator-likes be unambiguous. The + iterator should return a tuple of length 1, 2, or 3, where the optional + second and third elements will be used for y and sample_weight + respectively. Any other type provided will be wrapped in a length one + tuple, effectively treating everything as 'x'. When yielding dicts, they + should still adhere to the top-level tuple structure. + e.g. `({""x0"": x0, ""x1"": x1}, y)`. Keras will not attempt to separate + features, targets, and weights from the keys of a single dict. + A notable unsupported data type is the namedtuple. The reason is that + it behaves like both an ordered datatype (tuple) and a mapping + datatype (dict). So given a namedtuple of the form: + `namedtuple(""example_tuple"", [""y"", ""x""])` + it is ambiguous whether to reverse the order of the elements when + interpreting the value. Even worse is a tuple of the form: + `namedtuple(""other_tuple"", [""x"", ""y"", ""z""])` + where it is unclear if the tuple was intended to be unpacked into x, y, + and sample_weight or passed through as a single element to `x`. As a + result the data processing code will simply raise a ValueError if it + encounters a namedtuple. (Along with instructions to remedy the issue.) + +Returns: + A `History` object. Its `History.history` attribute is + a record of training loss values and metrics values + at successive epochs, as well as validation loss values + and validation metrics values (if applicable). + +Raises: + RuntimeError: 1. If the model was never compiled or, + 2. If `model.fit` is wrapped in `tf.function`. + + ValueError: In case of mismatch between the provided input data + and what the model expects or when the input data is empty." +5858,evaluate,tensorflow/tensorflow/python/keras/engine/training.py,1250,method,"Returns the loss value & metrics values for the model in test mode. + +Computation is done in batches (see the `batch_size` arg.) + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + - A `tf.data` dataset. Should return a tuple + of either `(inputs, targets)` or + `(inputs, targets, sample_weights)`. + - A generator or `keras.utils.Sequence` returning `(inputs, targets)` + or `(inputs, targets, sample_weights)`. + A more detailed description of unpacking behavior for iterator types + (Dataset, generator, Sequence) is given in the `Unpacking behavior + for iterator-like inputs` section of `Model.fit`. + y: Target data. Like the input data `x`, it could be either Numpy + array(s) or TensorFlow tensor(s). It should be consistent with `x` + (you cannot have Numpy inputs and tensor targets, or inversely). If + `x` is a dataset, generator or `keras.utils.Sequence` instance, `y` + should not be specified (since targets will be obtained from the + iterator/dataset). + batch_size: Integer or `None`. Number of samples per batch of + computation. If unspecified, `batch_size` will default to 32. Do not + specify the `batch_size` if your data is in the form of a dataset, + generators, or `keras.utils.Sequence` instances (since they generate + batches). + verbose: 0 or 1. Verbosity mode. 0 = silent, 1 = progress bar. + sample_weight: Optional Numpy array of weights for the test samples, + used for weighting the loss function. You can either pass a flat (1D) + Numpy array with the same length as the input samples + (1:1 mapping between weights and samples), or in the case of + temporal data, you can pass a 2D array with shape `(samples, + sequence_length)`, to apply a different weight to every timestep + of every sample. This argument is not supported when `x` is a + dataset, instead pass sample weights as the third element of `x`. + steps: Integer or `None`. Total number of steps (batches of samples) + before declaring the evaluation round finished. Ignored with the + default value of `None`. If x is a `tf.data` dataset and `steps` is + None, 'evaluate' will run until the dataset is exhausted. This + argument is not supported with array inputs. + callbacks: List of `keras.callbacks.Callback` instances. List of + callbacks to apply during evaluation. See + [callbacks](/api_docs/python/tf/keras/callbacks). + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. If unspecified, + `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up when using process-based + threading. If unspecified, `workers` will default to 1. If 0, will + execute the generator on the main thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to the + generator as they can't be passed easily to children processes. + return_dict: If `True`, loss and metric results are returned as a dict, + with each key being the name of the metric. If `False`, they are + returned as a list. + +See the discussion of `Unpacking behavior for iterator-like inputs` for +`Model.fit`. + +Returns: + Scalar test loss (if the model has a single output and no metrics) + or list of scalars (if the model has multiple outputs + and/or metrics). The attribute `model.metrics_names` will give you + the display labels for the scalar outputs. + +Raises: + RuntimeError: If `model.evaluate` is wrapped in `tf.function`. + ValueError: in case of invalid arguments." +5859,predict_step,tensorflow/tensorflow/python/keras/engine/training.py,1403,method,"The logic for one inference step. + +This method can be overridden to support custom inference logic. +This method is called by `Model.make_predict_function`. + +This method should contain the mathemetical logic for one step of inference. +This typically includes the forward pass. + +Configuration details for *how* this logic is run (e.g. `tf.function` and +`tf.distribute.Strategy` settings), should be left to +`Model.make_predict_function`, which can also be overridden. + +Arguments: + data: A nested structure of `Tensor`s. + +Returns: + The result of one inference step, typically the output of calling the + `Model` on data." +5860,make_predict_function,tensorflow/tensorflow/python/keras/engine/training.py,1427,method,"Creates a function that executes one step of inference. + +This method can be overridden to support custom inference logic. +This method is called by `Model.predict` and `Model.predict_on_batch`. + +Typically, this method directly controls `tf.function` and +`tf.distribute.Strategy` settings, and delegates the actual evaluation +logic to `Model.predict_step`. + +This function is cached the first time `Model.predict` or +`Model.predict_on_batch` is called. The cache is cleared whenever +`Model.compile` is called. + +Returns: + Function. The function created by this method should accept a + `tf.data.Iterator`, and return the outputs of the `Model`." +5861,predict,tensorflow/tensorflow/python/keras/engine/training.py,1494,method,"Generates output predictions for the input samples. + +Computation is done in batches. This method is designed for performance in +large scale inputs. For small amount of inputs that fit in one batch, +directly using `__call__` is recommended for faster execution, e.g., +`model(x)`, or `model(x, training=False)` if you have layers such as +`tf.keras.layers.BatchNormalization` that behaves differently during +inference. Also, note the fact that test loss is not affected by +regularization layers like noise and dropout. + +Arguments: + x: Input samples. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A `tf.data` dataset. + - A generator or `keras.utils.Sequence` instance. + A more detailed description of unpacking behavior for iterator types + (Dataset, generator, Sequence) is given in the `Unpacking behavior + for iterator-like inputs` section of `Model.fit`. + batch_size: Integer or `None`. + Number of samples per batch. + If unspecified, `batch_size` will default to 32. + Do not specify the `batch_size` if your data is in the + form of dataset, generators, or `keras.utils.Sequence` instances + (since they generate batches). + verbose: Verbosity mode, 0 or 1. + steps: Total number of steps (batches of samples) + before declaring the prediction round finished. + Ignored with the default value of `None`. If x is a `tf.data` + dataset and `steps` is None, `predict` will + run until the input dataset is exhausted. + callbacks: List of `keras.callbacks.Callback` instances. + List of callbacks to apply during prediction. + See [callbacks](/api_docs/python/tf/keras/callbacks). + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. + If unspecified, `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up when using + process-based threading. If unspecified, `workers` will default + to 1. If 0, will execute the generator on the main thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to + the generator as they can't be passed easily to children processes. + +See the discussion of `Unpacking behavior for iterator-like inputs` for +`Model.fit`. Note that Model.predict uses the same interpretation rules as +`Model.fit` and `Model.evaluate`, so inputs must be unambiguous for all +three methods. + +Returns: + Numpy array(s) of predictions. + +Raises: + RuntimeError: If `model.predict` is wrapped in `tf.function`. + ValueError: In case of mismatch between the provided + input data and the model's expectations, + or in case a stateful model receives a number of samples + that is not a multiple of the batch size." +5862,reset_metrics,tensorflow/tensorflow/python/keras/engine/training.py,1627,method,"Resets the state of all the metrics in the model. + +Examples: + +>>> inputs = tf.keras.layers.Input(shape=(3,)) +>>> outputs = tf.keras.layers.Dense(2)(inputs) +>>> model = tf.keras.models.Model(inputs=inputs, outputs=outputs) +>>> model.compile(optimizer=""Adam"", loss=""mse"", metrics=[""mae""]) + +>>> x = np.random.random((2, 3)) +>>> y = np.random.randint(0, 2, (2, 2)) +>>> _ = model.fit(x, y, verbose=0) +>>> assert all(float(m.result()) for m in model.metrics) + +>>> model.reset_metrics() +>>> assert all(float(m.result()) == 0 for m in model.metrics)" +5863,train_on_batch,tensorflow/tensorflow/python/keras/engine/training.py,1649,method,"Runs a single gradient update on a single batch of data. + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + y: Target data. Like the input data `x`, it could be either Numpy + array(s) or TensorFlow tensor(s). It should be consistent with `x` + (you cannot have Numpy inputs and tensor targets, or inversely). + sample_weight: Optional array of the same length as x, containing + weights to apply to the model's loss for each sample. In the case of + temporal data, you can pass a 2D array with shape (samples, + sequence_length), to apply a different weight to every timestep of + every sample. + class_weight: Optional dictionary mapping class indices (integers) to a + weight (float) to apply to the model's loss for the samples from this + class during training. This can be useful to tell the model to ""pay + more attention"" to samples from an under-represented class. + reset_metrics: If `True`, the metrics returned will be only for this + batch. If `False`, the metrics will be statefully accumulated across + batches. + return_dict: If `True`, loss and metric results are returned as a dict, + with each key being the name of the metric. If `False`, they are + returned as a list. + +Returns: + Scalar training loss + (if the model has a single output and no metrics) + or list of scalars (if the model has multiple outputs + and/or metrics). The attribute `model.metrics_names` will give you + the display labels for the scalar outputs. + +Raises: + RuntimeError: If `model.train_on_batch` is wrapped in `tf.function`. + ValueError: In case of invalid user-provided arguments." +5864,predict_on_batch,tensorflow/tensorflow/python/keras/engine/training.py,1777,method,"Returns predictions for a single batch of samples. + +Arguments: + x: Input data. It could be: - A Numpy array (or array-like), or a list + of arrays (in case the model has multiple inputs). - A TensorFlow + tensor, or a list of tensors (in case the model has multiple inputs). + +Returns: + Numpy array(s) of predictions. + +Raises: + RuntimeError: If `model.predict_on_batch` is wrapped in `tf.function`. + ValueError: In case of mismatch between given number of inputs and + expectations of the model." +5865,fit_generator,tensorflow/tensorflow/python/keras/engine/training.py,1803,method,"Fits the model on data yielded batch-by-batch by a Python generator. + +DEPRECATED: + `Model.fit` now supports generators, so there is no longer any need to use + this endpoint." +5866,evaluate_generator,tensorflow/tensorflow/python/keras/engine/training.py,1843,method,"Evaluates the model on a data generator. + +DEPRECATED: + `Model.evaluate` now supports generators, so there is no longer any need + to use this endpoint." +5867,predict_generator,tensorflow/tensorflow/python/keras/engine/training.py,1871,method,"Generates predictions for the input samples from a data generator. + +DEPRECATED: + `Model.predict` now supports generators, so there is no longer any need + to use this endpoint." +5868,trainable_weights,tensorflow/tensorflow/python/keras/engine/training.py,1901,method, +5869,non_trainable_weights,tensorflow/tensorflow/python/keras/engine/training.py,1910,method, +5870,get_weights,tensorflow/tensorflow/python/keras/engine/training.py,1919,method,"Retrieves the weights of the model. + +Returns: + A flat list of Numpy arrays." +5871,save,tensorflow/tensorflow/python/keras/engine/training.py,1928,method,"Saves the model to Tensorflow SavedModel or a single HDF5 file. + +The savefile includes: + +- The model architecture, allowing to re-instantiate the model. +- The model weights. +- The state of the optimizer, allowing to resume training + exactly where you left off. + +This allows you to save the entirety of the state of a model +in a single file. + +Saved models can be reinstantiated via `keras.models.load_model`. +The model returned by `load_model` is a compiled model ready to be used +(unless the saved model was never compiled in the first place). + +Models built with the Sequential and Functional API can be saved to both the +HDF5 and SavedModel formats. Subclassed models can only be saved with the +SavedModel format. + +Note that the model weights may have different scoped names after being +loaded. Scoped names include the model/layer names, such as +`""dense_1/kernel:0""`. It is recommended that you use the layer properties to + access specific variables, e.g. `model.get_layer(""dense_1"").kernel`. + +Arguments: + filepath: String, PathLike, path to SavedModel or H5 file to save the + model. + overwrite: Whether to silently overwrite any existing file at the + target location, or provide the user with a manual prompt. + include_optimizer: If True, save optimizer's state together. + save_format: Either `'tf'` or `'h5'`, indicating whether to save the + model to Tensorflow SavedModel or HDF5. Defaults to 'tf' in TF 2.X, + and 'h5' in TF 1.X. + signatures: Signatures to save with the SavedModel. Applicable to the + 'tf' format only. Please see the `signatures` argument in + `tf.saved_model.save` for details. + options: Optional `tf.saved_model.SaveOptions` object that specifies + options for saving to SavedModel. + +Example: + +```python +from keras.models import load_model + +model.save('my_model.h5') # creates a HDF5 file 'my_model.h5' +del model # deletes the existing model + +# returns a compiled model +# identical to the previous one +model = load_model('my_model.h5') +```" +5872,save_weights,tensorflow/tensorflow/python/keras/engine/training.py,1991,method,"Saves all layer weights. + +Either saves in HDF5 or in TensorFlow format based on the `save_format` +argument. + +When saving in HDF5 format, the weight file has: + - `layer_names` (attribute), a list of strings + (ordered names of model layers). + - For every layer, a `group` named `layer.name` + - For every such layer group, a group attribute `weight_names`, + a list of strings + (ordered names of weights tensor of the layer). + - For every weight in the layer, a dataset + storing the weight value, named after the weight tensor. + +When saving in TensorFlow format, all objects referenced by the network are +saved in the same format as `tf.train.Checkpoint`, including any `Layer` +instances or `Optimizer` instances assigned to object attributes. For +networks constructed from inputs and outputs using `tf.keras.Model(inputs, +outputs)`, `Layer` instances used by the network are tracked/saved +automatically. For user-defined classes which inherit from `tf.keras.Model`, +`Layer` instances must be assigned to object attributes, typically in the +constructor. See the documentation of `tf.train.Checkpoint` and +`tf.keras.Model` for details. + +While the formats are the same, do not mix `save_weights` and +`tf.train.Checkpoint`. Checkpoints saved by `Model.save_weights` should be +loaded using `Model.load_weights`. Checkpoints saved using +`tf.train.Checkpoint.save` should be restored using the corresponding +`tf.train.Checkpoint.restore`. Prefer `tf.train.Checkpoint` over +`save_weights` for training checkpoints. + +The TensorFlow format matches objects and variables by starting at a root +object, `self` for `save_weights`, and greedily matching attribute +names. For `Model.save` this is the `Model`, and for `Checkpoint.save` this +is the `Checkpoint` even if the `Checkpoint` has a model attached. This +means saving a `tf.keras.Model` using `save_weights` and loading into a +`tf.train.Checkpoint` with a `Model` attached (or vice versa) will not match +the `Model`'s variables. See the [guide to training +checkpoints](https://www.tensorflow.org/guide/checkpoint) for details +on the TensorFlow format. + +Arguments: + filepath: String or PathLike, path to the file to save the weights to. + When saving in TensorFlow format, this is the prefix used for + checkpoint files (multiple files are generated). Note that the '.h5' + suffix causes weights to be saved in HDF5 format. + overwrite: Whether to silently overwrite any existing file at the + target location, or provide the user with a manual prompt. + save_format: Either 'tf' or 'h5'. A `filepath` ending in '.h5' or + '.keras' will default to HDF5 if `save_format` is `None`. Otherwise + `None` defaults to 'tf'. + options: Optional `tf.train.CheckpointOptions` object that specifies + options for saving weights. + +Raises: + ImportError: If h5py is not available when attempting to save in HDF5 + format. + ValueError: For invalid/unknown format arguments." +5873,load_weights,tensorflow/tensorflow/python/keras/engine/training.py,2119,method,"Loads all layer weights, either from a TensorFlow or an HDF5 weight file. + +If `by_name` is False weights are loaded based on the network's +topology. This means the architecture should be the same as when the weights +were saved. Note that layers that don't have weights are not taken into +account in the topological ordering, so adding or removing layers is fine as +long as they don't have weights. + +If `by_name` is True, weights are loaded into layers only if they share the +same name. This is useful for fine-tuning or transfer-learning models where +some of the layers have changed. + +Only topological loading (`by_name=False`) is supported when loading weights +from the TensorFlow format. Note that topological loading differs slightly +between TensorFlow and HDF5 formats for user-defined classes inheriting from +`tf.keras.Model`: HDF5 loads based on a flattened list of weights, while the +TensorFlow format loads based on the object-local names of attributes to +which layers are assigned in the `Model`'s constructor. + +Arguments: + filepath: String, path to the weights file to load. For weight files in + TensorFlow format, this is the file prefix (the same as was passed + to `save_weights`). + by_name: Boolean, whether to load weights by name or by topological + order. Only topological loading is supported for weight files in + TensorFlow format. + skip_mismatch: Boolean, whether to skip loading of layers where there is + a mismatch in the number of weights, or a mismatch in the shape of + the weight (only valid when `by_name=True`). + options: Optional `tf.train.CheckpointOptions` object that specifies + options for loading weights. + +Returns: + When loading a weight file in TensorFlow format, returns the same status + object as `tf.train.Checkpoint.restore`. When graph building, restore + ops are run automatically as soon as the network is built (on first call + for user-defined classes inheriting from `Model`, immediately if it is + already built). + + When loading weights in HDF5 format, returns `None`. + +Raises: + ImportError: If h5py is not available and the weight file is in HDF5 + format. + ValueError: If `skip_mismatch` is set to `True` when `by_name` is + `False`." +5874,get_config,tensorflow/tensorflow/python/keras/engine/training.py,2240,method, +5875,from_config,tensorflow/tensorflow/python/keras/engine/training.py,2244,method, +5876,to_json,tensorflow/tensorflow/python/keras/engine/training.py,2251,method,"Returns a JSON string containing the network configuration. + +To load a network from a JSON save file, use +`keras.models.model_from_json(json_string, custom_objects={})`. + +Arguments: + **kwargs: Additional keyword arguments + to be passed to `json.dumps()`. + +Returns: + A JSON string." +5877,to_yaml,tensorflow/tensorflow/python/keras/engine/training.py,2268,method,"Returns a yaml string containing the network configuration. + +To load a network from a yaml save file, use +`keras.models.model_from_yaml(yaml_string, custom_objects={})`. + +`custom_objects` should be a dictionary mapping +the names of custom losses / layers / etc to the corresponding +functions / classes. + +Arguments: + **kwargs: Additional keyword arguments + to be passed to `yaml.dump()`. + +Returns: + A YAML string. + +Raises: + ImportError: if yaml module is not found." +5878,reset_states,tensorflow/tensorflow/python/keras/engine/training.py,2293,method, +5879,state_updates,tensorflow/tensorflow/python/keras/engine/training.py,2304,method,"Deprecated, do NOT use! + +Returns the `updates` from all layers that are stateful. + +This is useful for separating training updates and +state updates, e.g. when we need to update a layer's internal state +during prediction. + +Returns: + A list of update ops." +5880,weights,tensorflow/tensorflow/python/keras/engine/training.py,2324,method,"Returns the list of all layer variables/weights. + +Returns: + A list of variables." +5881,summary,tensorflow/tensorflow/python/keras/engine/training.py,2342,method,"Prints a string summary of the network. + +Arguments: + line_length: Total length of printed lines + (e.g. set this to adapt the display to different + terminal window sizes). + positions: Relative or absolute positions of log elements + in each line. If not provided, + defaults to `[.33, .55, .67, 1.]`. + print_fn: Print function to use. Defaults to `print`. + It will be called on each line of the summary. + You can set it to a custom function + in order to capture the string summary. + +Raises: + ValueError: if `summary()` is called before the model is built." +5882,layers,tensorflow/tensorflow/python/keras/engine/training.py,2372,method, +5883,get_layer,tensorflow/tensorflow/python/keras/engine/training.py,2375,method,"Retrieves a layer based on either its name (unique) or index. + +If `name` and `index` are both provided, `index` will take precedence. +Indices are based on order of horizontal graph traversal (bottom-up). + +Arguments: + name: String, name of layer. + index: Integer, index of layer. + +Returns: + A layer instance. + +Raises: + ValueError: In case of invalid layer name or index." +5884,step_function,tensorflow/tensorflow/python/keras/engine/training.py,788,method,Runs a single training step. +5885,step_function,tensorflow/tensorflow/python/keras/engine/training.py,1211,method,Runs a single evaluation step. +5886,step_function,tensorflow/tensorflow/python/keras/engine/training.py,1448,method,Runs a single evaluation step. +5887,run_step,tensorflow/tensorflow/python/keras/engine/training.py,791,method, +5888,train_function,tensorflow/tensorflow/python/keras/engine/training.py,807,method,Runs a training execution with one step. +5889,train_function,tensorflow/tensorflow/python/keras/engine/training.py,813,method,Runs a training execution with multiple steps. +5890,run_step,tensorflow/tensorflow/python/keras/engine/training.py,1214,method, +5891,run_step,tensorflow/tensorflow/python/keras/engine/training.py,1451,method, +5892,predict_function,tensorflow/tensorflow/python/keras/engine/training.py,1467,method,Runs an evaluation execution with one step. +5893,predict_function,tensorflow/tensorflow/python/keras/engine/training.py,1473,method,Runs an evaluation execution with multiple steps. +5894,reduce_per_replica,tensorflow/tensorflow/python/keras/engine/training.py,2647,function,"Reduce PerReplica objects. Arguments: values: Structure of `PerReplica` objects or `Tensor`s. `Tensor`s are @@ -38139,34 +45966,9 @@ Arguments: Returns: Structure of `Tensor`s." -5547,concat,tensorflow/tensorflow/python/keras/engine/training.py,2677,function,Concats `tensor`s along `axis`. -5548,_is_tpu_multi_host,tensorflow/tensorflow/python/keras/engine/training.py,2686,function, -5549,_tpu_multi_host_concat,tensorflow/tensorflow/python/keras/engine/training.py,2691,function,Correctly order TPU PerReplica objects. -5550,_minimize,tensorflow/tensorflow/python/keras/engine/training.py,2706,function,"Minimizes loss for one step by updating `trainable_variables`. - -This is roughly equivalent to - -```python -gradients = tape.gradient(loss, trainable_variables) -self.optimizer.apply_gradients(zip(gradients, trainable_variables)) -``` - -However, this function also applies gradient clipping and loss scaling if the -optimizer is a LossScaleOptimizer. - -Args: - strategy: `tf.distribute.Strategy`. - tape: A gradient tape. The loss must have been computed under this tape. - optimizer: The optimizer used to minimize the loss. - loss: The loss tensor. - trainable_variables: The variables that will be updated in order to minimize - the loss." -5551,_is_scalar,tensorflow/tensorflow/python/keras/engine/training.py,2760,function, -5552,write_scalar_summaries,tensorflow/tensorflow/python/keras/engine/training.py,2764,function, -5553,_minimum_control_deps,tensorflow/tensorflow/python/keras/engine/training.py,2770,function,Returns the minimum control dependencies to ensure step succeeded. -5554,_disallow_inside_tf_function,tensorflow/tensorflow/python/keras/engine/training.py,2782,function, -5555,_is_hdf5_filepath,tensorflow/tensorflow/python/keras/engine/training.py,2794,function, -5556,model_iteration,tensorflow/tensorflow/python/keras/engine/training_arrays.py,46,function,"Loop function for arrays of data with modes TRAIN/TEST/PREDICT. +5895,concat,tensorflow/tensorflow/python/keras/engine/training.py,2677,function,Concats `tensor`s along `axis`. +5896,write_scalar_summaries,tensorflow/tensorflow/python/keras/engine/training.py,2764,function, +5897,model_iteration,tensorflow/tensorflow/python/keras/engine/training_arrays.py,46,function,"Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Arguments: model: Keras Model instance. @@ -38223,48 +46025,19 @@ Returns: Raises: ValueError: in case of invalid arguments." -5557,_get_model_feed,tensorflow/tensorflow/python/keras/engine/training_arrays.py,461,function, -5558,_print_train_info,tensorflow/tensorflow/python/keras/engine/training_arrays.py,470,function, -5559,_get_num_samples_or_steps,tensorflow/tensorflow/python/keras/engine/training_arrays.py,480,function,Returns total number of samples (when training in batch mode) or steps. -5560,_prepare_feed_values,tensorflow/tensorflow/python/keras/engine/training_arrays.py,488,function,"Prepare feed values to the model execution function. - -Arguments: - model: Model to prepare feed values for. - inputs: List or dict of model inputs. - targets: Optional list of model targets. - sample_weights: Optional list of sample weight arrays. - mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT. - -Returns: - Feed values for the model in the given mode." -5561,_get_iterator,tensorflow/tensorflow/python/keras/engine/training_arrays.py,538,function, -5562,_reinitialize_iterator,tensorflow/tensorflow/python/keras/engine/training_arrays.py,545,function, -5563,_make_execution_function,tensorflow/tensorflow/python/keras/engine/training_arrays.py,553,function,Makes function to run one step of model execution. -5564,_update_sample_weight_mode,tensorflow/tensorflow/python/keras/engine/training_arrays.py,560,function,Updates the sample_weight_mode of a given model. -5565,ArrayLikeTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_arrays.py,594,class,"TrainingLoop that handle inputs like array. +5898,ArrayLikeTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_arrays.py,594,class,"TrainingLoop that handle inputs like array. This is the default handler for most of the input data types, includes symbolic tensors or Numpy array-like, Datasets and iterators in graph mode (since they generate symbolic tensors). This Function is used to handle model with `run_eagerly` = False." -5566,ValidationDatasetNoLimitTest,tensorflow/tensorflow/python/keras/engine/training_arrays_test.py,38,class, -5567,PrintTrainingInfoTest,tensorflow/tensorflow/python/keras/engine/training_arrays_test.py,66,class, -5568,BatchCounterCallback,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,40,class, -5569,TestTrainingWithDataset,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,53,class, -5570,TestMetricsWithDatasets,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,526,class, -5571,_per_replica_execution_function,tensorflow/tensorflow/python/keras/engine/training_distributed.py,45,function, -5572,_build_model,tensorflow/tensorflow/python/keras/engine/training_distributed.py,51,function, -5573,_make_train_step_fn,tensorflow/tensorflow/python/keras/engine/training_distributed.py,60,function,"Create step fn. - -Arguments: - model: a Keras Model instance. - mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT. - strategy: a `tf.distribute.Strategy` instance. - output_labels: the output labels for the step function. - -Returns: - A step function to run by `tf.distribute.Strategy`." -5574,experimental_tpu_fit_loop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,123,function,"Fit loop for training with TPU tf.distribute.Strategy. +5899,fit,tensorflow/tensorflow/python/keras/engine/training_arrays.py,603,method, +5900,evaluate,tensorflow/tensorflow/python/keras/engine/training_arrays.py,668,method, +5901,predict,tensorflow/tensorflow/python/keras/engine/training_arrays.py,697,method, +5902,BatchCounterCallback,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,40,class, +5903,on_batch_begin,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,46,method, +5904,on_batch_end,tensorflow/tensorflow/python/keras/engine/training_dataset_test.py,49,method, +5905,experimental_tpu_fit_loop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,123,function,"Fit loop for training with TPU tf.distribute.Strategy. Arguments: model: Keras Model instance. @@ -38294,23 +46067,7 @@ Returns: Raises: ValueError: in case of invalid arguments." -5575,experimental_tpu_test_loop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,293,function,"Test loop for evaluating with TPU tf.distribute.Strategy. - -Arguments: - model: Keras Model instance. - dataset: Dataset for input data. - verbose: Integer, Verbosity mode 0 or 1. - steps: Total number of steps (batches of samples) - before declaring predictions finished. - Ignored with the default value of `None`. - callbacks: List of callbacks to be called during training - -Returns: - Scalar loss (if the model has a single output and no metrics) - or list of scalars (if the model has multiple outputs - and/or metrics). The attribute `model.metrics_names` will give you - the display labels for the outputs." -5576,experimental_tpu_predict_loop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,423,function,"Predict loop for predicting with TPU tf.distribute.Strategy. +5906,experimental_tpu_predict_loop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,423,function,"Predict loop for predicting with TPU tf.distribute.Strategy. Arguments: model: Keras Model instance. @@ -38325,60 +46082,15 @@ Returns: Array of predictions (if the model has a single output) or list of arrays of predictions (if the model has multiple outputs)." -5577,DistributionSingleWorkerTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,577,class,Training loop for distribution strategy with single worker. -5578,_train_with_multi_worker,tensorflow/tensorflow/python/keras/engine/training_distributed.py,763,function,Decorator that handles multi worker training with distribution strategy. -5579,DistributionMultiWorkerTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,782,class,Training loop for distribution strategy with multiple worker. -5580,_eager_loss_fn,tensorflow/tensorflow/python/keras/engine/training_eager.py,35,function, -5581,_eager_metrics_fn,tensorflow/tensorflow/python/keras/engine/training_eager.py,41,function,"Calculates the metrics for each output of the given model. - -Arguments: - model: The model on which metrics are being calculated. - outputs: The outputs of the given model. - targets: The predictions or targets of the given model. - sample_weights: Optional list of sample weights for each output. - masks: Optional list of masks for each output. - -Returns: - Returns the metric results for each output of the model." -5582,_model_loss,tensorflow/tensorflow/python/keras/engine/training_eager.py,84,function,"Calculates the loss for a given model. - -Arguments: - model: The model on which metrics are being calculated. - inputs: Either a dictionary of inputs to the model or a list of input - arrays. - targets: List of target arrays. - output_loss_metrics: List of metrics that are used to aggregated output - loss values. - sample_weights: Optional list of sample weight arrays. - training: Whether the model should be run in inference or training mode. - -Returns: - Returns the model output, total loss, loss value calculated using the - specified loss function and masks for each output. The total loss includes - regularization losses and applies masking and sample weighting - to the loss value." -5583,_process_single_batch,tensorflow/tensorflow/python/keras/engine/training_eager.py,221,function,"Calculate the loss and gradient for one input batch. - - The model weights are updated if training is set to True. - -Arguments: - model: Model whose loss has to be calculated. - inputs: List of input arrays. - targets: List of target arrays. - output_loss_metrics: List of metrics that are used to aggregated output - loss values. - sample_weights: Optional list of sample weight arrays. - training: The boolean represents if the weights of the model are updated. - 'fit' methods will set this to True while 'evaluate' methods will - set this to False. - -Returns: - output of the model, total loss, the loss and the mask - associated with each output. - -Raises: - ValueError: If the model has no loss to optimize." -5584,train_on_batch,tensorflow/tensorflow/python/keras/engine/training_eager.py,285,function,"Calculates the loss and gradient updates for one input batch. +5907,DistributionSingleWorkerTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,577,class,Training loop for distribution strategy with single worker. +5908,fit,tensorflow/tensorflow/python/keras/engine/training_distributed.py,580,method,Fit loop for Distribution Strategies. +5909,evaluate,tensorflow/tensorflow/python/keras/engine/training_distributed.py,687,method,Evaluate loop for Distribution Strategies. +5910,predict,tensorflow/tensorflow/python/keras/engine/training_distributed.py,728,method,Predict loop for Distribution Strategies. +5911,DistributionMultiWorkerTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_distributed.py,782,class,Training loop for distribution strategy with multiple worker. +5912,fit,tensorflow/tensorflow/python/keras/engine/training_distributed.py,788,method, +5913,evaluate,tensorflow/tensorflow/python/keras/engine/training_distributed.py,792,method, +5914,predict,tensorflow/tensorflow/python/keras/engine/training_distributed.py,796,method, +5915,train_on_batch,tensorflow/tensorflow/python/keras/engine/training_eager.py,285,function,"Calculates the loss and gradient updates for one input batch. Arguments: model: Model whose loss has to be calculated. @@ -38394,25 +46106,7 @@ Returns: 'output_losses': list of tensors for loss corresponding to each of the model output. Could be a empty list when model has only one output. 'metrics': list of tensors for metric specified." -5585,test_on_batch,tensorflow/tensorflow/python/keras/engine/training_eager.py,326,function,"Calculates the loss for one input batch. - -Arguments: - model: Model whose loss has to be calculated. - inputs: Input batch data. - targets: Target batch data. - sample_weights: Sample weight batch data. - output_loss_metrics: List of metrics that are used to aggregated output - loss values. - -Returns: - Dict with three items: - 'total_loss': single tensor for overall loss, - 'output_losses': list of tensors for loss corresponding to each of the - model output. Could be a empty list when model has only one output. - 'metrics': list of tensors for metric specified." -5586,TrainingTest,tensorflow/tensorflow/python/keras/engine/training_eager_test.py,36,class, -5587,CorrectnessTest,tensorflow/tensorflow/python/keras/engine/training_eager_test.py,229,class, -5588,model_iteration,tensorflow/tensorflow/python/keras/engine/training_generator.py,41,function,"Loop function for arrays of data with modes TRAIN/TEST/PREDICT. +5916,model_iteration,tensorflow/tensorflow/python/keras/engine/training_generator.py,41,function,"Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Arguments: model: Keras Model instance. @@ -38474,37 +46168,7 @@ Returns: Raises: ValueError: in case of invalid arguments." -5589,_get_next_batch,tensorflow/tensorflow/python/keras/engine/training_generator.py,347,function,Retrieves the next batch of input data. -5590,_validate_arguments,tensorflow/tensorflow/python/keras/engine/training_generator.py,365,function,"Raises errors if arguments are invalid. - -Arguments: - is_sequence: Boolean, whether data is a `keras.utils.data_utils.Sequence` - instance. - is_dataset: Boolean, whether data is a dataset instance. - use_multiprocessing: Boolean. If `True`, use process-based threading. If - unspecified, `use_multiprocessing` will default to `False`. Note that - because this implementation relies on multiprocessing, you should not pass - non-picklable arguments to the generator as they can't be passed easily to - children processes. - workers: Integer. Maximum number of processes to spin up when using - process-based threading. If unspecified, `workers` will default to 1. If - 0, will execute the generator on the main thread. - steps_per_epoch: Total number of steps (batches of samples) before declaring - one epoch finished and starting the next epoch. Ignored with the default - value of `None`. - validation_data: Either a tuple of NumPy/Tensor inputs (i.e. `(x,)` or `(x, - y)` or `(x, y, sample_weights)`) or a generator or - `keras.utils.data_utils.Sequence` object or Eager Iterator or Dataset. - validation_steps: Total number of steps (batches of samples) before - declaring validation finished. - mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT. - kwargs: Additional arguments for backwards compatibility. - -Raises: - ValueError: If `steps_per_epoch` or `validation_steps` are not passed - for data types that require them, or if unrecognized keyword - arguments are passed." -5591,convert_to_generator_like,tensorflow/tensorflow/python/keras/engine/training_generator.py,422,function,"Make a generator out of NumPy or EagerTensor inputs. +5917,convert_to_generator_like,tensorflow/tensorflow/python/keras/engine/training_generator.py,422,function,"Make a generator out of NumPy or EagerTensor inputs. Arguments: data: Either a generator or `keras.utils.data_utils.Sequence` object or @@ -38525,46 +46189,45 @@ Returns: Raises: - ValueError: If `batch_size` is not provided for NumPy or EagerTensor inputs." -5592,_make_enqueued_generator,tensorflow/tensorflow/python/keras/engine/training_generator.py,487,function,Create a buffered queue of next elements of the generator. -5593,_make_execution_function,tensorflow/tensorflow/python/keras/engine/training_generator.py,512,function,Makes function to run one step of model execution. -5594,_get_num_samples_or_steps,tensorflow/tensorflow/python/keras/engine/training_generator.py,533,function,"Returns number of samples or steps, and whether to use steps count mode." -5595,GeneratorOrSequenceTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,541,class,"Generator-like. +5918,GeneratorOrSequenceTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,541,class,"Generator-like. Input is Python generator, or Sequence object. The difference between this class and `GeneratorLikeTrainingFunction` is that this class only handles inputs that with x, y and sample_weight fused into one param." -5596,EagerDatasetOrIteratorTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,638,class,A non-distributed Dataset or iterator in eager execution. -5597,GeneratorLikeTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,711,class,"TrainingLoop that handle inputs like python generator. +5919,fit,tensorflow/tensorflow/python/keras/engine/training_generator.py,551,method, +5920,evaluate,tensorflow/tensorflow/python/keras/engine/training_generator.py,592,method, +5921,predict,tensorflow/tensorflow/python/keras/engine/training_generator.py,616,method, +5922,EagerDatasetOrIteratorTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,638,class,A non-distributed Dataset or iterator in eager execution. +5923,fit,tensorflow/tensorflow/python/keras/engine/training_generator.py,641,method, +5924,evaluate,tensorflow/tensorflow/python/keras/engine/training_generator.py,682,method, +5925,predict,tensorflow/tensorflow/python/keras/engine/training_generator.py,698,method, +5926,GeneratorLikeTrainingLoop,tensorflow/tensorflow/python/keras/engine/training_generator.py,711,class,"TrainingLoop that handle inputs like python generator. This is the default handler for most of the input data types, includes symbolic tensors or Numpy array-like, Datasets and iterators in graph mode (since they generate symbolic tensors). This Function is used to handle model with `run_eagerly` = True." -5598,custom_generator,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,44,function, -5599,custom_generator_changing_batch_size,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,67,function, -5600,TestGeneratorMethods,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,95,class, -5601,TestGeneratorMethodsWithSequences,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,383,class, -5602,TestConvertToGeneratorLike,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,489,class, -5603,TrainingGPUTest,tensorflow/tensorflow/python/keras/engine/training_gpu_test.py,32,class, -5604,_conv2d_filter,tensorflow/tensorflow/python/keras/engine/training_integration_test.py,37,function,Convolution with non-default strides and dilation rate is not supported. -5605,_gather_test_cases,tensorflow/tensorflow/python/keras/engine/training_integration_test.py,104,function, -5606,CoreLayerIntegrationTest,tensorflow/tensorflow/python/keras/engine/training_integration_test.py,122,class,Test that layers and models produce the correct tensor types. -5607,TrainingTest,tensorflow/tensorflow/python/keras/engine/training_test.py,70,class, -5608,TestExceptionsAndWarnings,tensorflow/tensorflow/python/keras/engine/training_test.py,1622,class, -5609,LossWeightingTest,tensorflow/tensorflow/python/keras/engine/training_test.py,1695,class, -5610,MaskingTest,tensorflow/tensorflow/python/keras/engine/training_test.py,1981,class, -5611,TestDynamicTrainability,tensorflow/tensorflow/python/keras/engine/training_test.py,2044,class, -5612,TestTrainingWithDataTensors,tensorflow/tensorflow/python/keras/engine/training_test.py,2250,class, -5613,TestTrainingWithMetrics,tensorflow/tensorflow/python/keras/engine/training_test.py,2768,class,Training tests related to metrics. -5614,BareUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3431,class, -5615,LambdaUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3446,class, -5616,NestedUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3462,class, -5617,SubgraphUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3476,class, -5618,TestAutoUpdates,tensorflow/tensorflow/python/keras/engine/training_test.py,3496,class, -5619,TestFunctionTracing,tensorflow/tensorflow/python/keras/engine/training_test.py,3586,class, -5620,Aggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,65,class,"Abstract base class used to aggregate batch-level outputs of a loop. +5927,fit,tensorflow/tensorflow/python/keras/engine/training_generator.py,720,method, +5928,evaluate,tensorflow/tensorflow/python/keras/engine/training_generator.py,781,method, +5929,predict,tensorflow/tensorflow/python/keras/engine/training_generator.py,808,method, +5930,custom_generator,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,44,function, +5931,custom_generator_changing_batch_size,tensorflow/tensorflow/python/keras/engine/training_generator_test.py,67,function, +5932,BareUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3431,class, +5933,build,tensorflow/tensorflow/python/keras/engine/training_test.py,3433,method, +5934,call,tensorflow/tensorflow/python/keras/engine/training_test.py,3441,method, +5935,LambdaUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3446,class, +5936,build,tensorflow/tensorflow/python/keras/engine/training_test.py,3448,method, +5937,call,tensorflow/tensorflow/python/keras/engine/training_test.py,3456,method, +5938,NestedUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3462,class, +5939,build,tensorflow/tensorflow/python/keras/engine/training_test.py,3464,method, +5940,counter,tensorflow/tensorflow/python/keras/engine/training_test.py,3469,method, +5941,call,tensorflow/tensorflow/python/keras/engine/training_test.py,3472,method, +5942,SubgraphUpdateLayer,tensorflow/tensorflow/python/keras/engine/training_test.py,3476,class, +5943,build,tensorflow/tensorflow/python/keras/engine/training_test.py,3478,method, +5944,call,tensorflow/tensorflow/python/keras/engine/training_test.py,3486,method, +5945,Aggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,65,class,"Abstract base class used to aggregate batch-level outputs of a loop. Attributes: use_steps: Whether the loop is using `step` or `batch_size`. @@ -38573,25 +46236,44 @@ Attributes: batch_size: Batch size. It is used for validation checks between inputs and outputs. results: What to return at the end of the aggregation loop." -5621,MetricsAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,112,class,"Aggregator that calculates loss and metrics info. +5946,create,tensorflow/tensorflow/python/keras/engine/training_utils.py,85,method,"Creates the initial results from the first batch outputs. + +Arguments: + batch_outs: A list of batch-level outputs." +5947,aggregate,tensorflow/tensorflow/python/keras/engine/training_utils.py,94,method,"Aggregates batch-level results into total results. + +Arguments: + batch_outs: A list of batch-level outputs. + batch_start: The start index of this batch. Always `None` if `use_steps` + is `True`. + batch_end: The end index of this batch. Always `None` if `use_steps` is + `True`." +5948,finalize,tensorflow/tensorflow/python/keras/engine/training_utils.py,107,method,Prepares the total results to be returned. +5949,MetricsAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,112,class,"Aggregator that calculates loss and metrics info. Attributes: use_steps: Whether the loop is using `step` or `batch_size`. num_samples: Total number of samples: `batch_size*num_batches`. steps: Total number of steps, ie number of times to iterate over a dataset to cover all samples." -5622,ConcatAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,147,class,"Combine tensor-likes which cannot be merged on the fly. +5950,create,tensorflow/tensorflow/python/keras/engine/training_utils.py,129,method, +5951,aggregate,tensorflow/tensorflow/python/keras/engine/training_utils.py,132,method, +5952,finalize,tensorflow/tensorflow/python/keras/engine/training_utils.py,141,method, +5953,ConcatAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,147,class,"Combine tensor-likes which cannot be merged on the fly. This class expects to aggregate a single tensor-like rather than a nested structure of tensor-likes." -5623,get_copy_pool,tensorflow/tensorflow/python/keras/engine/training_utils.py,198,function,"Shared threadpool for copying arrays. +5954,create,tensorflow/tensorflow/python/keras/engine/training_utils.py,159,method, +5955,aggregate,tensorflow/tensorflow/python/keras/engine/training_utils.py,163,method, +5956,finalize,tensorflow/tensorflow/python/keras/engine/training_utils.py,175,method, +5957,get_copy_pool,tensorflow/tensorflow/python/keras/engine/training_utils.py,198,function,"Shared threadpool for copying arrays. Pool instantiation takes ~ 2ms, so a singleton pool is used rather than creating a pool per SliceAggregator. Returns: The global copy threadpool." -5624,SliceAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,214,class,"Combine arrays where the final size is known. +5958,SliceAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,214,class,"Combine arrays where the final size is known. This class expects to aggregate a single tensor-like rather than a nested structure of tensor-likes. @@ -38610,9 +46292,15 @@ it is faster to simply assign in the main thread rather than enqueue the assignment in a side thread. The exact threshold will vary from system to system, but the time is not very sensitive to the exact transition so a value of 2 ** 14 was chosen which should be reasonable on most systems." -5625,OutputsAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,312,class,Aggregator that concatenates outputs. -5626,get_progbar,tensorflow/tensorflow/python/keras/engine/training_utils.py,355,function,Get Progbar. -5627,slice_arrays,tensorflow/tensorflow/python/keras/engine/training_utils.py,366,function,"Slices batches out of provided arrays (workaround for eager tensors). +5959,create,tensorflow/tensorflow/python/keras/engine/training_utils.py,249,method, +5960,aggregate,tensorflow/tensorflow/python/keras/engine/training_utils.py,259,method, +5961,finalize,tensorflow/tensorflow/python/keras/engine/training_utils.py,301,method, +5962,OutputsAggregator,tensorflow/tensorflow/python/keras/engine/training_utils.py,312,class,Aggregator that concatenates outputs. +5963,create,tensorflow/tensorflow/python/keras/engine/training_utils.py,317,method, +5964,aggregate,tensorflow/tensorflow/python/keras/engine/training_utils.py,343,method, +5965,finalize,tensorflow/tensorflow/python/keras/engine/training_utils.py,348,method, +5966,get_progbar,tensorflow/tensorflow/python/keras/engine/training_utils.py,355,function,Get Progbar. +5967,slice_arrays,tensorflow/tensorflow/python/keras/engine/training_utils.py,366,function,"Slices batches out of provided arrays (workaround for eager tensors). Unfortunately eager tensors don't have the same slicing behavior as Numpy arrays (they follow the same slicing behavior as symbolic TF tensors), @@ -38628,7 +46316,7 @@ Arguments: Returns: Slice of data (either single array or list of arrays)." -5628,check_num_samples,tensorflow/tensorflow/python/keras/engine/training_utils.py,402,function,"Determine the number of samples provided for training and evaluation. +5968,check_num_samples,tensorflow/tensorflow/python/keras/engine/training_utils.py,402,function,"Determine the number of samples provided for training and evaluation. The number of samples is not defined when running with `steps`, in which case the number of samples is set to `None`. @@ -38651,8 +46339,8 @@ Returns: processed based on the size of the first dimension of the first input numpy array. When steps is not `None` and `batch_size` is `None`, returns `None`." -5629,standardize_single_array,tensorflow/tensorflow/python/keras/engine/training_utils.py,438,function,"Expand data of shape (x,) to (x, 1), unless len(expected_shape)==1." -5630,standardize_input_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,459,function,"Normalizes inputs and targets provided by users. +5969,standardize_single_array,tensorflow/tensorflow/python/keras/engine/training_utils.py,438,function,"Expand data of shape (x,) to (x, 1), unless len(expected_shape)==1." +5970,standardize_input_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,459,function,"Normalizes inputs and targets provided by users. Users may pass data as a list of arrays, dictionary of arrays, or as a single array. We normalize this to an ordered list of @@ -38672,7 +46360,7 @@ Returns: Raises: ValueError: in case of improperly formatted user-provided data." -5631,standardize_sample_or_class_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,585,function,"Maps `sample_weight` or `class_weight` to model outputs. +5971,standardize_sample_or_class_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,585,function,"Maps `sample_weight` or `class_weight` to model outputs. Arguments: x_weight: User-provided `sample_weight` or `class_weight` argument. @@ -38685,9 +46373,9 @@ Returns: Raises: ValueError: In case of invalid user-provided argument." -5632,standardize_class_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,631,function, -5633,standardize_sample_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,636,function, -5634,handle_partial_sample_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,641,function,"Adds 1.0 as sample weights for the outputs for which there is no weight. +5972,standardize_class_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,631,function, +5973,standardize_sample_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,636,function, +5974,handle_partial_sample_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,641,function,"Adds 1.0 as sample weights for the outputs for which there is no weight. Args: outputs: List of model outputs. @@ -38699,7 +46387,7 @@ Args: Returns: Tuple of sample weights, one sample weight for every output, and booleans describing the raw sample weights." -5635,check_array_lengths,tensorflow/tensorflow/python/keras/engine/training_utils.py,700,function,"Does user input validation for numpy arrays. +5975,check_array_lengths,tensorflow/tensorflow/python/keras/engine/training_utils.py,700,function,"Does user input validation for numpy arrays. Arguments: inputs: list of Numpy arrays of inputs. @@ -38708,7 +46396,7 @@ Arguments: Raises: ValueError: in case of incorrectly formatted data." -5636,check_loss_and_target_compatibility,tensorflow/tensorflow/python/keras/engine/training_utils.py,755,function,"Does validation on the compatibility of targets and loss functions. +5976,check_loss_and_target_compatibility,tensorflow/tensorflow/python/keras/engine/training_utils.py,755,function,"Does validation on the compatibility of targets and loss functions. This helps prevent users from using loss functions incorrectly. This check is purely for UX purposes. @@ -38721,7 +46409,7 @@ Arguments: Raises: ValueError: if a loss function or target array is incompatible with an output." -5637,collect_per_output_metric_info,tensorflow/tensorflow/python/keras/engine/training_utils.py,814,function,"Maps metric names and functions to model outputs. +5977,collect_per_output_metric_info,tensorflow/tensorflow/python/keras/engine/training_utils.py,814,function,"Maps metric names and functions to model outputs. Arguments: metrics: a list or a list of lists or a dict of metric functions. @@ -38744,7 +46432,7 @@ Returns: Raises: TypeError: if an incorrect type is passed for the `metrics` argument." -5638,batch_shuffle,tensorflow/tensorflow/python/keras/engine/training_utils.py,893,function,"Shuffles an array in a batch-wise fashion. +5978,batch_shuffle,tensorflow/tensorflow/python/keras/engine/training_utils.py,893,function,"Shuffles an array in a batch-wise fashion. Useful for shuffling HDF5 arrays (where one cannot access arbitrary indices). @@ -38755,7 +46443,7 @@ Arguments: Returns: The `index_array` array, shuffled in a batch-wise fashion." -5639,standardize_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,917,function,"Performs sample weight validation and standardization. +5979,standardize_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,917,function,"Performs sample weight validation and standardization. Everything gets normalized to a single sample-wise (or timestep-wise) weight array. If both `sample_weight` and `class_weight` are provided, @@ -38775,9 +46463,9 @@ Returns: Raises: ValueError: In case of invalid user-provided arguments." -5640,has_symbolic_tensors,tensorflow/tensorflow/python/keras/engine/training_utils.py,1044,function, -5641,has_tensors,tensorflow/tensorflow/python/keras/engine/training_utils.py,1050,function,Returns true if `ls` contains tensors. -5642,get_metric_name,tensorflow/tensorflow/python/keras/engine/training_utils.py,1068,function,"Returns the name corresponding to the given metric input. +5980,has_symbolic_tensors,tensorflow/tensorflow/python/keras/engine/training_utils.py,1044,function, +5981,has_tensors,tensorflow/tensorflow/python/keras/engine/training_utils.py,1050,function,Returns true if `ls` contains tensors. +5982,get_metric_name,tensorflow/tensorflow/python/keras/engine/training_utils.py,1068,function,"Returns the name corresponding to the given metric input. Arguments: metric: Metric function name or reference. @@ -38785,7 +46473,7 @@ Arguments: Returns: The metric name." -5643,get_metric_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1103,function,"Returns the metric function corresponding to the given metric input. +5983,get_metric_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1103,function,"Returns the metric function corresponding to the given metric input. Arguments: metric: Metric function name or reference. @@ -38795,9 +46483,9 @@ Arguments: Returns: The metric function." -5644,call_metric_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1145,function,Invokes metric function and returns the metric result tensor. -5645,get_loss_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1169,function,Returns the loss corresponding to the loss input in `compile` API. -5646,RespectCompiledTrainableState,tensorflow/tensorflow/python/keras/engine/training_utils.py,1201,class,"Set and restore trainable state if it has changed since compile. +5984,call_metric_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1145,function,Invokes metric function and returns the metric result tensor. +5985,get_loss_function,tensorflow/tensorflow/python/keras/engine/training_utils.py,1169,function,Returns the loss corresponding to the loss input in `compile` API. +5986,RespectCompiledTrainableState,tensorflow/tensorflow/python/keras/engine/training_utils.py,1201,class,"Set and restore trainable state if it has changed since compile. The keras API guarantees that the value of each Layer's `trainable` property at `Model.compile` time will be used when training that model. In order to @@ -38811,7 +46499,7 @@ However, the trainable state of a layer changes quite infrequently, if ever, for many kinds of workflows. Moreover, updating every layer in a model is an expensive operation. As a result, we will only explicitly set and unset the trainable state of a model if a trainable value has changed since compile." -5647,validate_dataset_input,tensorflow/tensorflow/python/keras/engine/training_utils.py,1247,function,"Validates user input arguments when a dataset iterator is passed. +5987,validate_dataset_input,tensorflow/tensorflow/python/keras/engine/training_utils.py,1247,function,"Validates user input arguments when a dataset iterator is passed. Arguments: x: Input data. A `tf.data` dataset or iterator. @@ -38827,9 +46515,9 @@ Arguments: Raises: ValueError: if argument `y` or `sample_weight` or `validation_split` are provided by user." -5648,validate_input_types,tensorflow/tensorflow/python/keras/engine/training_utils.py,1285,function,Helper function to validate either inputs or targets. -5649,check_generator_arguments,tensorflow/tensorflow/python/keras/engine/training_utils.py,1303,function,Validates arguments passed when using a generator. -5650,check_steps_argument,tensorflow/tensorflow/python/keras/engine/training_utils.py,1319,function,"Validates `steps` argument based on input data's type. +5988,validate_input_types,tensorflow/tensorflow/python/keras/engine/training_utils.py,1285,function,Helper function to validate either inputs or targets. +5989,check_generator_arguments,tensorflow/tensorflow/python/keras/engine/training_utils.py,1303,function,Validates arguments passed when using a generator. +5990,check_steps_argument,tensorflow/tensorflow/python/keras/engine/training_utils.py,1319,function,"Validates `steps` argument based on input data's type. The cases when `steps` value must be provided are when 1. input data passed is an iterator. @@ -38850,8 +46538,8 @@ Returns: Raises: ValueError: if `steps` argument is required for given input data type but not provided." -5651,cast_single_tensor,tensorflow/tensorflow/python/keras/engine/training_utils.py,1367,function, -5652,cast_if_floating_dtype_and_mismatch,tensorflow/tensorflow/python/keras/engine/training_utils.py,1376,function,"Returns target data tensors using correct datatype. +5991,cast_single_tensor,tensorflow/tensorflow/python/keras/engine/training_utils.py,1367,function, +5992,cast_if_floating_dtype_and_mismatch,tensorflow/tensorflow/python/keras/engine/training_utils.py,1376,function,"Returns target data tensors using correct datatype. Checks that each target and output pair are the same datatype. If not, casts the target to the output's datatype. @@ -38862,7 +46550,7 @@ Args: Returns: Targets in appropriate datatype." -5653,cast_if_floating_dtype,tensorflow/tensorflow/python/keras/engine/training_utils.py,1403,function,"Casts the given data tensors to the default floating point type. +5993,cast_if_floating_dtype,tensorflow/tensorflow/python/keras/engine/training_utils.py,1403,function,"Casts the given data tensors to the default floating point type. Casts only if the input is already a floating point type. Args: @@ -38871,7 +46559,7 @@ Args: Returns: Converted input." -5654,cast_to_model_input_dtypes,tensorflow/tensorflow/python/keras/engine/training_utils.py,1418,function,"Casts the given data tensors to the dtypes of the model inputs. +5994,cast_to_model_input_dtypes,tensorflow/tensorflow/python/keras/engine/training_utils.py,1418,function,"Casts the given data tensors to the dtypes of the model inputs. Args: x: tensor or list/tuple of tensors. @@ -38880,7 +46568,7 @@ Args: Returns: Converted input. Each tensor is casted to the corresponding input in `model.inputs`." -5655,prepare_sample_weight_modes,tensorflow/tensorflow/python/keras/engine/training_utils.py,1433,function,"Prepares sample weight modes for the model. +5995,prepare_sample_weight_modes,tensorflow/tensorflow/python/keras/engine/training_utils.py,1433,function,"Prepares sample weight modes for the model. Args: training_endpoints: List of model _TrainingEndpoints. @@ -38888,7 +46576,7 @@ Args: Raises: ValueError: In case of invalid `sample_weight_mode` input." -5656,prepare_loss_functions,tensorflow/tensorflow/python/keras/engine/training_utils.py,1473,function,"Converts loss to a list of loss functions. +5996,prepare_loss_functions,tensorflow/tensorflow/python/keras/engine/training_utils.py,1473,function,"Converts loss to a list of loss functions. Arguments: loss: String (name of objective function), objective function or @@ -38904,7 +46592,7 @@ Returns: Raises: ValueError: If loss is a dict with keys not in model output names, or if loss is a list with len not equal to model outputs." -5657,prepare_loss_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,1515,function,"Converts loss weights to a list of loss weights. +5997,prepare_loss_weights,tensorflow/tensorflow/python/keras/engine/training_utils.py,1515,function,"Converts loss weights to a list of loss weights. The result loss weights will be populated on the training endpoint. @@ -38921,9 +46609,9 @@ Arguments: Raises: ValueError: If loss weight is a dict with key not in model output names, or if loss is a list with len not equal to model outputs." -5658,is_feature_layer,tensorflow/tensorflow/python/keras/engine/training_utils.py,1559,function,Returns whether `layer` is a FeatureLayer or not. -5659,is_eager_dataset_or_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1564,function, -5660,assert_not_batched,tensorflow/tensorflow/python/keras/engine/training_utils.py,1571,function,"Asserts that `dataset` is not batched. +5998,is_feature_layer,tensorflow/tensorflow/python/keras/engine/training_utils.py,1559,function,Returns whether `layer` is a FeatureLayer or not. +5999,is_eager_dataset_or_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1564,function, +6000,assert_not_batched,tensorflow/tensorflow/python/keras/engine/training_utils.py,1571,function,"Asserts that `dataset` is not batched. The algorithm used by this method is sound but not complete. In other words, if the method fails to establish the assertion, it does not mean the dataset @@ -38943,7 +46631,7 @@ Args: Raises: ValueError: If the method cannot establish the assertion." -5661,assert_not_shuffled,tensorflow/tensorflow/python/keras/engine/training_utils.py,1626,function,"Asserts that `dataset` is not shuffled. +6001,assert_not_shuffled,tensorflow/tensorflow/python/keras/engine/training_utils.py,1626,function,"Asserts that `dataset` is not shuffled. The algorithm used by this method is sound but not complete. In other words, if the method fails to establish the assertion, it does not mean the dataset @@ -38963,31 +46651,31 @@ Args: Raises: ValueError: If the method cannot establish the assertion." -5662,verify_dataset_shuffled,tensorflow/tensorflow/python/keras/engine/training_utils.py,1682,function,"Verifies that the dataset is shuffled. +6002,verify_dataset_shuffled,tensorflow/tensorflow/python/keras/engine/training_utils.py,1682,function,"Verifies that the dataset is shuffled. Args: x: Dataset passed as an input to the model. Raises: ValueError: if the dataset is not already shuffled." -5663,is_dataset_or_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1702,function, -5664,get_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1707,function,Create and initialize an iterator from a dataset. -5665,initialize_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1717,function, -5666,extract_tensors_from_dataset,tensorflow/tensorflow/python/keras/engine/training_utils.py,1723,function,"Extract a tuple of tensors `inputs, targets, sample_weight` from a dataset. +6003,is_dataset_or_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1702,function, +6004,get_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1707,function,Create and initialize an iterator from a dataset. +6005,initialize_iterator,tensorflow/tensorflow/python/keras/engine/training_utils.py,1717,function, +6006,extract_tensors_from_dataset,tensorflow/tensorflow/python/keras/engine/training_utils.py,1723,function,"Extract a tuple of tensors `inputs, targets, sample_weight` from a dataset. Arguments: dataset: Dataset instance. Returns: Tuple of tensors `x, y, weights`. `y` and `weights` entry may be None." -5667,unpack_iterator_input,tensorflow/tensorflow/python/keras/engine/training_utils.py,1737,function,"Convert a dataset iterator to a tuple of tensors `x, y, sample_weights`. +6007,unpack_iterator_input,tensorflow/tensorflow/python/keras/engine/training_utils.py,1737,function,"Convert a dataset iterator to a tuple of tensors `x, y, sample_weights`. Arguments: iterator: Instance of a dataset iterator. Returns: Tuple of tensors `x, y, weights`. `y` and `weights` entry may be None." -5668,infer_steps_for_dataset,tensorflow/tensorflow/python/keras/engine/training_utils.py,1771,function,"Infers steps_per_epoch needed to loop through a dataset. +6008,infer_steps_for_dataset,tensorflow/tensorflow/python/keras/engine/training_utils.py,1771,function,"Infers steps_per_epoch needed to loop through a dataset. Arguments: model: Keras model instance. @@ -39006,10 +46694,17 @@ Returns: Raises: ValueError: In case of invalid argument values." -5669,ModelInputs,tensorflow/tensorflow/python/keras/engine/training_utils.py,1829,class,"Encapsulates model inputs. +6009,ModelInputs,tensorflow/tensorflow/python/keras/engine/training_utils.py,1829,class,"Encapsulates model inputs. Allows for transforming model inputs while keeping the same structure." -5670,get_input_shape_and_dtype,tensorflow/tensorflow/python/keras/engine/training_utils.py,1910,function,"Retrieves input shape and input dtype of layer if applicable. +6010,get_input_names,tensorflow/tensorflow/python/keras/engine/training_utils.py,1853,method,"Returns keys to name inputs by. + +In case inputs provided were a list, tuple or single entry, we make up a +key 'input_%d'. For dictionary case, we return a sorted list of keys." +6011,get_symbolic_inputs,tensorflow/tensorflow/python/keras/engine/training_utils.py,1861,method,Returns inputs to be set as self.inputs for a model. +6012,as_dict,tensorflow/tensorflow/python/keras/engine/training_utils.py,1898,method,An iterable over a dictionary version of inputs. +6013,as_list,tensorflow/tensorflow/python/keras/engine/training_utils.py,1903,method,Returning the inputs as a list. +6014,get_input_shape_and_dtype,tensorflow/tensorflow/python/keras/engine/training_utils.py,1910,function,"Retrieves input shape and input dtype of layer if applicable. Args: layer: Layer (or model) instance. @@ -39020,15 +46715,15 @@ Returns: Raises: ValueError: in case an empty Sequential or Functional model is passed." -5671,get_static_batch_size,tensorflow/tensorflow/python/keras/engine/training_utils.py,1944,function,"Gets the static batch size of a Layer. +6015,get_static_batch_size,tensorflow/tensorflow/python/keras/engine/training_utils.py,1944,function,"Gets the static batch size of a Layer. Arguments: layer: a `Layer` instance. Returns: The static batch size of a Layer." -5672,generic_output_names,tensorflow/tensorflow/python/keras/engine/training_utils.py,1959,function, -5673,convert_eager_tensors_to_numpy,tensorflow/tensorflow/python/keras/engine/training_utils.py,1963,function,"Convert every EagerTensor in `structure` to NumPy. +6016,generic_output_names,tensorflow/tensorflow/python/keras/engine/training_utils.py,1959,function, +6017,convert_eager_tensors_to_numpy,tensorflow/tensorflow/python/keras/engine/training_utils.py,1963,function,"Convert every EagerTensor in `structure` to NumPy. Arguments: structure: An arbitrary structure of elements to be converted to NumPy @@ -39036,8 +46731,8 @@ Arguments: Returns: An identical structure with EagerTensors converted to NumPy arrays." -5674,list_to_tuple,tensorflow/tensorflow/python/keras/engine/training_utils.py,1982,function,"Datasets will stack the list of tensor, so switch them to tuples." -5675,should_run_validation,tensorflow/tensorflow/python/keras/engine/training_utils.py,1989,function,"Checks if validation should be run this epoch. +6018,list_to_tuple,tensorflow/tensorflow/python/keras/engine/training_utils.py,1982,function,"Datasets will stack the list of tensor, so switch them to tuples." +6019,should_run_validation,tensorflow/tensorflow/python/keras/engine/training_utils.py,1989,function,"Checks if validation should be run this epoch. Arguments: validation_freq: Integer or list. If an integer, specifies how many training @@ -39051,8 +46746,8 @@ Returns: Raises: ValueError: if `validation_freq` is an Integer and less than 1, or if it is neither an Integer nor a Sequence." -5676,split_training_and_validation_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,2019,function,Split input data into train/eval section based on validation_split. -5677,unpack_validation_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,2042,function,"Unpack validation data based input type. +6020,split_training_and_validation_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,2019,function,Split input data into train/eval section based on validation_split. +6021,unpack_validation_data,tensorflow/tensorflow/python/keras/engine/training_utils.py,2042,function,"Unpack validation data based input type. The validation data is not touched if its dataset or dataset iterator. For other type of input (Numpy or tensor), it will be unpacked into tuple of @@ -39066,21 +46761,21 @@ Args: Returns: tuple of 3, (x, y, sample_weights) for numpy and tensor input." -5678,TrainingLoop,tensorflow/tensorflow/python/keras/engine/training_utils.py,2090,class,"TrainingLoop is a wrapper class around the training logic. +6022,TrainingLoop,tensorflow/tensorflow/python/keras/engine/training_utils.py,2090,class,"TrainingLoop is a wrapper class around the training logic. This class is trying to encapsulate the different logic of fit/eval/predict with regard to different data input and model condition. Note that TrainingLoop is stateless, which means it doesn't contain any internal field and can be reused with different model and inputs." -5679,ModelInputsTest,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,44,class, -5680,DatasetUtilsTest,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,134,class, -5681,StandardizeWeightsTest,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,244,class, -5682,MonitoredPool,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,287,class, -5683,add_sleep,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,301,function, -5684,cause_error,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,309,function, -5685,AggregationTest,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,326,class, -5686,Model,tensorflow/tensorflow/python/keras/engine/training_v1.py,79,class,"`Model` groups layers into an object with training and inference features. +6023,fit,tensorflow/tensorflow/python/keras/engine/training_utils.py,2100,method,Train the model with the inputs and targets. +6024,evaluate,tensorflow/tensorflow/python/keras/engine/training_utils.py,2121,method,Returns the loss value & metrics values for the model in test mode. +6025,predict,tensorflow/tensorflow/python/keras/engine/training_utils.py,2134,method, +6026,MonitoredPool,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,287,class, +6027,apply_async,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,294,method, +6028,add_sleep,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,301,function, +6029,cause_error,tensorflow/tensorflow/python/keras/engine/training_utils_test.py,309,function, +6030,Model,tensorflow/tensorflow/python/keras/engine/training_v1.py,79,class,"`Model` groups layers into an object with training and inference features. There are two ways to instantiate a `Model`: @@ -39141,53 +46836,473 @@ class MyModel(tf.keras.Model): model = MyModel() ```" -5687,DistributedCallbackModel,tensorflow/tensorflow/python/keras/engine/training_v1.py,2834,class,Model that is used for callbacks with tf.distribute.Strategy. -5688,_TrainingEndpoint,tensorflow/tensorflow/python/keras/engine/training_v1.py,2874,class,"A container for the training output/target and related entities. - -In the case of model with multiple outputs, there is a one-to-one mapping -between model output (y_pred), model target (y_true), loss, metrics etc. -By unifying these entities into one class, different entity can access -information between each other, rather than currently access different list of -attributes of the model." -5689,_TrainingTarget,tensorflow/tensorflow/python/keras/engine/training_v1.py,3106,class,"Container for a target tensor (y_true) and its metadata (shape, loss...). - -Arguments: - target: A target tensor for the model. It may be `None` if the - output is excluded from loss computation. It is still kept as None - since each output of the model should have a corresponding target. If - the target is None, the rest of the attributes will be None as well. - feedable: Boolean, whether the target is feedable (requires data to be - passed in `fit` or `train_on_batch`), or not (model compiled with - `target_tensors` argument). - skip_target_weights: Boolean, whether the target should be skipped during - weights calculation." -5690,_is_symbolic_tensor,tensorflow/tensorflow/python/keras/engine/training_v1.py,3139,function, -5691,_convert_scipy_sparse_tensor,tensorflow/tensorflow/python/keras/engine/training_v1.py,3143,function,"Handle scipy sparse tensor conversions. - -This method takes a value 'value' and returns the proper conversion. If -value is a scipy sparse tensor and the expected input is a dense tensor, -we densify 'value'. If value is a scipy sparse tensor and the expected input -is a TF SparseTensor, we convert 'value' to a SparseTensor. If 'value' is -not a scipy sparse tensor, or scipy is not imported, we pass it through -unchanged. - -Arguments: - value: An object that may be a scipy sparse tensor - expected_input: The expected input placeholder. +6031,get_weights,tensorflow/tensorflow/python/keras/engine/training_v1.py,173,method,"Retrieves the weights of the model. Returns: - The possibly-converted 'value'." -5692,_get_metrics_from_layers,tensorflow/tensorflow/python/keras/engine/training_v1.py,3179,function,"Returns list of metrics from the given layers. + A flat list of Numpy arrays." +6032,load_weights,tensorflow/tensorflow/python/keras/engine/training_v1.py,186,method,"Loads all layer weights, either from a TensorFlow or an HDF5 weight file. -This will not include the `compile` metrics of a model layer. +If `by_name` is False weights are loaded based on the network's +topology. This means the architecture should be the same as when the weights +were saved. Note that layers that don't have weights are not taken into +account in the topological ordering, so adding or removing layers is fine as +long as they don't have weights. + +If `by_name` is True, weights are loaded into layers only if they share the +same name. This is useful for fine-tuning or transfer-learning models where +some of the layers have changed. + +Only topological loading (`by_name=False`) is supported when loading weights +from the TensorFlow format. Note that topological loading differs slightly +between TensorFlow and HDF5 formats for user-defined classes inheriting from +`tf.keras.Model`: HDF5 loads based on a flattened list of weights, while the +TensorFlow format loads based on the object-local names of attributes to +which layers are assigned in the `Model`'s constructor. Arguments: - layers: List of layers. + filepath: String, path to the weights file to load. For weight files in + TensorFlow format, this is the file prefix (the same as was passed + to `save_weights`). + by_name: Boolean, whether to load weights by name or by topological + order. Only topological loading is supported for weight files in + TensorFlow format. + skip_mismatch: Boolean, whether to skip loading of layers where there is + a mismatch in the number of weights, or a mismatch in the shape of + the weight (only valid when `by_name=True`). Returns: - List of metrics." -5693,_non_none_constant_value,tensorflow/tensorflow/python/keras/engine/training_v1.py,3203,function, -5694,model_to_estimator,tensorflow/tensorflow/python/keras/estimator/__init__.py,35,function,"Constructs an `Estimator` instance from given keras model. + When loading a weight file in TensorFlow format, returns the same status + object as `tf.train.Checkpoint.restore`. When graph building, restore + ops are run automatically as soon as the network is built (on first call + for user-defined classes inheriting from `Model`, immediately if it is + already built). + + When loading weights in HDF5 format, returns `None`. + +Raises: + ImportError: If h5py is not available and the weight file is in HDF5 + format. + ValueError: If `skip_mismatch` is set to `True` when `by_name` is + `False`." +6033,compile,tensorflow/tensorflow/python/keras/engine/training_v1.py,240,method,"Configures the model for training. + +Arguments: + optimizer: String (name of optimizer) or optimizer instance. + See `tf.keras.optimizers`. + loss: String (name of objective function), objective function or + `tf.keras.losses.Loss` instance. See `tf.keras.losses`. An objective + function is any callable with the signature + `scalar_loss = fn(y_true, y_pred)`. If the model has multiple + outputs, you can use a different loss on each output by passing a + dictionary or a list of losses. The loss value that will be + minimized by the model will then be the sum of all individual + losses. + metrics: List of metrics to be evaluated by the model during training + and testing. Typically you will use `metrics=['accuracy']`. + To specify different metrics for different outputs of a + multi-output model, you could also pass a dictionary, such as + `metrics={'output_a': 'accuracy', 'output_b': ['accuracy', 'mse']}`. + You can also pass a list (len = len(outputs)) of lists of metrics + such as `metrics=[['accuracy'], ['accuracy', 'mse']]` or + `metrics=['accuracy', ['accuracy', 'mse']]`. + loss_weights: Optional list or dictionary specifying scalar + coefficients (Python floats) to weight the loss contributions + of different model outputs. + The loss value that will be minimized by the model + will then be the *weighted sum* of all individual losses, + weighted by the `loss_weights` coefficients. + If a list, it is expected to have a 1:1 mapping + to the model's outputs. If a tensor, it is expected to map + output names (strings) to scalar coefficients. + sample_weight_mode: If you need to do timestep-wise + sample weighting (2D weights), set this to `""temporal""`. + `None` defaults to sample-wise weights (1D). + If the model has multiple outputs, you can use a different + `sample_weight_mode` on each output by passing a + dictionary or a list of modes. + weighted_metrics: List of metrics to be evaluated and weighted + by sample_weight or class_weight during training and testing. + target_tensors: By default, Keras will create placeholders for the + model's target, which will be fed with the target data during + training. If instead you would like to use your own + target tensors (in turn, Keras will not expect external + Numpy data for these targets at training time), you + can specify them via the `target_tensors` argument. It can be + a single tensor (for a single-output model), a list of tensors, + or a dict mapping output names to target tensors. + distribute: NOT SUPPORTED IN TF 2.0, please create and compile the + model under distribution strategy scope instead of passing it to + compile. + **kwargs: Any additional arguments. + +Raises: + ValueError: In case of invalid arguments for + `optimizer`, `loss`, `metrics` or `sample_weight_mode`." +6034,metrics,tensorflow/tensorflow/python/keras/engine/training_v1.py,490,method,"Returns the model's metrics added using `compile`, `add_metric` APIs." +6035,metrics_names,tensorflow/tensorflow/python/keras/engine/training_v1.py,505,method,Returns the model's display labels for all outputs. +6036,run_eagerly,tensorflow/tensorflow/python/keras/engine/training_v1.py,531,method,"Settable attribute indicating whether the model should run eagerly. + +Running eagerly means that your model will be run step by step, +like Python code. Your model might run slower, but it should become easier +for you to debug it by stepping into individual layer calls. + +By default, we will attempt to compile your model to a static graph to +deliver the best execution performance. + +Returns: + Boolean, whether the model should run eagerly." +6037,run_eagerly,tensorflow/tensorflow/python/keras/engine/training_v1.py,570,method, +6038,fit,tensorflow/tensorflow/python/keras/engine/training_v1.py,610,method,"Trains the model for a fixed number of epochs (iterations on a dataset). + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + - A `tf.data` dataset. Should return a tuple + of either `(inputs, targets)` or + `(inputs, targets, sample_weights)`. + - A generator or `keras.utils.Sequence` returning `(inputs, targets)` + or `(inputs, targets, sample weights)`. + y: Target data. Like the input data `x`, + it could be either Numpy array(s) or TensorFlow tensor(s). + It should be consistent with `x` (you cannot have Numpy inputs and + tensor targets, or inversely). If `x` is a dataset, generator, + or `keras.utils.Sequence` instance, `y` should + not be specified (since targets will be obtained from `x`). + batch_size: Integer or `None`. + Number of samples per gradient update. + If unspecified, `batch_size` will default to 32. + Do not specify the `batch_size` if your data is in the + form of symbolic tensors, datasets, + generators, or `keras.utils.Sequence` instances (since they generate + batches). + epochs: Integer. Number of epochs to train the model. + An epoch is an iteration over the entire `x` and `y` + data provided. + Note that in conjunction with `initial_epoch`, + `epochs` is to be understood as ""final epoch"". + The model is not trained for a number of iterations + given by `epochs`, but merely until the epoch + of index `epochs` is reached. + verbose: 0, 1, or 2. Verbosity mode. + 0 = silent, 1 = progress bar, 2 = one line per epoch. + Note that the progress bar is not particularly useful when + logged to a file, so verbose=2 is recommended when not running + interactively (eg, in a production environment). + callbacks: List of `keras.callbacks.Callback` instances. + List of callbacks to apply during training. + See `tf.keras.callbacks`. + validation_split: Float between 0 and 1. + Fraction of the training data to be used as validation data. + The model will set apart this fraction of the training data, + will not train on it, and will evaluate + the loss and any model metrics + on this data at the end of each epoch. + The validation data is selected from the last samples + in the `x` and `y` data provided, before shuffling. This argument is + not supported when `x` is a dataset, generator or + `keras.utils.Sequence` instance. + validation_data: Data on which to evaluate + the loss and any model metrics at the end of each epoch. + The model will not be trained on this data. + `validation_data` will override `validation_split`. + `validation_data` could be: + - tuple `(x_val, y_val)` of Numpy arrays or tensors + - tuple `(x_val, y_val, val_sample_weights)` of Numpy arrays + - dataset + For the first two cases, `batch_size` must be provided. + For the last case, `validation_steps` could be provided. + shuffle: Boolean (whether to shuffle the training data + before each epoch) or str (for 'batch'). + 'batch' is a special option for dealing with the + limitations of HDF5 data; it shuffles in batch-sized chunks. + Has no effect when `steps_per_epoch` is not `None`. + class_weight: Optional dictionary mapping class indices (integers) + to a weight (float) value, used for weighting the loss function + (during training only). + This can be useful to tell the model to + ""pay more attention"" to samples from + an under-represented class. + sample_weight: Optional Numpy array of weights for + the training samples, used for weighting the loss function + (during training only). You can either pass a flat (1D) + Numpy array with the same length as the input samples + (1:1 mapping between weights and samples), + or in the case of temporal data, + you can pass a 2D array with shape + `(samples, sequence_length)`, + to apply a different weight to every timestep of every sample. + In this case you should make sure to specify + `sample_weight_mode=""temporal""` in `compile()`. This argument is not + supported when `x` is a dataset, generator, or + `keras.utils.Sequence` instance, instead provide the sample_weights + as the third element of `x`. + initial_epoch: Integer. + Epoch at which to start training + (useful for resuming a previous training run). + steps_per_epoch: Integer or `None`. + Total number of steps (batches of samples) + before declaring one epoch finished and starting the + next epoch. When training with input tensors such as + TensorFlow data tensors, the default `None` is equal to + the number of samples in your dataset divided by + the batch size, or 1 if that cannot be determined. If x is a + `tf.data` dataset, and 'steps_per_epoch' + is None, the epoch will run until the input dataset is exhausted. + This argument is not supported with array inputs. + validation_steps: Only relevant if `validation_data` is provided and + is a `tf.data` dataset. Total number of steps (batches of + samples) to draw before stopping when performing validation + at the end of every epoch. If 'validation_steps' is None, validation + will run until the `validation_data` dataset is exhausted. In the + case of a infinite dataset, it will run into a infinite loop. + If 'validation_steps' is specified and only part of the dataset + will be consumed, the evaluation will start from the beginning of + the dataset at each epoch. This ensures that the same validation + samples are used every time. + validation_freq: Only relevant if validation data is provided. Integer + or `collections_abc.Container` instance (e.g. list, tuple, etc.). + If an integer, specifies how many training epochs to run before a + new validation run is performed, e.g. `validation_freq=2` runs + validation every 2 epochs. If a Container, specifies the epochs on + which to run validation, e.g. `validation_freq=[1, 2, 10]` runs + validation at the end of the 1st, 2nd, and 10th epochs. + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. + If unspecified, `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up + when using process-based threading. If unspecified, `workers` + will default to 1. If 0, will execute the generator on the main + thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to + the generator as they can't be passed easily to children processes. + **kwargs: Used for backwards compatibility. + +Returns: + A `History` object. Its `History.history` attribute is + a record of training loss values and metrics values + at successive epochs, as well as validation loss values + and validation metrics values (if applicable). + +Raises: + RuntimeError: If the model was never compiled. + ValueError: In case of mismatch between the provided input data + and what the model expects." +6039,evaluate,tensorflow/tensorflow/python/keras/engine/training_v1.py,810,method,"Returns the loss value & metrics values for the model in test mode. + +Computation is done in batches (see the `batch_size` arg.) + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + - A `tf.data` dataset. + - A generator or `keras.utils.Sequence` instance. + y: Target data. Like the input data `x`, + it could be either Numpy array(s) or TensorFlow tensor(s). + It should be consistent with `x` (you cannot have Numpy inputs and + tensor targets, or inversely). + If `x` is a dataset, generator or + `keras.utils.Sequence` instance, `y` should not be specified (since + targets will be obtained from the iterator/dataset). + batch_size: Integer or `None`. + Number of samples per batch of computation. + If unspecified, `batch_size` will default to 32. + Do not specify the `batch_size` if your data is in the + form of symbolic tensors, dataset, + generators, or `keras.utils.Sequence` instances (since they generate + batches). + verbose: 0 or 1. Verbosity mode. + 0 = silent, 1 = progress bar. + sample_weight: Optional Numpy array of weights for + the test samples, used for weighting the loss function. + You can either pass a flat (1D) + Numpy array with the same length as the input samples + (1:1 mapping between weights and samples), + or in the case of temporal data, + you can pass a 2D array with shape + `(samples, sequence_length)`, + to apply a different weight to every timestep of every sample. + In this case you should make sure to specify + `sample_weight_mode=""temporal""` in `compile()`. This argument is not + supported when `x` is a dataset, instead pass + sample weights as the third element of `x`. + steps: Integer or `None`. + Total number of steps (batches of samples) + before declaring the evaluation round finished. + Ignored with the default value of `None`. + If x is a `tf.data` dataset and `steps` is + None, 'evaluate' will run until the dataset is exhausted. + This argument is not supported with array inputs. + callbacks: List of `keras.callbacks.Callback` instances. + List of callbacks to apply during evaluation. + See [callbacks](/api_docs/python/tf/keras/callbacks). + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. + If unspecified, `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up when using + process-based threading. If unspecified, `workers` will default + to 1. If 0, will execute the generator on the main thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to + the generator as they can't be passed easily to children processes. + +Returns: + Scalar test loss (if the model has a single output and no metrics) + or list of scalars (if the model has multiple outputs + and/or metrics). The attribute `model.metrics_names` will give you + the display labels for the scalar outputs. + +Raises: + ValueError: in case of invalid arguments." +6040,predict,tensorflow/tensorflow/python/keras/engine/training_v1.py,916,method,"Generates output predictions for the input samples. + +Computation is done in batches (see the `batch_size` arg.) + +Arguments: + x: Input samples. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A `tf.data` dataset. + - A generator or `keras.utils.Sequence` instance. + batch_size: Integer or `None`. + Number of samples per batch of computation. + If unspecified, `batch_size` will default to 32. + Do not specify the `batch_size` if your data is in the + form of symbolic tensors, dataset, + generators, or `keras.utils.Sequence` instances (since they generate + batches). + verbose: Verbosity mode, 0 or 1. + steps: Total number of steps (batches of samples) + before declaring the prediction round finished. + Ignored with the default value of `None`. If x is a `tf.data` + dataset and `steps` is None, `predict` will + run until the input dataset is exhausted. + callbacks: List of `keras.callbacks.Callback` instances. + List of callbacks to apply during prediction. + See [callbacks](/api_docs/python/tf/keras/callbacks). + max_queue_size: Integer. Used for generator or `keras.utils.Sequence` + input only. Maximum size for the generator queue. + If unspecified, `max_queue_size` will default to 10. + workers: Integer. Used for generator or `keras.utils.Sequence` input + only. Maximum number of processes to spin up when using + process-based threading. If unspecified, `workers` will default + to 1. If 0, will execute the generator on the main thread. + use_multiprocessing: Boolean. Used for generator or + `keras.utils.Sequence` input only. If `True`, use process-based + threading. If unspecified, `use_multiprocessing` will default to + `False`. Note that because this implementation relies on + multiprocessing, you should not pass non-picklable arguments to + the generator as they can't be passed easily to children processes. + + +Returns: + Numpy array(s) of predictions. + +Raises: + ValueError: In case of mismatch between the provided + input data and the model's expectations, + or in case a stateful model receives a number of samples + that is not a multiple of the batch size." +6041,reset_metrics,tensorflow/tensorflow/python/keras/engine/training_v1.py,993,method,Resets the state of metrics. +6042,train_on_batch,tensorflow/tensorflow/python/keras/engine/training_v1.py,1003,method,"Runs a single gradient update on a single batch of data. + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A dict mapping input names to the corresponding array/tensors, + if the model has named inputs. + - A `tf.data` dataset. + y: Target data. Like the input data `x`, it could be either Numpy + array(s) or TensorFlow tensor(s). It should be consistent with `x` + (you cannot have Numpy inputs and tensor targets, or inversely). If + `x` is a dataset, `y` should not be specified + (since targets will be obtained from the iterator). + sample_weight: Optional array of the same length as x, containing + weights to apply to the model's loss for each sample. In the case of + temporal data, you can pass a 2D array with shape (samples, + sequence_length), to apply a different weight to every timestep of + every sample. In this case you should make sure to specify + sample_weight_mode=""temporal"" in compile(). This argument is not + supported when `x` is a dataset. + class_weight: Optional dictionary mapping class indices (integers) to a + weight (float) to apply to the model's loss for the samples from this + class during training. This can be useful to tell the model to ""pay + more attention"" to samples from an under-represented class. + reset_metrics: If `True`, the metrics returned will be only for this + batch. If `False`, the metrics will be statefully accumulated across + batches. + +Returns: + Scalar training loss + (if the model has a single output and no metrics) + or list of scalars (if the model has multiple outputs + and/or metrics). The attribute `model.metrics_names` will give you + the display labels for the scalar outputs. + +Raises: + ValueError: In case of invalid user-provided arguments." +6043,predict_on_batch,tensorflow/tensorflow/python/keras/engine/training_v1.py,1173,method,"Returns predictions for a single batch of samples. + +Arguments: + x: Input data. It could be: + - A Numpy array (or array-like), or a list of arrays + (in case the model has multiple inputs). + - A TensorFlow tensor, or a list of tensors + (in case the model has multiple inputs). + - A `tf.data` dataset. + +Returns: + Numpy array(s) of predictions. + +Raises: + ValueError: In case of mismatch between given number of inputs and + expectations of the model." +6044,fit_generator,tensorflow/tensorflow/python/keras/engine/training_v1.py,1221,method,"Fits the model on data yielded batch-by-batch by a Python generator. + +DEPRECATED: + `Model.fit` now supports generators, so there is no longer any need to use + this endpoint." +6045,evaluate_generator,tensorflow/tensorflow/python/keras/engine/training_v1.py,1260,method,"Evaluates the model on a data generator. + +DEPRECATED: + `Model.evaluate` now supports generators, so there is no longer any need + to use this endpoint." +6046,predict_generator,tensorflow/tensorflow/python/keras/engine/training_v1.py,1287,method,"Generates predictions for the input samples from a data generator. + +DEPRECATED: + `Model.predict` now supports generators, so there is no longer any need + to use this endpoint." +6047,sample_weights,tensorflow/tensorflow/python/keras/engine/training_v1.py,2730,method, +6048,create_tensor_spec,tensorflow/tensorflow/python/keras/engine/training_v1.py,2514,method, +6049,DistributedCallbackModel,tensorflow/tensorflow/python/keras/engine/training_v1.py,2834,class,Model that is used for callbacks with tf.distribute.Strategy. +6050,set_original_model,tensorflow/tensorflow/python/keras/engine/training_v1.py,2841,method, +6051,save_weights,tensorflow/tensorflow/python/keras/engine/training_v1.py,2844,method, +6052,save,tensorflow/tensorflow/python/keras/engine/training_v1.py,2848,method, +6053,load_weights,tensorflow/tensorflow/python/keras/engine/training_v1.py,2856,method, +6054,model_to_estimator,tensorflow/tensorflow/python/keras/estimator/__init__.py,35,function,"Constructs an `Estimator` instance from given keras model. If you use infrastructure or other tooling that relies on Estimators, you can still build a Keras model and use model_to_estimator to convert the Keras @@ -39258,7 +47373,7 @@ Raises: ValueError: If the keras_model_path is a GCS URI. ValueError: If keras_model has not been compiled. ValueError: If an invalid checkpoint_format was given." -5695,model_to_estimator_v2,tensorflow/tensorflow/python/keras/estimator/__init__.py,133,function,"Constructs an `Estimator` instance from given keras model. +6055,model_to_estimator_v2,tensorflow/tensorflow/python/keras/estimator/__init__.py,133,function,"Constructs an `Estimator` instance from given keras model. If you use infrastructure or other tooling that relies on Estimators, you can still build a Keras model and use model_to_estimator to convert the Keras @@ -39379,23 +47494,7 @@ Raises: ValueError: If the keras_model_path is a GCS URI. ValueError: If keras_model has not been compiled. ValueError: If an invalid checkpoint_format was given." -5696,_BaseFeaturesLayer,tensorflow/tensorflow/python/keras/feature_column/base_feature_layer.py,32,class,"Base class for DenseFeatures and SequenceFeatures. - -Defines common methods and helpers. - -Args: - feature_columns: An iterable containing the FeatureColumns to use as - inputs to your model. - expected_column_type: Expected class for provided feature columns. - trainable: Boolean, whether the layer's variables will be updated via - gradient descent during training. - name: Name to give to the DenseFeatures. - **kwargs: Keyword arguments to construct a layer. - -Raises: - ValueError: if an item in `feature_columns` doesn't match - `expected_column_type`." -5697,DenseFeatures,tensorflow/tensorflow/python/keras/feature_column/dense_features.py,31,class,"A layer that produces a dense `Tensor` based on given `feature_columns`. +6056,DenseFeatures,tensorflow/tensorflow/python/keras/feature_column/dense_features.py,31,class,"A layer that produces a dense `Tensor` based on given `feature_columns`. Generally a single example in training data is described with FeatureColumns. At the first layer of the model, this column-oriented data should be converted @@ -39430,14 +47529,41 @@ for units in [128, 64, 32]: units, activation='relu')(dense_tensor) prediction = tf.compat.v1.keras.layers.Dense(1)(dense_tensor) ```" -5698,_initialized_session,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,46,function, -5699,DenseFeaturesTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,53,class, -5700,IndicatorColumnTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,684,class, -5701,EmbeddingColumnTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,704,class, -5702,SharedEmbeddingColumnTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,892,class, -5703,DenseFeaturesSerializationTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,1019,class, -5704,SequenceFeatureColumnsTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_test.py,1084,class,Tests DenseFeatures with sequence feature columns. -5705,DenseFeatures,tensorflow/tensorflow/python/keras/feature_column/dense_features_v2.py,29,class,"A layer that produces a dense `Tensor` based on given `feature_columns`. +6057,call,tensorflow/tensorflow/python/keras/feature_column/dense_features.py,119,method,"Returns a dense tensor corresponding to the `feature_columns`. + +Example usage: + +>>> t1 = tf.feature_column.embedding_column( +... tf.feature_column.categorical_column_with_hash_bucket(""t1"", 2), +... dimension=8) +>>> t2 = tf.feature_column.numeric_column('t2') +>>> feature_layer = tf.compat.v1.keras.layers.DenseFeatures([t1, t2]) +>>> features = {""t1"": tf.constant([""a"", ""b""]), ""t2"": tf.constant([1, 2])} +>>> dense_tensor = feature_layer(features, training=True) + +Args: + features: A mapping from key to tensors. `FeatureColumn`s look up via + these keys. For example `numeric_column('price')` will look at 'price' + key in this dict. Values can be a `SparseTensor` or a `Tensor` depends + on corresponding `FeatureColumn`. + cols_to_output_tensors: If not `None`, this will be filled with a dict + mapping feature columns to output tensors created. + training: Python boolean or None, indicating whether to the layer is being + run in training mode. This argument is passed to the call method of any + `FeatureColumn` that takes a `training` argument. For example, if a + `FeatureColumn` performed dropout, the column could expose a `training` + argument to control whether the dropout should be applied. If `None`, + defaults to `tf.keras.backend.learning_phase()`. + + +Returns: + A `Tensor` which represents input layer of a model. Its shape + is (batch_size, first_layer_dimension) and its dtype is `float32`. + first_layer_dimension is determined based on given `feature_columns`. + +Raises: + ValueError: If features are not a dictionary." +6058,DenseFeatures,tensorflow/tensorflow/python/keras/feature_column/dense_features_v2.py,29,class,"A layer that produces a dense `Tensor` based on given `feature_columns`. Generally a single example in training data is described with FeatureColumns. At the first layer of the model, this column oriented data should be converted @@ -39466,9 +47592,8 @@ for units in [128, 64, 32]: dense_tensor = tf.keras.layers.Dense(units, activation='relu')(dense_tensor) prediction = tf.keras.layers.Dense(1)(dense_tensor) ```" -5706,_initialized_session,tensorflow/tensorflow/python/keras/feature_column/dense_features_v2_test.py,41,function, -5707,DenseFeaturesTest,tensorflow/tensorflow/python/keras/feature_column/dense_features_v2_test.py,48,class, -5708,SequenceFeatures,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column.py,36,class,"A layer for sequence input. +6059,build,tensorflow/tensorflow/python/keras/feature_column/dense_features_v2.py,90,method, +6060,SequenceFeatures,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column.py,36,class,"A layer for sequence input. All `feature_columns` must be sequence dense columns with the same `sequence_length`. The output of this method can be fed into sequence @@ -39505,26 +47630,46 @@ rnn_cell = tf.keras.layers.SimpleRNNCell(hidden_size, training=training) rnn_layer = tf.keras.layers.RNN(rnn_cell, training=training) outputs, state = rnn_layer(sequence_input, mask=sequence_length_mask) ```" -5709,_assert_all_equal_and_return,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column.py,165,function,Asserts that all tensors are equal and returns the first one. -5710,SequenceFeatureColumnIntegrationTest,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_integration_test.py,41,class, -5711,_make_sequence_example,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_integration_test.py,253,function, -5712,_initialized_session,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_test.py,42,function, -5713,SequenceFeaturesTest,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_test.py,50,class, -5714,SequenceFeaturesSerializationTest,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_test.py,573,class, -5715,SequenceFeaturesSavingTest,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column_test.py,614,class, -5716,populate_deserializable_objects,tensorflow/tensorflow/python/keras/initializers/__init__.py,38,function,"Populates dict ALL_OBJECTS with every built-in initializer. +6061,call,tensorflow/tensorflow/python/keras/feature_column/sequence_feature_column.py,111,method,"Returns sequence input corresponding to the `feature_columns`. + +Args: + features: A dict mapping keys to tensors. + training: Python boolean or None, indicating whether to the layer is being + run in training mode. This argument is passed to the call method of any + `FeatureColumn` that takes a `training` argument. For example, if a + `FeatureColumn` performed dropout, the column could expose a `training` + argument to control whether the dropout should be applied. If `None`, + defaults to `tf.keras.backend.learning_phase()`. + + +Returns: + An `(input_layer, sequence_length)` tuple where: + - input_layer: A float `Tensor` of shape `[batch_size, T, D]`. + `T` is the maximum sequence length for this batch, which could differ + from batch to batch. `D` is the sum of `num_elements` for all + `feature_columns`. + - sequence_length: An int `Tensor` of shape `[batch_size]`. The sequence + length for each example. + +Raises: + ValueError: If features are not a dictionary." +6062,populate_deserializable_objects,tensorflow/tensorflow/python/keras/initializers/__init__.py,38,function,"Populates dict ALL_OBJECTS with every built-in initializer. " -5717,serialize,tensorflow/tensorflow/python/keras/initializers/__init__.py,134,function, -5718,deserialize,tensorflow/tensorflow/python/keras/initializers/__init__.py,139,function,Return an `Initializer` object from its config. -5719,get,tensorflow/tensorflow/python/keras/initializers/__init__.py,150,function, -5720,RandomNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,44,class, -5721,RandomUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,54,class, -5722,TruncatedNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,64,class, -5723,LecunNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,72,class, -5724,LecunUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,83,class, -5725,HeNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,94,class, -5726,HeUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,105,class, -5727,Initializer,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,30,class,"Initializer base class: all Keras initializers inherit from this class. +6063,serialize,tensorflow/tensorflow/python/keras/initializers/__init__.py,134,function, +6064,deserialize,tensorflow/tensorflow/python/keras/initializers/__init__.py,139,function,Return an `Initializer` object from its config. +6065,get,tensorflow/tensorflow/python/keras/initializers/__init__.py,150,function, +6066,RandomNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,44,class, +6067,RandomUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,54,class, +6068,TruncatedNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,64,class, +6069,LecunNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,72,class, +6070,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,78,method, +6071,LecunUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,83,class, +6072,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,89,method, +6073,HeNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,94,class, +6074,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,100,method, +6075,HeUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,105,class, +6076,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v1.py,111,method, +6077,Initializer,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,30,class,"Initializer base class: all Keras initializers inherit from this class. Initializers should implement a `__call__` method with the following signature: @@ -39562,7 +47707,26 @@ Note that we don't have to implement `from_config` in the example above since the constructor arguments of the class the keys in the config returned by `get_config` are the same. In this case, the default `from_config` works fine." -5728,Zeros,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,111,class,"Initializer that generates tensors initialized to 0. +6078,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,80,method,"Returns the configuration of the initializer as a JSON-serializable dict. + +Returns: + A JSON-serializable Python dict." +6079,from_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,89,method,"Instantiates an initializer from a configuration dictionary. + +Example: + +```python +initializer = RandomUniform(-1, 1) +config = initializer.get_config() +initializer = RandomUniform.from_config(config) +``` + +Args: + config: A Python dictionary, the output of `get_config`. + +Returns: + A `tf.keras.initializers.Initializer` instance." +6080,Zeros,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,111,class,"Initializer that generates tensors initialized to 0. Also available via the shortcut function `tf.keras.initializers.zeros`. @@ -39575,7 +47739,7 @@ Examples: >>> # Usage in a Keras layer: >>> initializer = tf.keras.initializers.Zeros() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)" -5729,Ones,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,141,class,"Initializer that generates tensors initialized to 1. +6081,Ones,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,141,class,"Initializer that generates tensors initialized to 1. Also available via the shortcut function `tf.keras.initializers.ones`. @@ -39588,7 +47752,7 @@ Examples: >>> # Usage in a Keras layer: >>> initializer = tf.keras.initializers.Ones() >>> layer = tf.keras.layers.Dense(3, kernel_initializer=initializer)" -5730,Constant,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,173,class,"Initializer that generates tensors with constant values. +6082,Constant,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,173,class,"Initializer that generates tensors with constant values. Also available via the shortcut function `tf.keras.initializers.constant`. @@ -39608,7 +47772,8 @@ Examples: Args: value: A Python scalar." -5731,RandomUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,219,class,"Initializer that generates tensors with a uniform distribution. +6083,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,212,method, +6084,RandomUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,219,class,"Initializer that generates tensors with a uniform distribution. Also available via the shortcut function `tf.keras.initializers.random_uniform`. @@ -39630,7 +47795,7 @@ Args: random values to generate (exclusive). seed: A Python integer. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype." -5732,RandomNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,261,class,"Initializer that generates tensors with a normal distribution. +6085,RandomNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,261,class,"Initializer that generates tensors with a normal distribution. Also available via the shortcut function `tf.keras.initializers.random_normal`. @@ -39652,7 +47817,7 @@ Args: values to generate. seed: A Python integer. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype." -5733,TruncatedNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,302,class,"Initializer that generates a truncated normal distribution. +6086,TruncatedNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,302,class,"Initializer that generates a truncated normal distribution. Also available via the shortcut function `tf.keras.initializers.truncated_normal`. @@ -39679,7 +47844,7 @@ Args: random values to generate. seed: A Python integer. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype." -5734,VarianceScaling,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,348,class,"Initializer capable of adapting its scale to the shape of weights tensors. +6087,VarianceScaling,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,348,class,"Initializer capable of adapting its scale to the shape of weights tensors. Also available via the shortcut function `tf.keras.initializers.variance_scaling`. @@ -39715,7 +47880,7 @@ Args: ""untruncated_normal"" and ""uniform"". seed: A Python integer. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype." -5735,Orthogonal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,403,class,"Initializer that generates an orthogonal matrix. +6088,Orthogonal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,403,class,"Initializer that generates an orthogonal matrix. Also available via the shortcut function `tf.keras.initializers.orthogonal`. @@ -39748,7 +47913,7 @@ Args: References: [Saxe et al., 2014](https://openreview.net/forum?id=_wzZwKpTDF_9C) ([pdf](https://arxiv.org/pdf/1312.6120.pdf))" -5736,Identity,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,455,class,"Initializer that generates the identity matrix. +6089,Identity,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,455,class,"Initializer that generates the identity matrix. Also available via the shortcut function `tf.keras.initializers.identity`. @@ -39766,7 +47931,7 @@ Examples: Args: gain: Multiplicative factor to apply to the identity matrix." -5737,GlorotUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,492,class,"The Glorot uniform initializer, also called Xavier uniform initializer. +6090,GlorotUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,492,class,"The Glorot uniform initializer, also called Xavier uniform initializer. Also available via the shortcut function `tf.keras.initializers.glorot_uniform`. @@ -39792,7 +47957,8 @@ Args: References: [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) ([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))" -5738,GlorotNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,535,class,"The Glorot normal initializer, also called Xavier normal initializer. +6091,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,528,method, +6092,GlorotNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,535,class,"The Glorot normal initializer, also called Xavier normal initializer. Also available via the shortcut function `tf.keras.initializers.glorot_normal`. @@ -39819,7 +47985,8 @@ Args: References: [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) ([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))" -5739,LecunNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,579,class,"Lecun normal initializer. +6093,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,572,method, +6094,LecunNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,579,class,"Lecun normal initializer. Also available via the shortcut function `tf.keras.initializers.lecun_normal`. @@ -39853,7 +48020,8 @@ References: (https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf)) - Efficient Backprop, [Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)" -5740,LecunUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,627,class,"Lecun uniform initializer. +6095,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,620,method, +6096,LecunUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,627,class,"Lecun uniform initializer. Also available via the shortcut function `tf.keras.initializers.lecun_uniform`. @@ -39882,7 +48050,8 @@ References: ([pdf](https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf)) - Efficient Backprop, [Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)" -5741,HeNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,670,class,"He normal initializer. +6097,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,663,method, +6098,HeNormal,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,670,class,"He normal initializer. Also available via the shortcut function `tf.keras.initializers.he_normal`. @@ -39908,7 +48077,8 @@ Arguments: References: [He et al., 2015](https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long ([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))" -5742,HeUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,710,class,"He uniform variance scaling initializer. +6099,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,703,method, +6100,HeUniform,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,710,class,"He uniform variance scaling initializer. Also available via the shortcut function `tf.keras.initializers.he_uniform`. @@ -39934,64 +48104,23 @@ Arguments: References: [He et al., 2015](https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long ([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))" -5743,_get_dtype,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,747,function, -5744,_jvp,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,27,function,Compute the jacobian of `f` at `primals` multiplied by `tangents`. -5745,_jacfwd,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,35,function,Compute the jacobian of `f` at `primals` using forward-mode autodiff. -5746,_grad,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,57,function,Return a function which computes the gradient of `f`. -5747,_hvp,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,72,function,Compute a forward-over-back Hessian-vector product. -5748,_vectorize_parameters,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,82,function,"Loop over `params`, providing a one-hot mask to `f` for each." -5749,_forward_over_back_hessian,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,102,function,"Computes the full Hessian matrix for the scalar-valued f(*params). - -Args: - f: A function taking `params` and returning a scalar. - params: A possibly nested structure of tensors. - use_pfor: If true, uses `tf.vectorized_map` calls instead of looping. - dtype: Required if `use_pfor=False`. A possibly nested structure of dtypes - (e.g. `tf.float32`) matching the structure of `f`'s returns. - -Returns: - A possibly nested structure of matrix slices corresponding to `params`. Each - slice has shape [P, p_s] where `p_s` is the number of parameters (`tf.size`) - in the corresponding element of `params` and `P` is the total number of - parameters (`sum_s(p_s)`). The full matrix can be obtained by concatenating - along the second axis." -5750,_test_gradients,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,124,function,"Tests forward/backward jacobians of `f`'s [0, `order`)-order gradients." -5751,ForwardpropTest,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,152,class, -5752,HessianTests,tensorflow/tensorflow/python/keras/integration_test/forwardprop_test.py,266,class, -5753,MiniModel,tensorflow/tensorflow/python/keras/integration_test/function_test.py,24,class,"Minimal model for mnist. +6101,get_config,tensorflow/tensorflow/python/keras/initializers/initializers_v2.py,743,method, +6102,MiniModel,tensorflow/tensorflow/python/keras/integration_test/function_test.py,24,class,"Minimal model for mnist. Useful for testing and debugging on slow TPU simulators." -5754,DefunnedMiniModel,tensorflow/tensorflow/python/keras/integration_test/function_test.py,39,class, -5755,ModelWithOptimizer,tensorflow/tensorflow/python/keras/integration_test/function_test.py,46,class, -5756,FunctionTest,tensorflow/tensorflow/python/keras/integration_test/function_test.py,65,class, -5757,AutomaticControlDependenciesTest,tensorflow/tensorflow/python/keras/integration_test/function_test.py,213,class, -5758,_get_big_cnn_model,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,26,function,Creates a test model whose activations are significantly larger than model size. -5759,_get_split_cnn_model,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,45,function,Creates a test model that is split into `num_partitions` smaller models. -5760,_compute_loss,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,68,function, -5761,_limit_gpu_memory,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,74,function,Helper function to limit GPU memory for testing. -5762,_get_dummy_data,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,85,function, -5763,_train_no_recompute,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,91,function,Trains a single large model without gradient checkpointing. -5764,_train_with_recompute,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,111,function,Trains a single large model with gradient checkpointing using tf.recompute_grad. -5765,GradientCheckpointTest,tensorflow/tensorflow/python/keras/integration_test/gradient_checkpoint_test.py,141,class, -5766,TestKerasModelClass,tensorflow/tensorflow/python/keras/integration_test/gradients_test.py,23,class,A simple tensorflow keras Model class definition. -5767,GradientsTest,tensorflow/tensorflow/python/keras/integration_test/gradients_test.py,42,class, -5768,KerasNetworkTFRNNs,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,25,class, -5769,KerasNetworkKerasRNNs,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,36,class, -5770,LegacyRNNTest,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,47,class, -5771,get_test_data,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,373,function, -5772,ModuleTest,tensorflow/tensorflow/python/keras/integration_test/module_test.py,22,class, -5773,cycle,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,27,function, -5774,_ModelWithOptimizer,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,44,class, -5775,_import_and_infer,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,62,function,Import a SavedModel into a TF 1.x-style graph and run `signature_key`. -5776,_run_signature,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,70,function, -5777,SaveTest,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,85,class, -5778,LoadTest,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,121,class, -5779,KerasLoadTest,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,180,class, -5780,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/integration_test/tpu_strategy_test.py,32,function, -5781,get_tpu_strategy,tensorflow/tensorflow/python/keras/integration_test/tpu_strategy_test.py,41,function, -5782,TpuStrategyTest,tensorflow/tensorflow/python/keras/integration_test/tpu_strategy_test.py,48,class, -5783,VectorizedMapTest,tensorflow/tensorflow/python/keras/integration_test/vectorized_map_test.py,22,class, -5784,VersionAwareLayers,tensorflow/tensorflow/python/keras/layers/__init__.py,275,class,"Utility to be used internally to access layers in a V1/V2-aware fashion. +6103,call,tensorflow/tensorflow/python/keras/integration_test/function_test.py,35,method, +6104,DefunnedMiniModel,tensorflow/tensorflow/python/keras/integration_test/function_test.py,39,class, +6105,call,tensorflow/tensorflow/python/keras/integration_test/function_test.py,42,method, +6106,ModelWithOptimizer,tensorflow/tensorflow/python/keras/integration_test/function_test.py,46,class, +6107,call,tensorflow/tensorflow/python/keras/integration_test/function_test.py,56,method, +6108,KerasNetworkTFRNNs,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,25,class, +6109,call,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,32,method, +6110,KerasNetworkKerasRNNs,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,36,class, +6111,call,tensorflow/tensorflow/python/keras/integration_test/legacy_rnn_test.py,43,method, +6112,cycle,tensorflow/tensorflow/python/keras/integration_test/saved_model_test.py,27,function, +6113,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/integration_test/tpu_strategy_test.py,32,function, +6114,get_tpu_strategy,tensorflow/tensorflow/python/keras/integration_test/tpu_strategy_test.py,41,function, +6115,VersionAwareLayers,tensorflow/tensorflow/python/keras/layers/__init__.py,275,class,"Utility to be used internally to access layers in a V1/V2-aware fashion. When using layers within the Keras codebase, under the constraint that e.g. `layers.BatchNormalization` should be the `BatchNormalization` version @@ -39999,7 +48128,7 @@ corresponding to the current runtime (TF1 or TF2), do not simply access `layers.BatchNormalization` since it would ignore e.g. an early `compat.v2.disable_v2_behavior()` call. Instead, use an instance of `VersionAwareLayers` (which you can use just like the `layers` module)." -5785,LeakyReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,33,class,"Leaky version of a Rectified Linear Unit. +6116,LeakyReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,33,class,"Leaky version of a Rectified Linear Unit. It allows a small gradient when the unit is not active: @@ -40029,7 +48158,10 @@ Output shape: Arguments: alpha: Float >= 0. Negative slope coefficient. Default to 0.3." -5786,PReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,86,class,"Parametric Rectified Linear Unit. +6117,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,72,method, +6118,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,75,method, +6119,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,81,method, +6120,PReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,86,class,"Parametric Rectified Linear Unit. It follows: @@ -40060,7 +48192,11 @@ Arguments: and you wish to share parameters across space so that each filter only has one set of parameters, set `shared_axes=[1, 2]`." -5787,ELU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,180,class,"Exponential Linear Unit. +6121,build,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,139,method, +6122,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,159,method, +6123,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,164,method, +6124,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,175,method, +6125,ELU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,180,class,"Exponential Linear Unit. It follows: @@ -40079,7 +48215,10 @@ Output shape: Arguments: alpha: Scale for the negative factor." -5788,ThresholdedReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,221,class,"Thresholded Rectified Linear Unit. +6126,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,207,method, +6127,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,210,method, +6128,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,216,method, +6129,ThresholdedReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,221,class,"Thresholded Rectified Linear Unit. It follows: @@ -40098,7 +48237,10 @@ Output shape: Arguments: theta: Float >= 0. Threshold location of activation." -5789,Softmax,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,263,class,"Softmax activation function. +6130,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,248,method, +6131,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,252,method, +6132,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,258,method, +6133,Softmax,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,263,class,"Softmax activation function. Input shape: Arbitrary. Use the keyword argument `input_shape` @@ -40110,7 +48252,10 @@ Output shape: Arguments: axis: Integer, axis along which the softmax normalization is applied." -5790,ReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,297,class,"Rectified Linear Unit activation function. +6134,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,283,method, +6135,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,286,method, +6136,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,292,method, +6137,ReLU,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,297,class,"Rectified Linear Unit activation function. With default values, it returns element-wise `max(x, 0)`. @@ -40154,8 +48299,10 @@ Arguments: means unlimited. negative_slope: Float >= 0. Negative slope coefficient. Default to 0. threshold: Float. Threshold value for thresholded activation. Default to 0." -5791,AdvancedActivationsTest,tensorflow/tensorflow/python/keras/layers/advanced_activations_test.py,31,class, -5792,Conv,tensorflow/tensorflow/python/keras/layers/convolutional.py,52,class,"Abstract N-D convolution layer (private, used as implementation base). +6138,call,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,363,method, +6139,get_config,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,371,method, +6140,compute_output_shape,tensorflow/tensorflow/python/keras/layers/advanced_activations.py,381,method, +6141,Conv,tensorflow/tensorflow/python/keras/layers/convolutional.py,52,class,"Abstract N-D convolution layer (private, used as implementation base). This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -40215,7 +48362,11 @@ Arguments: trainable: Boolean, if `True` the weights of this layer will be marked as trainable (and listed in `layer.trainable_weights`). name: A string, the name of the layer." -5793,Conv1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,378,class,"1D convolution layer (e.g. temporal convolution). +6142,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,189,method, +6143,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,247,method, +6144,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,287,method, +6145,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,303,method, +6146,Conv1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,378,class,"1D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved with the layer input over a single spatial (or temporal) dimension @@ -40313,7 +48464,7 @@ Returns: Raises: ValueError: when both `strides > 1` and `dilation_rate > 1`." -5794,Conv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,519,class,"2D convolution layer (e.g. spatial convolution over images). +6147,Conv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,519,class,"2D convolution layer (e.g. spatial convolution over images). This layer creates a convolution kernel that is convolved with the layer input to produce a tensor of @@ -40429,7 +48580,7 @@ Returns: Raises: ValueError: if `padding` is `""causal""`. ValueError: when both `strides > 1` and `dilation_rate > 1`." -5795,Conv3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,678,class,"3D convolution layer (e.g. spatial convolution over volumes). +6148,Conv3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,678,class,"3D convolution layer (e.g. spatial convolution over volumes). This layer creates a convolution kernel that is convolved with the layer input to produce a tensor of @@ -40533,7 +48684,7 @@ Returns: Raises: ValueError: if `padding` is ""causal"". ValueError: when both `strides > 1` and `dilation_rate > 1`." -5796,Conv1DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,826,class,"Transposed convolution layer (sometimes called Deconvolution). +6149,Conv1DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,826,class,"Transposed convolution layer (sometimes called Deconvolution). The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction @@ -40616,7 +48767,11 @@ References: https://arxiv.org/abs/1603.07285v1) - [Deconvolutional Networks]( https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf)" -5797,Conv2DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,1072,class,"Transposed convolution layer (sometimes called Deconvolution). +6150,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,958,method, +6151,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,992,method, +6152,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,1042,method, +6153,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,1064,method, +6154,Conv2DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,1072,class,"Transposed convolution layer (sometimes called Deconvolution). The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction @@ -40724,7 +48879,11 @@ References: learning](https://arxiv.org/abs/1603.07285v1) - [Deconvolutional Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf)" -5798,Conv3DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,1375,class,"Transposed convolution layer (sometimes called Deconvolution). +6155,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,1229,method, +6156,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,1263,method, +6157,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,1334,method, +6158,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,1367,method, +6159,Conv3DTranspose,tensorflow/tensorflow/python/keras/layers/convolutional.py,1375,class,"Transposed convolution layer (sometimes called Deconvolution). The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction @@ -40837,7 +48996,11 @@ References: learning](https://arxiv.org/abs/1603.07285v1) - [Deconvolutional Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf)" -5799,SeparableConv,tensorflow/tensorflow/python/keras/layers/convolutional.py,1684,class,"Abstract base layer for separable nD convolution. +6160,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,1537,method, +6161,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,1571,method, +6162,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,1640,method, +6163,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,1677,method, +6164,SeparableConv,tensorflow/tensorflow/python/keras/layers/convolutional.py,1684,class,"Abstract base layer for separable nD convolution. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -40902,7 +49065,10 @@ Arguments: trainable: Boolean, if `True` the weights of this layer will be marked as trainable (and listed in `layer.trainable_weights`). name: A string, the name of the layer." -5800,SeparableConv1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,1894,class,"Depthwise separable 1D convolution. +6165,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,1801,method, +6166,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,1844,method, +6167,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,1847,method, +6168,SeparableConv1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,1894,class,"Depthwise separable 1D convolution. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -40990,7 +49156,8 @@ Returns: Raises: ValueError: when both `strides` > 1 and `dilation_rate` > 1." -5801,SeparableConv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2074,class,"Depthwise separable 2D convolution. +6169,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2029,method, +6170,SeparableConv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2074,class,"Depthwise separable 2D convolution. Separable convolutions consist of first performing a depthwise spatial convolution @@ -41086,7 +49253,8 @@ Returns: Raises: ValueError: if `padding` is ""causal"". ValueError: when both `strides` > 1 and `dilation_rate` > 1." -5802,DepthwiseConv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2244,class,"Depthwise separable 2D convolution. +6171,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2217,method, +6172,DepthwiseConv2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2244,class,"Depthwise separable 2D convolution. Depthwise Separable convolutions consist of performing just the first step in a depthwise spatial convolution @@ -41168,7 +49336,11 @@ Returns: Raises: ValueError: if `padding` is ""causal"". ValueError: when both `strides` > 1 and `dilation_rate` > 1." -5803,UpSampling1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2461,class,"Upsampling layer for 1D inputs. +6173,build,tensorflow/tensorflow/python/keras/layers/convolutional.py,2365,method, +6174,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2400,method, +6175,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2421,method, +6176,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2444,method, +6177,UpSampling1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2461,class,"Upsampling layer for 1D inputs. Repeats each temporal step `size` times along the time axis. @@ -41201,7 +49373,10 @@ Input shape: Output shape: 3D tensor with shape: `(batch_size, upsampled_steps, features)`." -5804,UpSampling2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2518,class,"Upsampling layer for 2D inputs. +6178,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2502,method, +6179,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2507,method, +6180,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2511,method, +6181,UpSampling2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2518,class,"Upsampling layer for 2D inputs. Repeats the rows and columns of the data by `size[0]` and `size[1]` respectively. @@ -41255,7 +49430,10 @@ Output shape: `(batch_size, upsampled_rows, upsampled_cols, channels)` - If `data_format` is `""channels_first""`: `(batch_size, channels, upsampled_rows, upsampled_cols)`" -5805,UpSampling3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2622,class,"Upsampling layer for 3D inputs. +6182,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2589,method, +6183,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2606,method, +6184,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2611,method, +6185,UpSampling3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2622,class,"Upsampling layer for 3D inputs. Repeats the 1st, 2nd and 3rd dimensions of the data by `size[0]`, `size[1]` and `size[2]` respectively. @@ -41295,7 +49473,10 @@ Output shape: `(batch_size, upsampled_dim1, upsampled_dim2, upsampled_dim3, channels)` - If `data_format` is `""channels_first""`: `(batch_size, channels, upsampled_dim1, upsampled_dim2, upsampled_dim3)`" -5806,ZeroPadding1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2703,class,"Zero-padding layer for 1D input (e.g. temporal sequence). +6186,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2671,method, +6187,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2692,method, +6188,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2696,method, +6189,ZeroPadding1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2703,class,"Zero-padding layer for 1D input (e.g. temporal sequence). Examples: @@ -41336,7 +49517,10 @@ Input shape: Output shape: 3D tensor with shape `(batch_size, padded_axis, features)`" -5807,ZeroPadding2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2769,class,"Zero-padding layer for 2D input (e.g. picture). +6190,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2752,method, +6191,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2759,method, +6192,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2762,method, +6193,ZeroPadding2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2769,class,"Zero-padding layer for 2D input (e.g. picture). This layer can add rows and columns of zeros at the top, bottom, left and right side of an image tensor. @@ -41399,7 +49583,10 @@ Output shape: `(batch_size, padded_rows, padded_cols, channels)` - If `data_format` is `""channels_first""`: `(batch_size, channels, padded_rows, padded_cols)`" -5808,ZeroPadding3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2894,class,"Zero-padding layer for 3D data (spatial or spatio-temporal). +6194,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2858,method, +6195,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,2883,method, +6196,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,2887,method, +6197,ZeroPadding3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,2894,class,"Zero-padding layer for 3D data (spatial or spatio-temporal). Examples: @@ -41449,7 +49636,10 @@ Output shape: - If `data_format` is `""channels_first""`: `(batch_size, depth, first_padded_axis, second_padded_axis, third_axis_to_pad)`" -5809,Cropping1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3020,class,"Cropping layer for 1D input (e.g. temporal sequence). +6198,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,2976,method, +6199,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,3009,method, +6200,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,3013,method, +6201,Cropping1D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3020,class,"Cropping layer for 1D input (e.g. temporal sequence). It crops along the time dimension (axis 1). @@ -41481,7 +49671,10 @@ Input shape: Output shape: 3D tensor with shape `(batch_size, cropped_axis, features)`" -5810,Cropping2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3081,class,"Cropping layer for 2D input (e.g. picture). +6202,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,3060,method, +6203,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,3068,method, +6204,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,3074,method, +6205,Cropping2D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3081,class,"Cropping layer for 2D input (e.g. picture). It crops along spatial dimensions, i.e. height and width. @@ -41528,7 +49721,10 @@ Output shape: `(batch_size, cropped_rows, cropped_cols, channels)` - If `data_format` is `""channels_first""`: `(batch_size, channels, cropped_rows, cropped_cols)`" -5811,Cropping3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3208,class,"Cropping layer for 3D data (e.g. spatial or spatio-temporal). +6206,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,3154,method, +6207,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,3175,method, +6208,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,3201,method, +6209,Cropping3D,tensorflow/tensorflow/python/keras/layers/convolutional.py,3208,class,"Cropping layer for 3D data (e.g. spatial or spatio-temporal). Examples: @@ -41576,7 +49772,10 @@ Output shape: - If `data_format` is `""channels_first""`: `(batch_size, depth, first_cropped_axis, second_cropped_axis, third_cropped_axis)`" -5812,ConvRNN2D,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,40,class,"Base class for convolutional-recurrent layers. +6210,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional.py,3291,method, +6211,call,tensorflow/tensorflow/python/keras/layers/convolutional.py,3326,method, +6212,get_config,tensorflow/tensorflow/python/keras/layers/convolutional.py,3383,method, +6213,ConvRNN2D,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,40,class,"Base class for convolutional-recurrent layers. Arguments: cell: A RNN cell instance. A RNN cell is a class that has: @@ -41690,7 +49889,15 @@ Note on passing external constants to RNNs: `constants`. Such constants can be used to condition the cell transformation on additional static inputs (not changing over time), a.k.a. an attention mechanism." -5813,ConvLSTM2DCell,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,424,class,"Cell class for the ConvLSTM2D layer. +6214,compute_output_shape,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,184,method, +6215,build,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,225,method, +6216,get_initial_state,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,277,method, +6217,call,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,294,method, +6218,reset_states,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,353,method, +6219,get_tuple_shape,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,377,method, +6220,step,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,317,method, +6221,step,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,322,method, +6222,ConvLSTM2DCell,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,424,class,"Cell class for the ConvLSTM2D layer. Arguments: filters: Integer, the dimensionality of the output space @@ -41754,7 +49961,13 @@ Call arguments: training: Python boolean indicating whether the layer should behave in training mode or in inference mode. Only relevant when `dropout` or `recurrent_dropout` is used." -5814,ConvLSTM2D,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,700,class,"Convolutional LSTM. +6223,build,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,543,method, +6224,call,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,590,method, +6225,input_conv,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,650,method, +6226,recurrent_conv,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,660,method, +6227,get_config,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,666,method, +6228,bias_initializer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,572,method, +6229,ConvLSTM2D,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,700,class,"Convolutional LSTM. It is similar to an LSTM layer, but the input transformations and recurrent transformations are both convolutional. @@ -41879,21 +50092,31 @@ References: - [Shi et al., 2015](http://arxiv.org/abs/1506.04214v1) (the current implementation does not include the feedback loop on the cells output)." -5815,ConvLSTMTest,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent_test.py,32,class, -5816,Conv1DTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,38,class, -5817,Conv2DTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,175,class, -5818,Conv3DTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,283,class, -5819,GroupedConvTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,418,class, -5820,Conv1DTransposeTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,470,class, -5821,Conv3DTransposeTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,503,class, -5822,ConvSequentialTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,536,class, -5823,ZeroPaddingTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,596,class, -5824,UpSamplingTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,832,class, -5825,CroppingTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,981,class, -5826,DepthwiseConv2DTest,tensorflow/tensorflow/python/keras/layers/convolutional_test.py,1123,class, -5827,Conv2DTransposeTest,tensorflow/tensorflow/python/keras/layers/convolutional_transpose_test.py,31,class, -5828,Conv3DTransposeTest,tensorflow/tensorflow/python/keras/layers/convolutional_transpose_test.py,121,class, -5829,Masking,tensorflow/tensorflow/python/keras/layers/core.py,67,class,"Masks a sequence by using a mask value to skip timesteps. +6230,call,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,886,method, +6231,filters,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,894,method, +6232,kernel_size,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,898,method, +6233,strides,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,902,method, +6234,padding,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,906,method, +6235,data_format,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,910,method, +6236,dilation_rate,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,914,method, +6237,activation,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,918,method, +6238,recurrent_activation,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,922,method, +6239,use_bias,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,926,method, +6240,kernel_initializer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,930,method, +6241,recurrent_initializer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,934,method, +6242,bias_initializer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,938,method, +6243,unit_forget_bias,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,942,method, +6244,kernel_regularizer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,946,method, +6245,recurrent_regularizer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,950,method, +6246,bias_regularizer,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,954,method, +6247,kernel_constraint,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,958,method, +6248,recurrent_constraint,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,962,method, +6249,bias_constraint,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,966,method, +6250,dropout,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,970,method, +6251,recurrent_dropout,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,974,method, +6252,get_config,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,977,method, +6253,from_config,tensorflow/tensorflow/python/keras/layers/convolutional_recurrent.py,1013,method, +6254,Masking,tensorflow/tensorflow/python/keras/layers/core.py,67,class,"Masks a sequence by using a mask value to skip timesteps. For each timestep in the input tensor (dimension #1 in the tensor), if all values in the input tensor at that timestep @@ -41930,7 +50153,11 @@ output = model(inputs) See [the masking and padding guide]( https://www.tensorflow.org/guide/keras/masking_and_padding) for more details." -5830,Dropout,tensorflow/tensorflow/python/keras/layers/core.py,134,class,"Applies Dropout to the input. +6255,compute_mask,tensorflow/tensorflow/python/keras/layers/core.py,113,method, +6256,call,tensorflow/tensorflow/python/keras/layers/core.py,116,method, +6257,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,124,method, +6258,get_config,tensorflow/tensorflow/python/keras/layers/core.py,127,method, +6259,Dropout,tensorflow/tensorflow/python/keras/layers/core.py,134,class,"Applies Dropout to the input. The Dropout layer randomly sets input units to 0 with a frequency of `rate` at each step during training time, which helps prevent overfitting. @@ -41978,7 +50205,11 @@ Call arguments: inputs: Input tensor (of any rank). training: Python boolean indicating whether the layer should behave in training mode (adding dropout) or in inference mode (doing nothing)." -5831,SpatialDropout1D,tensorflow/tensorflow/python/keras/layers/core.py,235,class,"Spatial 1D version of Dropout. +6260,call,tensorflow/tensorflow/python/keras/layers/core.py,205,method, +6261,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,221,method, +6262,get_config,tensorflow/tensorflow/python/keras/layers/core.py,224,method, +6263,dropped_inputs,tensorflow/tensorflow/python/keras/layers/core.py,209,method, +6264,SpatialDropout1D,tensorflow/tensorflow/python/keras/layers/core.py,235,class,"Spatial 1D version of Dropout. This version performs the same function as Dropout, however, it drops entire 1D feature maps instead of individual elements. If adjacent frames @@ -42006,7 +50237,7 @@ Output shape: References: - [Efficient Object Localization Using Convolutional Networks](https://arxiv.org/abs/1411.4280)" -5832,SpatialDropout2D,tensorflow/tensorflow/python/keras/layers/core.py,277,class,"Spatial 2D version of Dropout. +6265,SpatialDropout2D,tensorflow/tensorflow/python/keras/layers/core.py,277,class,"Spatial 2D version of Dropout. This version performs the same function as Dropout, however, it drops entire 2D feature maps instead of individual elements. If adjacent pixels @@ -42043,7 +50274,7 @@ Output shape: References: - [Efficient Object Localization Using Convolutional Networks](https://arxiv.org/abs/1411.4280)" -5833,SpatialDropout3D,tensorflow/tensorflow/python/keras/layers/core.py,336,class,"Spatial 3D version of Dropout. +6266,SpatialDropout3D,tensorflow/tensorflow/python/keras/layers/core.py,336,class,"Spatial 3D version of Dropout. This version performs the same function as Dropout, however, it drops entire 3D feature maps instead of individual elements. If adjacent voxels @@ -42079,7 +50310,7 @@ Output shape: References: - [Efficient Object Localization Using Convolutional Networks](https://arxiv.org/abs/1411.4280)" -5834,Activation,tensorflow/tensorflow/python/keras/layers/core.py,394,class,"Applies an activation function to an output. +6267,Activation,tensorflow/tensorflow/python/keras/layers/core.py,394,class,"Applies an activation function to an output. Arguments: activation: Activation function, such as `tf.nn.relu`, or string name of @@ -42103,7 +50334,10 @@ Input shape: Output shape: Same shape as input." -5835,Reshape,tensorflow/tensorflow/python/keras/layers/core.py,439,class,"Layer that reshapes inputs into the given shape. +6268,call,tensorflow/tensorflow/python/keras/layers/core.py,426,method, +6269,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,429,method, +6270,get_config,tensorflow/tensorflow/python/keras/layers/core.py,432,method, +6271,Reshape,tensorflow/tensorflow/python/keras/layers/core.py,439,class,"Layer that reshapes inputs into the given shape. Input shape: Arbitrary, although all dimensions in the input shape must be known/fixed. @@ -42132,7 +50366,10 @@ Example: >>> model.add(tf.keras.layers.Reshape((-1, 2, 2))) >>> model.output_shape (None, 3, 2, 2)" -5836,Permute,tensorflow/tensorflow/python/keras/layers/core.py,554,class,"Permutes the dimensions of the input according to a given pattern. +6272,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,526,method, +6273,call,tensorflow/tensorflow/python/keras/layers/core.py,538,method, +6274,get_config,tensorflow/tensorflow/python/keras/layers/core.py,547,method, +6275,Permute,tensorflow/tensorflow/python/keras/layers/core.py,554,class,"Permutes the dimensions of the input according to a given pattern. Useful e.g. connecting RNNs and convnets. @@ -42159,7 +50396,10 @@ Input shape: Output shape: Same as the input shape, but with the dimensions re-ordered according to the specified pattern." -5837,Flatten,tensorflow/tensorflow/python/keras/layers/core.py,612,class,"Flattens the input. Does not affect the batch size. +6276,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,594,method, +6277,call,tensorflow/tensorflow/python/keras/layers/core.py,602,method, +6278,get_config,tensorflow/tensorflow/python/keras/layers/core.py,605,method, +6279,Flatten,tensorflow/tensorflow/python/keras/layers/core.py,612,class,"Flattens the input. Does not affect the batch size. Note: If inputs are shaped `(batch,)` without a feature axis, then flattening adds an extra channel dimension and output shape is `(batch, 1)`. @@ -42185,7 +50425,10 @@ Example: >>> model.add(Flatten()) >>> model.output_shape (None, 640)" -5838,RepeatVector,tensorflow/tensorflow/python/keras/layers/core.py,700,class,"Repeats the input n times. +6280,call,tensorflow/tensorflow/python/keras/layers/core.py,648,method, +6281,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,681,method, +6282,get_config,tensorflow/tensorflow/python/keras/layers/core.py,693,method, +6283,RepeatVector,tensorflow/tensorflow/python/keras/layers/core.py,700,class,"Repeats the input n times. Example: @@ -42207,7 +50450,10 @@ Input shape: Output shape: 3D tensor of shape `(num_samples, n, features)`." -5839,Lambda,tensorflow/tensorflow/python/keras/layers/core.py,744,class,"Wraps arbitrary expressions as a `Layer` object. +6284,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,730,method, +6285,call,tensorflow/tensorflow/python/keras/layers/core.py,734,method, +6286,get_config,tensorflow/tensorflow/python/keras/layers/core.py,737,method, +6287,Lambda,tensorflow/tensorflow/python/keras/layers/core.py,744,class,"Wraps arbitrary expressions as a `Layer` object. The `Lambda` layer exists so that arbitrary TensorFlow functions can be used when constructing `Sequential` and Functional API @@ -42298,7 +50544,12 @@ Input shape: Output shape: Specified by `output_shape` argument" -5840,Dense,tensorflow/tensorflow/python/keras/layers/core.py,1067,class,"Just your regular densely-connected NN layer. +6288,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,859,method, +6289,call,tensorflow/tensorflow/python/keras/layers/core.py,887,method, +6290,compute_mask,tensorflow/tensorflow/python/keras/layers/core.py,954,method, +6291,get_config,tensorflow/tensorflow/python/keras/layers/core.py,959,method, +6292,from_config,tensorflow/tensorflow/python/keras/layers/core.py,1003,method, +6293,Dense,tensorflow/tensorflow/python/keras/layers/core.py,1067,class,"Just your regular densely-connected NN layer. `Dense` implements the operation: `output = activation(dot(input, kernel) + bias)` @@ -42359,7 +50610,11 @@ Output shape: N-D tensor with shape: `(batch_size, ..., units)`. For instance, for a 2D input with shape `(batch_size, input_dim)`, the output would have shape `(batch_size, units)`." -5841,ActivityRegularization,tensorflow/tensorflow/python/keras/layers/core.py,1237,class,"Layer that applies an update to the cost function based input activity. +6294,build,tensorflow/tensorflow/python/keras/layers/core.py,1159,method, +6295,call,tensorflow/tensorflow/python/keras/layers/core.py,1192,method, +6296,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,1200,method, +6297,get_config,tensorflow/tensorflow/python/keras/layers/core.py,1209,method, +6298,ActivityRegularization,tensorflow/tensorflow/python/keras/layers/core.py,1237,class,"Layer that applies an update to the cost function based input activity. Arguments: l1: L1 regularization factor (positive float). @@ -42372,7 +50627,9 @@ Input shape: Output shape: Same shape as input." -5842,TFOpLambda,tensorflow/tensorflow/python/keras/layers/core.py,1269,class,"Wraps TF API symbols in a `Layer` object. +6299,compute_output_shape,tensorflow/tensorflow/python/keras/layers/core.py,1260,method, +6300,get_config,tensorflow/tensorflow/python/keras/layers/core.py,1263,method, +6301,TFOpLambda,tensorflow/tensorflow/python/keras/layers/core.py,1269,class,"Wraps TF API symbols in a `Layer` object. It is inserted by the Functional API construction whenever users call a supported TF symbol on KerasTensors. @@ -42385,10 +50642,11 @@ This is useful in the case where users do something like: x = keras.Input(...) y = tf.Variable(...) out = x * tf_variable" -5843,KerasOpDispatcher,tensorflow/tensorflow/python/keras/layers/core.py,1416,class,A global dispatcher that allows building a functional model with TF Ops. -5844,_slice_to_dict,tensorflow/tensorflow/python/keras/layers/core.py,1431,function, -5845,_dict_to_slice,tensorflow/tensorflow/python/keras/layers/core.py,1437,function, -5846,SlicingOpLambda,tensorflow/tensorflow/python/keras/layers/core.py,1443,class,"Wraps TF API symbols in a `Layer` object. +6302,get_config,tensorflow/tensorflow/python/keras/layers/core.py,1384,method, +6303,from_config,tensorflow/tensorflow/python/keras/layers/core.py,1403,method, +6304,KerasOpDispatcher,tensorflow/tensorflow/python/keras/layers/core.py,1416,class,A global dispatcher that allows building a functional model with TF Ops. +6305,handle,tensorflow/tensorflow/python/keras/layers/core.py,1419,method,Handle the specified operation with the specified arguments. +6306,SlicingOpLambda,tensorflow/tensorflow/python/keras/layers/core.py,1443,class,"Wraps TF API symbols in a `Layer` object. It is inserted by the Functional API construction whenever users call a supported TF symbol on KerasTensors. @@ -42401,28 +50659,9 @@ This is useful in the case where users do something like: x = keras.Input(...) y = tf.Variable(...) out = x * tf_variable" -5847,TFSlicingOpDispatcher,tensorflow/tensorflow/python/keras/layers/core.py,1499,class,A global dispatcher that allows building a functional model with TF Ops. -5848,DropoutLayersTest,tensorflow/tensorflow/python/keras/layers/core_test.py,42,class, -5849,LambdaLayerTest,tensorflow/tensorflow/python/keras/layers/core_test.py,98,class, -5850,TestStatefulLambda,tensorflow/tensorflow/python/keras/layers/core_test.py,285,class, -5851,CoreLayersTest,tensorflow/tensorflow/python/keras/layers/core_test.py,374,class, -5852,_CuDNNRNN,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,37,class,"Private base class for CuDNNGRU and CuDNNLSTM layers. - -Arguments: - return_sequences: Boolean. Whether to return the last output - in the output sequence, or the full sequence. - return_state: Boolean. Whether to return the last state - in addition to the output. - go_backwards: Boolean (default False). - If True, process the input sequence backwards and return the - reversed sequence. - stateful: Boolean (default False). If True, the last state - for each sample at index i in a batch will be used as initial - state for the sample of index i in the following batch. - time_major: Boolean (default False). If true, the inputs and outputs will be - in shape `(timesteps, batch, ...)`, whereas in the False case, it will - be `(batch, timesteps, ...)`." -5853,CuDNNGRU,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,162,class,"Fast GRU implementation backed by cuDNN. +6307,TFSlicingOpDispatcher,tensorflow/tensorflow/python/keras/layers/core.py,1499,class,A global dispatcher that allows building a functional model with TF Ops. +6308,handle,tensorflow/tensorflow/python/keras/layers/core.py,1505,method,Handle the specified operation with the specified arguments. +6309,CuDNNGRU,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,162,class,"Fast GRU implementation backed by cuDNN. More information about cuDNN can be found on the [NVIDIA developer website](https://developer.nvidia.com/cudnn). @@ -42456,7 +50695,10 @@ Arguments: stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch." -5854,CuDNNLSTM,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,342,class,"Fast LSTM implementation backed by cuDNN. +6310,cell,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,240,method, +6311,build,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,243,method, +6312,get_config,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,319,method, +6313,CuDNNLSTM,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,342,class,"Fast LSTM implementation backed by cuDNN. More information about cuDNN can be found on the [NVIDIA developer website](https://developer.nvidia.com/cudnn). @@ -42494,10 +50736,11 @@ Arguments: stateful: Boolean (default False). If True, the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch." -5855,CuDNNTest,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent_test.py,40,class, -5856,CuDNNGraphOnlyTest,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent_test.py,162,class, -5857,CuDNNV1OnlyTest,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent_test.py,249,class, -5858,BaseDenseAttention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,38,class,"Base Attention class for Dense networks. +6314,cell,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,426,method, +6315,build,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,429,method, +6316,get_config,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,521,method, +6317,bias_initializer,tensorflow/tensorflow/python/keras/layers/cudnn_recurrent.py,451,method, +6318,BaseDenseAttention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,38,class,"Base Attention class for Dense networks. This class is suitable for Dense or CNN networks, and not for RNN networks. @@ -42532,7 +50775,11 @@ Call Arguments: Output shape: Attention outputs of shape `[batch_size, Tq, dim]`." -5859,Attention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,210,class,"Dot-product attention layer, a.k.a. Luong-style attention. +6319,call,tensorflow/tensorflow/python/keras/layers/dense_attention.py,137,method, +6320,compute_mask,tensorflow/tensorflow/python/keras/layers/dense_attention.py,169,method, +6321,get_config,tensorflow/tensorflow/python/keras/layers/dense_attention.py,200,method, +6322,dropped_weights,tensorflow/tensorflow/python/keras/layers/dense_attention.py,127,method, +6323,Attention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,210,class,"Dot-product attention layer, a.k.a. Luong-style attention. Inputs are `query` tensor of shape `[batch_size, Tq, dim]`, `value` tensor of shape `[batch_size, Tv, dim]` and `key` tensor of shape @@ -42625,7 +50872,9 @@ input_layer = tf.keras.layers.Concatenate()( # Add DNN layers, and create Model. # ... ```" -5860,AdditiveAttention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,344,class,"Additive attention layer, a.k.a. Bahdanau-style attention. +6324,build,tensorflow/tensorflow/python/keras/layers/dense_attention.py,310,method,Creates scale variable if use_scale==True. +6325,get_config,tensorflow/tensorflow/python/keras/layers/dense_attention.py,337,method, +6326,AdditiveAttention,tensorflow/tensorflow/python/keras/layers/dense_attention.py,344,class,"Additive attention layer, a.k.a. Bahdanau-style attention. Inputs are `query` tensor of shape `[batch_size, Tq, dim]`, `value` tensor of shape `[batch_size, Tv, dim]` and `key` tensor of shape @@ -42720,13 +50969,9 @@ input_layer = tf.keras.layers.Concatenate()( # Add DNN layers, and create Model. # ... ```" -5861,_lower_triangular_mask,tensorflow/tensorflow/python/keras/layers/dense_attention.py,489,function,Creates a lower-triangular boolean mask over the last 2 dimensions. -5862,_merge_masks,tensorflow/tensorflow/python/keras/layers/dense_attention.py,498,function, -5863,BaseDenseAttentionTest,tensorflow/tensorflow/python/keras/layers/dense_attention_test.py,34,class, -5864,AttentionTest,tensorflow/tensorflow/python/keras/layers/dense_attention_test.py,155,class, -5865,AdditiveAttentionTest,tensorflow/tensorflow/python/keras/layers/dense_attention_test.py,472,class, -5866,LowerTriangularMaskTest,tensorflow/tensorflow/python/keras/layers/dense_attention_test.py,718,class, -5867,EinsumDense,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,34,class,"A layer that uses tf.einsum as the backing computation. +6327,build,tensorflow/tensorflow/python/keras/layers/dense_attention.py,446,method, +6328,get_config,tensorflow/tensorflow/python/keras/layers/dense_attention.py,483,method, +6329,EinsumDense,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,34,class,"A layer that uses tf.einsum as the backing computation. This layer can perform einsum calculations of arbitrary dimensionality. @@ -42801,11 +51046,11 @@ sequence dimension exists. >>> output_tensor = layer(input_tensor) >>> output_tensor <... shape=(None, 32, 64) dtype=...>" -5868,_analyze_einsum_string,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,209,function,Analyzes an einsum string to determine the required weight shape. -5869,_analyze_split_string,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,240,function,Analyze an pre-split einsum string to find the weight shape. -5870,TestEinsumDenseLayer,tensorflow/tensorflow/python/keras/layers/einsum_dense_test.py,225,class, -5871,TestEinsumLayerAPI,tensorflow/tensorflow/python/keras/layers/einsum_dense_test.py,258,class, -5872,Embedding,tensorflow/tensorflow/python/keras/layers/embeddings.py,36,class,"Turns positive integers (indexes) into dense vectors of fixed size. +6330,build,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,140,method, +6331,compute_output_shape,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,169,method, +6332,get_config,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,172,method, +6333,call,tensorflow/tensorflow/python/keras/layers/einsum_dense.py,200,method, +6334,Embedding,tensorflow/tensorflow/python/keras/layers/embeddings.py,36,class,"Turns positive integers (indexes) into dense vectors of fixed size. e.g. `[[4], [20]] -> [[0.25, 0.1], [0.6, -0.2]]` @@ -42855,13 +51100,12 @@ Input shape: Output shape: 3D tensor with shape: `(batch_size, input_length, output_dim)`." -5873,EmbeddingTest,tensorflow/tensorflow/python/keras/layers/embeddings_test.py,37,class, -5874,GRULayerTest,tensorflow/tensorflow/python/keras/layers/gru_test.py,38,class, -5875,GRULayerGenericTest,tensorflow/tensorflow/python/keras/layers/gru_test.py,230,class, -5876,GRUV2Test,tensorflow/tensorflow/python/keras/layers/gru_v2_test.py,63,class, -5877,GRULayerGradientTapeTest,tensorflow/tensorflow/python/keras/layers/gru_v2_test.py,644,class, -5878,GRUGraphRewriteTest,tensorflow/tensorflow/python/keras/layers/gru_v2_test.py,672,class, -5879,RandomFourierFeatures,tensorflow/tensorflow/python/keras/layers/kernelized.py,40,class,"Layer that projects its inputs into a random feature space. +6335,build,tensorflow/tensorflow/python/keras/layers/embeddings.py,127,method, +6336,compute_mask,tensorflow/tensorflow/python/keras/layers/embeddings.py,152,method, +6337,compute_output_shape,tensorflow/tensorflow/python/keras/layers/embeddings.py,159,method, +6338,call,tensorflow/tensorflow/python/keras/layers/embeddings.py,182,method, +6339,get_config,tensorflow/tensorflow/python/keras/layers/embeddings.py,192,method, +6340,RandomFourierFeatures,tensorflow/tensorflow/python/keras/layers/kernelized.py,40,class,"Layer that projects its inputs into a random feature space. This layer implements a mapping from input space to a space with `output_dim` dimensions, which approximates shift-invariant kernels. A kernel function @@ -42968,13 +51212,11 @@ Arguments: trainable: Whether the scaling parameter of the layer should be trainable. Defaults to `False`. name: String, name to use for this layer." -5880,_get_random_features_initializer,tensorflow/tensorflow/python/keras/layers/kernelized.py,250,function,Returns Initializer object for random features. -5881,_get_default_scale,tensorflow/tensorflow/python/keras/layers/kernelized.py,273,function, -5882,_exact_gaussian,tensorflow/tensorflow/python/keras/layers/kernelized_test.py,53,function, -5883,_exact_laplacian,tensorflow/tensorflow/python/keras/layers/kernelized_test.py,58,function, -5884,RandomFourierFeaturesTest,tensorflow/tensorflow/python/keras/layers/kernelized_test.py,64,class, -5885,LayersTest,tensorflow/tensorflow/python/keras/layers/layers_test.py,27,class, -5886,LocallyConnected1D,tensorflow/tensorflow/python/keras/layers/local.py,36,class,"Locally-connected layer for 1D inputs. +6341,build,tensorflow/tensorflow/python/keras/layers/kernelized.py,175,method, +6342,call,tensorflow/tensorflow/python/keras/layers/kernelized.py,220,method, +6343,compute_output_shape,tensorflow/tensorflow/python/keras/layers/kernelized.py,228,method, +6344,get_config,tensorflow/tensorflow/python/keras/layers/kernelized.py,237,method, +6345,LocallyConnected1D,tensorflow/tensorflow/python/keras/layers/local.py,36,class,"Locally-connected layer for 1D inputs. The `LocallyConnected1D` layer works similarly to the `Conv1D` layer, except that weights are unshared, @@ -43070,7 +51312,11 @@ Input shape: Output shape: 3D tensor with shape: `(batch_size, new_steps, filters)` `steps` value might have changed due to padding or strides." -5887,LocallyConnected2D,tensorflow/tensorflow/python/keras/layers/local.py,339,class,"Locally-connected layer for 2D inputs. +6346,build,tensorflow/tensorflow/python/keras/layers/local.py,175,method, +6347,compute_output_shape,tensorflow/tensorflow/python/keras/layers/local.py,263,method, +6348,call,tensorflow/tensorflow/python/keras/layers/local.py,277,method, +6349,get_config,tensorflow/tensorflow/python/keras/layers/local.py,301,method, +6350,LocallyConnected2D,tensorflow/tensorflow/python/keras/layers/local.py,339,class,"Locally-connected layer for 2D inputs. The `LocallyConnected2D` layer works similarly to the `Conv2D` layer, except that weights are unshared, @@ -43178,7 +51424,11 @@ Output shape: or 4D tensor with shape: `(samples, new_rows, new_cols, filters)` if data_format='channels_last'. `rows` and `cols` values might have changed due to padding." -5888,get_locallyconnected_mask,tensorflow/tensorflow/python/keras/layers/local.py,666,function,"Return a mask representing connectivity of a locally-connected operation. +6351,build,tensorflow/tensorflow/python/keras/layers/local.py,490,method, +6352,compute_output_shape,tensorflow/tensorflow/python/keras/layers/local.py,586,method, +6353,call,tensorflow/tensorflow/python/keras/layers/local.py,604,method, +6354,get_config,tensorflow/tensorflow/python/keras/layers/local.py,629,method, +6355,get_locallyconnected_mask,tensorflow/tensorflow/python/keras/layers/local.py,666,function,"Return a mask representing connectivity of a locally-connected operation. This method returns a masking numpy array of 0s and 1s (of type `np.float32`) that, when element-wise multiplied with a fully-connected weight tensor, masks @@ -43215,7 +51465,7 @@ Returns: Raises: ValueError: if `data_format` is neither `""channels_first""` nor `""channels_last""`." -5889,local_conv_matmul,tensorflow/tensorflow/python/keras/layers/local.py,729,function,"Apply N-D convolution with un-shared weights using a single matmul call. +6356,local_conv_matmul,tensorflow/tensorflow/python/keras/layers/local.py,729,function,"Apply N-D convolution with un-shared weights using a single matmul call. This method outputs `inputs . (kernel * kernel_mask)` (with `.` standing for matrix-multiply and `*` for element-wise multiply) @@ -43256,7 +51506,7 @@ Arguments: Returns: Output (N+2)-D tensor with shape `output_shape`." -5890,local_conv_sparse_matmul,tensorflow/tensorflow/python/keras/layers/local.py,783,function,"Apply N-D convolution with un-shared weights using a single sparse matmul. +6357,local_conv_sparse_matmul,tensorflow/tensorflow/python/keras/layers/local.py,783,function,"Apply N-D convolution with un-shared weights using a single sparse matmul. This method outputs `inputs . tf.sparse.SparseTensor(indices=kernel_idxs, values=kernel, dense_shape=kernel_shape)`, with `.` standing for @@ -43279,7 +51529,7 @@ Arguments: Returns: Output (N+2)-D dense tensor with shape `output_shape`." -5891,make_2d,tensorflow/tensorflow/python/keras/layers/local.py,821,function,"Reshapes an N-dimensional tensor into a 2D tensor. +6358,make_2d,tensorflow/tensorflow/python/keras/layers/local.py,821,function,"Reshapes an N-dimensional tensor into a 2D tensor. Dimensions before (excluding) and after (including) `split_dim` are grouped together. @@ -43292,23 +51542,13 @@ Arguments: Returns: Tensor of shape `(d0 * ... * d(split_dim-1), d(split_dim) * ... * d(N-1))`." -5892,LocallyConnected1DLayersTest,tensorflow/tensorflow/python/keras/layers/local_test.py,84,class, -5893,LocallyConnected2DLayersTest,tensorflow/tensorflow/python/keras/layers/local_test.py,163,class, -5894,LocallyConnectedImplementationModeTest,tensorflow/tensorflow/python/keras/layers/local_test.py,270,class, -5895,get_inputs,tensorflow/tensorflow/python/keras/layers/local_test.py,402,function, -5896,xent,tensorflow/tensorflow/python/keras/layers/local_test.py,423,function, -5897,get_model,tensorflow/tensorflow/python/keras/layers/local_test.py,433,function, -5898,copy_lc_weights_2_to_1,tensorflow/tensorflow/python/keras/layers/local_test.py,471,function, -5899,copy_lc_weights_2_to_3,tensorflow/tensorflow/python/keras/layers/local_test.py,512,function, -5900,copy_model_weights,tensorflow/tensorflow/python/keras/layers/local_test.py,529,function, -5901,LSTMLayerTest,tensorflow/tensorflow/python/keras/layers/lstm_test.py,37,class, -5902,LSTMV2Test,tensorflow/tensorflow/python/keras/layers/lstm_v2_test.py,64,class, -5903,LSTMGraphRewriteTest,tensorflow/tensorflow/python/keras/layers/lstm_v2_test.py,846,class, -5904,LSTMPerformanceTest,tensorflow/tensorflow/python/keras/layers/lstm_v2_test.py,987,class, -5905,_Merge,tensorflow/tensorflow/python/keras/layers/merge.py,33,class,"Generic merge layer for elementwise merge functions. - -Used to implement `Sum`, `Average`, etc." -5906,Add,tensorflow/tensorflow/python/keras/layers/merge.py,221,class,"Layer that adds a list of inputs. +6359,get_inputs,tensorflow/tensorflow/python/keras/layers/local_test.py,402,function, +6360,xent,tensorflow/tensorflow/python/keras/layers/local_test.py,423,function, +6361,get_model,tensorflow/tensorflow/python/keras/layers/local_test.py,433,function, +6362,copy_lc_weights_2_to_1,tensorflow/tensorflow/python/keras/layers/local_test.py,471,function, +6363,copy_lc_weights_2_to_3,tensorflow/tensorflow/python/keras/layers/local_test.py,512,function, +6364,copy_model_weights,tensorflow/tensorflow/python/keras/layers/local_test.py,529,function, +6365,Add,tensorflow/tensorflow/python/keras/layers/merge.py,221,class,"Layer that adds a list of inputs. It takes as input a list of tensors, all of the same shape, and returns @@ -43333,7 +51573,7 @@ Used in a functional model: >>> added = tf.keras.layers.Add()([x1, x2]) >>> out = tf.keras.layers.Dense(4)(added) >>> model = tf.keras.models.Model(inputs=[input1, input2], outputs=out)" -5907,Subtract,tensorflow/tensorflow/python/keras/layers/merge.py,258,class,"Layer that subtracts two inputs. +6366,Subtract,tensorflow/tensorflow/python/keras/layers/merge.py,258,class,"Layer that subtracts two inputs. It takes as input a list of tensors of size 2, both of the same shape, and returns a single tensor, (inputs[0] - inputs[1]), @@ -43354,7 +51594,8 @@ Examples: out = keras.layers.Dense(4)(subtracted) model = keras.models.Model(inputs=[input1, input2], outputs=out) ```" -5908,Multiply,tensorflow/tensorflow/python/keras/layers/merge.py,297,class,"Layer that multiplies (element-wise) a list of inputs. +6367,build,tensorflow/tensorflow/python/keras/layers/merge.py,283,method, +6368,Multiply,tensorflow/tensorflow/python/keras/layers/merge.py,297,class,"Layer that multiplies (element-wise) a list of inputs. It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape). @@ -43373,7 +51614,7 @@ array([[ 0], >>> multiplied = tf.keras.layers.Multiply()([x1, x2]) >>> multiplied.shape TensorShape([5, 8])" -5909,Average,tensorflow/tensorflow/python/keras/layers/merge.py,327,class,"Layer that averages a list of inputs element-wise. +6369,Average,tensorflow/tensorflow/python/keras/layers/merge.py,327,class,"Layer that averages a list of inputs element-wise. It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape). @@ -43399,7 +51640,7 @@ Usage in a functional model: Raises: ValueError: If there is a shape mismatch between the inputs and the shapes cannot be broadcasted to match." -5910,Maximum,tensorflow/tensorflow/python/keras/layers/merge.py,364,class,"Layer that computes the maximum (element-wise) a list of inputs. +6370,Maximum,tensorflow/tensorflow/python/keras/layers/merge.py,364,class,"Layer that computes the maximum (element-wise) a list of inputs. It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape). @@ -43418,7 +51659,7 @@ array([[5], >>> maxed = tf.keras.layers.Maximum()([x1, x2]) >>> maxed.shape TensorShape([5, 8])" -5911,Minimum,tensorflow/tensorflow/python/keras/layers/merge.py,394,class,"Layer that computes the minimum (element-wise) a list of inputs. +6371,Minimum,tensorflow/tensorflow/python/keras/layers/merge.py,394,class,"Layer that computes the minimum (element-wise) a list of inputs. It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape). @@ -43437,7 +51678,7 @@ array([[0], >>> minned = tf.keras.layers.Minimum()([x1, x2]) >>> minned.shape TensorShape([5, 8])" -5912,Concatenate,tensorflow/tensorflow/python/keras/layers/merge.py,424,class,"Layer that concatenates a list of inputs. +6372,Concatenate,tensorflow/tensorflow/python/keras/layers/merge.py,424,class,"Layer that concatenates a list of inputs. It takes as input a list of tensors, all of the same shape except for the concatenation axis, and returns a single tensor that is the @@ -43467,7 +51708,11 @@ array([[[ 0, 1, 2, 3, 4], >>> concatted = tf.keras.layers.Concatenate()([x1, x2]) >>> concatted.shape TensorShape([5, 16])" -5913,Dot,tensorflow/tensorflow/python/keras/layers/merge.py,579,class,"Layer that computes a dot product between samples in two tensors. +6373,build,tensorflow/tensorflow/python/keras/layers/merge.py,490,method, +6374,compute_output_shape,tensorflow/tensorflow/python/keras/layers/merge.py,525,method, +6375,compute_mask,tensorflow/tensorflow/python/keras/layers/merge.py,542,method, +6376,get_config,tensorflow/tensorflow/python/keras/layers/merge.py,570,method, +6377,Dot,tensorflow/tensorflow/python/keras/layers/merge.py,579,class,"Layer that computes a dot product between samples in two tensors. E.g. if applied to a list of two tensors `a` and `b` of shape `(batch_size, n)`, the output will be a tensor of shape `(batch_size, 1)` @@ -43495,7 +51740,11 @@ array([[[260, 360], >>> dotted = tf.keras.layers.Dot(axes=1)([x1, x2]) >>> dotted.shape TensorShape([5, 1])" -5914,add,tensorflow/tensorflow/python/keras/layers/merge.py,741,function,"Functional interface to the `tf.keras.layers.Add` layer. +6378,build,tensorflow/tensorflow/python/keras/layers/merge.py,660,method, +6379,compute_output_shape,tensorflow/tensorflow/python/keras/layers/merge.py,707,method, +6380,compute_mask,tensorflow/tensorflow/python/keras/layers/merge.py,728,method, +6381,get_config,tensorflow/tensorflow/python/keras/layers/merge.py,731,method, +6382,add,tensorflow/tensorflow/python/keras/layers/merge.py,741,function,"Functional interface to the `tf.keras.layers.Add` layer. Arguments: inputs: A list of input tensors (at least 2) with the same shape. @@ -43522,7 +51771,7 @@ Used in a functiona model: >>> added = tf.keras.layers.add([x1, x2]) >>> out = tf.keras.layers.Dense(4)(added) >>> model = tf.keras.models.Model(inputs=[input1, input2], outputs=out)" -5915,subtract,tensorflow/tensorflow/python/keras/layers/merge.py,775,function,"Functional interface to the `Subtract` layer. +6383,subtract,tensorflow/tensorflow/python/keras/layers/merge.py,775,function,"Functional interface to the `Subtract` layer. Arguments: inputs: A list of input tensors (exactly 2). @@ -43545,7 +51794,7 @@ Examples: out = keras.layers.Dense(4)(subtracted) model = keras.models.Model(inputs=[input1, input2], outputs=out) ```" -5916,multiply,tensorflow/tensorflow/python/keras/layers/merge.py,804,function,"Functional interface to the `Multiply` layer. +6384,multiply,tensorflow/tensorflow/python/keras/layers/merge.py,804,function,"Functional interface to the `Multiply` layer. Arguments: inputs: A list of input tensors (at least 2). @@ -43553,7 +51802,7 @@ Arguments: Returns: A tensor, the element-wise product of the inputs." -5917,average,tensorflow/tensorflow/python/keras/layers/merge.py,818,function,"Functional interface to the `tf.keras.layers.Average` layer. +6385,average,tensorflow/tensorflow/python/keras/layers/merge.py,818,function,"Functional interface to the `tf.keras.layers.Average` layer. Example: @@ -43583,7 +51832,7 @@ Returns: Raises: ValueError: If there is a shape mismatch between the inputs and the shapes cannot be broadcasted to match." -5918,maximum,tensorflow/tensorflow/python/keras/layers/merge.py,854,function,"Functional interface to compute maximum (element-wise) list of `inputs`. +6386,maximum,tensorflow/tensorflow/python/keras/layers/merge.py,854,function,"Functional interface to compute maximum (element-wise) list of `inputs`. This is equivalent to the `tf.keras.layers.Maximum` layer. @@ -43609,7 +51858,7 @@ Returns: Raises: ValueError: If input tensors are of different shape." -5919,minimum,tensorflow/tensorflow/python/keras/layers/merge.py,886,function,"Functional interface to the `Minimum` layer. +6387,minimum,tensorflow/tensorflow/python/keras/layers/merge.py,886,function,"Functional interface to the `Minimum` layer. Arguments: inputs: A list of input tensors (at least 2). @@ -43617,7 +51866,7 @@ Arguments: Returns: A tensor, the element-wise minimum of the inputs." -5920,concatenate,tensorflow/tensorflow/python/keras/layers/merge.py,900,function,"Functional interface to the `Concatenate` layer. +6388,concatenate,tensorflow/tensorflow/python/keras/layers/merge.py,900,function,"Functional interface to the `Concatenate` layer. >>> x = np.arange(20).reshape(2, 2, 5) >>> print(x) @@ -43646,7 +51895,7 @@ Arguments: Returns: A tensor, the concatenation of the inputs alongside axis `axis`." -5921,dot,tensorflow/tensorflow/python/keras/layers/merge.py,935,function,"Functional interface to the `Dot` layer. +6389,dot,tensorflow/tensorflow/python/keras/layers/merge.py,935,function,"Functional interface to the `Dot` layer. Arguments: inputs: A list of input tensors (at least 2). @@ -43660,9 +51909,7 @@ Arguments: Returns: A tensor, the dot product of the samples from the inputs." -5922,MergeLayersTest,tensorflow/tensorflow/python/keras/layers/merge_test.py,36,class, -5923,MergeLayersTestNoExecution,tensorflow/tensorflow/python/keras/layers/merge_test.py,266,class, -5924,GaussianNoise,tensorflow/tensorflow/python/keras/layers/noise.py,32,class,"Apply additive zero-centered Gaussian noise. +6390,GaussianNoise,tensorflow/tensorflow/python/keras/layers/noise.py,32,class,"Apply additive zero-centered Gaussian noise. This is useful to mitigate overfitting (you could see it as a form of random data augmentation). @@ -43686,7 +51933,11 @@ Input shape: Output shape: Same shape as input." -5925,GaussianDropout,tensorflow/tensorflow/python/keras/layers/noise.py,86,class,"Apply multiplicative 1-centered Gaussian noise. +6391,call,tensorflow/tensorflow/python/keras/layers/noise.py,64,method, +6392,get_config,tensorflow/tensorflow/python/keras/layers/noise.py,75,method, +6393,compute_output_shape,tensorflow/tensorflow/python/keras/layers/noise.py,81,method, +6394,noised,tensorflow/tensorflow/python/keras/layers/noise.py,66,method, +6395,GaussianDropout,tensorflow/tensorflow/python/keras/layers/noise.py,86,class,"Apply multiplicative 1-centered Gaussian noise. As it is a regularization layer, it is only active at training time. @@ -43707,7 +51958,11 @@ Input shape: Output shape: Same shape as input." -5926,AlphaDropout,tensorflow/tensorflow/python/keras/layers/noise.py,140,class,"Applies Alpha Dropout to the input. +6396,call,tensorflow/tensorflow/python/keras/layers/noise.py,115,method, +6397,get_config,tensorflow/tensorflow/python/keras/layers/noise.py,129,method, +6398,compute_output_shape,tensorflow/tensorflow/python/keras/layers/noise.py,135,method, +6399,noised,tensorflow/tensorflow/python/keras/layers/noise.py,118,method, +6400,AlphaDropout,tensorflow/tensorflow/python/keras/layers/noise.py,140,class,"Applies Alpha Dropout to the input. Alpha Dropout is a `Dropout` that keeps mean and variance of inputs to their original values, in order to ensure the self-normalizing property @@ -43733,8 +51988,11 @@ Input shape: Output shape: Same shape as input." -5927,NoiseLayersTest,tensorflow/tensorflow/python/keras/layers/noise_test.py,31,class, -5928,BatchNormalizationBase,tensorflow/tensorflow/python/keras/layers/normalization.py,43,class,"Normalize and scale inputs or activations. +6401,call,tensorflow/tensorflow/python/keras/layers/noise.py,179,method, +6402,get_config,tensorflow/tensorflow/python/keras/layers/noise.py,205,method, +6403,compute_output_shape,tensorflow/tensorflow/python/keras/layers/noise.py,211,method, +6404,dropped_inputs,tensorflow/tensorflow/python/keras/layers/noise.py,183,method, +6405,BatchNormalizationBase,tensorflow/tensorflow/python/keras/layers/normalization.py,43,class,"Normalize and scale inputs or activations. Normalize the activations of the previous layer at each batch, i.e. applies a transformation that maintains the mean activation @@ -43835,9 +52093,22 @@ Normalization equations: Consider the intermediate activations \(x\) of a \hat{x_i} + \beta}\\) Reference: - [Ioffe and Szegedy, 2015](https://arxiv.org/abs/1502.03167)." -5929,replace_in_base_docstring,tensorflow/tensorflow/python/keras/layers/normalization.py,925,function, -5930,BatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization.py,934,class, -5931,LayerNormalization,tensorflow/tensorflow/python/keras/layers/normalization.py,949,class,"Layer normalization layer (Ba et al., 2016). +6406,trainable,tensorflow/tensorflow/python/keras/layers/normalization.py,264,method, +6407,trainable,tensorflow/tensorflow/python/keras/layers/normalization.py,268,method, +6408,build,tensorflow/tensorflow/python/keras/layers/normalization.py,284,method, +6409,call,tensorflow/tensorflow/python/keras/layers/normalization.py,697,method, +6410,compute_output_shape,tensorflow/tensorflow/python/keras/layers/normalization.py,875,method, +6411,get_config,tensorflow/tensorflow/python/keras/layers/normalization.py,878,method, +6412,mean_update,tensorflow/tensorflow/python/keras/layers/normalization.py,589,method,Update self.moving_mean with the most recent data point. +6413,variance_update,tensorflow/tensorflow/python/keras/layers/normalization.py,597,method,Update self.moving_variance with the most recent data point. +6414,undo_virtual_batching,tensorflow/tensorflow/python/keras/layers/normalization.py,715,method, +6415,mean_update,tensorflow/tensorflow/python/keras/layers/normalization.py,826,method, +6416,variance_update,tensorflow/tensorflow/python/keras/layers/normalization.py,831,method,Update the moving variance. +6417,moving_stddev_initializer,tensorflow/tensorflow/python/keras/layers/normalization.py,429,method, +6418,true_branch_renorm,tensorflow/tensorflow/python/keras/layers/normalization.py,834,method, +6419,replace_in_base_docstring,tensorflow/tensorflow/python/keras/layers/normalization.py,925,function, +6420,BatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization.py,934,class, +6421,LayerNormalization,tensorflow/tensorflow/python/keras/layers/normalization.py,949,class,"Layer normalization layer (Ba et al., 2016). Normalize the activations of the previous layer for each given example in a batch independently, rather than across a batch like Batch Normalization. @@ -43953,15 +52224,11 @@ Input shape: Arbitrary. Use the keyword argument `input_shape` (tuple of Output shape: Same shape as input. Reference: - [Lei Ba et al., 2016](https://arxiv.org/abs/1607.06450)." -5932,BatchNormalizationTest,tensorflow/tensorflow/python/keras/layers/normalization_test.py,44,class, -5933,BatchNormalizationV1Test,tensorflow/tensorflow/python/keras/layers/normalization_test.py,238,class, -5934,BatchNormalizationV2Test,tensorflow/tensorflow/python/keras/layers/normalization_test.py,260,class, -5935,_run_batchnorm_correctness_test,tensorflow/tensorflow/python/keras/layers/normalization_test.py,348,function, -5936,NormalizationLayersGraphModeOnlyTest,tensorflow/tensorflow/python/keras/layers/normalization_test.py,375,class, -5937,_run_layernorm_correctness_test,tensorflow/tensorflow/python/keras/layers/normalization_test.py,474,function, -5938,LayerNormalizationTest,tensorflow/tensorflow/python/keras/layers/normalization_test.py,496,class, -5939,LayerNormalizationNumericsTest,tensorflow/tensorflow/python/keras/layers/normalization_test.py,619,class,Tests LayerNormalization has correct and numerically stable outputs. -5940,SyncBatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization_v2.py,32,class,"Normalize and scale inputs or activations synchronously across replicas. +6422,build,tensorflow/tensorflow/python/keras/layers/normalization.py,1129,method, +6423,call,tensorflow/tensorflow/python/keras/layers/normalization.py,1179,method, +6424,compute_output_shape,tensorflow/tensorflow/python/keras/layers/normalization.py,1267,method, +6425,get_config,tensorflow/tensorflow/python/keras/layers/normalization.py,1270,method, +6426,SyncBatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization_v2.py,32,class,"Normalize and scale inputs or activations synchronously across replicas. Applies batch normalization to activations of the previous layer at each batch by synchronizing the global batch statistics across all devices that are @@ -44038,8 +52305,8 @@ Input shape: Output shape: Same shape as input." -5941,BatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization_v2.py,208,class, -5942,Pooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,34,class,"Pooling layer for arbitrary pooling functions, for 1D inputs. +6427,BatchNormalization,tensorflow/tensorflow/python/keras/layers/normalization_v2.py,208,class, +6428,Pooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,34,class,"Pooling layer for arbitrary pooling functions, for 1D inputs. This class only exists for code reuse. It will never be an exposed API. @@ -44059,7 +52326,10 @@ Arguments: corresponds to inputs with shape `(batch, features, steps)`. name: A string, the name of the layer." -5943,MaxPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,112,class,"Max pooling operation for 1D temporal data. +6429,call,tensorflow/tensorflow/python/keras/layers/pooling.py,72,method, +6430,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,83,method, +6431,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,100,method, +6432,MaxPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,112,class,"Max pooling operation for 1D temporal data. Downsamples the input representation by taking the maximum value over the window defined by `pool_size`. The window is shifted by `strides`. The @@ -44135,7 +52405,7 @@ Output shape: 3D tensor with shape `(batch_size, downsampled_steps, features)`. - If `data_format='channels_first'`: 3D tensor with shape `(batch_size, features, downsampled_steps)`." -5944,AveragePooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,204,class,"Average pooling for temporal data. +6433,AveragePooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,204,class,"Average pooling for temporal data. Arguments: pool_size: Integer, size of the average pooling windows. @@ -44165,7 +52435,7 @@ Output shape: 3D tensor with shape `(batch_size, downsampled_steps, features)`. - If `data_format='channels_first'`: 3D tensor with shape `(batch_size, features, downsampled_steps)`." -5945,Pooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,248,class,"Pooling layer for arbitrary pooling functions, for 2D inputs (e.g. images). +6434,Pooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,248,class,"Pooling layer for arbitrary pooling functions, for 2D inputs (e.g. images). This class only exists for code reuse. It will never be an exposed API. @@ -44187,7 +52457,10 @@ Arguments: `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. name: A string, the name of the layer." -5946,MaxPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,334,class,"Max pooling operation for 2D spatial data. +6435,call,tensorflow/tensorflow/python/keras/layers/pooling.py,288,method, +6436,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,303,method, +6437,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,322,method, +6438,MaxPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,334,class,"Max pooling operation for 2D spatial data. Downsamples the input representation by taking the maximum value over the window defined by `pool_size` for each dimension along the features axis. @@ -44307,7 +52580,7 @@ Output shape: Returns: A tensor of rank 4 representing the maximum pooled values. See above for output shape." -5947,AveragePooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,470,class,"Average pooling operation for spatial data. +6439,AveragePooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,470,class,"Average pooling operation for spatial data. Arguments: pool_size: integer or tuple of 2 integers, @@ -44344,7 +52617,7 @@ Output shape: 4D tensor with shape `(batch_size, pooled_rows, pooled_cols, channels)`. - If `data_format='channels_first'`: 4D tensor with shape `(batch_size, channels, pooled_rows, pooled_cols)`." -5948,Pooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,522,class,"Pooling layer for arbitrary pooling functions, for 3D inputs. +6440,Pooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,522,class,"Pooling layer for arbitrary pooling functions, for 3D inputs. This class only exists for code reuse. It will never be an exposed API. @@ -44368,7 +52641,10 @@ Arguments: while `channels_first` corresponds to inputs with shape `(batch, channels, depth, height, width)`. name: A string, the name of the layer." -5949,MaxPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,619,class,"Max pooling operation for 3D data (spatial or spatio-temporal). +6441,call,tensorflow/tensorflow/python/keras/layers/pooling.py,564,method, +6442,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,584,method, +6443,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,607,method, +6444,MaxPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,619,class,"Max pooling operation for 3D data (spatial or spatio-temporal). Arguments: pool_size: Tuple of 3 integers, @@ -44405,7 +52681,7 @@ Output shape: - If `data_format='channels_first'`: 5D tensor with shape: `(batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3)`" -5950,AveragePooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,672,class,"Average pooling operation for 3D data (spatial or spatio-temporal). +6445,AveragePooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,672,class,"Average pooling operation for 3D data (spatial or spatio-temporal). Arguments: pool_size: tuple of 3 integers, @@ -44442,8 +52718,11 @@ Output shape: - If `data_format='channels_first'`: 5D tensor with shape: `(batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3)`" -5951,GlobalPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,724,class,Abstract class for different global pooling 1D layers. -5952,GlobalAveragePooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,750,class,"Global average pooling operation for temporal data. +6446,GlobalPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,724,class,Abstract class for different global pooling 1D layers. +6447,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,732,method, +6448,call,tensorflow/tensorflow/python/keras/layers/pooling.py,739,method, +6449,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,742,method, +6450,GlobalAveragePooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,750,class,"Global average pooling operation for temporal data. Examples: @@ -44477,7 +52756,9 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, features)`." -5953,GlobalMaxPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,809,class,"Global max pooling operation for 1D temporal data. +6451,call,tensorflow/tensorflow/python/keras/layers/pooling.py,792,method, +6452,compute_mask,tensorflow/tensorflow/python/keras/layers/pooling.py,804,method, +6453,GlobalMaxPooling1D,tensorflow/tensorflow/python/keras/layers/pooling.py,809,class,"Global max pooling operation for 1D temporal data. Downsamples the input representation by taking the maximum value over the time dimension. @@ -44517,9 +52798,13 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, features)`." -5954,GlobalPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,857,class,"Abstract class for different global pooling 2D layers. +6454,call,tensorflow/tensorflow/python/keras/layers/pooling.py,852,method, +6455,GlobalPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,857,class,"Abstract class for different global pooling 2D layers. " -5955,GlobalAveragePooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,884,class,"Global average pooling operation for spatial data. +6456,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,866,method, +6457,call,tensorflow/tensorflow/python/keras/layers/pooling.py,873,method, +6458,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,876,method, +6459,GlobalAveragePooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,884,class,"Global average pooling operation for spatial data. Examples: @@ -44549,7 +52834,8 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, channels)`." -5956,GlobalMaxPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,925,class,"Global max pooling operation for spatial data. +6460,call,tensorflow/tensorflow/python/keras/layers/pooling.py,917,method, +6461,GlobalMaxPooling2D,tensorflow/tensorflow/python/keras/layers/pooling.py,925,class,"Global max pooling operation for spatial data. Examples: @@ -44579,8 +52865,12 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, channels)`." -5957,GlobalPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,965,class,Abstract class for different global pooling 3D layers. -5958,GlobalAveragePooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,991,class,"Global Average pooling operation for 3D data. +6462,call,tensorflow/tensorflow/python/keras/layers/pooling.py,958,method, +6463,GlobalPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,965,class,Abstract class for different global pooling 3D layers. +6464,compute_output_shape,tensorflow/tensorflow/python/keras/layers/pooling.py,973,method, +6465,call,tensorflow/tensorflow/python/keras/layers/pooling.py,980,method, +6466,get_config,tensorflow/tensorflow/python/keras/layers/pooling.py,983,method, +6467,GlobalAveragePooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,991,class,"Global Average pooling operation for 3D data. Arguments: data_format: A string, @@ -44604,7 +52894,8 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, channels)`." -5959,GlobalMaxPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,1026,class,"Global Max pooling operation for 3D data. +6468,call,tensorflow/tensorflow/python/keras/layers/pooling.py,1018,method, +6469,GlobalMaxPooling3D,tensorflow/tensorflow/python/keras/layers/pooling.py,1026,class,"Global Max pooling operation for 3D data. Arguments: data_format: A string, @@ -44628,11 +52919,8 @@ Input shape: Output shape: 2D tensor with shape `(batch_size, channels)`." -5960,GlobalPoolingTest,tensorflow/tensorflow/python/keras/layers/pooling_test.py,34,class, -5961,Pooling2DTest,tensorflow/tensorflow/python/keras/layers/pooling_test.py,148,class, -5962,Pooling3DTest,tensorflow/tensorflow/python/keras/layers/pooling_test.py,194,class, -5963,Pooling1DTest,tensorflow/tensorflow/python/keras/layers/pooling_test.py,238,class, -5964,StackedRNNCells,tensorflow/tensorflow/python/keras/layers/recurrent.py,59,class,"Wrapper allowing a stack of RNN cells to behave as a single cell. +6470,call,tensorflow/tensorflow/python/keras/layers/pooling.py,1053,method, +6471,StackedRNNCells,tensorflow/tensorflow/python/keras/layers/recurrent.py,59,class,"Wrapper allowing a stack of RNN cells to behave as a single cell. Used to implement efficient stacked RNNs. @@ -44654,7 +52942,14 @@ lstm_layer = tf.keras.layers.RNN(stacked_lstm) result = lstm_layer(x) ```" -5965,RNN,tensorflow/tensorflow/python/keras/layers/recurrent.py,204,class,"Base class for recurrent layers. +6472,state_size,tensorflow/tensorflow/python/keras/layers/recurrent.py,107,method, +6473,output_size,tensorflow/tensorflow/python/keras/layers/recurrent.py,112,method, +6474,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,120,method, +6475,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,133,method, +6476,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,164,method, +6477,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,182,method, +6478,from_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,194,method, +6479,RNN,tensorflow/tensorflow/python/keras/layers/recurrent.py,204,class,"Base class for recurrent layers. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -44841,7 +53136,34 @@ x = keras.Input((None, 5)) layer = RNN(cells) y = layer(x) ```" -5966,AbstractRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,995,class,"Abstract object representing an RNN cell. +6480,states,tensorflow/tensorflow/python/keras/layers/recurrent.py,448,method, +6481,states,tensorflow/tensorflow/python/keras/layers/recurrent.py,458,method, +6482,compute_output_shape,tensorflow/tensorflow/python/keras/layers/recurrent.py,461,method, +6483,compute_mask,tensorflow/tensorflow/python/keras/layers/recurrent.py,514,method, +6484,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,528,method, +6485,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,632,method, +6486,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,721,method, +6487,reset_states,tensorflow/tensorflow/python/keras/layers/recurrent.py,888,method,"Reset the recorded states for the stateful RNN layer. + +Can only be used when RNN layer is constructed with `stateful` = `True`. +Args: + states: Numpy arrays that contains the value for the initial state, which + will be feed to cell at the first time step. When the value is None, + zero filled numpy array will be created based on the cell state size. + +Raises: + AttributeError: When the RNN layer is not stateful. + ValueError: When the batch size of the RNN layer is unknown. + ValueError: When the input numpy array is not compatible with the RNN + layer state, either size wise or dtype wise." +6488,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,958,method, +6489,from_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,981,method, +6490,get_input_spec,tensorflow/tensorflow/python/keras/layers/recurrent.py,535,method,Convert input shape to InputSpec. +6491,get_step_input_shape,tensorflow/tensorflow/python/keras/layers/recurrent.py,547,method, +6492,step,tensorflow/tensorflow/python/keras/layers/recurrent.py,778,method, +6493,step,tensorflow/tensorflow/python/keras/layers/recurrent.py,790,method, +6494,create_state_variable,tensorflow/tensorflow/python/keras/layers/recurrent.py,928,method, +6495,AbstractRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,995,class,"Abstract object representing an RNN cell. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -44893,7 +53215,26 @@ state matrix with `self.state_size` columns. If `self.state_size` is a (possibly nested tuple of) TensorShape object(s), then it should return a matching structure of Tensors having shape `[batch_size].concatenate(s)` for each `s` in `self.batch_size`." -5967,DropoutRNNCellMixin,tensorflow/tensorflow/python/keras/layers/recurrent.py,1086,class,"Object that hold dropout related fields for RNN Cell. +6496,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,1050,method,"The function that contains the logic for one RNN step calculation. + +Args: + inputs: the input tensor, which is a slide from the overall RNN input by + the time dimension (usually the second dimension). + states: the state tensor from previous step, which has the same shape + as `(batch, state_size)`. In the case of timestep 0, it will be the + initial state user specified, or zero filled tensor otherwise. + +Returns: + A tuple of two tensors: + 1. output tensor for the current timestep, with size `output_size`. + 2. state tensor for next step, which has the shape of `state_size`." +6497,state_size,tensorflow/tensorflow/python/keras/layers/recurrent.py,1068,method,"size(s) of state(s) used by this cell. + +It can be represented by an Integer, a TensorShape or a tuple of Integers +or TensorShapes." +6498,output_size,tensorflow/tensorflow/python/keras/layers/recurrent.py,1077,method,Integer or TensorShape: size of outputs produced by this cell. +6499,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,1081,method, +6500,DropoutRNNCellMixin,tensorflow/tensorflow/python/keras/layers/recurrent.py,1086,class,"Object that hold dropout related fields for RNN Cell. This class is not a standalone RNN cell. It suppose to be used with a RNN cell by multiple inheritance. Any cell that mix with class should have following @@ -44904,7 +53245,49 @@ fields: recurrent state weights need to dropout. This object will create and cache created dropout masks, and reuse them for the incoming data, so that the same mask is used for every batch input." -5968,SimpleRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1221,class,"Cell class for SimpleRNN. +6501,reset_dropout_mask,tensorflow/tensorflow/python/keras/layers/recurrent.py,1126,method,"Reset the cached dropout masks if any. + +This is important for the RNN layer to invoke this in it `call()` method so +that the cached mask is cleared before calling the `cell.call()`. The mask +should be cached across the timestep within the same batch, but shouldn't +be cached between batches. Otherwise it will introduce unreasonable bias +against certain index of data within the batch." +6502,reset_recurrent_dropout_mask,tensorflow/tensorflow/python/keras/layers/recurrent.py,1137,method,"Reset the cached recurrent dropout masks if any. + +This is important for the RNN layer to invoke this in it call() method so +that the cached mask is cleared before calling the cell.call(). The mask +should be cached across the timestep within the same batch, but shouldn't +be cached between batches. Otherwise it will introduce unreasonable bias +against certain index of data within the batch." +6503,get_dropout_mask_for_cell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1162,method,"Get the dropout mask for RNN cell's input. + +It will create mask based on context if there isn't any existing cached +mask. If a new mask is generated, it will update the cache in the cell. + +Args: + inputs: The input tensor whose shape will be used to generate dropout + mask. + training: Boolean tensor, whether its in training mode, dropout will be + ignored in non-training mode. + count: Int, how many dropout mask will be generated. It is useful for cell + that has internal weights fused together. +Returns: + List of mask tensor, generated or cached mask based on context." +6504,get_recurrent_dropout_mask_for_cell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1183,method,"Get the recurrent dropout mask for RNN cell. + +It will create mask based on context if there isn't any existing cached +mask. If a new mask is generated, it will update the cache in the cell. + +Args: + inputs: The input tensor whose shape will be used to generate dropout + mask. + training: Boolean tensor, whether its in training mode, dropout will be + ignored in non-training mode. + count: Int, how many dropout mask will be generated. It is useful for cell + that has internal weights fused together. +Returns: + List of mask tensor, generated or cached mask based on context." +6505,SimpleRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1221,class,"Cell class for SimpleRNN. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -44969,7 +53352,11 @@ rnn = tf.keras.layers.RNN( # final_state has shape `[32, 4]`. whole_sequence_output, final_state = rnn(inputs) ```" -5969,SimpleRNN,tensorflow/tensorflow/python/keras/layers/recurrent.py,1423,class,"Fully-connected RNN where the output is to be fed back to input. +6506,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,1333,method, +6507,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,1361,method, +6508,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,1383,method, +6509,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,1386,method, +6510,SimpleRNN,tensorflow/tensorflow/python/keras/layers/recurrent.py,1423,class,"Fully-connected RNN where the output is to be fed back to input. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -45051,7 +53438,24 @@ simple_rnn = tf.keras.layers.SimpleRNN( # final_state has shape `[32, 4]`. whole_sequence_output, final_state = simple_rnn(inputs) ```" -5970,GRUCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1676,class,"Cell class for the GRU layer. +6511,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,1569,method, +6512,units,tensorflow/tensorflow/python/keras/layers/recurrent.py,1575,method, +6513,activation,tensorflow/tensorflow/python/keras/layers/recurrent.py,1579,method, +6514,use_bias,tensorflow/tensorflow/python/keras/layers/recurrent.py,1583,method, +6515,kernel_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1587,method, +6516,recurrent_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1591,method, +6517,bias_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1595,method, +6518,kernel_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1599,method, +6519,recurrent_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1603,method, +6520,bias_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,1607,method, +6521,kernel_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,1611,method, +6522,recurrent_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,1615,method, +6523,bias_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,1619,method, +6524,dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,1623,method, +6525,recurrent_dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,1627,method, +6526,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,1630,method, +6527,from_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,1669,method, +6528,GRUCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,1676,class,"Cell class for the GRU layer. Arguments: units: Positive integer, dimensionality of the output space. @@ -45102,7 +53506,11 @@ Call arguments: training: Python boolean indicating whether the layer should behave in training mode or in inference mode. Only relevant when `dropout` or `recurrent_dropout` is used." -5971,GRU,tensorflow/tensorflow/python/keras/layers/recurrent.py,1956,class,"Gated Recurrent Unit - Cho et al. 2014. +6529,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,1784,method, +6530,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,1821,method, +6531,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,1923,method, +6532,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,1951,method, +6533,GRU,tensorflow/tensorflow/python/keras/layers/recurrent.py,1956,class,"Gated Recurrent Unit - Cho et al. 2014. There are two variants. The default one is based on 1406.1078v3 and has reset gate applied to hidden state before matrix multiplication. The @@ -45192,7 +53600,27 @@ Call arguments: `recurrent_dropout` is used. initial_state: List of initial state tensors to be passed to the first call of the cell." -5972,LSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,2240,class,"Cell class for the LSTM layer. +6534,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,2115,method, +6535,units,tensorflow/tensorflow/python/keras/layers/recurrent.py,2121,method, +6536,activation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2125,method, +6537,recurrent_activation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2129,method, +6538,use_bias,tensorflow/tensorflow/python/keras/layers/recurrent.py,2133,method, +6539,kernel_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2137,method, +6540,recurrent_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2141,method, +6541,bias_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2145,method, +6542,kernel_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2149,method, +6543,recurrent_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2153,method, +6544,bias_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2157,method, +6545,kernel_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2161,method, +6546,recurrent_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2165,method, +6547,bias_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2169,method, +6548,dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,2173,method, +6549,recurrent_dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,2177,method, +6550,implementation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2181,method, +6551,reset_after,tensorflow/tensorflow/python/keras/layers/recurrent.py,2185,method, +6552,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,2188,method, +6553,from_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,2233,method, +6554,LSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,2240,class,"Cell class for the LSTM layer. Arguments: units: Positive integer, dimensionality of the output space. @@ -45246,7 +53674,12 @@ Call arguments: training: Python boolean indicating whether the layer should behave in training mode or in inference mode. Only relevant when `dropout` or `recurrent_dropout` is used." -5973,PeepholeLSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,2527,class,"Equivalent to LSTMCell class but adds peephole connections. +6555,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,2357,method, +6556,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,2420,method, +6557,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,2480,method, +6558,get_initial_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,2521,method, +6559,bias_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2378,method, +6560,PeepholeLSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent.py,2527,class,"Equivalent to LSTMCell class but adds peephole connections. Peephole connections allow the gates to utilize the previous internal state as well as the previous hidden state (which is what LSTMCell is limited to). @@ -45274,7 +53707,8 @@ layer = RNN(peephole_lstm_cells) input = keras.Input((timesteps, input_dim)) output = layer(input) ```" -5974,LSTM,tensorflow/tensorflow/python/keras/layers/recurrent.py,2645,class,"Long Short-Term Memory layer - Hochreiter 1997. +6561,build,tensorflow/tensorflow/python/keras/layers/recurrent.py,2599,method, +6562,LSTM,tensorflow/tensorflow/python/keras/layers/recurrent.py,2645,class,"Long Short-Term Memory layer - Hochreiter 1997. Note that this cell is not optimized for performance on GPU. Please use `tf.compat.v1.keras.layers.CuDNNLSTM` for better performance on GPU. @@ -45361,68 +53795,45 @@ Call arguments: `recurrent_dropout` is used. initial_state: List of initial state tensors to be passed to the first call of the cell." -5975,_generate_dropout_mask,tensorflow/tensorflow/python/keras/layers/recurrent.py,2925,function, -5976,_standardize_args,tensorflow/tensorflow/python/keras/layers/recurrent.py,2937,function,"Standardizes `__call__` to a single list of tensor inputs. - -When running a model loaded from a file, the input tensors -`initial_state` and `constants` can be passed to `RNN.__call__()` as part -of `inputs` instead of by the dedicated keyword arguments. This method -makes sure the arguments are separated and that `initial_state` and -`constants` are lists of tensors (or None). - -Arguments: - inputs: Tensor or list/tuple of tensors. which may include constants - and initial states. In that case `num_constant` must be specified. - initial_state: Tensor or list of tensors or None, initial states. - constants: Tensor or list of tensors or None, constant tensors. - num_constants: Expected number of constants (if constants are passed as - part of the `inputs` list. - -Returns: - inputs: Single tensor or tuple of tensors. - initial_state: List of tensors or None. - constants: List of tensors or None." -5977,_is_multiple_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,2998,function,Check whether the state_size contains multiple states. -5978,_generate_zero_filled_state_for_cell,tensorflow/tensorflow/python/keras/layers/recurrent.py,3004,function, -5979,_generate_zero_filled_state,tensorflow/tensorflow/python/keras/layers/recurrent.py,3011,function,"Generate a zero filled tensor with shape [batch_size, state_size]." -5980,_caching_device,tensorflow/tensorflow/python/keras/layers/recurrent.py,3029,function,"Returns the caching device for the RNN variable. - -This is useful for distributed training, when variable is not located as same -device as the training worker. By enabling the device cache, this allows -worker to read the variable once and cache locally, rather than read it every -time step from remote when it is needed. - -Note that this is assuming the variable that cell needs for each time step is -having the same value in the forward path, and only gets updated in the -backprop. It is true for all the default cells (SimpleRNN, GRU, LSTM). If the -cell body relies on any variable that gets updated every time step, then -caching device will cause it to read the stall value. - -Args: - rnn_cell: the rnn cell instance." -5981,_config_for_enable_caching_device,tensorflow/tensorflow/python/keras/layers/recurrent.py,3076,function,"Return the dict config for RNN cell wrt to enable_caching_device field. - -Since enable_caching_device is a internal implementation detail for speed up -the RNN variable read when running on the multi remote worker setting, we -don't want this config to be serialized constantly in the JSON. We will only -serialize this field when a none default value is used to create the cell. -Args: - rnn_cell: the RNN cell for serialize. - -Returns: - A dict which contains the JSON config for enable_caching_device value or - empty dict if the enable_caching_device value is same as the default value." -5982,RNNTest,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,62,class, -5983,RNNCellWithConstants,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1700,class, -5984,Minimal2DRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1738,class,"The minimal 2D RNN cell is a simple combination of 2 1-D RNN cell. +6563,call,tensorflow/tensorflow/python/keras/layers/recurrent.py,2801,method, +6564,units,tensorflow/tensorflow/python/keras/layers/recurrent.py,2807,method, +6565,activation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2811,method, +6566,recurrent_activation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2815,method, +6567,use_bias,tensorflow/tensorflow/python/keras/layers/recurrent.py,2819,method, +6568,kernel_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2823,method, +6569,recurrent_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2827,method, +6570,bias_initializer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2831,method, +6571,unit_forget_bias,tensorflow/tensorflow/python/keras/layers/recurrent.py,2835,method, +6572,kernel_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2839,method, +6573,recurrent_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2843,method, +6574,bias_regularizer,tensorflow/tensorflow/python/keras/layers/recurrent.py,2847,method, +6575,kernel_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2851,method, +6576,recurrent_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2855,method, +6577,bias_constraint,tensorflow/tensorflow/python/keras/layers/recurrent.py,2859,method, +6578,dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,2863,method, +6579,recurrent_dropout,tensorflow/tensorflow/python/keras/layers/recurrent.py,2867,method, +6580,implementation,tensorflow/tensorflow/python/keras/layers/recurrent.py,2871,method, +6581,get_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,2874,method, +6582,from_config,tensorflow/tensorflow/python/keras/layers/recurrent.py,2919,method, +6583,RNNCellWithConstants,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1700,class, +6584,build,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1708,method, +6585,call,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1723,method, +6586,get_config,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1732,method, +6587,Minimal2DRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1738,class,"The minimal 2D RNN cell is a simple combination of 2 1-D RNN cell. Both internal state and output have 2 dimensions and are orthogonal between each other." -5985,PlusOneRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1776,class,"Add one to the input and state. +6588,build,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1752,method, +6589,call,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1767,method, +6590,PlusOneRNNCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1776,class,"Add one to the input and state. This cell is used for testing state_size and output_size." -5986,NestedCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1792,class, -5987,GRUCell,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,69,class,"Cell class for the GRU layer. +6591,build,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1785,method, +6592,call,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1788,method, +6593,NestedCell,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1792,class, +6594,build,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1808,method, +6595,call,tensorflow/tensorflow/python/keras/layers/recurrent_test.py,1824,method, +6596,GRUCell,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,69,class,"Cell class for the GRU layer. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -45497,7 +53908,7 @@ Call arguments: training: Python boolean indicating whether the layer should behave in training mode or in inference mode. Only relevant when `dropout` or `recurrent_dropout` is used." -5988,GRU,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,188,class,"Gated Recurrent Unit - Cho et al. 2014. +6597,GRU,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,188,class,"Gated Recurrent Unit - Cho et al. 2014. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -45625,7 +54036,10 @@ Call arguments: initial_state: List of initial state tensors to be passed to the first call of the cell (optional, defaults to `None` which causes creation of zero-filled initial state tensors)." -5989,standard_gru,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,508,function,"GRU with standard kernel implementation. +6598,build,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,389,method, +6599,call,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,402,method, +6600,step,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,424,method, +6601,standard_gru,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,508,function,"GRU with standard kernel implementation. This implementation can be run on all types of hardware. @@ -45660,8 +54074,8 @@ Returns: state_0: the cell output, which has same shape as init_h. runtime: constant string tensor which indicate real runtime hardware. This value is for testing purpose and should be used by user." -5990,gpu_gru,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,590,function,GRU with CuDNN implementation which is only available for GPU. -5991,gru_with_backend_selection,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,676,function,"Call the GRU with optimized backend kernel selection. +6602,gpu_gru,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,590,function,GRU with CuDNN implementation which is only available for GPU. +6603,gru_with_backend_selection,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,676,function,"Call the GRU with optimized backend kernel selection. Under the hood, this function will create two TF function, one with the most generic kernel and can run on all device condition, and the second one with @@ -45691,7 +54105,7 @@ Args: Returns: List of output tensors, same as standard_gru." -5992,LSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,791,class,"Cell class for the LSTM layer. +6604,LSTMCell,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,791,class,"Cell class for the LSTM layer. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -45769,7 +54183,7 @@ Call arguments: training: Python boolean indicating whether the layer should behave in training mode or in inference mode. Only relevant when `dropout` or `recurrent_dropout` is used." -5993,LSTM,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,913,class,"Long Short-Term Memory layer - Hochreiter 1997. +6605,LSTM,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,913,class,"Long Short-Term Memory layer - Hochreiter 1997. See [the Keras RNN API guide](https://www.tensorflow.org/guide/keras/rnn) for details about the usage of RNN API. @@ -45881,28 +54295,9 @@ Call arguments: initial_state: List of initial state tensors to be passed to the first call of the cell (optional, defaults to `None` which causes creation of zero-filled initial state tensors)." -5994,_canonical_to_params,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1208,function,"Utility function convert variable to CuDNN compatible parameter. - -Note that Keras weights for kernels are different from the CuDNN format. Eg.: - -``` - Keras CuDNN - [[0, 1, 2], <---> [[0, 2, 4], - [3, 4, 5]] [1, 3, 5]] -``` - -If the input weights need to be in a unified format, then set -`transpose_weights=True` to convert the weights. - -Args: - weights: list of weights for the individual kernels and recurrent kernels. - biases: list of biases for individual gate. - shape: the shape for the converted variables that will be feed to CuDNN. - transpose_weights: boolean, whether to transpose the weights. - -Returns: - The converted weights that can be feed to CuDNN ops as param." -5995,standard_lstm,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1239,function,"LSTM with standard kernel implementation. +6606,call,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1101,method, +6607,step,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1124,method, +6608,standard_lstm,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1239,function,"LSTM with standard kernel implementation. This implementation can be run on all types for hardware. @@ -45943,7 +54338,7 @@ Returns: state_1: the cell hidden state, which has same shape as init_c. runtime: constant string tensor which indicate real runtime hardware. This value is for testing purpose and should be used by user." -5996,gpu_lstm,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1321,function,"LSTM with either CuDNN or ROCm implementation which is only available for GPU. +6609,gpu_lstm,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1321,function,"LSTM with either CuDNN or ROCm implementation which is only available for GPU. Note that currently only right padded data is supported, or the result will be polluted by the unmasked data which should be filtered. @@ -45974,7 +54369,7 @@ Returns: state_1: The cell hidden state, which has same shape as init_c. runtime: Constant string tensor which indicate real runtime hardware. This value is for testing purpose and should not be used by user." -5997,lstm_with_backend_selection,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1443,function,"Call the LSTM with optimized backend kernel selection. +6610,lstm_with_backend_selection,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1443,function,"Call the LSTM with optimized backend kernel selection. Under the hood, this function will create two TF function, one with the most generic kernel and can run on all device condition, and the second one with @@ -46005,7 +54400,7 @@ Args: Returns: List of output tensors, same as standard_lstm." -5998,is_sequence_right_padded,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1565,function,"Check the mask tensor and see if it right padded. +6611,is_sequence_right_padded,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1565,function,"Check the mask tensor and see if it right padded. For CuDNN kernel, it uses the sequence length param to skip the tailing timestep. If the data is left padded, or not a strict right padding (has @@ -46025,9 +54420,9 @@ Args: Returns: boolean scalar tensor, whether the mask is strictly right padded." -5999,has_fully_masked_sequence,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1594,function, -6000,is_cudnn_supported_inputs,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1607,function, -6001,calculate_sequence_by_mask,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1616,function,"Calculate the sequence length tensor (1-D) based on the masking tensor. +6612,has_fully_masked_sequence,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1594,function, +6613,is_cudnn_supported_inputs,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1607,function, +6614,calculate_sequence_by_mask,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1616,function,"Calculate the sequence length tensor (1-D) based on the masking tensor. The masking tensor is a 2D boolean tensor with shape [batch, timestep]. For any timestep that should be masked, the corresponding field will be False. @@ -46045,26 +54440,13 @@ Args: major. Returns: sequence_length: 1D int32 tensor." -6002,_generate_defun_backend,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1641,function, -6003,_get_context_device_type,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1653,function,"Parse the current context and return the device type, eg CPU/GPU." -6004,_runtime,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1661,function, -6005,_read_variable_value,tensorflow/tensorflow/python/keras/layers/recurrent_v2.py,1667,function,Read the value of a variable if it is variable. -6006,RNNV2Test,tensorflow/tensorflow/python/keras/layers/recurrent_v2_test.py,40,class, -6007,_RNNCellWrapperV2,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,34,class,"Base class for cells wrappers V2 compatibility. - -This class along with `rnn_cell_impl._RNNCellWrapperV1` allows to define -wrappers that are compatible with V1 and V2, and defines helper methods for -this purpose." -6008,DropoutWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,98,class,Operator adding dropout to inputs and outputs of the given cell. -6009,ResidualWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,113,class,RNNCell wrapper that ensures cell inputs are added to the outputs. -6010,DeviceWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,124,class,Operator that ensures an RNNCell runs on a particular device. -6011,RNNCellWrapperTest,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2_test.py,39,class, -6012,SeparableConv1DTest,tensorflow/tensorflow/python/keras/layers/separable_convolutional_test.py,31,class, -6013,SeparableConv2DTest,tensorflow/tensorflow/python/keras/layers/separable_convolutional_test.py,99,class, -6014,populate_deserializable_objects,tensorflow/tensorflow/python/keras/layers/serialization.py,83,function,"Populates dict ALL_OBJECTS with every built-in layer. +6615,DropoutWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,98,class,Operator adding dropout to inputs and outputs of the given cell. +6616,ResidualWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,113,class,RNNCell wrapper that ensures cell inputs are added to the outputs. +6617,DeviceWrapper,tensorflow/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py,124,class,Operator that ensures an RNNCell runs on a particular device. +6618,populate_deserializable_objects,tensorflow/tensorflow/python/keras/layers/serialization.py,83,function,"Populates dict ALL_OBJECTS with every built-in layer. " -6015,serialize,tensorflow/tensorflow/python/keras/layers/serialization.py,154,function, -6016,deserialize,tensorflow/tensorflow/python/keras/layers/serialization.py,159,function,"Instantiates a layer from a config dictionary. +6619,serialize,tensorflow/tensorflow/python/keras/layers/serialization.py,154,function, +6620,deserialize,tensorflow/tensorflow/python/keras/layers/serialization.py,159,function,"Instantiates a layer from a config dictionary. Arguments: config: dict of the form {'class_name': str, 'config': dict} @@ -46073,38 +54455,15 @@ Arguments: Returns: Layer instance (may be Model, Sequential, Network, Layer...)" -6017,SerializableInt,tensorflow/tensorflow/python/keras/layers/serialization_test.py,33,class, -6018,LayerSerializationTest,tensorflow/tensorflow/python/keras/layers/serialization_test.py,47,class, -6019,SimpleRNNLayerTest,tensorflow/tensorflow/python/keras/layers/simplernn_test.py,37,class, -6020,SubclassedLayersTest,tensorflow/tensorflow/python/keras/layers/subclassed_layers_test.py,33,class, -6021,_single_op_at_end,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,43,function, -6022,_single_identity_op_at_end,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,50,function, -6023,_multiple_ops_at_end,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,57,function, -6024,_single_op_in_middle,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,65,function, -6025,_multiple_ops_in_middle,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,73,function, -6026,_shape_op_inference,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,82,function, -6027,_shape_op_known_batch_size,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,91,function, -6028,_shape_op_slice_and_range,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,106,function, -6029,_shape_op_slice_and_range_known_dim,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,117,function, -6030,_single_standalone_branch,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,134,function, -6031,_single_op_with_attrs,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,141,function, -6032,_multiple_uses,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,148,function, -6033,_op_with_tensor_list,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,157,function, -6034,_add_n,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,164,function, -6035,_reuse_op,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,170,function, -6036,_float64_op,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,181,function, -6037,MyAdd,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,190,class, -6038,_layer_with_tensor_arg,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,196,function, -6039,LayerWithLayer,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,203,class, -6040,_inner_layer,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,215,function, -6041,_reuse_ancillary_layer,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,221,function, -6042,AutoLambdaTest,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,242,class, -6043,InputInEagerTest,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,681,class,"Tests ops on keras inputs in Eager runtime. - -Input returns graph/symbolic tensors in the Eager runtime (this -happens, for example, with tensors returned from Keras layers). These -should be routed to the graph-style branch of these ops (b/134715641)" -6044,Wrapper,tensorflow/tensorflow/python/keras/layers/wrappers.py,40,class,"Abstract wrapper base class. +6621,SerializableInt,tensorflow/tensorflow/python/keras/layers/serialization_test.py,33,class, +6622,get_config,tensorflow/tensorflow/python/keras/layers/serialization_test.py,38,method, +6623,from_config,tensorflow/tensorflow/python/keras/layers/serialization_test.py,42,method, +6624,MyAdd,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,190,class, +6625,call,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,192,method, +6626,LayerWithLayer,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,203,class, +6627,build,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,205,method, +6628,call,tensorflow/tensorflow/python/keras/layers/tensorflow_op_layer_test.py,209,method, +6629,Wrapper,tensorflow/tensorflow/python/keras/layers/wrappers.py,40,class,"Abstract wrapper base class. Wrappers take another layer and augment it in various ways. Do not use this class as a layer, it is only an abstract base class. @@ -46112,7 +54471,11 @@ Two usable wrappers are the `TimeDistributed` and `Bidirectional` wrappers. Arguments: layer: The layer to be wrapped." -6045,TimeDistributed,tensorflow/tensorflow/python/keras/layers/wrappers.py,85,class,"This wrapper allows to apply a layer to every temporal slice of an input. +6630,build,tensorflow/tensorflow/python/keras/layers/wrappers.py,56,method, +6631,activity_regularizer,tensorflow/tensorflow/python/keras/layers/wrappers.py,63,method, +6632,get_config,tensorflow/tensorflow/python/keras/layers/wrappers.py,69,method, +6633,from_config,tensorflow/tensorflow/python/keras/layers/wrappers.py,75,method, +6634,TimeDistributed,tensorflow/tensorflow/python/keras/layers/wrappers.py,85,class,"This wrapper allows to apply a layer to every temporal slice of an input. The input should be at least 3D, and the dimension of index one will be considered to be the temporal dimension. @@ -46144,7 +54507,43 @@ Call arguments: Raises: ValueError: If not initialized with a `tf.keras.layers.Layer` instance." -6046,Bidirectional,tensorflow/tensorflow/python/keras/layers/wrappers.py,325,class,"Bidirectional wrapper for RNNs. +6635,build,tensorflow/tensorflow/python/keras/layers/wrappers.py,168,method, +6636,compute_output_shape,tensorflow/tensorflow/python/keras/layers/wrappers.py,180,method, +6637,call,tensorflow/tensorflow/python/keras/layers/wrappers.py,192,method, +6638,compute_mask,tensorflow/tensorflow/python/keras/layers/wrappers.py,247,method,"Computes an output mask tensor for Embedding layer. + +This is based on the inputs, mask, and the inner layer. +If batch size is specified: +Simply return the input `mask`. (An rnn-based implementation with +more than one rnn inputs is required but not supported in tf.keras yet.) +Otherwise we call `compute_mask` of the inner layer at each time step. +If the output mask at each time step is not `None`: +(E.g., inner layer is Masking or RNN) +Concatenate all of them and return the concatenation. +If the output mask at each time step is `None` and the input mask is not +`None`:(E.g., inner layer is Dense) +Reduce the input_mask to 2 dimensions and return it. +Otherwise (both the output mask and the input mask are `None`): +(E.g., `mask` is not used at all) +Return `None`. + +Arguments: + inputs: Tensor with shape [batch size, timesteps, ...] indicating the + input to TimeDistributed. If static shape information is available for + ""batch size"", `mask` is returned unmodified. + mask: Either None (indicating no masking) or a Tensor indicating the + input mask for TimeDistributed. The shape can be static or dynamic. + +Returns: + Either None (no masking), or a [batch size, timesteps, ...] Tensor with + an output mask for the TimeDistributed layer with the shape beyond the + second dimension being the value of the input mask shape(if the computed + output mask is none), an output mask with the shape beyond the first + dimension being the value of the mask shape(if mask is not None) or + output mask with the shape beyond the first dimension being the + value of the computed output shape." +6639,step,tensorflow/tensorflow/python/keras/layers/wrappers.py,203,method, +6640,Bidirectional,tensorflow/tensorflow/python/keras/layers/wrappers.py,325,class,"Bidirectional wrapper for RNNs. Arguments: layer: `keras.layers.RNN` instance, such as `keras.layers.LSTM` or @@ -46209,16 +54608,18 @@ model.compile(loss='categorical_crossentropy', optimizer='rmsprop') model.add(Activation('softmax')) model.compile(loss='categorical_crossentropy', optimizer='rmsprop') ```" -6047,_RNNCellWithConstants,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,50,class, -6048,_ResidualLSTMCell,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,88,class, -6049,_AddOneCell,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,95,class,Increments inputs and state by one on each call. -6050,TimeDistributedTest,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,113,class, -6051,BidirectionalTest,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,471,class, -6052,ExampleWrapper,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,1252,class,Simple Wrapper subclass. -6053,WrapperTest,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,1259,class, -6054,_to_list,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,1273,function, -6055,_hasattr,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,64,function, -6056,assert_like_rnncell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,73,function,"Raises a TypeError if cell is not like an RNNCell. +6641,compute_output_shape,tensorflow/tensorflow/python/keras/layers/wrappers.py,497,method, +6642,call,tensorflow/tensorflow/python/keras/layers/wrappers.py,594,method,`Bidirectional.call` implements the same API as the wrapped `RNN`. +6643,reset_states,tensorflow/tensorflow/python/keras/layers/wrappers.py,679,method, +6644,build,tensorflow/tensorflow/python/keras/layers/wrappers.py,683,method, +6645,compute_mask,tensorflow/tensorflow/python/keras/layers/wrappers.py,690,method, +6646,constraints,tensorflow/tensorflow/python/keras/layers/wrappers.py,710,method, +6647,get_config,tensorflow/tensorflow/python/keras/layers/wrappers.py,717,method, +6648,from_config,tensorflow/tensorflow/python/keras/layers/wrappers.py,728,method, +6649,force_zero_output_for_mask,tensorflow/tensorflow/python/keras/layers/wrappers.py,436,method, +6650,ExampleWrapper,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,1252,class,Simple Wrapper subclass. +6651,call,tensorflow/tensorflow/python/keras/layers/wrappers_test.py,1255,method, +6652,assert_like_rnncell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,73,function,"Raises a TypeError if cell is not like an RNNCell. NOTE: Do not rely on the error message (in particular in tests) which can be subject to change to increase readability. Use @@ -46231,28 +54632,7 @@ Args: Raises: TypeError: A human-friendly exception." -6057,_concat,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,107,function,"Concat that enables int, Tensor, or TensorShape values. - -This function takes a size specification, which can be an integer, a -TensorShape, or a Tensor, and converts it into a concatenated Tensor -(if static = False) or a list of integers (if static = True). - -Args: - prefix: The prefix; usually the batch size (and/or time step size). - (TensorShape, int, or Tensor.) - suffix: TensorShape, int, or Tensor. - static: If `True`, return a python list with possibly unknown dimensions. - Otherwise return a `Tensor`. - -Returns: - shape: the concatenation of prefix and suffix. - -Raises: - ValueError: if `suffix` is not a scalar or vector (or TensorShape). - ValueError: if prefix or suffix was `None` and asked for dynamic - Tensors out." -6058,_zero_state_tensors,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,169,function,"Create tensors of zeros based on state_size, batch_size, and dtype." -6059,RNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,185,class,"Abstract object representing an RNN cell. +6653,RNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,185,class,"Abstract object representing an RNN cell. Every `RNNCell` must have the properties below and implement `call` with the signature `(output, next_state) = call(input, state)`. The optional @@ -46271,7 +54651,28 @@ state matrix with `self.state_size` columns. If `self.state_size` is a (possibly nested tuple of) TensorShape object(s), then it should return a matching structure of Tensors having shape `[batch_size].concatenate(s)` for each `s` in `self.batch_size`." -6060,LayerRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,349,class,"Subclass of RNNCells that act like proper `tf.Layer` objects. +6654,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,265,method,"size(s) of state(s) used by this cell. + +It can be represented by an Integer, a TensorShape or a tuple of Integers +or TensorShapes." +6655,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,274,method,Integer or TensorShape: size of outputs produced by this cell. +6656,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,278,method, +6657,get_initial_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,283,method, +6658,zero_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,313,method,"Return zero-filled state tensor(s). + +Args: + batch_size: int, float, or unit Tensor representing the batch size. + dtype: the data type to use for the state. + +Returns: + If `state_size` is an int or TensorShape, then the return value is a + `N-D` tensor of shape `[batch_size, state_size]` filled with zeros. + + If `state_size` is a nested list or tuple, then the return value is + a nested list or tuple (of the same structure) of `2-D` tensors with + the shapes `[batch_size, s]` for each s in `state_size`." +6659,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,345,method, +6660,LayerRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,349,class,"Subclass of RNNCells that act like proper `tf.Layer` objects. For backwards compatibility purposes, most `RNNCell` instances allow their `call` methods to instantiate variables via `tf.compat.v1.get_variable`. The @@ -46283,7 +54684,7 @@ part of layer building into a `build` method that is only called once. Here we provide a subclass for `RNNCell` objects that act exactly as `Layer` objects do. They must provide a `build` method and their `call` methods do not access Variables `tf.compat.v1.get_variable`." -6061,BasicRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,392,class,"The most basic RNN cell. +6661,BasicRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,392,class,"The most basic RNN cell. Note that this cell is not optimized for performance. Please use `tf.contrib.cudnn_rnn.CudnnRNNTanh` for better performance on GPU. @@ -46301,7 +54702,12 @@ Args: the first input). Required when `build` is called before `call`. **kwargs: Dict, keyword named properties for common layer attributes, like `trainable` etc when constructing the cell from configs of get_config()." -6062,GRUCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,486,class,"Gated Recurrent Unit cell. +6662,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,441,method, +6663,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,445,method, +6664,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,449,method, +6665,call,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,466,method,Most basic RNN: output = new_state = act(W * input + U * state + B). +6666,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,475,method, +6667,GRUCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,486,class,"Gated Recurrent Unit cell. Note that this cell is not optimized for performance. Please use `tf.contrib.cudnn_rnn.CudnnGRU` for better performance on GPU, or @@ -46329,13 +54735,19 @@ Args: [Cho et al., 2014] (https://aclanthology.coli.uni-saarland.de/papers/D14-1179/d14-1179) ([pdf](http://emnlp2014.org/papers/pdf/EMNLP2014179.pdf))" -6063,LSTMStateTuple,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,623,class,"Tuple used by LSTM Cells for `state_size`, `zero_state`, and output state. +6668,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,549,method, +6669,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,553,method, +6670,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,557,method, +6671,call,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,586,method,Gated recurrent unit (GRU) with nunits cells. +6672,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,607,method, +6673,LSTMStateTuple,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,623,class,"Tuple used by LSTM Cells for `state_size`, `zero_state`, and output state. Stores two elements: `(c, h)`, in that order. Where `c` is the hidden state and `h` is the output. Only used when `state_is_tuple=True`." -6064,BasicLSTMCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,643,class,"DEPRECATED: Please use `tf.compat.v1.nn.rnn_cell.LSTMCell` instead. +6674,dtype,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,634,method, +6675,BasicLSTMCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,643,class,"DEPRECATED: Please use `tf.compat.v1.nn.rnn_cell.LSTMCell` instead. Basic LSTM recurrent network cell. @@ -46354,7 +54766,23 @@ Note that this cell is not optimized for performance. Please use `tf.contrib.cudnn_rnn.CudnnLSTM` for better performance on GPU, or `tf.contrib.rnn.LSTMBlockCell` and `tf.contrib.rnn.LSTMBlockFusedCell` for better performance on CPU." -6065,LSTMCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,811,class,"Long short-term memory unit (LSTM) recurrent network cell. +6676,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,724,method, +6677,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,729,method, +6678,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,733,method, +6679,call,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,750,method,"Long short-term memory cell (LSTM). + +Args: + inputs: `2-D` tensor with shape `[batch_size, input_size]`. + state: An `LSTMStateTuple` of state tensors, each shaped `[batch_size, + num_units]`, if `state_is_tuple` has been set to `True`. Otherwise, a + `Tensor` shaped `[batch_size, 2 * num_units]`. + +Returns: + A pair containing the new hidden state, and the new state (either a + `LSTMStateTuple` or a concatenated state, depending on + `state_is_tuple`)." +6680,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,798,method, +6681,LSTMCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,811,class,"Long short-term memory unit (LSTM) recurrent network cell. The default non-peephole implementation is based on (Gers et al., 1999). The peephole implementation is based on (Sak et al., 2014). @@ -46381,14 +54809,36 @@ References: [Hochreiter et al., 1997] (https://www.mitpressjournals.org/doi/abs/10.1162/neco.1997.9.8.1735) ([pdf](http://ml.jku.at/publications/older/3504.pdf))" -6066,_RNNCellWrapperV1,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1094,class,"Base class for cells wrappers V1 compatibility. +6682,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,946,method, +6683,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,950,method, +6684,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,954,method, +6685,call,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,997,method,"Run one step of LSTM. -This class along with `_RNNCellWrapperV2` allows to define cells wrappers that -are compatible with V1 and V2, and defines helper methods for this purpose." -6067,DropoutWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1176,class,Operator adding dropout to inputs and outputs of the given cell. -6068,ResidualWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1187,class,RNNCell wrapper that ensures cell inputs are added to the outputs. -6069,DeviceWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1198,class, -6070,MultiRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1208,class,"RNN cell composed sequentially of multiple simple cells. +Args: + inputs: input Tensor, must be 2-D, `[batch, input_size]`. + state: if `state_is_tuple` is False, this must be a state Tensor, `2-D, + [batch, state_size]`. If `state_is_tuple` is True, this must be a tuple + of state Tensors, both `2-D`, with column sizes `c_state` and `m_state`. + +Returns: + A tuple containing: + + - A `2-D, [batch, output_dim]`, Tensor representing the output of the + LSTM after reading `inputs` when previous state was `state`. + Here output_dim is: + num_proj if num_proj was set, + num_units otherwise. + - Tensor(s) representing the new state of LSTM after reading `inputs` when + the previous state was `state`. Same type and shape(s) as `state`. + +Raises: + ValueError: If input size cannot be inferred from inputs via + static shape inference." +6686,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1075,method, +6687,DropoutWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1176,class,Operator adding dropout to inputs and outputs of the given cell. +6688,ResidualWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1187,class,RNNCell wrapper that ensures cell inputs are added to the outputs. +6689,DeviceWrapper,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1198,class, +6690,MultiRNNCell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1208,class,"RNN cell composed sequentially of multiple simple cells. Example: @@ -46397,28 +54847,39 @@ num_units = [128, 64] cells = [BasicLSTMCell(num_units=n) for n in num_units] stacked_rnn_cell = MultiRNNCell(cells) ```" -6071,_check_rnn_cell_input_dtypes,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1332,function,"Check whether the input tensors are with supported dtypes. - -Default RNN cells only support floats and complex as its dtypes since the -activation function (tanh and sigmoid) only allow those types. This function -will throw a proper error message if the inputs is not in a supported type. - -Args: - inputs: tensor or nested structure of tensors that are feed to RNN cell as - input or state. - -Raises: - ValueError: if any of the input tensor are not having dtypes of float or - complex." -6072,_check_supported_dtypes,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1351,function, -6073,DropoutWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,38,class,Operator adding dropout to inputs and outputs of the given cell. -6074,ResidualWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,323,class,RNNCell wrapper that ensures cell inputs are added to the outputs. -6075,DeviceWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,411,class,Operator that ensures an RNNCell runs on a particular device. -6076,_serialize_function_to_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,451,function,Serialize the function for get_config(). -6077,_parse_config_to_function,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,468,function,Reconstruct the function from the config. -6078,_default_dropout_state_filter_visitor,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,497,function, -6079,_enumerated_map_structure_up_to,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,507,function, -6080,dense,tensorflow/tensorflow/python/keras/layers/ops/core.py,30,function,"Densely connected NN layer op. +6691,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1262,method, +6692,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1269,method, +6693,zero_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1272,method, +6694,trainable_weights,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1282,method, +6695,non_trainable_weights,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1292,method, +6696,call,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_impl.py,1305,method,"Run this multi-layer cell on inputs, starting from state." +6697,DropoutWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,38,class,Operator adding dropout to inputs and outputs of the given cell. +6698,wrapped_cell,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,186,method, +6699,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,190,method, +6700,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,194,method, +6701,build,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,197,method, +6702,zero_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,201,method, +6703,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,291,method,Returns the config of the dropout wrapper. +6704,from_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,311,method, +6705,tensor_and_const_value,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,118,method, +6706,convert_to_batch_shape,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,149,method, +6707,batch_noise,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,155,method, +6708,dropout,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,232,method, +6709,dropout,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,244,method, +6710,ResidualWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,323,class,RNNCell wrapper that ensures cell inputs are added to the outputs. +6711,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,341,method, +6712,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,345,method, +6713,zero_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,348,method, +6714,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,383,method,Returns the config of the residual wrapper. +6715,from_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,399,method, +6716,assert_shape_match,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,372,method, +6717,default_residual_fn,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,375,method, +6718,DeviceWrapperBase,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,411,class,Operator that ensures an RNNCell runs on a particular device. +6719,state_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,428,method, +6720,output_size,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,432,method, +6721,zero_state,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,435,method, +6722,get_config,tensorflow/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py,445,method, +6723,dense,tensorflow/tensorflow/python/keras/layers/ops/core.py,30,function,"Densely connected NN layer op. Arguments: inputs: `tf.Tensor` or `tf.SparseTensor`. Inputs to operation. @@ -46430,7 +54891,7 @@ Arguments: Returns: `tf.Tensor`. Output of dense connection." -6081,CategoryCrossing,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,39,class,"Category crossing layer. +6724,CategoryCrossing,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,39,class,"Category crossing layer. This layer concatenates multiple categorical inputs into a single categorical output (similar to Cartesian product). The output dtype is string. @@ -46505,10 +54966,13 @@ Example: (`depth` is a tuple/list of integers) `[[b'2_X_3'], [b'5_X_6']]`, `[[b'3_X_1'], [b'6_X_4']]`, `[[b'1_X_2_X_3'], [b'4_X_5_X_6']]`" -6082,batch_wrapper,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing_distribution_test.py,36,function, -6083,CategoryCrossingDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing_distribution_test.py,53,class, -6084,CategoryCrossingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing_test.py,41,class, -6085,CategoryEncoding,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,56,class,"Category encoding layer. +6725,partial_crossing,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,129,method,Gets the crossed output from a partial list/tuple of inputs. +6726,call,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,151,method, +6727,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,174,method, +6728,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,190,method, +6729,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing.py,204,method, +6730,batch_wrapper,tensorflow/tensorflow/python/keras/layers/preprocessing/category_crossing_distribution_test.py,36,function, +6731,CategoryEncoding,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,56,class,"Category encoding layer. This layer provides options for condensing data into a categorical encoding. It accepts integer values as inputs and outputs a dense representation @@ -46561,26 +55025,29 @@ Call arguments: count_weights: A 2D tensor in the same shape as `inputs` indicating the weight for each sample value when summing up in `count` mode. Not used in `binary` or `tfidf` mode." -6086,_CategoryEncodingAccumulator,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,332,class, -6087,_CategoryEncodingCombiner,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,337,class,"Combiner for the CategoryEncoding preprocessing layer. +6732,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,170,method, +6733,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,173,method, +6734,adapt,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,182,method,"Fits the state of the preprocessing layer to the dataset. -This class encapsulates the logic for computing the number of elements in the -input dataset and the document frequency for each element. +Overrides the default adapt method to apply relevant preprocessing to the +inputs before passing to the combiner. -Attributes: - compute_max_element: (Optional) If set, this combiner will return the - maximum element in this set as part of its `extract()` call. - compute_idf: (Optional) If set, the inverse document frequency will be - computed for each value." -6088,batch_wrapper,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_distribution_test.py,36,function, -6089,CategoryEncodingDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_distribution_test.py,53,class, -6090,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,43,function, -6091,CategoryEncodingInputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,51,class, -6092,CategoryEncodingAdaptTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,272,class, -6093,CategoryEncodingOutputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,434,class, -6094,CategoryEncodingModelBuildingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,568,class, -6095,CategoryEncodingCombinerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,621,class, -6096,CategoryEncoding,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_v1.py,27,class,"CategoryEncoding layer. +Arguments: + data: The data to train on. It can be passed either as a tf.data Dataset, + or as a numpy array. + reset_state: Optional argument specifying whether to clear the state of + the layer at the start of the call to `adapt`. This must be True for + this layer, which does not support repeated calls to `adapt`. + +Raises: + RuntimeError: if the layer cannot be adapted at this time." +6735,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,214,method, +6736,set_num_elements,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,241,method, +6737,set_tfidf_data,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,253,method, +6738,call,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding.py,270,method, +6739,batch_wrapper,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_distribution_test.py,36,function, +6740,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_test.py,43,function, +6741,CategoryEncoding,tensorflow/tensorflow/python/keras/layers/preprocessing/category_encoding_v1.py,27,class,"CategoryEncoding layer. This layer provides options for condensing input data into denser representations. It accepts either integer values or strings as inputs, @@ -46620,7 +55087,7 @@ Attributes: even if the number of unique values in the vocabulary is less than max_elements, resulting in a tensor of shape [batch_size, max_elements] regardless of vocabulary size. Defaults to False." -6097,Discretization,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,32,class,"Buckets data into discrete ranges. +6742,Discretization,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,32,class,"Buckets data into discrete ranges. This layer will place each element of its input data into one of several contiguous ranges and output an integer index indicating which range each @@ -46647,9 +55114,11 @@ Bucketize float values based on provided buckets. " -6098,DiscretizationDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization_distribution_test.py,36,class, -6099,DiscretizationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization_test.py,35,class, -6100,Hashing,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,44,class,"Implements categorical feature hashing, also known as ""hashing trick"". +6743,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,67,method, +6744,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,74,method, +6745,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,77,method, +6746,call,tensorflow/tensorflow/python/keras/layers/preprocessing/discretization.py,85,method, +6747,Hashing,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,44,class,"Implements categorical feature hashing, also known as ""hashing trick"". This layer transforms single or multiple categorical inputs to hashed output. It converts a sequence of int or string to a sequence of int. The stable hash @@ -46738,10 +55207,12 @@ Output shape: An int64 `Tensor`, `SparseTensor` or `RaggedTensor` of shape `[batch_size, ...]`. If any input is `RaggedTensor` then output is `RaggedTensor`, otherwise if any input is `SparseTensor` then output is `SparseTensor`, otherwise the output is `Tensor`." -6101,HashingDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing_distribution_test.py,39,class, -6102,HashingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing_test.py,38,class, -6103,check_fill_mode_and_interpolation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,60,function, -6104,Resizing,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,71,class,"Image resizing layer. +6748,call,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,169,method, +6749,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,239,method, +6750,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,254,method, +6751,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/hashing.py,276,method, +6752,check_fill_mode_and_interpolation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,60,function, +6753,Resizing,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,71,class,"Image resizing layer. Resize the batched image input to target height and width. The input should be a 4-D tensor in the format of NHWC. @@ -46753,7 +55224,10 @@ Arguments: Supports `bilinear`, `nearest`, `bicubic`, `area`, `lanczos3`, `lanczos5`, `gaussian`, `mitchellcubic` name: A string, the name of the layer." -6105,CenterCrop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,123,class,"Crop the central portion of the images to target height and width. +6754,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,100,method, +6755,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,107,method, +6756,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,112,method, +6757,CenterCrop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,123,class,"Crop the central portion of the images to target height and width. Input shape: 4D tensor with shape: @@ -46770,7 +55244,10 @@ Arguments: height: Integer, the height of the output shape. width: Integer, the width of the output shape. name: A string, the name of the layer." -6106,RandomCrop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,191,class,"Randomly crop the images to target height and width. +6758,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,150,method, +6759,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,176,method, +6760,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,181,method, +6761,RandomCrop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,191,class,"Randomly crop the images to target height and width. This layer will crop all the images in the same batch to the same cropping location. @@ -46792,7 +55269,12 @@ Arguments: width: Integer, the width of the output shape. seed: Integer. Used to create a random seed. name: A string, the name of the layer." -6107,Rescaling,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,299,class,"Multiply inputs by `scale` and adds `offset`. +6762,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,225,method, +6763,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,283,method, +6764,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,288,method, +6765,random_cropped_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,229,method,Cropped inputs with stateless random ops. +6766,resize_and_center_cropped_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,247,method,Deterministically resize to shorter side and center crop. +6767,Rescaling,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,299,class,"Multiply inputs by `scale` and adds `offset`. For instance: @@ -46814,7 +55296,10 @@ Arguments: scale: Float, the scale to apply to the inputs. offset: Float, the offset to apply to the inputs. name: A string, the name of the layer." -6108,RandomFlip,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,354,class,"Randomly flip each image horizontally and vertically. +6768,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,330,method, +6769,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,336,method, +6770,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,339,method, +6771,RandomFlip,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,354,class,"Randomly flip each image horizontally and vertically. This layer will flip the images based on the `mode` attribute. During inference time, the output will be identical to input. Call the layer @@ -46835,7 +55320,11 @@ Attributes: ""vertical"" is a top-bottom flip. seed: Integer. Used to create a random seed. name: A string, the name of the layer." -6109,RandomTranslation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,435,class,"Randomly translate each image during training. +6772,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,402,method, +6773,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,421,method, +6774,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,424,method, +6775,random_flipped_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,406,method, +6776,RandomTranslation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,435,class,"Randomly translate each image during training. Arguments: height_factor: a float represented as fraction of value, or a tuple @@ -46882,7 +55371,11 @@ Output shape: Raise: ValueError: if either bound is not between [0, 1], or upper bound is less than lower bound." -6110,get_translation_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,583,function,"Returns projective transform(s) for the given translation(s). +6777,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,531,method, +6778,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,568,method, +6779,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,571,method, +6780,random_translated_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,535,method,Translated inputs with random ops. +6781,get_translation_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,583,function,"Returns projective transform(s) for the given translation(s). Args: translations: A matrix of 2-element lists representing [dx, dy] to translate @@ -46892,7 +55385,7 @@ Args: Returns: A tensor of shape (num_images, 8) projective transforms which can be given to `transform`." -6111,transform,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,616,function,"Applies the given transform(s) to the image(s). +6782,transform,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,616,function,"Applies the given transform(s) to the image(s). Args: images: A tensor of shape (num_images, num_rows, num_columns, num_channels) @@ -46944,7 +55437,7 @@ Returns: Raises: TypeError: If `image` is an invalid type. ValueError: If output shape is not 1-D int32 Tensor." -6112,get_rotation_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,699,function,"Returns projective transform(s) for the given angle(s). +6783,get_rotation_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,699,function,"Returns projective transform(s) for the given angle(s). Args: angles: A scalar angle to rotate all images by, or (for batches of images) a @@ -46961,7 +55454,7 @@ Returns: `(x, y)` to a transformed *input* point `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where `k = c0 x + c1 y + 1`." -6113,RandomRotation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,740,class,"Randomly rotate each image. +6784,RandomRotation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,740,class,"Randomly rotate each image. By default, random rotations are only applied during training. At inference time, the layer does nothing. If you need to apply random @@ -47010,7 +55503,11 @@ Output shape: Raise: ValueError: if either bound is not between [0, 1], or upper bound is less than lower bound." -6114,RandomZoom,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,858,class,"Randomly zoom each image during training. +6785,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,818,method, +6786,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,843,method, +6787,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,846,method, +6788,random_rotated_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,822,method,Rotated inputs with random ops. +6789,RandomZoom,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,858,class,"Randomly zoom each image during training. Arguments: height_factor: a float represented as fraction of value, or a tuple @@ -47065,7 +55562,11 @@ Output shape: Raise: ValueError: if lower bound is not between [0, 1], or upper bound is negative." -6115,get_zoom_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1009,function,"Returns projective transform(s) for the given zoom(s). +6790,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,960,method, +6791,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,994,method, +6792,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,997,method, +6793,random_zoomed_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,964,method,Zoomed inputs with random ops. +6794,get_zoom_matrix,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1009,function,"Returns projective transform(s) for the given zoom(s). Args: zooms: A matrix of 2-element lists representing [zx, zy] to zoom @@ -47081,7 +55582,7 @@ Returns: `(x, y)` to a transformed *input* point `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where `k = c0 x + c1 y + 1`." -6116,RandomContrast,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1051,class,"Adjust the contrast of an image or images by a random factor. +6795,RandomContrast,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1051,class,"Adjust the contrast of an image or images by a random factor. Contrast is adjusted independently for each channel of each image during training. @@ -47109,7 +55610,11 @@ Attributes: Raise: ValueError: if lower bound is not between [0, 1], or upper bound is negative." -6117,RandomHeight,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1123,class,"Randomly vary the height of a batch of images during training. +6796,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1097,method, +6797,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1110,method, +6798,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1113,method, +6799,random_contrasted_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1101,method, +6800,RandomHeight,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1123,class,"Randomly vary the height of a batch of images during training. Adjusts the height of a batch of images by a random factor. The input should be a 4-D tensor in the ""channels_last"" image data format. @@ -47136,7 +55641,11 @@ Input shape: (data_format='channels_last'). Output shape: 4D tensor with shape: `(samples, random_height, width, channels)`." -6118,RandomWidth,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1221,class,"Randomly vary the width of a batch of images during training. +6801,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1181,method, +6802,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1205,method, +6803,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1210,method, +6804,random_height_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1185,method,Inputs height-adjusted with random ops. +6805,RandomWidth,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1221,class,"Randomly vary the width of a batch of images during training. Adjusts the width of a batch of images by a random factor. The input should be a 4-D tensor in the ""channels_last"" image data format. @@ -47165,31 +55674,14 @@ Input shape: Output shape: 4D tensor with shape: `(samples, height, random_width, channels)`." -6119,_RandomGenerator,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1322,class,"A subclass that allows creation inside distribution strategies. - -This is a temporary solution to allow creating tf.random.Generator inside -distribution strategies. It will be removed when proper API is in place. - -All replicas will have the same RNG state and generate the same random -numbers." -6120,make_generator,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1352,function, -6121,get_interpolation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1359,function, -6122,ImagePreprocessingDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_distribution_test.py,38,class, -6123,ResizingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,41,class, -6124,get_numpy_center_crop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,131,function, -6125,CenterCropTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,142,class, -6126,RandomCropTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,203,class, -6127,RescalingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,308,class, -6128,RandomFlipTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,342,class, -6129,RandomContrastTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,426,class, -6130,RandomTranslationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,511,class, -6131,RandomTransformTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,695,class, -6132,RandomRotationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,990,class, -6133,RandomZoomTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,1046,class, -6134,RandomHeightTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,1152,class, -6135,RandomWidthTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,1243,class, -6136,LearningPhaseTest,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,1333,class, -6137,IndexLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,44,class,"Maps values from a vocabulary to integer indices. +6806,call,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1280,method, +6807,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1304,method, +6808,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1309,method, +6809,random_width_inputs,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1284,method,Inputs width-adjusted with random ops. +6810,make_generator,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1352,function, +6811,get_interpolation,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py,1359,function, +6812,get_numpy_center_crop,tensorflow/tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py,131,function, +6813,IndexLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,44,class,"Maps values from a vocabulary to integer indices. This layer translates a set of arbitrary hashables into an integer output via a table-based lookup, with optional out-of-vocabulary handling. This is the @@ -47225,34 +55717,40 @@ Attributes: same token multiple times, an error will be thrown. invert: If true, this layer will map indices to vocabulary items instead of mapping vocabulary items to indices." -6138,_IndexLookupAccumulator,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,379,class, -6139,_IndexLookupCombiner,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,384,class,"Combiner for the IndexLookup preprocessing layer. +6814,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,170,method, +6815,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,173,method, +6816,adapt,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,178,method,"Fits the state of the preprocessing layer to the dataset. -This class encapsulates the logic for computing a vocabulary based on the -frequency of each token. +Overrides the default adapt method to apply relevant preprocessing to the +inputs before passing to the combiner. -Attributes: - vocab_size: (Optional) If set, only the top `vocab_size` tokens (based on - frequency across the dataset) are retained in the vocabulary. If None, or - set to a value greater than the total number of distinct tokens in the - dataset, all tokens are retained.s" -6140,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py,37,function, -6141,IndexLookupDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py,48,class, -6142,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,48,function, -6143,_get_end_to_end_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,55,function, -6144,IndexLookupLayerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,217,class, -6145,CategoricalEncodingInputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,267,class, -6146,CategoricalEncodingMultiOOVTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,382,class, -6147,CategoricalEncodingAdaptTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,478,class, -6148,IndexLookupOutputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,599,class, -6149,IndexLookupVocabularyTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,672,class, -6150,IndexLookupInverseVocabularyTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,875,class, -6151,IndexLookupSaveableTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,987,class, -6152,IndexLookupErrorTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,1029,class, -6153,IndexLookupSavingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,1056,class, -6154,IndexLookupStringCombinerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,1101,class, -6155,IndexLookupIntCombinerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,1232,class, -6156,IndexLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_v1.py,26,class,"IndexLookup layer. +Arguments: + data: The data to train on. It can be passed either as a tf.data Dataset, + or as a numpy array. + reset_state: Optional argument specifying whether to clear the state of + the layer at the start of the call to `adapt`. This must be True for + this layer, which does not support repeated calls to `adapt`." +6817,get_vocabulary,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,195,method, +6818,vocab_size,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,208,method, +6819,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,211,method, +6820,count_params,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,222,method, +6821,set_vocabulary,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,345,method,"Sets vocabulary data for this layer with inverse=False. + +This method sets the vocabulary for this layer directly, instead of +analyzing a dataset through 'adapt'. It should be used whenever the vocab +information is already known. If vocabulary data is already present in the +layer, this method will either replace it + +Arguments: + vocab: An array of string tokens. + +Raises: + ValueError: If there are too many inputs, the inputs do not match, or + input data is missing." +6822,call,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup.py,370,method, +6823,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py,37,function, +6824,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_test.py,48,function, +6825,IndexLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/index_lookup_v1.py,26,class,"IndexLookup layer. This layer translates a set of arbitray strings or integers into an integer output via a table-based lookup, with optional out-of-vocabulary handling. @@ -47281,7 +55779,7 @@ Attributes: mask_inputs: If True, input values of 0 (for integers) and """" (for strings) will be treated as masked values and assigned an output value of 0. If this option is set, reserve_zero must also be set. Defaults to False." -6157,IntegerLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup.py,28,class,"Maps integers from a vocabulary to integer indices. +6826,IntegerLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup.py,28,class,"Maps integers from a vocabulary to integer indices. This layer translates a set of arbitrary integers into an integer output via a table-based lookup, with optional out-of-vocabulary handling. @@ -47416,19 +55914,10 @@ In this example, the input value 1000 resulted in an output of -1, since values are returned as -1 in the inverse layer. Also, note that for the inverse to work, you must have already set the forward layer vocabulary either directly or via fit() before calling get_vocabulary()." -6158,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,48,function, -6159,_get_end_to_end_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,55,function, -6160,IntegerLookupLayerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,93,class, -6161,CategoricalEncodingInputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,136,class, -6162,CategoricalEncodingMultiOOVTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,177,class, -6163,CategoricalEncodingAdaptTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,223,class, -6164,IntegerLookupOutputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,300,class, -6165,IntegerLookupVocabularyTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,382,class, -6166,IntegerLookupSaveableTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,442,class, -6167,IntegerLookupErrorTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,475,class, -6168,IntegerLookupSavingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,492,class, -6169,IntegerLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_v1.py,27,class,Maps integers from a vocabulary to integer indices. -6170,Normalization,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,42,class,"Feature-wise normalization of the data. +6827,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup.py,207,method, +6828,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_test.py,48,function, +6829,IntegerLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/integer_lookup_v1.py,27,class,Maps integers from a vocabulary to integer indices. +6830,Normalization,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,42,class,"Feature-wise normalization of the data. This layer will coerce its inputs into a distribution centered around 0 with standard deviation 1. It accomplishes this by precomputing the mean and @@ -47461,24 +55950,16 @@ Calculate the mean and variance by analyzing the dataset in `adapt`. array([[-1.4142135 ], [-0.70710677], [ 0. ]], dtype=float32)>" -6171,_NormalizingCombiner,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,180,class,"Combiner for the Normalization preprocessing layer. - -This class encapsulates the computations for finding the mean and variance -of a set of data in a stable and numerically correct way. Its associated -accumulator is a namedtuple('count', 'mean', 'variance'). - -Attributes: - axis: The axis to compute mean and var over." -6172,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_distribution_test.py,35,function, -6173,_get_layer_computation_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_distribution_test.py,42,function, -6174,NormalizationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_distribution_test.py,112,class, -6175,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_test.py,37,function, -6176,_get_layer_computation_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_test.py,44,function, -6177,NormalizationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_test.py,126,class, -6178,_get_layer_computation_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_tpu_test.py,34,function, -6179,NormalizationTest,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_tpu_test.py,101,class, -6180,Normalization,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_v1.py,28,class, -6181,PreprocessingStage,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_stage.py,30,class,"A sequential preprocessing stage. +6831,build,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,100,method, +6832,call,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,147,method, +6833,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,162,method, +6834,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,165,method, +6835,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,168,method, +6836,set_weights,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization.py,173,method,Override for set_weights to ensure we can set just mean/var weights. +6837,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_distribution_test.py,35,function, +6838,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_test.py,37,function, +6839,Normalization,tensorflow/tensorflow/python/keras/layers/preprocessing/normalization_v1.py,28,class, +6840,PreprocessingStage,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_stage.py,30,class,"A sequential preprocessing stage. This preprocessing stage wraps a list of preprocessing layers into a Sequential-like object that enables you to `adapt()` the whole list via @@ -47487,10 +55968,24 @@ a single `adapt()` call on the preprocessing stage. Arguments: layers: List of layers. Can include layers that aren't preprocessing layers. name: String. Optional name for the preprocessing stage object." -6182,PreprocessingStageTest,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_stage_test.py,37,class, -6183,PreprocessingLayerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_test_utils.py,27,class,Base test class for preprocessing layer API validation. -6184,get_reduce_op,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction.py,28,function,Translate a reduction string name to a reduction op. -6185,Reduction,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction.py,45,class,"Performs an optionally-weighted reduction. +6841,adapt,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_stage.py,43,method,"Adapt the state of the layers of the preprocessing stage to the data. + +Arguments: + data: A batched Dataset object, or a NumPy array, or an EagerTensor. + Data to be iterated over to adapt the state of the layers in this + preprocessing stage. + reset_state: Whether this call to `adapt` should reset the state of + the layers in this preprocessing stage." +6842,map_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/preprocessing_stage.py,73,method,"Maps `PreprocessingStage` inputs to inputs at `current_layer_index`. + +Args: + x: Batch of inputs seen in entry of the `PreprocessingStage` instance. + +Returns: + Batch of inputs to be processed by layer + `self.layers[current_layer_index]`" +6843,get_reduce_op,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction.py,28,function,Translate a reduction string name to a reduction op. +6844,Reduction,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction.py,45,class,"Performs an optionally-weighted reduction. This layer performs a reduction across one axis of its input data. This data may optionally be weighted by passing in an identical float tensor. @@ -47513,8 +56008,8 @@ Call arguments: inputs: The data to reduce. weights: An optional tensor or constant of the same shape as inputs that will weight the input data before it is reduced." -6186,ReductionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction_test.py,33,class, -6187,StringLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup.py,28,class,"Maps strings from a vocabulary to integer indices. +6845,call,tensorflow/tensorflow/python/keras/layers/preprocessing/reduction.py,79,method, +6846,StringLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup.py,28,class,"Maps strings from a vocabulary to integer indices. This layer translates a set of arbitrary strings into an integer output via a table-based lookup, with optional out-of-vocabulary handling. @@ -47648,22 +56143,22 @@ In this example, the input value 'z' resulted in an output of '[UNK]', since values are returned as '[OOV}' in the inverse layer. Also, note that for the inverse to work, you must have already set the forward layer vocabulary either directly or via fit() before calling get_vocabulary()." -6188,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,44,function, -6189,_get_end_to_end_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,51,function, -6190,StringLookupLayerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,88,class, -6191,StringLookupVocabularyTest,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,131,class, -6192,StringLookupSaveableTest,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,238,class, -6193,StringLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_v1.py,27,class,Maps strings from a vocabulary to integer indices. -6194,TableHandler,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,36,class,Wrapper object that holds a lookup table and provides accessors. -6195,get_vocabulary_from_file,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,151,function,Read a vocabulary in from a file. -6196,validate_vocabulary_is_unique,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,171,function,Validate that a vocabulary contains no repeated tokens. -6197,assert_same_type,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,184,function,Assert that 'values' is of type 'expected_type'. -6198,convert_to_ndarray,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,191,function,Convert 'x' to a numpy array. -6199,get_table,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils_test.py,34,function, -6200,CategoricalEncodingInputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils_test.py,45,class, -6201,CategoricalEncodingMultiOOVTest,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils_test.py,122,class, -6202,IndexLookupOutputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils_test.py,212,class, -6203,TextVectorization,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,74,class,"Text vectorization layer. +6847,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup.py,202,method, +6848,get_vocabulary,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup.py,207,method, +6849,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_test.py,44,function, +6850,StringLookup,tensorflow/tensorflow/python/keras/layers/preprocessing/string_lookup_v1.py,27,class,Maps strings from a vocabulary to integer indices. +6851,TableHandler,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,36,class,Wrapper object that holds a lookup table and provides accessors. +6852,data,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,49,method, +6853,vocab_size,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,53,method, +6854,clear,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,56,method, +6855,insert,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,60,method, +6856,lookup,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,123,method,Perform a table lookup. +6857,get_vocabulary_from_file,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,151,function,Read a vocabulary in from a file. +6858,validate_vocabulary_is_unique,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,171,function,Validate that a vocabulary contains no repeated tokens. +6859,assert_same_type,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,184,function,Assert that 'values' is of type 'expected_type'. +6860,convert_to_ndarray,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils.py,191,function,Convert 'x' to a numpy array. +6861,get_table,tensorflow/tensorflow/python/keras/layers/preprocessing/table_utils_test.py,34,function, +6862,TextVectorization,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,74,class,"Text vectorization layer. This layer has basic options for managing text in a Keras model. It transforms a batch of strings (one sample = one string) into either a list of @@ -47786,22 +56281,51 @@ splits on whitespace, strips punctuation, and outputs integer vocab indices. >>> model.predict(input_data) array([[2, 1, 4, 0], [1, 3, 0, 0]])" -6204,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py,37,function, -6205,TextVectorizationDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py,48,class, -6206,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,50,function, -6207,_get_end_to_end_test_cases,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,57,function, -6208,TextVectorizationLayerTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,264,class, -6209,TextVectorizationPreprocessingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,413,class, -6210,TextVectorizationDistributionTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,695,class, -6211,TextVectorizationOutputTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,722,class, -6212,TextVectorizationModelBuildingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1208,class, -6213,TextVectorizationSaveableTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1291,class, -6214,TextVectorizationErrorTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1316,class, -6215,custom_standardize_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1427,function, -6216,custom_split_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1432,function, -6217,TextVectorizationSavingTest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1437,class, -6218,TextVectorizationE2ETest,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1570,class, -6219,TextVectorization,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_v1.py,30,class,"Text vectorization layer. +6863,compute_output_shape,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,328,method, +6864,compute_output_signature,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,345,method, +6865,adapt,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,350,method,"Fits the state of the preprocessing layer to the dataset. + +Overrides the default adapt method to apply relevant preprocessing to the +inputs before passing to the combiner. + +Arguments: + data: The data to train on. It can be passed either as a tf.data Dataset, + as a NumPy array, a string tensor, or as a list of texts. + reset_state: Optional argument specifying whether to clear the state of + the layer at the start of the call to `adapt`. This must be True for + this layer, which does not support repeated calls to `adapt`." +6866,get_vocabulary,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,403,method, +6867,get_config,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,406,method, +6868,count_params,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,419,method, +6869,set_vocabulary,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,426,method,"Sets vocabulary (and optionally document frequency) data for this layer. + +This method sets the vocabulary and DF data for this layer directly, instead +of analyzing a dataset through 'adapt'. It should be used whenever the vocab +(and optionally document frequency) information is already known. If +vocabulary data is already present in the layer, this method will replace +it. + +Arguments: + vocab: An array of string tokens. + df_data: An array of document frequency data. Only necessary if the layer + output_mode is TFIDF. + oov_df_value: The document frequency of the OOV token. Only necessary if + output_mode is TFIDF. + +Raises: + ValueError: If there are too many inputs, the inputs do not match, or + input data is missing. + RuntimeError: If the vocabulary cannot be set when this function is + called. This happens when ""binary"", ""count"", and ""tfidf"" modes, + if ""pad_to_max_tokens"" is False and the layer itself has already been + called." +6870,build,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,492,method, +6871,call,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization.py,567,method, +6872,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py,37,function, +6873,get_layer_class,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,50,function, +6874,custom_standardize_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1427,function, +6875,custom_split_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py,1432,function, +6876,TextVectorization,tensorflow/tensorflow/python/keras/layers/preprocessing/text_vectorization_v1.py,30,class,"Text vectorization layer. This layer has basic options for managing text in a Keras model. It transforms a batch of strings (one sample = one string) into either a list of @@ -47847,21 +56371,38 @@ Attributes: pad_to_max_tokens: If True, BINARY, COUNT, and TFIDF modes will have their outputs padded to max_tokens, even if the number of unique tokens in the vocabulary is less than max_tokens." -6220,int_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,43,function, -6221,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,48,class,Benchmark the layer forward pass. -6222,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py,39,class,Benchmark the layer forward pass. -6223,word_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,45,function, -6224,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,50,class,Benchmark the layer forward pass. -6225,rotate,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,48,function,rotate image. -6226,zoom,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,62,function,zoom image. -6227,image_augmentation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,78,function,image augmentation. -6228,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,88,class,Benchmark the layer forward pass. -6229,word_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,45,function, -6230,get_top_k,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,50,function,Python implementation of vocabulary building using a defaultdict. -6231,BenchmarkAdapt,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,66,class,Benchmark adapt. -6232,reduce_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,41,function,tf.data.Dataset-friendly implementation of mean and variance. -6233,BenchmarkAdapt,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,63,class,Benchmark adapt. -6234,keras_style_scope,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,47,function,"Use Keras-style variable management. +6877,int_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,43,function, +6878,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,48,class,Benchmark the layer forward pass. +6879,run_dataset_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,51,method, +6880,bm_layer_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,74,method, +6881,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py,110,method, +6882,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py,39,class,Benchmark the layer forward pass. +6883,run_dataset_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py,42,method, +6884,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py,75,method, +6885,word_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,45,function, +6886,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,50,class,Benchmark the layer forward pass. +6887,run_dataset_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,53,method, +6888,bm_layer_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,75,method, +6889,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py,109,method, +6890,rotate,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,48,function,rotate image. +6891,zoom,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,62,function,zoom image. +6892,image_augmentation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,78,function,image augmentation. +6893,BenchmarkLayer,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,88,class,Benchmark the layer forward pass. +6894,run_dataset_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,91,method, +6895,bm_layer_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,116,method, +6896,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py,157,method, +6897,word_gen,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,45,function, +6898,get_top_k,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,50,function,Python implementation of vocabulary building using a defaultdict. +6899,BenchmarkAdapt,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,66,class,Benchmark adapt. +6900,run_numpy_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,69,method,Test the python implementation. +6901,bm_adapt_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,89,method,Test the KPL adapt implementation. +6902,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py,117,method, +6903,reduce_fn,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,41,function,tf.data.Dataset-friendly implementation of mean and variance. +6904,BenchmarkAdapt,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,63,class,Benchmark adapt. +6905,run_dataset_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,66,method, +6906,bm_adapt_implementation,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,93,method,Test the KPL adapt implementation. +6907,benchmark_vocab_size_by_batch,tensorflow/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py,126,method, +6908,keras_style_scope,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,47,function,"Use Keras-style variable management. All tf.layers and tf RNN cells created in this scope use Keras-style variable management. Creating such layers with a scope= argument is @@ -47917,7 +56458,7 @@ with keras_style_scope(): Yields: A keras layer style scope." -6235,set_keras_style,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,115,function,"Use Keras-style variable management. +6909,set_keras_style,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,115,function,"Use Keras-style variable management. All tf.layers and tf RNN cells created after keras style ha been enabled use Keras-style variable management. Creating such layers with a @@ -47948,8 +56489,7 @@ assert len(model_1.weights) > 0 assert len(model_2.weights) > 0 assert(model_1.weights != model_2.weights) ```" -6236,_is_in_keras_style_scope,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,152,function, -6237,Layer,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,158,class,"Base layer class. +6910,Layer,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,158,class,"Base layer class. It is considered legacy, and we recommend the use of `tf.keras.layers.Layer` instead. @@ -47980,11 +56520,58 @@ Mutable properties: trainable: Whether the layer should be trained (boolean). input_spec: Optional (list of) `InputSpec` object(s) specifying the constraints on inputs that can be accepted by the layer." -6238,_add_elements_to_collection,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,582,function, -6239,BaseLayerTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/base_test.py,47,class, -6240,IdentityLayer,tensorflow/tensorflow/python/keras/legacy_tf_layers/base_test.py,647,class,A layer returns the identity of it's input. -6241,DTypeTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/base_test.py,655,class, -6242,Conv1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,30,class,"1D convolution layer (e.g. temporal convolution). +6911,graph,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,244,method, +6912,scope_name,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,273,method, +6913,add_loss,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,282,method, +6914,add_weight,tensorflow/tensorflow/python/keras/legacy_tf_layers/base.py,317,method,"Adds a new variable to the layer, or gets an existing one; returns it. + +Arguments: + name: variable name. + shape: variable shape. + dtype: The type of the variable. Defaults to `self.dtype` or `float32`. + initializer: initializer instance (callable). + regularizer: regularizer instance (callable). + trainable: whether the variable should be part of the layer's + ""trainable_variables"" (e.g. variables, biases) + or ""non_trainable_variables"" (e.g. BatchNorm mean, stddev). + Note, if the current variable scope is marked as non-trainable + then this parameter is ignored and any added variables are also + marked as non-trainable. `trainable` defaults to `True` unless + `synchronization` is set to `ON_READ`. + constraint: constraint instance (callable). + use_resource: Whether to use `ResourceVariable`. + synchronization: Indicates when a distributed a variable will be + aggregated. Accepted values are constants defined in the class + `tf.VariableSynchronization`. By default the synchronization is set to + `AUTO` and the current `DistributionStrategy` chooses + when to synchronize. If `synchronization` is set to `ON_READ`, + `trainable` must not be set to `True`. + aggregation: Indicates how a distributed variable will be aggregated. + Accepted values are constants defined in the class + `tf.VariableAggregation`. + partitioner: (optional) partitioner instance (callable). If + provided, when the requested variable is created it will be split + into multiple partitions according to `partitioner`. In this case, + an instance of `PartitionedVariable` is returned. Available + partitioners include `tf.compat.v1.fixed_size_partitioner` and + `tf.compat.v1.variable_axis_size_partitioner`. For more details, see + the documentation of `tf.compat.v1.get_variable` and the ""Variable + Partitioners and Sharding"" section of the API guide. + **kwargs: Additional keyword arguments. + +Returns: + The created variable. Usually either a `Variable` or `ResourceVariable` + instance. If `partitioner` is not `None`, a `PartitionedVariable` + instance is returned. + +Raises: + RuntimeError: If called with partitioned variable regularization and + eager execution is enabled. + ValueError: When trainable has been set to True with synchronization + set as `ON_READ`." +6915,IdentityLayer,tensorflow/tensorflow/python/keras/legacy_tf_layers/base_test.py,647,class,A layer returns the identity of it's input. +6916,call,tensorflow/tensorflow/python/keras/legacy_tf_layers/base_test.py,650,method, +6917,Conv1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,30,class,"1D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48034,7 +56621,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6243,conv1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,125,function,"Functional interface for 1D convolution layer (e.g. temporal convolution). +6918,conv1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,125,function,"Functional interface for 1D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48093,7 +56680,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6244,Conv2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,228,class,"2D convolution layer (e.g. spatial convolution over images). +6919,Conv2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,228,class,"2D convolution layer (e.g. spatial convolution over images). This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48150,7 +56737,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6245,conv2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,330,function,"Functional interface for the 2D convolution layer. +6920,conv2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,330,function,"Functional interface for the 2D convolution layer. This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48216,7 +56803,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6246,Conv3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,440,class,"3D convolution layer (e.g. spatial convolution over volumes). +6921,Conv3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,440,class,"3D convolution layer (e.g. spatial convolution over volumes). This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48274,7 +56861,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6247,conv3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,543,function,"Functional interface for the 3D convolution layer. +6922,conv3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,543,function,"Functional interface for the 3D convolution layer. This layer creates a convolution kernel that is convolved (actually cross-correlated) with the layer input to produce a tensor of @@ -48341,7 +56928,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6248,SeparableConv1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,654,class,"Depthwise separable 1D convolution. +6923,SeparableConv1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,654,class,"Depthwise separable 1D convolution. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -48400,7 +56987,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6249,SeparableConv2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,764,class,"Depthwise separable 2D convolution. +6924,SeparableConv2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,764,class,"Depthwise separable 2D convolution. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -48464,7 +57051,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6250,separable_conv1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,882,function,"Functional interface for the depthwise separable 1D convolution layer. +6925,separable_conv1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,882,function,"Functional interface for the depthwise separable 1D convolution layer. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -48532,7 +57119,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6251,separable_conv2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1005,function,"Functional interface for the depthwise separable 2D convolution layer. +6926,separable_conv2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1005,function,"Functional interface for the depthwise separable 2D convolution layer. This layer performs a depthwise convolution that acts separately on channels, followed by a pointwise convolution that mixes channels. @@ -48605,7 +57192,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6252,Conv2DTranspose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1130,class,"Transposed 2D convolution layer (sometimes called 2D Deconvolution). +6927,Conv2DTranspose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1130,class,"Transposed 2D convolution layer (sometimes called 2D Deconvolution). The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction @@ -48652,7 +57239,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6253,conv2d_transpose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1221,function,"Functional interface for transposed 2D convolution layer. +6928,conv2d_transpose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1221,function,"Functional interface for transposed 2D convolution layer. The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction @@ -48708,7 +57295,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6254,Conv3DTranspose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1319,class,"Transposed 3D convolution layer (sometimes called 3D Deconvolution). +6929,Conv3DTranspose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1319,class,"Transposed 3D convolution layer (sometimes called 3D Deconvolution). Arguments: filters: Integer, the dimensionality of the output space (i.e. the number @@ -48751,7 +57338,7 @@ Arguments: trainable: Boolean, if `True` also add variables to the graph collection `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). name: A string, the name of the layer." -6255,conv3d_transpose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1407,function,"Functional interface for transposed 3D convolution layer. +6930,conv3d_transpose,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional.py,1407,function,"Functional interface for transposed 3D convolution layer. Arguments: inputs: Input tensor. @@ -48801,12 +57388,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6256,ConvTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional_test.py,37,class, -6257,SeparableConv1DTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional_test.py,353,class, -6258,SeparableConv2DTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional_test.py,530,class, -6259,Conv2DTransposeTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional_test.py,790,class, -6260,Conv3DTransposeTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/convolutional_test.py,987,class, -6261,Dense,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,33,class,"Densely-connected layer class. +6931,Dense,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,33,class,"Densely-connected layer class. This layer implements the operation: `outputs = activation(inputs * kernel + bias)` @@ -48855,7 +57437,7 @@ Properties: bias_constraint: Constraint function for the bias. kernel: Weight matrix (TensorFlow variable or tensor). bias: Bias vector, if applicable (TensorFlow variable or tensor)." -6262,dense,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,116,function,"Functional interface for the densely-connected layer. +6932,dense,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,116,function,"Functional interface for the densely-connected layer. This layer implements the operation: `outputs = activation(inputs * kernel + bias)` @@ -48897,7 +57479,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6263,Dropout,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,191,class,"Applies Dropout to the input. +6933,Dropout,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,191,class,"Applies Dropout to the input. Dropout consists in randomly setting a fraction `rate` of input units to 0 at each update during training time, which helps prevent overfitting. @@ -48917,7 +57499,8 @@ Arguments: `tf.compat.v1.set_random_seed`. for behavior. name: The name of the layer (string)." -6264,dropout,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,233,function,"Applies Dropout to the input. +6934,call,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,225,method, +6935,dropout,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,233,function,"Applies Dropout to the input. Dropout consists in randomly setting a fraction `rate` of input units to 0 at each update during training time, which helps prevent overfitting. @@ -48947,7 +57530,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6265,Flatten,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,275,class,"Flattens an input tensor while preserving the batch axis (axis 0). +6936,Flatten,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,275,class,"Flattens an input tensor while preserving the batch axis (axis 0). Arguments: data_format: A string, one of `channels_last` (default) or `channels_first`. @@ -48967,7 +57550,7 @@ Examples: y = Flatten()(x) # now `y` has shape `(None, None)` ```" -6266,flatten,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,304,function,"Flattens an input tensor while preserving the batch axis (axis 0). +6937,flatten,tensorflow/tensorflow/python/keras/legacy_tf_layers/core.py,304,function,"Flattens an input tensor while preserving the batch axis (axis 0). Arguments: inputs: Tensor input. @@ -48992,11 +57575,7 @@ Examples: y = flatten(x) # now `y` has shape `(None, None)` ```" -6267,DenseTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/core_test.py,45,class, -6268,_get_variable_dict_from_varstore,tensorflow/tensorflow/python/keras/legacy_tf_layers/core_test.py,379,function, -6269,DropoutTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/core_test.py,386,class, -6270,FlattenTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/core_test.py,469,class, -6271,BatchNormalization,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization.py,31,class,"Batch Normalization layer from (Ioffe et al., 2015). +6938,BatchNormalization,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization.py,31,class,"Batch Normalization layer from (Ioffe et al., 2015). Keras APIs handle BatchNormalization updates to the moving_mean and moving_variance as part of their `fit()` and `evaluate()` loops. However, if a @@ -49086,7 +57665,8 @@ References: [Ioffe, 2017](http://papers.nips.cc/paper/6790-batch-renormalization-towards-reducing-minibatch-dependence-in-batch-normalized-models) ([pdf](http://papers.nips.cc/paper/6790-batch-renormalization-towards-reducing-minibatch-dependence-in-batch-normalized-models.pdf))" -6272,batch_normalization,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization.py,181,function,"Functional interface for the batch normalization layer from_config(Ioffe et al., 2015). +6939,call,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization.py,171,method, +6940,batch_normalization,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization.py,181,function,"Functional interface for the batch normalization layer from_config(Ioffe et al., 2015). Note: when training, the moving_mean and moving_variance need to be updated. By default the update ops are placed in `tf.GraphKeys.UPDATE_OPS`, so they @@ -49192,8 +57772,7 @@ References: [Ioffe, 2017](http://papers.nips.cc/paper/6790-batch-renormalization-towards-reducing-minibatch-dependence-in-batch-normalized-models) ([pdf](http://papers.nips.cc/paper/6790-batch-renormalization-towards-reducing-minibatch-dependence-in-batch-normalized-models.pdf))" -6273,BNTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/normalization_test.py,43,class, -6274,AveragePooling1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,29,class,"Average Pooling layer for 1D inputs. +6941,AveragePooling1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,29,class,"Average Pooling layer for 1D inputs. Arguments: pool_size: An integer or tuple/list of a single integer, @@ -49208,7 +57787,7 @@ Arguments: `(batch, length, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, length)`. name: A string, the name of the layer." -6275,average_pooling1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,64,function,"Average Pooling layer for 1D inputs. +6942,average_pooling1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,64,function,"Average Pooling layer for 1D inputs. Arguments: inputs: The tensor over which to pool. Must have rank 3. @@ -49230,7 +57809,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6276,MaxPooling1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,99,class,"Max Pooling layer for 1D inputs. +6943,MaxPooling1D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,99,class,"Max Pooling layer for 1D inputs. Arguments: pool_size: An integer or tuple/list of a single integer, @@ -49245,7 +57824,7 @@ Arguments: `(batch, length, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, length)`. name: A string, the name of the layer." -6277,max_pooling1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,134,function,"Max Pooling layer for 1D inputs. +6944,max_pooling1d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,134,function,"Max Pooling layer for 1D inputs. Arguments: inputs: The tensor over which to pool. Must have rank 3. @@ -49267,7 +57846,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6278,AveragePooling2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,169,class,"Average pooling layer for 2D inputs (e.g. images). +6945,AveragePooling2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,169,class,"Average pooling layer for 2D inputs (e.g. images). Arguments: pool_size: An integer or tuple/list of 2 integers: (pool_height, pool_width) @@ -49286,7 +57865,7 @@ Arguments: `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. name: A string, the name of the layer." -6279,average_pooling2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,204,function,"Average pooling layer for 2D inputs (e.g. images). +6946,average_pooling2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,204,function,"Average pooling layer for 2D inputs (e.g. images). Arguments: inputs: The tensor over which to pool. Must have rank 4. @@ -49312,7 +57891,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6280,MaxPooling2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,242,class,"Max pooling layer for 2D inputs (e.g. images). +6947,MaxPooling2D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,242,class,"Max pooling layer for 2D inputs (e.g. images). Arguments: pool_size: An integer or tuple/list of 2 integers: (pool_height, pool_width) @@ -49331,7 +57910,7 @@ Arguments: `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. name: A string, the name of the layer." -6281,max_pooling2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,277,function,"Max pooling layer for 2D inputs (e.g. images). +6948,max_pooling2d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,277,function,"Max pooling layer for 2D inputs (e.g. images). Arguments: inputs: The tensor over which to pool. Must have rank 4. @@ -49357,7 +57936,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6282,AveragePooling3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,315,class,"Average pooling layer for 3D inputs (e.g. volumes). +6949,AveragePooling3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,315,class,"Average pooling layer for 3D inputs (e.g. volumes). Arguments: pool_size: An integer or tuple/list of 3 integers: @@ -49378,7 +57957,7 @@ Arguments: corresponds to inputs with shape `(batch, channels, depth, height, width)`. name: A string, the name of the layer." -6283,average_pooling3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,352,function,"Average pooling layer for 3D inputs (e.g. volumes). +6950,average_pooling3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,352,function,"Average pooling layer for 3D inputs (e.g. volumes). Arguments: inputs: The tensor over which to pool. Must have rank 5. @@ -49406,7 +57985,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6284,MaxPooling3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,392,class,"Max pooling layer for 3D inputs (e.g. volumes). +6951,MaxPooling3D,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,392,class,"Max pooling layer for 3D inputs (e.g. volumes). Arguments: pool_size: An integer or tuple/list of 3 integers: @@ -49427,7 +58006,7 @@ Arguments: corresponds to inputs with shape `(batch, channels, depth, height, width)`. name: A string, the name of the layer." -6285,max_pooling3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,429,function,"Max pooling layer for 3D inputs (e.g. +6952,max_pooling3d,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling.py,429,function,"Max pooling layer for 3D inputs (e.g. volumes). @@ -49453,8 +58032,7 @@ Returns: Raises: ValueError: if eager execution is enabled." -6286,PoolingTest,tensorflow/tensorflow/python/keras/legacy_tf_layers/pooling_test.py,28,class, -6287,AutoCastVariable,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,30,class,"Variable that will cast itself to a different dtype in applicable contexts. +6953,AutoCastVariable,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,30,class,"Variable that will cast itself to a different dtype in applicable contexts. This class wraps a floating-point `tf.Variable`. It emulates the variable interface and delegates to the wrapped variable, but it additionally will cast @@ -49477,7 +58055,45 @@ tf.float16 The purpose of this class is to allow Keras layers to create variables in float32, and automatically cast them to float16 or bfloat16 when the layer is called." -6288,create_autocast_variable,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,431,function,"Creates an AutoCastVariable that wraps another variable. +6954,dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,82,method,The dtype this variable will be casted to when read. +6955,true_dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,90,method,"The dtype of the underlying variable, before any casts are done." +6956,value,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,94,method, +6957,read_value,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,100,method, +6958,sparse_read,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,104,method,"Reads the value of this variable sparsely, using `gather`." +6959,gather_nd,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,109,method,Gather slices of the variable into a Tensor. +6960,set_shape,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,162,method, +6961,trainable,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,166,method, +6962,synchronization,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,170,method, +6963,aggregation,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,174,method, +6964,eval,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,177,method, +6965,initialized_value,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,180,method, +6966,initial_value,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,184,method, +6967,constraint,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,188,method, +6968,assign,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,191,method, +6969,assign_add,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,195,method, +6970,assign_sub,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,199,method, +6971,scatter_sub,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,203,method, +6972,scatter_add,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,207,method, +6973,scatter_max,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,211,method, +6974,scatter_min,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,215,method, +6975,scatter_mul,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,219,method, +6976,scatter_div,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,223,method, +6977,scatter_update,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,227,method, +6978,batch_scatter_update,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,231,method, +6979,scatter_nd_sub,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,235,method, +6980,scatter_nd_add,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,239,method, +6981,scatter_nd_update,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,243,method, +6982,load,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,247,method, +6983,name,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,251,method, +6984,initializer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,259,method, +6985,device,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,263,method, +6986,op,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,267,method, +6987,graph,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,271,method, +6988,shape,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,275,method, +6989,get_shape,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,278,method, +6990,to_proto,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,297,method, +6991,from_proto,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,300,method, +6992,create_autocast_variable,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,431,function,"Creates an AutoCastVariable that wraps another variable. This typically just returns `AutoCastVariable(variable)`. But, if the variable is a DistributedVariable or one of its subclasses, we instead dynamically @@ -49491,97 +58107,40 @@ Args: Returns: An AutoCastVariable that wraps the variable." -6289,_maybe_wrap,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable.py,474,function,"Creates an AutoCastVariable that wraps another variable if applicable. - -This function is used to wrap the return value of AutoCastVariable.assign. -Unfortunately MirroredVariable.assign will (incorrectly) return a Mirrored -value instead of a MirroredVariable. So we cannot properly wrap it in an -AutoCastVariable. We return the original variable in that case. - -Args: - variable: A tf.Variable or op. - wrap: A boolean to define whether to wrap the variable in an - AutoCastVariable or not. - -Returns: - An AutoCastVariable if wrap is True and variable is a resource variable." -6290,get_var,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable_test.py,51,function, -6291,AutoCastVariableTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable_test.py,56,class, -6292,_dedup_strings,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check.py,36,function,"Groups together consecutive identical strings. - -For example, given: - ['GPU 1', 'GPU 2', 'GPU 2', 'GPU 3', 'GPU 3', 'GPU 3'] -This function returns: - ['GPU 1', 'GPU 2 (x2)', 'GPU 3 (x3)'] - -Args: - device_strs: A list of strings, each representing a device. - -Returns: - A copy of the input, but identical consecutive strings are merged into a - single string." -6293,_log_device_compatibility_check,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check.py,61,function,"Logs a compatibility check if the devices support the policy. - -Currently only logs for the policy mixed_float16. - -Args: - policy_name: The name of the dtype policy. - gpu_details_list: A list of dicts, one dict per GPU. Each dict - is the device details for a GPU, as returned by - `tf.config.experimental.get_device_details()`." -6294,log_device_compatibility_check,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check.py,135,function,"Logs a compatibility check if the devices support the policy. +6993,get_var,tensorflow/tensorflow/python/keras/mixed_precision/experimental/autocast_variable_test.py,51,function, +6994,log_device_compatibility_check,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check.py,135,function,"Logs a compatibility check if the devices support the policy. Currently only logs for the policy mixed_float16. A log is shown only the first time this function is called. Args: policy_name: The name of the dtype policy." -6295,device_details,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check_test.py,29,function, -6296,DeviceCompatibilityCheckTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check_test.py,39,class, -6297,get_layer_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/get_layer_policy.py,29,function,"Returns the dtype policy of a layer. +6995,device_details,tensorflow/tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check_test.py,29,function, +6996,get_layer_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/get_layer_policy.py,29,function,"Returns the dtype policy of a layer. Args: layer: A `tf.keras.layers.Layer`. Returns: The `tf.keras.mixed_precision.experimental.Policy` of the layer." -6298,GetLayerPolicyTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/get_layer_policy_test.py,28,class, -6299,MultiplyLayerWithoutAutoCast,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,65,class,"Same as MultiplyLayer, but does not use AutoCastVariables." -6300,MultiplyLayerWithFunction,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,86,class,"Same as MultiplyLayer, but _multiply is decorated with a tf.function." -6301,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,99,function,"Create a MirroredStrategy, using a GPU if it is available." -6302,create_central_storage_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,107,function,"Create a CentralStorageStrategy, using a GPU if it is available." -6303,KerasLayerTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,124,class,Test mixed precision with Keras layers. -6304,KerasModelTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,427,class,Test mixed precision with Keras models. -6305,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/layer_correctness_test.py,49,function, -6306,LayerCorrectnessTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/layer_correctness_test.py,55,class, -6307,serialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,30,function, -6308,deserialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,34,function, -6309,get,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,48,function,Get a loss scale object. -6310,_get_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,38,function, -6311,LossScaleBenchmark,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,46,class,Benchmark for loss scaling. -6312,_UnwrapPreventer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,39,class,"Wrapper that DistributionStrategy will not unwrap. - -Typically, DistributionStrategy will unwrap values when going from a cross- -replica context to a replica context via `call_for_each_replica`. This class -is a wrapper that DistributionStrategy will not unwrap, so it can be used to -prevent it from unwrapping a value. - -TODO(reedwm): Find/implement a better way of preventing values from being -unwrapped by DistributionStrategy" -6313,_DelegatingTrackableMixin,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,57,class,"A mixin that delegates all Trackable methods to another trackable object. - -This class must be used with multiple inheritance. A class that subclasses -Trackable can also subclass this class, which causes all Trackable methods to -be delegated to the trackable object passed in the constructor. - -A subclass can use this mixin to appear as if it were the trackable passed to -the constructor, from a Checkpoint's perspective. LossScaleOptimizer uses this -mixin, so that the checkpoint format for a LossScaleOptimizer is identical to -the checkpoint format for a normal optimizer. This allows a model to be saved -with a normal Optimizer and restored with a LossScaleOptimizer, or vice versa. -The only difference in checkpoint format is that the loss scale is also saved -with a LossScaleOptimizer." -6314,LossScaleOptimizer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,176,class,"An optimizer that applies loss scaling. +6997,MultiplyLayerWithoutAutoCast,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,65,class,"Same as MultiplyLayer, but does not use AutoCastVariables." +6998,build,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,68,method, +6999,call,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,80,method, +7000,MultiplyLayerWithFunction,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,86,class,"Same as MultiplyLayer, but _multiply is decorated with a tf.function." +7001,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,99,function,"Create a MirroredStrategy, using a GPU if it is available." +7002,create_central_storage_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/keras_test.py,107,function,"Create a CentralStorageStrategy, using a GPU if it is available." +7003,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/layer_correctness_test.py,49,function, +7004,serialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,30,function, +7005,deserialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,34,function, +7006,get,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale.py,48,function,Get a loss scale object. +7007,LossScaleBenchmark,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,46,class,Benchmark for loss scaling. +7008,benchmark_optimizer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,164,method, +7009,benchmark_gradient_tape,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,170,method, +7010,get_loss,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,111,method, +7011,run_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,138,method, +7012,minimize_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,117,method, +7013,minimize_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_benchmark.py,126,method, +7014,LossScaleOptimizer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,176,class,"An optimizer that applies loss scaling. Loss scaling is a process that multiplies the loss by a multiplier called the loss scale, and divides each gradient by the same multiplier. The pseudocode @@ -49635,7 +58194,65 @@ computing the gradients with `tf.GradientTape`. For example: >>> opt.apply_gradients([(grad, var)]) # Loss scale is updated here >>> var.numpy() 0.25" -6315,FakeOptimizerForRestoration,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,545,class,"A fake optimizer used to support restoring TensorFlow 2.2 checkpoints. +7015,loss_scale,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,290,method,The `LossScale` instance associated with this optimizer. +7016,get_scaled_loss,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,294,method,"Scales the loss by the loss scale. + +This method is only needed if you compute gradients manually, e.g. with +`tf.GradientTape`. In that case, call this method to scale the loss before +passing the loss to `tf.GradientTape`. If you use +`LossScaleOptimizer.minimize` or `LossScaleOptimizer.get_gradients`, loss +scaling is automatically applied and this method is unneeded. + +If this method is called, `get_unscaled_gradients` should also be called. +See the `tf.keras.mixed_precision.experimental.LossScaleOptimizer` doc for +an example. + +Args: + loss: The loss, which will be multiplied by the loss scale. Can either be + a tensor or a callable returning a tensor. + +Returns: + `loss` multiplied by `LossScaleOptimizer.loss_scale()`." +7017,get_unscaled_gradients,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,323,method,"Unscales the gradients by the loss scale. + +This method is only needed if you compute gradients manually, e.g. with +`tf.GradientTape`. In that case, call this method to unscale the gradients +after computing them with `tf.GradientTape`. If you use +`LossScaleOptimizer.minimize` or `LossScaleOptimizer.get_gradients`, loss +scaling is automatically applied and this method is unneeded. + +If this method is called, `get_scaled_loss` should also be called. See +the `tf.keras.mixed_precision.experimental.LossScaleOptimizer` doc for an +example. + +Args: + grads: A list of tensors, each which will be divided by the loss scale. + Can have None values, which are ignored. + +Returns: + A new list the same size as `grads`, where every non-None value in `grads` + is divided by `LossScaleOptimizer.loss_scale()`." +7018,get_gradients,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,360,method, +7019,apply_gradients,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,368,method, +7020,get_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,423,method, +7021,from_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,432,method, +7022,iterations,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,461,method, +7023,iterations,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,465,method, +7024,get_slot_names,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,468,method, +7025,variables,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,471,method, +7026,weights,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,475,method, +7027,get_weights,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,478,method, +7028,set_weights,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,481,method, +7029,get_slot,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,496,method, +7030,add_slot,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,499,method, +7031,learning_rate,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,508,method, +7032,learning_rate,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,512,method, +7033,lr,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,516,method, +7034,lr,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,520,method, +7035,apply_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,388,method, +7036,do_not_apply_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,399,method, +7037,new_loss,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,316,method, +7038,FakeOptimizerForRestoration,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,545,class,"A fake optimizer used to support restoring TensorFlow 2.2 checkpoints. The checkpoint format for LossScaleOptimizers changed after TF 2.2. This class exists to support restoring TF 2.2 checkpoints in newer version of TensorFlow. @@ -49660,12 +58277,10 @@ To allow restoring TF 2.2. checkpoints, LossScaleOptimizer adds a dependency on this class instead of the inner optimizer. When restored, this class will instead restore the slot variables of the inner optimizer. Since this class has no variables, it does not affect the checkpoint when saved." -6316,_multiply_gradient,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,590,function,Multiply a (possibly sparse) gradient by the given scale factor. -6317,strategy_supports_loss_scaling,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,602,function,Returns True if the current Strategy supports loss scaling. -6318,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py,55,function, -6319,LossScaleOptimizerTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py,73,class, -6320,MixedPrecisionTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/mixed_precision_graph_rewrite_test.py,42,class, -6321,Policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,41,class,"A dtype policy for a Keras layer. +7039,get_slot_names,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,576,method, +7040,strategy_supports_loss_scaling,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer.py,602,function,Returns True if the current Strategy supports loss scaling. +7041,create_mirrored_strategy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/loss_scale_optimizer_test.py,55,function, +7042,Policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,41,class,"A dtype policy for a Keras layer. A dtype policy determines dtype-related aspects of a layer, such as its computation and variable dtypes. Each layer has a policy. Policies can be @@ -49917,7 +58532,51 @@ tf.float16 If you did not pass `dtype=inputs.dtype` to `tf.random.normal`, a `TypeError` would have occurred. This is because the dtype defaults to `""float32""`, so the layer would only work if the inputs were float32." -6322,global_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,489,function,"Returns the global Policy. +7043,variable_dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,393,method,"The variable dtype of this policy. + +This is the dtype layers will create their variables in, unless a layer +explicitly chooses a different dtype. If this is different than +`Policy.compute_dtype`, Layers will cast variables to the compute dtype to +avoid type errors. + +Returns: + The variable dtype of this policy." +7044,compute_dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,407,method,"The compute dtype of this policy. + +This is the dtype layers will do their computations in. + +Note that even if the compute dtype is float16 or bfloat16, hardware devices +may not do individual adds, multiplies, and other fundamental operations in +[b]float16, but instead may do some of them in float32 for numeric +stability. The compute dtype is the dtype of the inputs and outputs of the +TensorFlow ops that the layer executes. Internally, many TensorFlow ops will +do certain internal calculations in float32, or some other device-internal +intermediate format with higher precision than [b]float16, to increase +numeric stability. + +For example, a `tf.keras.layers.Dense` layer, when run on a GPU with a +float16 compute dtype, will pass float16 inputs to tf.matmul. But, tf.matmul +will do use float32 intermediate math. The performance benefit of float16 is +still apparent, due to increased memory bandwidth and the fact modern GPUs +have specialized hardware for computing matmuls on float16 while still +keeping intermediate computations in float32. + +Returns: + The compute dtype of this policy." +7045,should_cast_variables,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,434,method,"Returns True if variables should be casted. + +This is true if the variable dtype is not the same as the compute dtype. + +Returns: + True, if variables should be casted." +7046,loss_scale,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,445,method,"Returns the loss scale of this Policy. + +Returns: + A `tf.mixed_precision.experimental.LossScale`, or None." +7047,name,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,454,method,Returns the name of this policy. +7048,get_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,461,method, +7049,from_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,473,method, +7050,global_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,489,function,"Returns the global Policy. The global policy is the default policy used for layers, if no policy is passed to the layer constructor. If no policy has been set with @@ -49935,9 +58594,8 @@ policies. Returns: The global Policy." -6323,policy_defaults_to_floatx,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,517,function,Returns True if `global_policy()` will use the current value of floatx. -6324,_check_if_mixed_precision_graph_rewrite_is_enabled,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,522,function, -6325,set_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,539,function,"Sets the global Policy. +7051,policy_defaults_to_floatx,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,517,function,Returns True if `global_policy()` will use the current value of floatx. +7052,set_policy,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,539,function,"Sets the global Policy. The global policy is the default policy used for layers, if no policy is passed to the layer constructor. If no global policy is set, layers will @@ -49947,31 +58605,16 @@ See `keras.mixed_precision.experimental.Policy` for more information. Args: policy: A Policy, or a string that will be converted to a Policy.." -6326,policy_scope,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,568,function,"A context manager that sets the global Policy under it. +7053,policy_scope,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,568,function,"A context manager that sets the global Policy under it. Args: policy: A Policy, or a string that will be converted to a Policy.. Yields: Nothing." -6327,_is_convertible_to_dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,585,function, -6328,_policy_equivalent_to_dtype,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,593,function,"Returns True if the Policy is equivalent to a single dtype. - -A policy is equivalent to a single dtype if the policy's compute and variable -dtypes are the same and the policy does not cause the layer/model to have -additional behavior, such as loss scaling. - -The ""_infer"" policy is considered equivalent to a single dtype. - -Args: - policy: A Policy. - -Returns: - True, if the policy is equivalent to a single dtype." -6329,serialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,615,function, -6330,deserialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,624,function, -6331,PolicyTest,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy_test.py,40,class,Tests Policies. -6332,create_identity_with_grad_check_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,32,function,"Returns a function that asserts it's gradient has a certain value. +7054,serialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,615,function, +7055,deserialize,tensorflow/tensorflow/python/keras/mixed_precision/experimental/policy.py,624,function, +7056,create_identity_with_grad_check_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,32,function,"Returns a function that asserts it's gradient has a certain value. This serves as a hook to assert intermediate gradients have a certain value. This returns an identity function. The identity's gradient function is also @@ -49986,7 +58629,7 @@ Args: Returns: An identity function whose gradient function asserts the gradient has a certain value." -6333,create_identity_with_nan_gradients_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,76,function,"Returns a function that optionally has NaN gradients. +7057,create_identity_with_nan_gradients_fn,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,76,function,"Returns a function that optionally has NaN gradients. This serves as a hook to introduce NaN gradients to a model. This returns an identity function. The identity's gradient function will check if the boolean @@ -50000,10 +58643,15 @@ Args: Returns: An identity function whose gradient function will return NaNs, if `have_nan_gradients` is True." -6334,AssertTypeLayer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,110,class,A layer which asserts it's inputs are a certain type. -6335,MultiplyLayer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,128,class,A layer which multiplies its input by a scalar variable. -6336,IdentityRegularizer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,180,class, -6337,Adadelta,tensorflow/tensorflow/python/keras/optimizer_v2/adadelta.py,32,class,"Optimizer that implements the Adadelta algorithm. +7058,AssertTypeLayer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,110,class,A layer which asserts it's inputs are a certain type. +7059,assert_input_types,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,118,method,Asserts `inputs` are of the correct type. Should be called in call(). +7060,MultiplyLayer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,128,class,A layer which multiplies its input by a scalar variable. +7061,build,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,155,method, +7062,call,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,160,method, +7063,get_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,171,method, +7064,IdentityRegularizer,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,180,class, +7065,get_config,tensorflow/tensorflow/python/keras/mixed_precision/experimental/test_util.py,186,method, +7066,Adadelta,tensorflow/tensorflow/python/keras/optimizer_v2/adadelta.py,32,class,"Optimizer that implements the Adadelta algorithm. Adadelta optimization is a stochastic gradient descent method that is based on adaptive learning rate per dimension to address two drawbacks: @@ -50047,8 +58695,9 @@ Args: Reference: - [Zeiler, 2012](http://arxiv.org/abs/1212.5701)" -6338,AdadeltaOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/adadelta_test.py,42,class, -6339,Adagrad,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad.py,34,class,"Optimizer that implements the Adagrad algorithm. +7067,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/adadelta.py,107,method, +7068,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/adadelta.py,151,method, +7069,Adagrad,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad.py,34,class,"Optimizer that implements the Adagrad algorithm. Adagrad is an optimizer with parameter-specific learning rates, which are adapted relative to how frequently a parameter gets @@ -50071,10 +58720,25 @@ Args: Reference: - [Duchi et al., 2011]( http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)." -6340,adagrad_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad_test.py,45,function, -6341,sparse_adagrad_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad_test.py,51,function, -6342,AdagradOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad_test.py,72,class, -6343,Adam,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,34,class,"Optimizer that implements the Adam algorithm. +7070,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad.py,94,method, +7071,from_config,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad.py,104,method,"Creates an optimizer from its config. + +This method is the reverse of `get_config`, +capable of instantiating the same optimizer from the config +dictionary. + +Arguments: + config: A Python dictionary, typically the output of get_config. + custom_objects: A Python dictionary mapping names to additional Python + objects used to create this optimizer, such as a function used for a + hyperparameter. + +Returns: + An optimizer instance." +7072,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad.py,155,method, +7073,adagrad_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad_test.py,45,function, +7074,sparse_adagrad_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adagrad_test.py,51,function, +7075,Adam,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,34,class,"Optimizer that implements the Adam algorithm. Adam optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments. @@ -50142,7 +58806,9 @@ to zero). Momentum decay (beta1) is also applied to the entire momentum accumulator. This means that the sparse behavior is equivalent to the dense behavior (in contrast to some momentum implementations which ignore momentum unless a variable slice was actually used)." -6344,NonFusedAdam,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,255,class,"Optimizer that implements the Adam algorithm without fused kernels. +7076,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,155,method, +7077,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,242,method, +7078,NonFusedAdam,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,255,class,"Optimizer that implements the Adam algorithm without fused kernels. Adam optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments. @@ -50212,13 +58878,13 @@ Usage: >>> # The first step is `-learning_rate*sign(grad)` >>> var1.numpy() 9.9" -6345,adam_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,38,function, -6346,adam_update_numpy_amsgrad,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,56,function, -6347,adam_sparse_update_numpy_amsgrad,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,76,function, -6348,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,102,function, -6349,AdamOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,111,class, -6350,NonFusedAdamOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,563,class, -6351,Adamax,tensorflow/tensorflow/python/keras/optimizer_v2/adamax.py,33,class,"Optimizer that implements the Adamax algorithm. +7079,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,407,method, +7080,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/adam.py,465,method, +7081,adam_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,38,function, +7082,adam_update_numpy_amsgrad,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,56,function, +7083,adam_sparse_update_numpy_amsgrad,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,76,function, +7084,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/adam_test.py,102,function, +7085,Adamax,tensorflow/tensorflow/python/keras/optimizer_v2/adamax.py,33,class,"Optimizer that implements the Adamax algorithm. It is a variant of Adam based on the infinity norm. Default parameters follow those provided in the paper. @@ -50272,11 +58938,11 @@ Args: Reference: - [Kingma et al., 2014](http://arxiv.org/abs/1412.6980)" -6352,adamax_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,36,function, -6353,adamax_sparse_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,51,function, -6354,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,72,function, -6355,AdamaxOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,79,class, -6356,Ftrl,tensorflow/tensorflow/python/keras/optimizer_v2/ftrl.py,30,class,"Optimizer that implements the FTRL algorithm. +7086,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/adamax.py,178,method, +7087,adamax_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,36,function, +7088,adamax_sparse_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,51,function, +7089,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/adamax_test.py,72,function, +7090,Ftrl,tensorflow/tensorflow/python/keras/optimizer_v2/ftrl.py,30,class,"Optimizer that implements the FTRL algorithm. See Algorithm 1 of this [paper]( https://www.eecs.tufts.edu/~dsculley/papers/ad-click-prediction.pdf). @@ -50310,8 +58976,8 @@ Args: Reference: - [paper]( https://www.eecs.tufts.edu/~dsculley/papers/ad-click-prediction.pdf)" -6357,FtrlOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/ftrl_test.py,35,class, -6358,SGD,tensorflow/tensorflow/python/keras/optimizer_v2/gradient_descent.py,30,class,"Gradient descent (with momentum) optimizer. +7091,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/ftrl.py,195,method, +7092,SGD,tensorflow/tensorflow/python/keras/optimizer_v2/gradient_descent.py,30,class,"Gradient descent (with momentum) optimizer. Update rule for parameter `w` with gradient `g` when `momentum` is 0: @@ -50379,15 +59045,22 @@ Usage: Reference: - For `nesterov=True`, See [Sutskever et al., 2013]( http://jmlr.org/proceedings/papers/v28/sutskever13.pdf)." -6359,GradientDescentOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/gradient_descent_test.py,40,class, -6360,MomentumOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/gradient_descent_test.py,295,class, -6361,LearningRateSchedule,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,34,class,"A serializable learning rate decay schedule. +7093,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/gradient_descent.py,186,method, +7094,LearningRateSchedule,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,34,class,"A serializable learning rate decay schedule. `LearningRateSchedule`s can be passed in as the learning rate of optimizers in `tf.keras.optimizers`. They can be serialized and deserialized using `tf.keras.optimizers.schedules.serialize` and `tf.keras.optimizers.schedules.deserialize`." -6362,ExponentialDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,65,class,"A LearningRateSchedule that uses an exponential decay schedule. +7095,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,48,method, +7096,from_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,52,method,"Instantiates a `LearningRateSchedule` from its config. + +Args: + config: Output of `get_config()`. + +Returns: + A `LearningRateSchedule` instance." +7097,ExponentialDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,65,class,"A LearningRateSchedule that uses an exponential decay schedule. When training a model, it is often recommended to lower the learning rate as the training progresses. This schedule applies an exponential decay function @@ -50435,7 +59108,8 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6363,PiecewiseConstantDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,170,class,"A LearningRateSchedule that uses a piecewise constant decay schedule. +7098,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,159,method, +7099,PiecewiseConstantDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,170,class,"A LearningRateSchedule that uses a piecewise constant decay schedule. The function returns a 1-arg callable to compute the piecewise constant when passed the current optimizer step. This can be useful for changing the @@ -50469,7 +59143,8 @@ Returns: is `values[0]` when `step <= boundaries[0]`, `values[1]` when `step > boundaries[0]` and `step <= boundaries[1]`, ..., and values[-1] when `step > boundaries[-1]`." -6364,PolynomialDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,272,class,"A LearningRateSchedule that uses a polynomial decay schedule. +7100,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,263,method, +7101,PolynomialDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,272,class,"A LearningRateSchedule that uses a polynomial decay schedule. It is commonly observed that a monotonically decreasing learning rate, whose degree of change is carefully chosen, results in a better performing model. @@ -50537,7 +59212,8 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6365,InverseTimeDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,416,class,"A LearningRateSchedule that uses an inverse time decay schedule. +7102,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,404,method, +7103,InverseTimeDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,416,class,"A LearningRateSchedule that uses an inverse time decay schedule. When training a model, it is often recommended to lower the learning rate as the training progresses. This schedule applies the inverse decay function @@ -50586,7 +59262,8 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6366,CosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,522,class,"A LearningRateSchedule that uses a cosine decay schedule. +7104,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,511,method, +7105,CosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,522,class,"A LearningRateSchedule that uses a cosine decay schedule. See [Loshchilov & Hutter, ICLR2016], SGDR: Stochastic Gradient Descent with Warm Restarts. https://arxiv.org/abs/1608.03983 @@ -50626,7 +59303,8 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6367,CosineDecayRestarts,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,615,class,"A LearningRateSchedule that uses a cosine decay schedule with restarts. +7106,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,605,method, +7107,CosineDecayRestarts,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,615,class,"A LearningRateSchedule that uses a cosine decay schedule with restarts. See [Loshchilov & Hutter, ICLR2016], SGDR: Stochastic Gradient Descent with Warm Restarts. https://arxiv.org/abs/1608.03983 @@ -50664,7 +59342,9 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6368,LinearCosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,741,class,"A LearningRateSchedule that uses a linear cosine decay schedule. +7108,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,729,method, +7109,compute_step,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,701,method,Helper for `cond` operation. +7110,LinearCosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,741,class,"A LearningRateSchedule that uses a linear cosine decay schedule. See [Bello et al., ICML2017] Neural Optimizer Search with RL. https://arxiv.org/abs/1709.07417 @@ -50714,7 +59394,8 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6369,NoisyLinearCosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,859,class,"A LearningRateSchedule that uses a noisy linear cosine decay schedule. +7111,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,847,method, +7112,NoisyLinearCosineDecay,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,859,class,"A LearningRateSchedule that uses a noisy linear cosine decay schedule. See [Bello et al., ICML2017] Neural Optimizer Search with RL. https://arxiv.org/abs/1709.07417 @@ -50766,19 +59447,10 @@ Returns: A 1-arg callable learning rate schedule that takes the current optimizer step and outputs the decayed learning rate, a scalar `Tensor` of the same type as `initial_learning_rate`." -6370,serialize,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,997,function, -6371,deserialize,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,1002,function, -6372,_maybe_serialized,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,38,function, -6373,LRDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,51,class, -6374,LinearDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,170,class, -6375,SqrtDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,224,class, -6376,PolynomialDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,288,class, -6377,InverseDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,307,class, -6378,CosineDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,342,class, -6379,CosineDecayRestartsTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,375,class, -6380,LinearCosineDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,439,class, -6381,NoisyLinearCosineDecayTestV2,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule_test.py,482,class, -6382,exponential_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,32,function,"Applies exponential decay to the learning rate. +7113,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,983,method, +7114,serialize,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,997,function, +7115,deserialize,tensorflow/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py,1002,function, +7116,exponential_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,32,function,"Applies exponential decay to the learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies an exponential decay function @@ -50837,7 +59509,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6383,piecewise_constant,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,108,function,"Piecewise constant from boundaries and interval values. +7117,piecewise_constant,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,108,function,"Piecewise constant from boundaries and interval values. Example: use a learning rate that's 1.0 for the first 100001 steps, 0.5 for the next 10000 steps, and 0.1 for any additional steps. @@ -50878,7 +59550,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6384,polynomial_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,185,function,"Applies a polynomial decay to the learning rate. +7118,polynomial_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,185,function,"Applies a polynomial decay to the learning rate. It is commonly observed that a monotonically decreasing learning rate, whose degree of change is carefully chosen, results in a better performing model. @@ -50955,7 +59627,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6385,natural_exp_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,286,function,"Applies natural exponential decay to the initial learning rate. +7119,natural_exp_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,286,function,"Applies natural exponential decay to the initial learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies an exponential decay function @@ -51020,7 +59692,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6386,inverse_time_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,374,function,"Applies inverse time decay to the initial learning rate. +7120,inverse_time_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,374,function,"Applies inverse time decay to the initial learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies an inverse decay function @@ -51085,7 +59757,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6387,cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,457,function,"Applies cosine decay to the learning rate. +7121,cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,457,function,"Applies cosine decay to the learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies a cosine decay function @@ -51135,7 +59807,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6388,cosine_decay_restarts,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,520,function,"Applies cosine decay with restarts to the learning rate. +7122,cosine_decay_restarts,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,520,function,"Applies cosine decay with restarts to the learning rate. When training a model, it is often recommended to lower the learning rate as the training progresses. This function applies a cosine decay function with @@ -51188,7 +59860,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6389,linear_cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,597,function,"Applies linear cosine decay to the learning rate. +7123,linear_cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,597,function,"Applies linear cosine decay to the learning rate. Note that linear cosine decay is more aggressive than cosine decay and larger initial learning rates can typically be used. @@ -51249,7 +59921,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6390,noisy_linear_cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,682,function,"Applies noisy linear cosine decay to the learning rate. +7124,noisy_linear_cosine_decay,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay.py,682,function,"Applies noisy linear cosine decay to the learning rate. Note that linear cosine decay is more aggressive than cosine decay and larger initial learning rates can typically be used. @@ -51316,17 +59988,7 @@ When eager execution is enabled, this function returns a function which in turn returns the decayed learning rate Tensor. This can be useful for changing the learning rate value across different invocations of optimizer functions. @end_compatibility" -6391,LRDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,33,class, -6392,LinearDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,147,class, -6393,SqrtDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,192,class, -6394,PolynomialDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,246,class, -6395,ExponentialDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,259,class, -6396,InverseDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,291,class, -6397,CosineDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,323,class, -6398,CosineDecayRestartsTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,352,class, -6399,LinearCosineDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,410,class, -6400,NoisyLinearCosineDecayTest,tensorflow/tensorflow/python/keras/optimizer_v2/legacy_learning_rate_decay_test.py,450,class, -6401,Nadam,tensorflow/tensorflow/python/keras/optimizer_v2/nadam.py,34,class,"Optimizer that implements the NAdam algorithm. +7125,Nadam,tensorflow/tensorflow/python/keras/optimizer_v2/nadam.py,34,class,"Optimizer that implements the NAdam algorithm. Much like Adam is essentially RMSprop with momentum, Nadam is Adam with Nesterov momentum. @@ -51347,22 +60009,11 @@ Args: Reference: - [Dozat, 2015](http://cs229.stanford.edu/proj2015/054_report.pdf)." -6402,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,32,function, -6403,update_m_cache,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,41,function, -6404,nadam_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,47,function, -6405,NadamOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,73,class, -6406,_deduplicate_indexed_slices,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,59,function,"Sums `values` associated with any non-unique `indices`. - -Args: - values: A `Tensor` with rank >= 1. - indices: A one-dimensional integer `Tensor`, indexing into the first - dimension of `values` (as in an IndexedSlices object). - -Returns: - A tuple of (`summed_values`, `unique_indices`) where `unique_indices` is a - de-duplicated version of `indices` and `summed_values` contains the sum of - `values` slices associated with each unique index." -6407,OptimizerV2,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,81,class,"Base class for Keras optimizers. +7126,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/nadam.py,206,method, +7127,get_beta_accumulators,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,32,function, +7128,update_m_cache,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,41,function, +7129,nadam_update_numpy,tensorflow/tensorflow/python/keras/optimizer_v2/nadam_test.py,47,function, +7130,OptimizerV2,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,81,class,"Base class for Keras optimizers. You should not use this class directly, but instead instantiate one of its subclasses such as `tf.keras.optimizers.SGD`, `tf.keras.optimizers.Adam`, etc. @@ -51545,32 +60196,173 @@ this class and override the following methods: (if your optimizer algorithm requires additional variables) - `get_config` (serialization of the optimizer, include all hyper parameters)" -6408,_filter_grads,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1262,function,Filter out iterable with grad equal to None. -6409,_var_key,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1285,function,"Key for representing a primary variable, for looking up slots. +7131,minimize,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,348,method,"Minimize `loss` by updating `var_list`. -In graph mode the name is derived from the var shared name. -In eager mode the name is derived from the var unique id. -If distribution strategy exists, get the primary variable first. +This method simply computes gradient using `tf.GradientTape` and calls +`apply_gradients()`. If you want to process the gradient before applying +then call `tf.GradientTape` and `apply_gradients()` explicitly instead +of using this function. Args: - var: the variable. + loss: A callable taking no arguments which returns the value to minimize. + var_list: list or tuple of `Variable` objects to update to minimize + `loss`, or a callable returning the list or tuple of `Variable` objects. + Use callable when the variable list would otherwise be incomplete before + `minimize` since the variables are created at the first time `loss` is + called. + grad_loss: Optional. A `Tensor` holding the gradient computed for `loss`. + name: Optional name for the returned operation. Returns: - the unique name of the variable." -6410,_get_slot_key_from_var,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1308,function,Get the slot key for the variable: var_name/slot_name. -6411,RestoredOptimizer,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1315,class,"A non-functional Optimizer implementation for checkpoint compatibility. + An `Operation` that updates the variables in `var_list`. The `iterations` + will be automatically increased by 1. + +Raises: + ValueError: If some of the variables are not `Variable` objects." +7132,get_gradients,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,445,method,"Returns gradients of `loss` with respect to `params`. + +Arguments: + loss: Loss tensor. + params: List of variables. + +Returns: + List of gradient tensors. + +Raises: + ValueError: In case any gradient cannot be computed (e.g. if gradient + function not implemented)." +7133,apply_gradients,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,473,method,"Apply gradients to variables. + +This is the second part of `minimize()`. It returns an `Operation` that +applies gradients. + +The method sums gradients from all replicas in the presence of +`tf.distribute.Strategy` by default. You can aggregate gradients yourself by +passing `experimental_aggregate_gradients=False`. + +Example: + +```python +grads = tape.gradient(loss, vars) +grads = tf.distribute.get_replica_context().all_reduce('sum', grads) +# Processing aggregated gradients. +optimizer.apply_gradients(zip(grads, vars), + experimental_aggregate_gradients=False) + +``` + +Args: + grads_and_vars: List of (gradient, variable) pairs. + name: Optional name for the returned operation. Default to the name passed + to the `Optimizer` constructor. + experimental_aggregate_gradients: Whether to sum gradients from different + replicas in the presense of `tf.distribute.Strategy`. If False, it's + user responsibility to aggregate the gradients. Default to True. + +Returns: + An `Operation` that applies the specified gradients. The `iterations` + will be automatically increased by 1. + +Raises: + TypeError: If `grads_and_vars` is malformed. + ValueError: If none of the variables have gradients." +7134,get_updates,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,647,method, +7135,get_slot_names,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,731,method,A list of names for this optimizer's slots. +7136,add_slot,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,735,method,Add a new slot variable for `var`. +7137,get_slot,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,773,method, +7138,iterations,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,830,method,Variable. The number of training steps this Optimizer has run. +7139,iterations,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,844,method, +7140,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,864,method,"Returns the config of the optimizer. + +An optimizer config is a Python dictionary (serializable) +containing the configuration of an optimizer. +The same optimizer can be reinstantiated later +(without any saved state) from this configuration. + +Returns: + Python dictionary." +7141,from_config,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,883,method,"Creates an optimizer from its config. + +This method is the reverse of `get_config`, +capable of instantiating the same optimizer from the config +dictionary. + +Arguments: + config: A Python dictionary, typically the output of get_config. + custom_objects: A Python dictionary mapping names to additional Python + objects used to create this optimizer, such as a function used for a + hyperparameter. + +Returns: + An optimizer instance." +7142,variables,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,918,method,Returns variables of this Optimizer based on the order created. +7143,weights,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,923,method,Returns variables of this Optimizer based on the order created. +7144,get_weights,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,927,method,"Returns the current weights of the optimizer. + +The weights of an optimizer are its state (ie, variables). +This function returns the weight values associated with this +optimizer as a list of Numpy arrays. The first value is always the +iterations count of the optimizer, followed by the optimizer's state +variables in the order they were created. The returned list can in turn +be used to load state into similarly parameterized optimizers. + +For example, the RMSprop optimizer for this simple model returns a list of +three values-- the iteration count, followed by the root-mean-square value +of the kernel and bias of the single Dense layer: + +>>> opt = tf.keras.optimizers.RMSprop() +>>> m = tf.keras.models.Sequential([tf.keras.layers.Dense(10)]) +>>> m.compile(opt, loss='mse') +>>> data = np.arange(100).reshape(5, 20) +>>> labels = np.zeros(5) +>>> print('Training'); results = m.fit(data, labels) +Training ... +>>> len(opt.get_weights()) +3 + +Returns: + Weights values as a list of numpy arrays." +7145,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,958,method,"Set the weights of the optimizer. + +The weights of an optimizer are its state (ie, variables). +This function takes the weight values associated with this +optimizer as a list of Numpy arrays. The first value is always the +iterations count of the optimizer, followed by the optimizer's state +variables in the order they are created. The passed values are used to set +the new state of the optimizer. + +For example, the RMSprop optimizer for this simple model takes a list of +three values-- the iteration count, followed by the root-mean-square value +of the kernel and bias of the single Dense layer: + +>>> opt = tf.keras.optimizers.RMSprop() +>>> m = tf.keras.models.Sequential([tf.keras.layers.Dense(10)]) +>>> m.compile(opt, loss='mse') +>>> data = np.arange(100).reshape(5, 20) +>>> labels = np.zeros(5) +>>> print('Training'); results = m.fit(data, labels) +Training ... +>>> new_weights = [np.array(10), np.ones([20, 10]), np.zeros([10])] +>>> opt.set_weights(new_weights) +>>> opt.iterations + + +Arguments: + weights: weight values as a list of numpy arrays." +7146,add_weight,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1006,method, +7147,all_reduce_fn,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,563,method, +7148,apply_grad_to_update_var,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,591,method,Apply gradient to variable. +7149,RestoredOptimizer,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1315,class,"A non-functional Optimizer implementation for checkpoint compatibility. Holds slot variables and hyperparameters when an optimizer is restored from a SavedModel. These variables may be referenced in functions along with ops created by the original optimizer, but currently we do not support using the optimizer object iself (e.g. through `apply_gradients`)." -6412,OptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,71,class, -6413,OptimizersCompatibilityTest,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,667,class, -6414,OptimizerWithFunctionTest,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,859,class, -6415,get_inputs,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,928,function, -6416,strip_name,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,935,function, -6417,topological_sort,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,941,function, -6418,identify_redundant_ops,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,981,function,"Implements basic common subexpression elimination. +7150,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2.py,1330,method, +7151,get_inputs,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,928,function, +7152,strip_name,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,935,function, +7153,topological_sort,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,941,function, +7154,identify_redundant_ops,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,981,function,"Implements basic common subexpression elimination. This is not intended to replicate the graph semantics of TensorFlow Graphs (for instance it does not handle stateful op ordering), nor is it intended to @@ -51583,7 +60375,7 @@ Args: Returns: A count of the duplicate ops and a description of the structure of each." -6419,make_model,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,1064,function,"Constructs a simple ensemble of weak learners model. +7155,make_model,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,1064,function,"Constructs a simple ensemble of weak learners model. --------- --------- --------- --------- | Input | | Input | ... | Input | | Input | @@ -51611,8 +60403,7 @@ paths. Returns: A model for testing optimizer coefficient reuse." -6420,OptimizerCoefficientTest,tensorflow/tensorflow/python/keras/optimizer_v2/optimizer_v2_test.py,1130,class, -6421,RMSprop,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop.py,35,class,"Optimizer that implements the RMSprop algorithm. +7156,RMSprop,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop.py,35,class,"Optimizer that implements the RMSprop algorithm. The gist of RMSprop is to: @@ -51670,9 +60461,9 @@ Usage: Reference: - [Hinton, 2012]( http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)" -6422,RMSpropOptimizerTest,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop_test.py,62,class, -6423,SlotColocationTest,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop_test.py,552,class, -6424,LinearModel,tensorflow/tensorflow/python/keras/premade/linear.py,32,class,"Linear Model for regression and classification problems. +7157,set_weights,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop.py,279,method, +7158,get_config,tensorflow/tensorflow/python/keras/optimizer_v2/rmsprop.py,288,method, +7159,LinearModel,tensorflow/tensorflow/python/keras/premade/linear.py,32,class,"Linear Model for regression and classification problems. This model approximates the following function: $$y = \beta + \sum_{i=1}^{N} w_{i} * x_{i}$$ @@ -51699,8 +60490,11 @@ with tf.GradientTape() as tape: grads = tape.gradient(loss, model.weights) opt.apply_gradients(zip(grads, model.weights)) ```" -6425,LinearModelTest,tensorflow/tensorflow/python/keras/premade/linear_test.py,44,class, -6426,WideDeepModel,tensorflow/tensorflow/python/keras/premade/wide_deep.py,34,class,"Wide & Deep Model for regression and classification problems. +7160,build,tensorflow/tensorflow/python/keras/premade/linear.py,98,method, +7161,call,tensorflow/tensorflow/python/keras/premade/linear.py,129,method, +7162,get_config,tensorflow/tensorflow/python/keras/premade/linear.py,149,method, +7163,from_config,tensorflow/tensorflow/python/keras/premade/linear.py,163,method, +7164,WideDeepModel,tensorflow/tensorflow/python/keras/premade/wide_deep.py,34,class,"Wide & Deep Model for regression and classification problems. This model jointly train a linear and a dnn model. @@ -51736,8 +60530,11 @@ combined_model = WideDeepModel(linear_model, dnn_model) combined_model.compile(optimizer=['sgd', 'adam'], 'mse', ['mse']) combined_model.fit([linear_inputs, dnn_inputs], y, epochs) ```" -6427,WideDeepModelTest,tensorflow/tensorflow/python/keras/premade/wide_deep_test.py,41,class, -6428,index_directory,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,31,function,"Make list of all files in the subdirs of `directory`, with their labels. +7165,call,tensorflow/tensorflow/python/keras/premade/wide_deep.py,93,method, +7166,train_step,tensorflow/tensorflow/python/keras/premade/wide_deep.py,112,method, +7167,get_config,tensorflow/tensorflow/python/keras/premade/wide_deep.py,196,method, +7168,from_config,tensorflow/tensorflow/python/keras/premade/wide_deep.py,208,method, +7169,index_directory,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,31,function,"Make list of all files in the subdirs of `directory`, with their labels. Args: directory: The target directory (string). @@ -51762,8 +60559,8 @@ Returns: file_paths: list of file paths (strings). labels: list of matching integer labels (same length as file_paths) class_names: names of the classes corresponding to these labels, in order." -6429,iter_valid_files,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,123,function, -6430,index_subdirectory,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,131,function,"Recursively walks directory and list image paths and their class index. +7170,iter_valid_files,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,123,function, +7171,index_subdirectory,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,131,function,"Recursively walks directory and list image paths and their class index. Arguments: directory: string, target directory. @@ -51776,7 +60573,7 @@ Returns: tuple `(filenames, labels)`. `filenames` is a list of relative file paths, and `labels` is a list of integer labels corresponding to these files." -6431,get_training_or_validation_split,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,159,function,"Potentially restict samples & labels to a training or validation split. +7172,get_training_or_validation_split,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,159,function,"Potentially restict samples & labels to a training or validation split. Args: samples: List of elements. @@ -51788,9 +60585,9 @@ Args: Returns: tuple (samples, labels), potentially restricted to the specified subset." -6432,labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,191,function, -6433,check_validation_split_arg,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,201,function,Raise errors in case of invalid argument values. -6434,smart_resize,tensorflow/tensorflow/python/keras/preprocessing/image.py,55,function,"Resize images to a target size without aspect ratio distortion. +7173,labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,191,function, +7174,check_validation_split_arg,tensorflow/tensorflow/python/keras/preprocessing/dataset_utils.py,201,function,Raise errors in case of invalid argument values. +7175,smart_resize,tensorflow/tensorflow/python/keras/preprocessing/image.py,55,function,"Resize images to a target size without aspect ratio distortion. TensorFlow image datasets typically yield images that have each a different size. However, these images need to be batched before they can be @@ -51844,7 +60641,7 @@ Returns: Array with shape `(size[0], size[1], channels)`. If the input image was a NumPy array, the output is a NumPy array, and if it was a TF tensor, the output is a TF tensor." -6435,array_to_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,152,function,"Converts a 3D Numpy array to a PIL Image instance. +7176,array_to_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,152,function,"Converts a 3D Numpy array to a PIL Image instance. Usage: @@ -51873,7 +60670,7 @@ Returns: Raises: ImportError: if PIL is not available. ValueError: if invalid `x` or `data_format` is passed." -6436,img_to_array,tensorflow/tensorflow/python/keras/preprocessing/image.py,195,function,"Converts a PIL Image instance to a Numpy array. +7177,img_to_array,tensorflow/tensorflow/python/keras/preprocessing/image.py,195,function,"Converts a PIL Image instance to a Numpy array. Usage: @@ -51900,7 +60697,7 @@ Returns: Raises: ValueError: if invalid `img` or `data_format` is passed." -6437,save_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,236,function,"Saves an image stored as a Numpy array to a path or file object. +7178,save_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,236,function,"Saves an image stored as a Numpy array to a path or file object. Arguments: path: Path or file object. @@ -51913,7 +60710,7 @@ Arguments: parameter should always be used. scale: Whether to rescale image values to be within `[0, 255]`. **kwargs: Additional keyword arguments passed to `PIL.Image.save()`." -6438,load_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,265,function,"Loads an image into PIL format. +7179,load_img,tensorflow/tensorflow/python/keras/preprocessing/image.py,265,function,"Loads an image into PIL format. Usage: @@ -51944,8 +60741,8 @@ Returns: Raises: ImportError: if PIL is not available. ValueError: if interpolation method is not supported." -6439,Iterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,304,class, -6440,DirectoryIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,309,class,"Iterator capable of reading images from a directory on disk. +7180,Iterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,304,class, +7181,DirectoryIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,309,class,"Iterator capable of reading images from a directory on disk. Arguments: directory: Path to the directory to read images from. @@ -51989,7 +60786,7 @@ Arguments: supported. If PIL version 3.4.0 or newer is installed, ""box"" and ""hamming"" are also supported. By default, ""nearest"" is used. dtype: Dtype to use for generated arrays." -6441,NumpyArrayIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,400,class,"Iterator yielding data from a Numpy array. +7182,NumpyArrayIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,400,class,"Iterator yielding data from a Numpy array. Arguments: x: Numpy array of input data or tuple. @@ -52016,7 +60813,7 @@ Arguments: subset: Subset of data (`""training""` or `""validation""`) if validation_split is set in ImageDataGenerator. dtype: Dtype to use for the generated arrays." -6442,DataFrameIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,463,class,"Iterator capable of reading images from a directory on disk as a dataframe. +7183,DataFrameIterator,tensorflow/tensorflow/python/keras/preprocessing/image.py,463,class,"Iterator capable of reading images from a directory on disk as a dataframe. Arguments: dataframe: Pandas dataframe containing the filepaths relative to @@ -52082,7 +60879,7 @@ Arguments: `x_col`. If `True`, invalid images will be ignored. Disabling this option can lead to speed-up in the instantiation of this class. Default: `True`." -6443,ImageDataGenerator,tensorflow/tensorflow/python/keras/preprocessing/image.py,581,class,"Generate batches of tensor image data with real-time data augmentation. +7184,ImageDataGenerator,tensorflow/tensorflow/python/keras/preprocessing/image.py,581,class,"Generate batches of tensor image data with real-time data augmentation. The data will be looped over (in batches). @@ -52250,7 +61047,179 @@ model.fit( steps_per_epoch=2000, epochs=50) ```" -6444,image_dataset_from_directory,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,35,function,"Generates a `tf.data.Dataset` from image files in a directory. +7185,flow,tensorflow/tensorflow/python/keras/preprocessing/image.py,807,method,"Takes data & label arrays, generates batches of augmented data. + +Arguments: + x: Input data. Numpy array of rank 4 or a tuple. If tuple, the first + element should contain the images and the second element another numpy + array or a list of numpy arrays that gets passed to the output without + any modifications. Can be used to feed the model miscellaneous data + along with the images. In case of grayscale data, the channels axis of + the image array should have value 1, in case of RGB data, it should + have value 3, and in case of RGBA data, it should have value 4. + y: Labels. + batch_size: Int (default: 32). + shuffle: Boolean (default: True). + sample_weight: Sample weights. + seed: Int (default: None). + save_to_dir: None or str (default: None). This allows you to optionally + specify a directory to which to save the augmented pictures being + generated (useful for visualizing what you are doing). + save_prefix: Str (default: `''`). Prefix to use for filenames of saved + pictures (only relevant if `save_to_dir` is set). + save_format: one of ""png"", ""jpeg"" + (only relevant if `save_to_dir` is set). Default: ""png"". + subset: Subset of data (`""training""` or `""validation""`) if + `validation_split` is set in `ImageDataGenerator`. + +Returns: + An `Iterator` yielding tuples of `(x, y)` + where `x` is a numpy array of image data + (in the case of a single image input) or a list + of numpy arrays (in the case with + additional inputs) and `y` is a numpy array + of corresponding labels. If 'sample_weight' is not None, + the yielded tuples are of the form `(x, y, sample_weight)`. + If `y` is None, only the numpy array `x` is returned." +7186,flow_from_directory,tensorflow/tensorflow/python/keras/preprocessing/image.py,867,method,"Takes the path to a directory & generates batches of augmented data. + +Arguments: + directory: string, path to the target directory. It should contain one + subdirectory per class. Any PNG, JPG, BMP, PPM or TIF images inside + each of the subdirectories directory tree will be included in the + generator. See [this script]( + https://gist.github.com/fchollet/0830affa1f7f19fd47b06d4cf89ed44d) + for more details. + target_size: Tuple of integers `(height, width)`, defaults to `(256, + 256)`. The dimensions to which all images found will be resized. + color_mode: One of ""grayscale"", ""rgb"", ""rgba"". Default: ""rgb"". Whether + the images will be converted to have 1, 3, or 4 channels. + classes: Optional list of class subdirectories + (e.g. `['dogs', 'cats']`). Default: None. If not provided, the list + of classes will be automatically inferred from the subdirectory + names/structure under `directory`, where each subdirectory will be + treated as a different class (and the order of the classes, which + will map to the label indices, will be alphanumeric). The + dictionary containing the mapping from class names to class + indices can be obtained via the attribute `class_indices`. + class_mode: One of ""categorical"", ""binary"", ""sparse"", + ""input"", or None. Default: ""categorical"". + Determines the type of label arrays that are returned: - + ""categorical"" will be 2D one-hot encoded labels, - ""binary"" will + be 1D binary labels, ""sparse"" will be 1D integer labels, - ""input"" + will be images identical to input images (mainly used to work with + autoencoders). - If None, no labels are returned (the generator + will only yield batches of image data, which is useful to use with + `model.predict()`). Please note that in case of + class_mode None, the data still needs to reside in a subdirectory + of `directory` for it to work correctly. + batch_size: Size of the batches of data (default: 32). + shuffle: Whether to shuffle the data (default: True) If set to False, + sorts the data in alphanumeric order. + seed: Optional random seed for shuffling and transformations. + save_to_dir: None or str (default: None). This allows you to optionally + specify a directory to which to save the augmented pictures being + generated (useful for visualizing what you are doing). + save_prefix: Str. Prefix to use for filenames of saved pictures (only + relevant if `save_to_dir` is set). + save_format: One of ""png"", ""jpeg"" + (only relevant if `save_to_dir` is set). Default: ""png"". + follow_links: Whether to follow symlinks inside + class subdirectories (default: False). + subset: Subset of data (`""training""` or `""validation""`) if + `validation_split` is set in `ImageDataGenerator`. + interpolation: Interpolation method used to resample the image if the + target size is different from that of the loaded image. Supported + methods are `""nearest""`, `""bilinear""`, and `""bicubic""`. If PIL version + 1.1.3 or newer is installed, `""lanczos""` is also supported. If PIL + version 3.4.0 or newer is installed, `""box""` and `""hamming""` are also + supported. By default, `""nearest""` is used. + +Returns: + A `DirectoryIterator` yielding tuples of `(x, y)` + where `x` is a numpy array containing a batch + of images with shape `(batch_size, *target_size, channels)` + and `y` is a numpy array of corresponding labels." +7187,flow_from_dataframe,tensorflow/tensorflow/python/keras/preprocessing/image.py,960,method,"Takes the dataframe and the path to a directory + generates batches. + + The generated batches contain augmented/normalized data. + +**A simple tutorial can be found **[here]( + http://bit.ly/keras_flow_from_dataframe). + +Arguments: + dataframe: Pandas dataframe containing the filepaths relative to + `directory` (or absolute paths if `directory` is None) of the images + in a string column. It should include other column/s + depending on the `class_mode`: - if `class_mode` is `""categorical""` + (default value) it must include the `y_col` column with the + class/es of each image. Values in column can be string/list/tuple + if a single class or list/tuple if multiple classes. - if + `class_mode` is `""binary""` or `""sparse""` it must include the given + `y_col` column with class values as strings. - if `class_mode` is + `""raw""` or `""multi_output""` it should contain the columns + specified in `y_col`. - if `class_mode` is `""input""` or `None` no + extra column is needed. + directory: string, path to the directory to read images from. If `None`, + data in `x_col` column should be absolute paths. + x_col: string, column in `dataframe` that contains the filenames (or + absolute paths if `directory` is `None`). + y_col: string or list, column/s in `dataframe` that has the target data. + weight_col: string, column in `dataframe` that contains the sample + weights. Default: `None`. + target_size: tuple of integers `(height, width)`, default: `(256, 256)`. + The dimensions to which all images found will be resized. + color_mode: one of ""grayscale"", ""rgb"", ""rgba"". Default: ""rgb"". Whether + the images will be converted to have 1 or 3 color channels. + classes: optional list of classes (e.g. `['dogs', 'cats']`). Default is + None. If not provided, the list of classes will be automatically + inferred from the `y_col`, which will map to the label indices, will + be alphanumeric). The dictionary containing the mapping from class + names to class indices can be obtained via the attribute + `class_indices`. + class_mode: one of ""binary"", ""categorical"", ""input"", ""multi_output"", + ""raw"", sparse"" or None. Default: ""categorical"". + Mode for yielding the targets: + - `""binary""`: 1D numpy array of binary labels, + - `""categorical""`: 2D numpy array of one-hot encoded labels. + Supports multi-label output. + - `""input""`: images identical to input images (mainly used to work + with autoencoders), + - `""multi_output""`: list with the values of the different columns, + - `""raw""`: numpy array of values in `y_col` column(s), + - `""sparse""`: 1D numpy array of integer labels, - `None`, no targets + are returned (the generator will only yield batches of image data, + which is useful to use in `model.predict()`). + batch_size: size of the batches of data (default: 32). + shuffle: whether to shuffle the data (default: True) + seed: optional random seed for shuffling and transformations. + save_to_dir: None or str (default: None). This allows you to optionally + specify a directory to which to save the augmented pictures being + generated (useful for visualizing what you are doing). + save_prefix: str. Prefix to use for filenames of saved pictures (only + relevant if `save_to_dir` is set). + save_format: one of ""png"", ""jpeg"" + (only relevant if `save_to_dir` is set). Default: ""png"". + subset: Subset of data (`""training""` or `""validation""`) if + `validation_split` is set in `ImageDataGenerator`. + interpolation: Interpolation method used to resample the image if the + target size is different from that of the loaded image. Supported + methods are `""nearest""`, `""bilinear""`, and `""bicubic""`. If PIL version + 1.1.3 or newer is installed, `""lanczos""` is also supported. If PIL + version 3.4.0 or newer is installed, `""box""` and `""hamming""` are also + supported. By default, `""nearest""` is used. + validate_filenames: Boolean, whether to validate image filenames in + `x_col`. If `True`, invalid images will be ignored. Disabling this + option can lead to speed-up in the execution of this function. + Defaults to `True`. + **kwargs: legacy arguments for raising deprecation warnings. + +Returns: + A `DataFrameIterator` yielding tuples of `(x, y)` + where `x` is a numpy array containing a batch + of images with shape `(batch_size, *target_size, channels)` + and `y` is a numpy array of corresponding labels." +7188,image_dataset_from_directory,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,35,function,"Generates a `tf.data.Dataset` from image files in a directory. If your directory structure is: @@ -52343,12 +61312,9 @@ Rules regarding number of channels in the yielded images: there are 3 channel in the image tensors. - if `color_mode` is `rgba`, there are 4 channel in the image tensors." -6445,paths_and_labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,209,function,Constructs a dataset of images and labels. -6446,path_to_image,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,227,function, -6447,ImageDatasetFromDirectoryTest,tensorflow/tensorflow/python/keras/preprocessing/image_dataset_test.py,39,class, -6448,_generate_test_images,tensorflow/tensorflow/python/keras/preprocessing/image_test.py,41,function, -6449,TestImage,tensorflow/tensorflow/python/keras/preprocessing/image_test.py,59,class, -6450,TimeseriesGenerator,tensorflow/tensorflow/python/keras/preprocessing/sequence.py,34,class,"Utility class for generating batches of temporal data. +7189,paths_and_labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,209,function,Constructs a dataset of images and labels. +7190,path_to_image,tensorflow/tensorflow/python/keras/preprocessing/image_dataset.py,227,function, +7191,TimeseriesGenerator,tensorflow/tensorflow/python/keras/preprocessing/sequence.py,34,class,"Utility class for generating batches of temporal data. This class takes in a sequence of data-points gathered at equal intervals, along with time series parameters such as @@ -52401,7 +61367,7 @@ assert np.array_equal(x, assert np.array_equal(y, np.array([[10], [11]])) ```" -6451,pad_sequences,tensorflow/tensorflow/python/keras/preprocessing/sequence.py,93,function,"Pads sequences to the same length. +7192,pad_sequences,tensorflow/tensorflow/python/keras/preprocessing/sequence.py,93,function,"Pads sequences to the same length. This function transforms a list (of length `num_samples`) of sequences (lists of integers) @@ -52461,8 +61427,7 @@ Returns: Raises: ValueError: In case of invalid values for `truncating` or `padding`, or in case of invalid shape for a `sequences` entry." -6452,TestSequence,tensorflow/tensorflow/python/keras/preprocessing/sequence_test.py,29,class, -6453,text_to_word_sequence,tensorflow/tensorflow/python/keras/preprocessing/text.py,32,function,"Converts a text to a sequence of words (or tokens). +7193,text_to_word_sequence,tensorflow/tensorflow/python/keras/preprocessing/text.py,32,function,"Converts a text to a sequence of words (or tokens). This function transforms a string of text into a list of words while ignoring `filters` which include punctuations by default. @@ -52481,7 +61446,7 @@ Arguments: Returns: A list of words (or tokens)." -6454,one_hot,tensorflow/tensorflow/python/keras/preprocessing/text.py,61,function,"One-hot encodes a text into a list of word indexes of size `n`. +7194,one_hot,tensorflow/tensorflow/python/keras/preprocessing/text.py,61,function,"One-hot encodes a text into a list of word indexes of size `n`. This function receives as input a string of text and returns a list of encoded integers each corresponding to a word (or token) @@ -52499,7 +61464,7 @@ Arguments: Returns: List of integers in `[1, n]`. Each integer encodes a word (unicity non-guaranteed)." -6455,text_dataset_from_directory,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,30,function,"Generates a `tf.data.Dataset` from text files in a directory. +7195,text_dataset_from_directory,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,30,function,"Generates a `tf.data.Dataset` from text files in a directory. If your directory structure is: @@ -52574,11 +61539,9 @@ Rules regarding labels format: - if `label_mode` is `categorial`, the labels are a `float32` tensor of shape `(batch_size, num_classes)`, representing a one-hot encoding of the class index." -6456,paths_and_labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,171,function,Constructs a dataset of text strings and labels. -6457,path_to_string_content,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,186,function, -6458,TextDatasetFromDirectoryTest,tensorflow/tensorflow/python/keras/preprocessing/text_dataset_test.py,32,class, -6459,TestText,tensorflow/tensorflow/python/keras/preprocessing/text_test.py,28,class, -6460,timeseries_dataset_from_array,tensorflow/tensorflow/python/keras/preprocessing/timeseries.py,30,function,"Creates a dataset of sliding windows over a timeseries provided as array. +7196,paths_and_labels_to_dataset,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,171,function,Constructs a dataset of text strings and labels. +7197,path_to_string_content,tensorflow/tensorflow/python/keras/preprocessing/text_dataset.py,186,function, +7198,timeseries_dataset_from_array,tensorflow/tensorflow/python/keras/preprocessing/timeseries.py,30,function,"Creates a dataset of sliding windows over a timeseries provided as array. This function takes in a sequence of data-points gathered at equal intervals, along with time series parameters such as @@ -52654,9 +61617,8 @@ for batch in dataset: assert np.array_equal(targets[0], data[10]) # Corresponding target: step 10 break ```" -6461,sequences_from_indices,tensorflow/tensorflow/python/keras/preprocessing/timeseries.py,202,function, -6462,TimeseriesDatasetTest,tensorflow/tensorflow/python/keras/preprocessing/timeseries_test.py,28,class, -6463,save_model_to_hdf5,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,56,function,"Saves a model to a HDF5 file. +7199,sequences_from_indices,tensorflow/tensorflow/python/keras/preprocessing/timeseries.py,202,function, +7200,save_model_to_hdf5,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,56,function,"Saves a model to a HDF5 file. The saved model contains: - the model's configuration (topology) @@ -52679,7 +61641,7 @@ Arguments: Raises: ImportError: if h5py is not available." -6464,load_model_from_hdf5,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,133,function,"Loads a model saved via `save_model_to_hdf5`. +7201,load_model_from_hdf5,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,133,function,"Loads a model saved via `save_model_to_hdf5`. Arguments: filepath: One of the following: @@ -52702,7 +61664,7 @@ Returns: Raises: ImportError: if h5py is not available. ValueError: In case of an invalid savefile." -6465,preprocess_weights_for_loading,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,221,function,"Preprocess layer weights between different Keras formats. +7202,preprocess_weights_for_loading,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,221,function,"Preprocess layer weights between different Keras formats. Converts layers weights from Keras 1 format to Keras 2 and also weights of CuDNN layers in Keras 2. @@ -52716,46 +61678,24 @@ Arguments: Returns: A list of weights values (Numpy arrays)." -6466,_convert_rnn_weights,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,411,function,"Converts weights for RNN layers between native and CuDNN format. - -Input kernels for each gate are transposed and converted between Fortran -and C layout, recurrent kernels are transposed. For LSTM biases are summed/ -split in half, for GRU biases are reshaped. - -Weights can be converted in both directions between `LSTM` and`CuDNNSLTM` -and between `CuDNNGRU` and `GRU(reset_after=True)`. Default `GRU` is not -compatible with `CuDNNGRU`. - -For missing biases in `LSTM`/`GRU` (`use_bias=False`) no conversion is made. - -Arguments: - layer: Target layer instance. - weights: List of source weights values (input kernels, recurrent - kernels, [biases]) (Numpy arrays). - -Returns: - A list of converted weights values (Numpy arrays). - -Raises: - ValueError: for incompatible GRU layer/weights or incompatible biases" -6467,save_optimizer_weights_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,578,function,"Saves optimizer weights of a optimizer to a HDF5 group. +7203,save_optimizer_weights_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,578,function,"Saves optimizer weights of a optimizer to a HDF5 group. Arguments: hdf5_group: HDF5 group. optimizer: optimizer instance." -6468,load_optimizer_weights_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,602,function,"Load optimizer weights from a HDF5 group. +7204,load_optimizer_weights_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,602,function,"Load optimizer weights from a HDF5 group. Arguments: hdf5_group: A pointer to a HDF5 group. Returns: data: List of optimizer weight names." -6469,save_weights_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,617,function,"Saves the weights of a list of layers to a HDF5 group. +7205,save_weights_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,617,function,"Saves the weights of a list of layers to a HDF5 group. Arguments: f: HDF5 group. layers: List of layer instances." -6470,load_weights_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,648,function,"Implements topological (order-based) weight loading. +7206,load_weights_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,648,function,"Implements topological (order-based) weight loading. Arguments: f: A pointer to a HDF5 group. @@ -52764,7 +61704,7 @@ Arguments: Raises: ValueError: in case of mismatch between provided layers and weights file." -6471,load_weights_from_hdf5_group_by_name,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,711,function,"Implements name-based weight loading. +7207,load_weights_from_hdf5_group_by_name,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,711,function,"Implements name-based weight loading. (instead of topological weight loading). @@ -52780,7 +61720,7 @@ Arguments: Raises: ValueError: in case of mismatch between provided layers and weights file and skip_match=False." -6472,save_attributes_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,793,function,"Saves attributes (data) of the specified name into the HDF5 group. +7208,save_attributes_to_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,793,function,"Saves attributes (data) of the specified name into the HDF5 group. This method deals with an inherent problem of HDF5 file which is not able to store data larger than HDF5_OBJECT_HEADER_LIMIT bytes. @@ -52792,7 +61732,7 @@ Arguments: Raises: RuntimeError: If any single attribute is too large to be saved." -6473,load_attributes_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,835,function,"Loads attributes of the specified name from the HDF5 group. +7209,load_attributes_from_hdf5_group,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,835,function,"Loads attributes of the specified name from the HDF5 group. This method deals with an inherent problem of HDF5 file which is not able to store @@ -52804,44 +61744,19 @@ Arguments: Returns: data: Attributes data." -6474,_legacy_weights,tensorflow/tensorflow/python/keras/saving/hdf5_format.py,861,function,"DO NOT USE. - -For legacy reason, the layer.weights was in the order of -[self.trainable_weights + self.non_trainable_weights], and this order was -used for preserving the weights in h5 format. The new order of layer.weights -are the same as layer.get_weights() which is more intuitive for user. To -keep supporting the existing saved h5 file, this method should be used to -save/load weights. In future version, we will delete this method and -introduce a breaking change for h5 and stay with the new order for weights. - -Args: - layer: a `tf.keras.Model` or `tf.keras.layers.Layer` instance. - -Returns: - A list of variables with the order of trainable_weights, followed by - non_trainable_weights." -6475,TestWeightSavingAndLoading,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,58,class, -6476,TestWholeModelSaving,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,374,class, -6477,_make_graph_network,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,866,function, -6478,_make_sequential,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,873,function, -6479,_make_sequential_built,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,881,function, -6480,_make_sequential_graph_network,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,887,function, -6481,_make_sequential_input_shape,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,895,function, -6482,_make_subclassed,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,902,class, -6483,_make_subclassed_built,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,922,class, -6484,TestWholeModelSavingWithNesting,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,930,class,Tests saving a whole model that contains other models. -6485,SubclassedModel,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,973,class, -6486,TestWeightSavingAndLoadingTFFormat,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,984,class, -6487,DummySubclassModel,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,1274,class, -6488,MyMeanAbsoluteError,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,45,class, -6489,my_mae,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,55,function, -6490,_get_multi_io_model,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,59,function, -6491,LossesSerialization,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,117,class, -6492,MyMeanAbsoluteError,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,45,class, -6493,_my_mae,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,52,function, -6494,_get_multi_io_model,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,56,function, -6495,MetricsSerialization,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,150,class, -6496,model_from_config,tensorflow/tensorflow/python/keras/saving/model_config.py,35,function,"Instantiates a Keras model from its config. +7210,SubclassedModel,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,973,class, +7211,call,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,980,method, +7212,DummySubclassModel,tensorflow/tensorflow/python/keras/saving/hdf5_format_test.py,1274,class, +7213,MyMeanAbsoluteError,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,45,class, +7214,my_mae,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,55,function, +7215,LossesSerialization,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,117,class, +7216,setUp,tensorflow/tensorflow/python/keras/saving/losses_serialization_test.py,119,method, +7217,MyMeanAbsoluteError,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,45,class, +7218,MetricsSerialization,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,150,class, +7219,setUp,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,152,method, +7220,get_instance,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,163,method, +7221,get_instance,tensorflow/tensorflow/python/keras/saving/metrics_serialization_test.py,208,method, +7222,model_from_config,tensorflow/tensorflow/python/keras/saving/model_config.py,35,function,"Instantiates a Keras model from its config. Arguments: config: Configuration dictionary. @@ -52854,7 +61769,7 @@ Returns: Raises: TypeError: if `config` is not a dictionary." -6497,model_from_yaml,tensorflow/tensorflow/python/keras/saving/model_config.py,59,function,"Parses a yaml model configuration file and returns a model instance. +7223,model_from_yaml,tensorflow/tensorflow/python/keras/saving/model_config.py,59,function,"Parses a yaml model configuration file and returns a model instance. Usage: @@ -52879,7 +61794,7 @@ Returns: Raises: ImportError: if yaml module is not found." -6498,model_from_json,tensorflow/tensorflow/python/keras/saving/model_config.py,100,function,"Parses a JSON model configuration string and returns a model instance. +7224,model_from_json,tensorflow/tensorflow/python/keras/saving/model_config.py,100,function,"Parses a JSON model configuration string and returns a model instance. Usage: @@ -52897,7 +61812,7 @@ Arguments: Returns: A Keras model instance (uncompiled)." -6499,save_model,tensorflow/tensorflow/python/keras/saving/save.py,49,function,"Saves a model as a TensorFlow SavedModel or HDF5 file. +7225,save_model,tensorflow/tensorflow/python/keras/saving/save.py,49,function,"Saves a model as a TensorFlow SavedModel or HDF5 file. Usage: @@ -52951,7 +61866,7 @@ Arguments: Raises: ImportError: If save format is hdf5, and h5py is not available." -6500,load_model,tensorflow/tensorflow/python/keras/saving/save.py,139,function,"Loads a model saved via `model.save()`. +7226,load_model,tensorflow/tensorflow/python/keras/saving/save.py,139,function,"Loads a model saved via `model.save()`. Usage: @@ -52990,8 +61905,7 @@ Returns: Raises: ImportError: if loading from an hdf5 file and h5py is not available. IOError: In case of an invalid savefile." -6501,TestSaveModel,tensorflow/tensorflow/python/keras/saving/save_test.py,53,class, -6502,export_saved_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,69,function,"Exports a `tf.keras.Model` as a Tensorflow SavedModel. +7227,export_saved_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,69,function,"Exports a `tf.keras.Model` as a Tensorflow SavedModel. Note that at this time, subclassed models can only be saved using `serving_only=True`. @@ -53048,31 +61962,8 @@ Raises: False. ValueError: If the input signature cannot be inferred from the model. AssertionError: If the SavedModel directory already exists and isn't empty." -6503,_export_model_json,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,149,function,Saves model configuration as a json string under assets folder. -6504,_export_model_variables,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,158,function,Saves model weights in checkpoint format under variables folder. -6505,_save_v1_format,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,166,function,Exports model to v1 SavedModel format. -6506,_get_var_list,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,224,function,Returns list of all checkpointed saveable objects in the model. -6507,create_placeholder,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,230,function, -6508,_export_mode,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,234,function,"Exports a model, and optionally saves new vars from the clone model. - -Args: - mode: A `tf.estimator.ModeKeys` string. - has_saved_vars: A `boolean` indicating whether the SavedModel has already - exported variables. - builder: A `SavedModelBuilder` object. - model: A `tf.keras.Model` object. - custom_objects: A dictionary mapping string names to custom classes - or functions. - checkpoint_path: String path to checkpoint. - input_signature: Nested TensorSpec containing the expected inputs. Can be - `None`, in which case the signature will be inferred from the model. - -Raises: - ValueError: If the train/eval mode is being exported, but the model does - not have an optimizer." -6509,_create_signature_def_map,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,329,function,Creates a SignatureDef map from a Keras model. -6510,_assert_same_non_optimizer_objects,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,367,function,Asserts model and clone contain the same trackable objects. -6511,load_from_saved_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,379,function,"Loads a keras Model from a SavedModel created by `export_saved_model()`. +7228,create_placeholder,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,230,function, +7229,load_from_saved_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental.py,379,function,"Loads a keras Model from a SavedModel created by `export_saved_model()`. This function reinstantiates model state by: 1) loading model topology from json (this will eventually come @@ -53106,16 +61997,18 @@ Args: Returns: a keras.Model instance." -6512,TestModelSavingandLoading,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,47,class, -6513,LayerWithLearningPhase,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,203,class, -6514,functional_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,222,function, -6515,sequential_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,231,function, -6516,sequential_model_without_input_shape,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,240,function, -6517,Subclassed,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,249,class, -6518,subclassed_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,262,function, -6519,load_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,266,function, -6520,TestModelSavedModelExport,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,280,class, -6521,extract_model_metrics,tensorflow/tensorflow/python/keras/saving/saving_utils.py,37,function,"Convert metrics from a Keras model `compile` API to dictionary. +7230,LayerWithLearningPhase,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,203,class, +7231,build,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,205,method, +7232,call,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,209,method, +7233,compute_output_shape,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,218,method, +7234,functional_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,222,function, +7235,sequential_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,231,function, +7236,sequential_model_without_input_shape,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,240,function, +7237,Subclassed,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,249,class, +7238,call,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,256,method, +7239,subclassed_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,262,function, +7240,load_model,tensorflow/tensorflow/python/keras/saving/saved_model_experimental_test.py,266,function, +7241,extract_model_metrics,tensorflow/tensorflow/python/keras/saving/saving_utils.py,37,function,"Convert metrics from a Keras model `compile` API to dictionary. This is used for converting Keras models to Estimators and SavedModels. @@ -53125,7 +62018,7 @@ Args: Returns: Dictionary mapping metric names to metric instances. May return `None` if the model does not contain any metrics." -6522,model_input_signature,tensorflow/tensorflow/python/keras/saving/saving_utils.py,57,function,"Inspect model to get its input signature. +7242,model_input_signature,tensorflow/tensorflow/python/keras/saving/saving_utils.py,57,function,"Inspect model to get its input signature. The model's input signature is a list with a single (possibly-nested) object. This is due to the Keras-enforced restriction that tensor inputs must be @@ -53144,8 +62037,8 @@ Args: Returns: A list containing either a single TensorSpec or an object with nested TensorSpecs. This list does not contain the `training` argument." -6523,raise_model_input_error,tensorflow/tensorflow/python/keras/saving/saving_utils.py,92,function, -6524,trace_model_call,tensorflow/tensorflow/python/keras/saving/saving_utils.py,100,function,"Trace the model call to create a tf.function for exporting a Keras model. +7243,raise_model_input_error,tensorflow/tensorflow/python/keras/saving/saving_utils.py,92,function, +7244,trace_model_call,tensorflow/tensorflow/python/keras/saving/saving_utils.py,100,function,"Trace the model call to create a tf.function for exporting a Keras model. Args: model: A Keras model. @@ -53157,25 +62050,112 @@ Returns: Raises: ValueError: if input signature cannot be inferred from the model." -6525,model_metadata,tensorflow/tensorflow/python/keras/saving/saving_utils.py,147,function,Returns a dictionary containing the model metadata. -6526,should_overwrite,tensorflow/tensorflow/python/keras/saving/saving_utils.py,196,function,Returns whether the filepath should be overwritten. -6527,compile_args_from_training_config,tensorflow/tensorflow/python/keras/saving/saving_utils.py,204,function,Return model.compile arguments from training config. -6528,_deserialize_nested_config,tensorflow/tensorflow/python/keras/saving/saving_utils.py,245,function,Deserializes arbitrary Keras `config` using `deserialize_fn`. -6529,_serialize_nested_config,tensorflow/tensorflow/python/keras/saving/saving_utils.py,270,function,Serialized a nested structure of Keras objects. -6530,_deserialize_metric,tensorflow/tensorflow/python/keras/saving/saving_utils.py,281,function,"Deserialize metrics, leaving special strings untouched." -6531,_enforce_names_consistency,tensorflow/tensorflow/python/keras/saving/saving_utils.py,291,function,Enforces that either all specs have names or none do. -6532,try_build_compiled_arguments,tensorflow/tensorflow/python/keras/saving/saving_utils.py,313,function, -6533,TraceModelCallTest,tensorflow/tensorflow/python/keras/saving/saving_utils_test.py,54,class, -6534,_import_and_infer,tensorflow/tensorflow/python/keras/saving/saving_utils_test.py,249,function,Import a SavedModel into a TF 1.x-style graph and run `signature_key`. -6535,ModelSaveTest,tensorflow/tensorflow/python/keras/saving/saving_utils_test.py,272,class, -6536,ExtractModelMetricsTest,tensorflow/tensorflow/python/keras/saving/saving_utils_test.py,297,class, -6537,SavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,29,class,"Saver defining the methods and properties used to serialize Keras objects. +7245,model_metadata,tensorflow/tensorflow/python/keras/saving/saving_utils.py,147,function,Returns a dictionary containing the model metadata. +7246,should_overwrite,tensorflow/tensorflow/python/keras/saving/saving_utils.py,196,function,Returns whether the filepath should be overwritten. +7247,compile_args_from_training_config,tensorflow/tensorflow/python/keras/saving/saving_utils.py,204,function,Return model.compile arguments from training config. +7248,try_build_compiled_arguments,tensorflow/tensorflow/python/keras/saving/saving_utils.py,313,function, +7249,SavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,29,class,"Saver defining the methods and properties used to serialize Keras objects. " -6538,Encoder,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,43,class,JSON encoder and decoder that handles TensorShapes and tuples. -6539,_encode_tuple,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,56,function, -6540,decode,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,68,function, -6541,_decode_helper,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,72,function,A decoding helper that is TF-object aware. -6542,get_json_type,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,84,function,"Serializes any object to a JSON-serializable structure. +7250,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,37,method,"String stored in object identifier field in the SavedModel proto. + +Returns: + A string with the object identifier, which is used at load time." +7251,tracking_metadata,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,46,method,"String stored in metadata field in the SavedModel proto. + +Returns: + A serialized JSON storing information necessary for recreating this layer." +7252,list_extra_dependencies_for_serialization,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,56,method,"Lists extra dependencies to serialize to SavedModel. + +By overriding this method, extra dependencies can be attached to the +serialized Layer. For example, this is used to save the list of `variables` +and `trainable_variables`, which are python properties in a Layer object, +but are represented as a static list in the SavedModel. + +Args: + serialization_cache: A dictionary shared between all objects in the same + object graph. This object is passed to both + `_list_extra_dependencies_for_serialization` and + `_list_functions_for_serialization`. + +Returns: + A dictionary mapping attribute names to trackable objects. The entire list + of attributes are listed in the `saved_model._LayerAttributes` class." +7253,list_functions_for_serialization,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,76,method,"Lists extra functions to serialize to the SavedModel. + +Args: + serialization_cache: Dictionary passed to all objects in the same object + graph during serialization. + +Returns: + A dictionary mapping attribute names to `Function` or + `ConcreteFunction`." +7254,python_properties,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,98,method,"Returns dictionary of python properties to save in the metadata. + +This dictionary must be serializable and deserializable to/from JSON. + +When loading, the items in this dict are used to initialize the object and +define attributes in the revived object." +7255,objects_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,109,method,"Returns dictionary of extra checkpointable objects to serialize. + +See `functions_to_serialize` for an explanation of this function's +effects. + +Args: + serialization_cache: Dictionary passed to all objects in the same object + graph during serialization. + +Returns: + A dictionary mapping attribute names to checkpointable objects." +7256,functions_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/base_serialization.py,125,method,"Returns extra functions to include when serializing a Keras object. + +Normally, when calling exporting an object to SavedModel, only the +functions and objects defined by the user are saved. For example: + +``` +obj = tf.Module() +obj.v = tf.Variable(1.) + +@tf.function +def foo(...): ... + +obj.foo = foo + +w = tf.Variable(1.) + +tf.saved_model.save(obj, 'path/to/saved/model') +loaded = tf.saved_model.load('path/to/saved/model') + +loaded.v # Variable with the same value as obj.v +loaded.foo # Equivalent to obj.foo +loaded.w # AttributeError +``` + +Assigning trackable objects to attributes creates a graph, which is used for +both checkpointing and SavedModel serialization. + +When the graph generated from attribute tracking is insufficient, extra +objects and functions may be added at serialization time. For example, +most models do not have their call function wrapped with a @tf.function +decorator. This results in `model.call` not being saved. Since Keras objects +should be revivable from the SavedModel format, the call function is added +as an extra function to serialize. + +This function and `objects_to_serialize` is called multiple times when +exporting to SavedModel. Please use the cache to avoid generating new +functions and objects. A fresh cache is created for each SavedModel export. + +Args: + serialization_cache: Dictionary passed to all objects in the same object + graph during serialization. + +Returns: + A dictionary mapping attribute names to `Function` or + `ConcreteFunction`." +7257,Encoder,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,43,class,JSON encoder and decoder that handles TensorShapes and tuples. +7258,default,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,46,method, +7259,encode,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,52,method, +7260,decode,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,68,function, +7261,get_json_type,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils.py,84,function,"Serializes any object to a JSON-serializable structure. Arguments: obj: the object to serialize @@ -53185,12 +62165,20 @@ Returns: Raises: TypeError: if `obj` cannot be serialized." -6543,JsonUtilsTest,tensorflow/tensorflow/python/keras/saving/saved_model/json_utils_test.py,27,class, -6544,LayerSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,31,class,Implements Layer SavedModel serialization. -6545,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,113,function, -6546,InputLayerSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,125,class,InputLayer serialization. -6547,RNNSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,151,class,RNN layer serialization. -6548,load,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,93,function,"Loads Keras objects from a SavedModel. +7262,LayerSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,31,class,Implements Layer SavedModel serialization. +7263,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,35,method, +7264,python_properties,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,39,method, +7265,objects_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,73,method, +7266,functions_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,77,method, +7267,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,113,function, +7268,InputLayerSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,125,class,InputLayer serialization. +7269,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,129,method, +7270,python_properties,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,133,method, +7271,objects_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,144,method, +7272,functions_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,147,method, +7273,RNNSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,151,class,RNN layer serialization. +7274,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/layer_serialization.py,155,method, +7275,load,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,93,function,"Loads Keras objects from a SavedModel. Any Keras layer or model saved to the SavedModel will be loaded back as Keras objects. Other objects are loaded as regular trackable objects (same @@ -53212,8 +62200,7 @@ Args: Returns: Object loaded from SavedModel." -6549,_is_graph_network,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,146,function,Determines whether the layer is a graph network. -6550,KerasObjectLoader,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,157,class,"Loader that recreates Keras objects (e.g. layers, models). +7276,KerasObjectLoader,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,157,class,"Loader that recreates Keras objects (e.g. layers, models). Layers and models are revived from either the config or SavedModel following these rules: @@ -53228,34 +62215,15 @@ these rules: 4. If nothing of the above applies, compose the various artifacts from the SavedModel to create a subclassed layer or model. At this time, custom metrics are not supported." -6551,_finalize_saved_model_layers,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,682,function,Runs the final steps of loading Keras Layers from SavedModel. -6552,_unable_to_call_layer_due_to_serialization_issue,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,721,function,"Replaces the `layer.call` if the layer was not fully serialized. - -Keras Model/Layer serialization is relatively relaxed because SavedModels -are not always loaded back as keras models. Thus, when there is an issue -tracing a non-signature function, a warning is logged instead of raising an -error. This results in a SavedModel where the model's call function is saved, -but the internal layer call functions are not. - -When deserialized with `tf.keras.models.load_model`, the internal layers -which do not have serialized call functions should raise an error when called. - -Args: - layer: Layer without the serialized call function. - -Raises: - ValueError" -6553,_finalize_config_layers,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,756,function,Runs the final steps of loading Keras Layers from config. -6554,_finalize_metric,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,786,function, -6555,_restore_layer_unconditional_losses,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,792,function,Restore unconditional losses from SavedModel. -6556,_restore_layer_activation_loss,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,805,function,Restore actiation loss from SavedModel. -6557,revive_custom_object,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,820,function,Revives object from SavedModel. -6558,_restore_layer_metrics,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,849,function, -6559,RevivedLayer,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,860,class,Keras layer loaded from a SavedModel. -6560,_revive_setter,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,908,function,Setter function that saves some attributes to separate dictionary. -6561,RevivedInputLayer,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,930,class,InputLayer loaded from a SavedModel. -6562,recursively_deserialize_keras_object,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,952,function,Deserialize Keras object from a nested structure. -6563,infer_inputs_from_restored_call_function,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,969,function,"Returns TensorSpec of inputs from a restored call function. +7277,setattr_wrapper,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,675,method, +7278,revive_custom_object,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,820,function,Revives object from SavedModel. +7279,RevivedLayer,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,860,class,Keras layer loaded from a SavedModel. +7280,keras_api,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,898,method, +7281,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,901,method, +7282,RevivedInputLayer,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,930,class,InputLayer loaded from a SavedModel. +7283,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,948,method, +7284,recursively_deserialize_keras_object,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,952,function,Deserialize Keras object from a nested structure. +7285,infer_inputs_from_restored_call_function,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,969,function,"Returns TensorSpec of inputs from a restored call function. Args: fn: Restored layer call function. It is assumed that the inputs are entirely @@ -53263,20 +62231,28 @@ Args: Returns: TensorSpec of call function inputs." -6564,RevivedNetwork,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,989,class,Keras network of layers loaded from a SavedModel. -6565,_set_network_attributes_from_metadata,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,1015,function,Sets attributes recorded in the metadata. -6566,_maybe_add_serialized_attributes,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,1026,function, -6567,_get_keras_attr,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,1035,function, -6568,MetricSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/metric_serialization.py,25,class,Metric serialization. -6569,ModelSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,27,class,Model SavedModel serialization. -6570,SequentialSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,62,class, -6571,NetworkSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/network_serialization.py,25,class,Network serialization. -6572,SubclassedModelNoConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,47,class, -6573,SubclassedModelWithConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,75,class, -6574,CustomLayerNoConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,86,class, -6575,CustomLayerWithConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,110,class, -6576,TestModelRevive,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,118,class, -6577,save,tensorflow/tensorflow/python/keras/saving/saved_model/save.py,40,function,"Saves a model as a SavedModel to the filepath. +7286,RevivedNetwork,tensorflow/tensorflow/python/keras/saving/saved_model/load.py,989,class,Keras network of layers loaded from a SavedModel. +7287,MetricSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/metric_serialization.py,25,class,Metric serialization. +7288,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/metric_serialization.py,29,method, +7289,ModelSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,27,class,Model SavedModel serialization. +7290,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,31,method, +7291,SequentialSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,62,class, +7292,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/model_serialization.py,65,method, +7293,NetworkSavedModelSaver,tensorflow/tensorflow/python/keras/saving/saved_model/network_serialization.py,25,class,Network serialization. +7294,object_identifier,tensorflow/tensorflow/python/keras/saving/saved_model/network_serialization.py,29,method, +7295,SubclassedModelNoConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,47,class, +7296,build,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,57,method, +7297,call,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,68,method, +7298,SubclassedModelWithConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,75,class, +7299,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,77,method, +7300,from_config,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,82,method, +7301,CustomLayerNoConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,86,class, +7302,build,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,98,method, +7303,call,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,102,method, +7304,a_regularizer,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,92,method, +7305,CustomLayerWithConfig,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,110,class, +7306,get_config,tensorflow/tensorflow/python/keras/saving/saved_model/revive_test.py,112,method, +7307,save,tensorflow/tensorflow/python/keras/saving/saved_model/save.py,40,function,"Saves a model as a SavedModel to the filepath. Args: model: Keras model instance to be saved. @@ -53291,8 +62267,8 @@ Args: Raises: ValueError: if the model's inputs have not been defined." -6578,should_skip_serialization,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,72,function,Skip serializing extra objects and functions if layer inputs aren't set. -6579,wrap_layer_objects,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,83,function,"Returns extra trackable objects to attach to the serialized layer. +7308,should_skip_serialization,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,72,function,Skip serializing extra objects and functions if layer inputs aren't set. +7309,wrap_layer_objects,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,83,function,"Returns extra trackable objects to attach to the serialized layer. Args: layer: Keras Layer object. @@ -53303,7 +62279,7 @@ Returns: A dictionary containing all checkpointable objects from a SerializedAttributes object. See LayerAttributes and ModelAttributes for entire list of objects" -6580,wrap_layer_functions,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,134,function,"Returns dict of wrapped layer call function and losses in tf.functions. +7310,wrap_layer_functions,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,134,function,"Returns dict of wrapped layer call function and losses in tf.functions. Args: layer: Keras Layer object. @@ -53313,66 +62289,41 @@ Args: Returns: A dictionary containing all keras tf.functions to serialize. See LayerAttributes and ModelAttributes for the list of all attributes." -6581,default_save_signature,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,202,function, -6582,_replace_child_layer_functions,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,210,function,"Replaces functions in the children layers with wrapped tf.functions. - -This step allows functions from parent layers to reference the wrapped -functions from their children layers instead of retracing the ops. - -This function also resets all losses stored in the layer. These are stored in -the returned dictionary. Use `_restore_child_layer_functions` to restore -the original attributes. - -Args: - layer: Keras Layer object. - serialization_cache: Dictionary shared between all objects during - serialization. - -Returns: - Dictionary mapping layer objects -> original functions and losses: - { Child layer 1: { - 'losses': Original losses, - 'call': Original call function - '_activity_regularizer': Original activity regularizer}, - Child layer 2: ... - }" -6583,_restore_child_layer_functions,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,296,function,Restores attributes replaced with `_replace_child_layer_functions`. -6584,_reset_layer_losses,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,309,function,"Resets losses of layer and its sublayers, and returns original losses." -6585,_restore_layer_losses,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,321,function, -6586,LayerCallCollection,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,329,class,"Groups wrapped layer call functions. +7311,default_save_signature,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,202,function, +7312,LayerCallCollection,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,329,class,"Groups wrapped layer call functions. This is used to ensure that all layer call functions are traced with the same inputs- - call - call_and_return_conditional_losses - call_and_return_all_conditional_losses" -6587,layer_call_wrapper,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,509,function,"Ensures layer losses are kept the same, and runs method in call context." -6588,LayerCall,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,532,class,Function that triggers traces of other functions in the same collection. -6589,_wrap_call_and_conditional_losses,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,552,function,"Wraps call function that returns a tuple of (outputs, losses). - -The losses returned are conditional on the inputs passed to the call function. -Unconditional losses (e.g. weight regularizeration) are wrapped separately. +7313,add_trace,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,401,method,"Traces all functions with the same args and kwargs. Args: - layer: a Keras layer object - -Returns: - python call function that returns outputs and conditional losses -- excludes - activity regularizer" -6590,_extract_outputs_from_fn,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,581,function,Returns a function that returns only call function outputs. -6591,_append_activity_regularizer_loss,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,590,function,Appends activity regularizer loss to losses returned by the wrapped fn. -6592,_create_call_fn_decorator,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,600,function, -6593,_wrap_unconditional_loss,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,611,function,"Wraps callable/unconditional loss, returning a serializable function." -6594,_wrap_activity_regularizer,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,622,function,Wraps the activity regularizer. -6595,_get_layer_call_method,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,634,function, -6596,LayerWithLearningPhase,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,69,class, -6597,LayerWithLoss,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,88,class, -6598,LayerWithUpdate,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,95,class, -6599,GlobalLayerThatShouldFailIfNotAdded,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,112,class, -6600,TestModelSavingAndLoadingV2,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,117,class, -6601,TestLayerCallTracing,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,862,class, -6602,MetricTest,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,949,class, -6603,SerializedAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,45,class,"Class that tracks and validates all serialization attributes. + *args: Positional args passed to the original function. + **kwargs: Keyword args passed to the original function." +7314,fn_input_signature,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,427,method,Returns input signature for the wrapped layer call function. +7315,training_arg_was_passed,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,438,method, +7316,get_training_arg_value,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,446,method, +7317,get_input_arg_value,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,453,method, +7318,add_function,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,495,method,Adds a layer call function to the collection. +7319,wrap_with_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,479,method, +7320,trace_with_training,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,415,method, +7321,to_tensor_spec_or_none,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,385,method, +7322,layer_call_wrapper,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,509,function,"Ensures layer losses are kept the same, and runs method in call context." +7323,LayerCall,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,532,class,Function that triggers traces of other functions in the same collection. +7324,get_concrete_function,tensorflow/tensorflow/python/keras/saving/saved_model/save_impl.py,546,method, +7325,LayerWithLearningPhase,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,69,class, +7326,build,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,71,method, +7327,call,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,75,method, +7328,compute_output_shape,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,84,method, +7329,LayerWithLoss,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,88,class, +7330,call,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,90,method, +7331,LayerWithUpdate,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,95,class, +7332,build,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,97,method, +7333,call,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,105,method, +7334,GlobalLayerThatShouldFailIfNotAdded,tensorflow/tensorflow/python/keras/saving/saved_model/saved_model_test.py,112,class, +7335,SerializedAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,45,class,"Class that tracks and validates all serialization attributes. Keras models contain many Python-defined components. For example, the trainable_variable property lists the model's trainable variables by @@ -53436,7 +62387,27 @@ attributes: All changes to the serialized attributes must be backwards-compatible, so attributes should not be removed or modified without sufficient justification." -6604,CommonEndpoints,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,221,class,"Common endpoints shared by all models loadable by Keras. +7336,with_attributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,113,method,"Creates a subclass with all attributes as specified in the arguments. + +Args: + name: Name of subclass + checkpointable_objects: List of checkpointable objects to be serialized + in the SavedModel. + functions: List of functions to be serialized in the SavedModel. + copy_from: List of other SerializedAttributes subclasses. The returned + class will copy checkpoint objects/functions from each subclass. + +Returns: + Child class with attributes as defined in the `checkpointable_objects` + and `functions` lists." +7337,new,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,143,method,Returns a new SerializedAttribute object. +7338,functions,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,163,method,Returns dictionary of all functions. +7339,checkpointable_objects,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,169,method,Returns dictionary of all checkpointable objects. +7340,functions_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,175,method,Returns functions to attach to the root object during serialization. +7341,objects_to_serialize,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,181,method,Returns objects to attach to the root object during serialization. +7342,set_and_validate_functions,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,188,method,"Saves function dictionary, and validates dictionary values." +7343,set_and_validate_objects,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,205,method,"Saves objects to a dictionary, and validates the values." +7344,CommonEndpoints,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,221,class,"Common endpoints shared by all models loadable by Keras. List of all attributes: variables: List of all variables in the model and its sublayers. @@ -53450,7 +62421,7 @@ List of all attributes: (call function outputs, list of all losses that depend on the inputs). _default_save_signature: Traced model call function. This is only included if the top level exported object is a Keras model." -6605,LayerAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,244,class,"Layer checkpointable objects + functions that are saved to the SavedModel. +7345,LayerAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,244,class,"Layer checkpointable objects + functions that are saved to the SavedModel. List of all attributes: All attributes from CommonEndpoints @@ -53466,20 +62437,20 @@ List of all attributes: activity_regularizer_fn: Callable that returns the activity regularizer loss layer_regularization_losses: List of losses owned only by this layer. layer_metrics: List of metrics owned by this layer." -6606,ModelAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,270,class,"Model checkpointable objects + functions that are saved to the SavedModel. +7346,ModelAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,270,class,"Model checkpointable objects + functions that are saved to the SavedModel. List of all attributes: All attributes from LayerAttributes (including CommonEndpoints)" -6607,MetricAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,282,class,"Attributes that are added to Metric objects when saved to SavedModel. +7347,MetricAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,282,class,"Attributes that are added to Metric objects when saved to SavedModel. List of all attributes: variables: list of all variables" -6608,RNNAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,296,class,"RNN checkpointable objects + functions that are saved to the SavedModel. +7348,RNNAttributes,tensorflow/tensorflow/python/keras/saving/saved_model/serialized_attributes.py,296,class,"RNN checkpointable objects + functions that are saved to the SavedModel. List of all attributes: All attributes from LayerAttributes (including CommonEndpoints) states: List of state variables" -6609,use_wrapped_call,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,40,function,"Creates fn that adds the losses returned by call_fn & returns the outputs. +7349,use_wrapped_call,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,40,function,"Creates fn that adds the losses returned by call_fn & returns the outputs. Args: layer: A Keras layer object @@ -53492,10 +62463,10 @@ Args: Returns: function that calls call_fn and returns the outputs. Losses returned by call_fn are added to the layer losses." -6610,layer_uses_training_bool,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,99,function,Returns whether this layer or any of its children uses the training arg. -6611,list_all_layers,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,116,function, -6612,list_all_layers_and_sublayers,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,124,function, -6613,maybe_add_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,131,function,"Decorate call and optionally adds training argument. +7350,layer_uses_training_bool,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,99,function,Returns whether this layer or any of its children uses the training arg. +7351,list_all_layers,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,116,function, +7352,list_all_layers_and_sublayers,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,124,function, +7353,maybe_add_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,131,function,"Decorate call and optionally adds training argument. If a layer expects a training argument, this function ensures that 'training' is present in the layer args or kwonly args, with the default training value. @@ -53511,7 +62482,7 @@ Returns: Tuple of ( function that calls `wrapped_call` and sets the training arg, Argspec of returned function or `None` if the argspec is unchanged)" -6614,get_training_arg_index,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,202,function,"Returns the index of 'training' in the layer call function arguments. +7354,get_training_arg_index,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,202,function,"Returns the index of 'training' in the layer call function arguments. Args: call_fn: Call function. @@ -53521,91 +62492,73 @@ Returns: - -1: if 'training' is not found in the arguments, but layer.call accepts variable keyword arguments - None: if layer doesn't expect a training argument." -6615,set_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,223,function, -6616,get_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,233,function, -6617,remove_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,242,function, -6618,get_ctl_train_step,tensorflow/tensorflow/python/keras/tests/add_loss_correctness_test.py,44,function, -6619,TestAddLossCorrectness,tensorflow/tensorflow/python/keras/tests/add_loss_correctness_test.py,65,class, -6620,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,57,function, -6621,get_tpu_strategy,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,66,function, -6622,LayerForScalarSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,73,class,A pass-through layer that only records scalar values to summary. -6623,LayerForImageSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,81,class,A pass-through layer that only records image values to summary. -6624,LayerForHistogramSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,89,class,A pass-through layer that records histogram values to summary. -6625,CustomModel,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,97,class,Custom model with summary ops in model call definition. -6626,get_image_dataset,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,124,function, -6627,mnist_model,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,133,function,Creates a MNIST model. -6628,AutoOutsideCompilationWithKerasTest,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,156,class, -6629,VariablesToConstantsTest,tensorflow/tensorflow/python/keras/tests/convert_to_constants_test.py,41,class, -6630,LayerWithLosses,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,35,class, -6631,LayerWithMetrics,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,49,class, -6632,LayerWithTrainingArg,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,61,class, -6633,add_loss_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,71,function, -6634,batch_norm_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,92,function, -6635,add_metric_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,115,function, -6636,CustomTrainingLoopTest,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,145,class, -6637,TestGetConfigBackwardsCompatible,tensorflow/tensorflow/python/keras/tests/get_config_test.py,29,class, -6638,ConvertVariablesToConstantsTest,tensorflow/tensorflow/python/keras/tests/graph_util_test.py,35,class, -6639,KerasIntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,38,class, -6640,VectorClassificationIntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,58,class, -6641,SequentialIntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,129,class, -6642,TimeseriesClassificationIntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,181,class, -6643,ImageClassificationIntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,247,class, -6644,ActivationV2IntegrationTest,tensorflow/tensorflow/python/keras/tests/integration_test.py,284,class,"Tests activation function V2 in model exporting and loading. - -This test is to verify in TF 2.x, when 'tf.nn.softmax' is used as an -activation function, its model exporting and loading work as expected. -Check b/123041942 for details." -6645,MemoryCheckerTest,tensorflow/tensorflow/python/keras/tests/memory_checker_test.py,28,class, -6646,SingleLayerNet,tensorflow/tensorflow/python/keras/tests/memory_test.py,35,class,Simple keras model used to ensure that there are no leaks. -6647,MemoryTest,tensorflow/tensorflow/python/keras/tests/memory_test.py,46,class, -6648,basic_sequential,tensorflow/tensorflow/python/keras/tests/model_architectures.py,29,function,Basic sequential model. -6649,basic_sequential_deferred,tensorflow/tensorflow/python/keras/tests/model_architectures.py,38,function,Sequential model with deferred input shape. -6650,stacked_rnn,tensorflow/tensorflow/python/keras/tests/model_architectures.py,47,function,Stacked RNN model. -6651,lstm,tensorflow/tensorflow/python/keras/tests/model_architectures.py,57,function,LSTM model. -6652,multi_input_multi_output,tensorflow/tensorflow/python/keras/tests/model_architectures.py,68,function,Multi-input Multi-ouput model. -6653,nested_sequential_in_functional,tensorflow/tensorflow/python/keras/tests/model_architectures.py,85,function,A sequential model nested in a functional model. -6654,seq_to_seq,tensorflow/tensorflow/python/keras/tests/model_architectures.py,99,function,Sequence to sequence model. -6655,shared_layer_functional,tensorflow/tensorflow/python/keras/tests/model_architectures.py,121,function,Shared layer in a functional model. -6656,shared_sequential,tensorflow/tensorflow/python/keras/tests/model_architectures.py,140,function,Shared sequential model in a functional model. -6657,MySubclassModel,tensorflow/tensorflow/python/keras/tests/model_architectures.py,156,class,A subclass model. -6658,nested_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,181,function,A subclass model nested in another subclass model. -6659,nested_subclassed_in_functional_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,203,function,A subclass model nested in a functional model. -6660,nested_functional_in_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,214,function,A functional model nested in a subclass model. -6661,shared_layer_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,240,function,Shared layer in a subclass model. -6662,functional_with_keyword_args,tensorflow/tensorflow/python/keras/tests/model_architectures.py,261,function,A functional model with keyword args. -6663,get_models,tensorflow/tensorflow/python/keras/tests/model_architectures.py,292,function,Get all models excluding the specificed ones. -6664,TestModelArchitectures,tensorflow/tensorflow/python/keras/tests/model_architectures_test.py,35,class, -6665,ModelSubclassCompiledTest,tensorflow/tensorflow/python/keras/tests/model_subclassing_compiled_test.py,39,class, -6666,ModelSubclassingTest,tensorflow/tensorflow/python/keras/tests/model_subclassing_test.py,51,class, -6667,GraphSpecificModelSubclassingTests,tensorflow/tensorflow/python/keras/tests/model_subclassing_test.py,480,class, -6668,CustomCallSignatureTests,tensorflow/tensorflow/python/keras/tests/model_subclassing_test.py,608,class, -6669,SimpleConvTestModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,26,class, -6670,get_multi_io_subclass_model,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,42,function,Creates MultiIOModel for the tests of subclass model. -6671,NestedTestModel1,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,61,class,"A model subclass nested inside a model subclass. - " -6672,NestedTestModel2,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,81,class,"A model subclass with a functional-API graph network inside. - " -6673,get_nested_model_3,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,109,function, -6674,CustomCallModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,136,class, -6675,TrainingNoDefaultModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,151,class, -6676,TrainingMaskingModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,161,class, -6677,_NumpyFunctionCallback,tensorflow/tensorflow/python/keras/tests/op_callbacks_test.py,50,class, -6678,OpCallbacksTest,tensorflow/tensorflow/python/keras/tests/op_callbacks_test.py,133,class, -6679,_ModelWithOptimizerUsingDefun,tensorflow/tensorflow/python/keras/tests/saved_model_test.py,38,class, -6680,MemoryTests,tensorflow/tensorflow/python/keras/tests/saved_model_test.py,60,class, -6681,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/saver_test.py,39,class, -6682,MyModel,tensorflow/tensorflow/python/keras/tests/saver_test.py,47,class,A concrete Model for testing. -6683,TrackableCompatibilityTests,tensorflow/tensorflow/python/keras/tests/saver_test.py,62,class, -6684,SerializationTests,tensorflow/tensorflow/python/keras/tests/serialization_util_test.py,35,class, -6685,SummaryOpsTest,tensorflow/tensorflow/python/keras/tests/summary_ops_test.py,36,class, -6686,events_from_file,tensorflow/tensorflow/python/keras/tests/summary_ops_test.py,110,function,"Returns all events in a single event file. +7355,set_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,223,function, +7356,get_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,233,function, +7357,remove_training_arg,tensorflow/tensorflow/python/keras/saving/saved_model/utils.py,242,function, +7358,get_ctl_train_step,tensorflow/tensorflow/python/keras/tests/add_loss_correctness_test.py,44,function, +7359,get_tpu_cluster_resolver,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,57,function, +7360,get_tpu_strategy,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,66,function, +7361,LayerForScalarSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,73,class,A pass-through layer that only records scalar values to summary. +7362,call,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,76,method, +7363,LayerForImageSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,81,class,A pass-through layer that only records image values to summary. +7364,call,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,84,method, +7365,LayerForHistogramSummary,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,89,class,A pass-through layer that records histogram values to summary. +7366,call,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,92,method, +7367,CustomModel,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,97,class,Custom model with summary ops in model call definition. +7368,call,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,117,method, +7369,get_image_dataset,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,124,function, +7370,mnist_model,tensorflow/tensorflow/python/keras/tests/automatic_outside_compilation_test.py,133,function,Creates a MNIST model. +7371,LayerWithLosses,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,35,class, +7372,build,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,37,method, +7373,call,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,44,method, +7374,LayerWithMetrics,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,49,class, +7375,build,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,51,method, +7376,call,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,54,method, +7377,LayerWithTrainingArg,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,61,class, +7378,call,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,63,method, +7379,add_loss_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,71,function, +7380,batch_norm_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,92,function, +7381,add_metric_step,tensorflow/tensorflow/python/keras/tests/custom_training_loop_test.py,115,function, +7382,SingleLayerNet,tensorflow/tensorflow/python/keras/tests/memory_test.py,35,class,Simple keras model used to ensure that there are no leaks. +7383,call,tensorflow/tensorflow/python/keras/tests/memory_test.py,42,method, +7384,basic_sequential,tensorflow/tensorflow/python/keras/tests/model_architectures.py,29,function,Basic sequential model. +7385,basic_sequential_deferred,tensorflow/tensorflow/python/keras/tests/model_architectures.py,38,function,Sequential model with deferred input shape. +7386,stacked_rnn,tensorflow/tensorflow/python/keras/tests/model_architectures.py,47,function,Stacked RNN model. +7387,lstm,tensorflow/tensorflow/python/keras/tests/model_architectures.py,57,function,LSTM model. +7388,multi_input_multi_output,tensorflow/tensorflow/python/keras/tests/model_architectures.py,68,function,Multi-input Multi-ouput model. +7389,nested_sequential_in_functional,tensorflow/tensorflow/python/keras/tests/model_architectures.py,85,function,A sequential model nested in a functional model. +7390,seq_to_seq,tensorflow/tensorflow/python/keras/tests/model_architectures.py,99,function,Sequence to sequence model. +7391,shared_layer_functional,tensorflow/tensorflow/python/keras/tests/model_architectures.py,121,function,Shared layer in a functional model. +7392,shared_sequential,tensorflow/tensorflow/python/keras/tests/model_architectures.py,140,function,Shared sequential model in a functional model. +7393,MySubclassModel,tensorflow/tensorflow/python/keras/tests/model_architectures.py,156,class,A subclass model. +7394,call,tensorflow/tensorflow/python/keras/tests/model_architectures.py,167,method, +7395,get_config,tensorflow/tensorflow/python/keras/tests/model_architectures.py,173,method, +7396,from_config,tensorflow/tensorflow/python/keras/tests/model_architectures.py,177,method, +7397,nested_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,181,function,A subclass model nested in another subclass model. +7398,nested_subclassed_in_functional_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,203,function,A subclass model nested in a functional model. +7399,nested_functional_in_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,214,function,A functional model nested in a subclass model. +7400,shared_layer_subclassed_model,tensorflow/tensorflow/python/keras/tests/model_architectures.py,240,function,Shared layer in a subclass model. +7401,functional_with_keyword_args,tensorflow/tensorflow/python/keras/tests/model_architectures.py,261,function,A functional model with keyword args. +7402,get_models,tensorflow/tensorflow/python/keras/tests/model_architectures.py,292,function,Get all models excluding the specificed ones. +7403,get_multi_io_subclass_model,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,42,function,Creates MultiIOModel for the tests of subclass model. +7404,get_nested_model_3,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,109,function, +7405,CustomCallModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,136,class, +7406,call,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,143,method, +7407,TrainingNoDefaultModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,151,class, +7408,call,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,157,method, +7409,TrainingMaskingModel,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,161,class, +7410,call,tensorflow/tensorflow/python/keras/tests/model_subclassing_test_util.py,167,method, +7411,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/saver_test.py,39,class, +7412,MyModel,tensorflow/tensorflow/python/keras/tests/saver_test.py,47,class,A concrete Model for testing. +7413,call,tensorflow/tensorflow/python/keras/tests/saver_test.py,57,method, +7414,events_from_file,tensorflow/tensorflow/python/keras/tests/summary_ops_test.py,110,function,"Returns all events in a single event file. Args: filepath: Path to the event file. Returns: A list of all tf.Event protos in the event file." -6687,events_from_logdir,tensorflow/tensorflow/python/keras/tests/summary_ops_test.py,128,function,"Returns all events in the single eventfile in logdir. +7415,events_from_logdir,tensorflow/tensorflow/python/keras/tests/summary_ops_test.py,128,function,"Returns all events in the single eventfile in logdir. Args: logdir: The directory in which the single event file is sought. @@ -53615,39 +62568,34 @@ Returns: Raises: AssertionError: If logdir does not contain exactly one file." -6688,Bias,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,32,class,Layer that add a bias to its inputs. -6689,get_multi_io_temporal_model,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,45,function, -6690,get_compiled_multi_io_model_temporal,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,58,function, -6691,run_with_different_sample_weight_mode_inputs,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,70,function,"Executes the given function with different sample weight mode inputs. +7416,Bias,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,32,class,Layer that add a bias to its inputs. +7417,build,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,35,method, +7418,call,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,38,method, +7419,compute_output_shape,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,41,method, +7420,get_multi_io_temporal_model,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,45,function, +7421,get_compiled_multi_io_model_temporal,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,58,function, +7422,run_with_different_sample_weight_mode_inputs,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,70,function,"Executes the given function with different sample weight mode inputs. Args: fn: Training or eval function to execute. partial_sw: Boolean flag to indicate whether temporal sample weight mode should be set partially just for one output." -6692,TestMetricsCorrectnessMultiIOTemporal,tensorflow/tensorflow/python/keras/tests/temporal_sample_weights_correctness_test.py,105,class, -6693,HasList,tensorflow/tensorflow/python/keras/tests/tracking_test.py,45,class, -6694,ListTests,tensorflow/tensorflow/python/keras/tests/tracking_test.py,76,class, -6695,ListWrapperTest,tensorflow/tensorflow/python/keras/tests/tracking_test.py,235,class, -6696,HasMapping,tensorflow/tensorflow/python/keras/tests/tracking_test.py,245,class, -6697,MappingTests,tensorflow/tensorflow/python/keras/tests/tracking_test.py,268,class, -6698,HasTuple,tensorflow/tensorflow/python/keras/tests/tracking_test.py,400,class, -6699,TupleTests,tensorflow/tensorflow/python/keras/tests/tracking_test.py,418,class, -6700,InterfaceTests,tensorflow/tensorflow/python/keras/tests/tracking_test.py,549,class, -6701,MyModel,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,56,class,A concrete Model for testing. -6702,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,71,class, -6703,InterfaceTests,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,79,class, -6704,CheckpointingTests,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,118,class, -6705,_ManualScope,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,712,class, -6706,TemplateTests,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,725,class, -6707,CheckpointCompatibilityTests,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,782,class, -6708,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,49,class, -6709,MyModel,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,58,class,A concrete Model for testing. -6710,CheckpointingTests,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,73,class, -6711,CheckpointCompatibilityTests,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,581,class, -6712,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,32,class, -6713,Subclassed,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,40,class,A concrete Model for testing. -6714,CheckpointingTests,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,55,class, -6715,Layer,tensorflow/tensorflow/python/keras/type/types.py,34,class,"This is the class from which all layers inherit. +7423,HasList,tensorflow/tensorflow/python/keras/tests/tracking_test.py,45,class, +7424,call,tensorflow/tensorflow/python/keras/tests/tracking_test.py,67,method, +7425,HasMapping,tensorflow/tensorflow/python/keras/tests/tracking_test.py,245,class, +7426,call,tensorflow/tensorflow/python/keras/tests/tracking_test.py,260,method, +7427,HasTuple,tensorflow/tensorflow/python/keras/tests/tracking_test.py,400,class, +7428,call,tensorflow/tensorflow/python/keras/tests/tracking_test.py,409,method, +7429,MyModel,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,56,class,A concrete Model for testing. +7430,call,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,66,method, +7431,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_test.py,71,class, +7432,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,49,class, +7433,MyModel,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,58,class,A concrete Model for testing. +7434,call,tensorflow/tensorflow/python/keras/tests/tracking_util_with_v1_optimizers_test.py,68,method, +7435,NonLayerTrackable,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,32,class, +7436,Subclassed,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,40,class,A concrete Model for testing. +7437,call,tensorflow/tensorflow/python/keras/tests/tracking_util_xla_test.py,50,method, +7438,Layer,tensorflow/tensorflow/python/keras/type/types.py,34,class,"This is the class from which all layers inherit. A layer is a callable object that takes as input one or more tensors and that outputs one or more tensors. It involves *computation*, defined @@ -53814,26 +62762,20 @@ layers will cast their inputs to the layer's dtype in TensorFlow 2. When mixed precision is used, layers may have different computation and variable dtypes. See `tf.keras.mixed_precision.experimental.Policy` for details on layer dtypes." -6716,ToDense,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,52,class,Create a dense (standard) tensor from the given input tensor. -6717,ToRagged,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,78,class,Create a ragged tensor based on a given dense tensor. -6718,ToSparse,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,91,class,Create a sparse tensor based on a given dense tensor. -6719,_SubclassModel,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,101,class,A Keras subclass model. -6720,get_model_from_layers_with_input,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,125,function,Builds a model from a sequence of layers. -6721,get_test_mode_kwargs,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,163,function, -6722,CompositeTensorInternalTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,172,class, -6723,CompositeTensorOutputTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,219,class, -6724,get_input_name,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,289,function, -6725,get_kwargs,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,299,function, -6726,prepare_inputs,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,308,function, -6727,SparseTensorInputTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,332,class, -6728,ScipySparseTensorInputTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,375,class, -6729,RaggedTensorInputTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,497,class, -6730,RaggedTensorInputValidationTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,542,class, -6731,CompositeTensorModelPredictTest,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,607,class, -6732,InXlaContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,26,function, -6733,GraphOrParentsInXlaContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,31,function, -6734,IsInWhileLoop,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,40,function, -6735,GetContainingWhileContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,45,function,"Returns the first ancestor WhileContext of `ctxt`. +7439,ToDense,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,52,class,Create a dense (standard) tensor from the given input tensor. +7440,call,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,59,method, +7441,ToRagged,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,78,class,Create a ragged tensor based on a given dense tensor. +7442,call,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,86,method, +7443,ToSparse,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,91,class,Create a sparse tensor based on a given dense tensor. +7444,call,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,94,method, +7445,get_model_from_layers_with_input,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,125,function,Builds a model from a sequence of layers. +7446,get_input_name,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,289,function, +7447,get_kwargs,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,299,function, +7448,prepare_inputs,tensorflow/tensorflow/python/keras/utils/composite_tensor_support_test.py,308,function, +7449,InXlaContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,26,function, +7450,GraphOrParentsInXlaContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,31,function, +7451,IsInWhileLoop,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,40,function, +7452,GetContainingWhileContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,45,function,"Returns the first ancestor WhileContext of `ctxt`. Returns `ctxt` if `ctxt` is a WhileContext, or None if `ctxt` is not in a while loop. @@ -53847,7 +62789,7 @@ Returns: `ctxt` if `ctxt` is a WhileContext, the most nested WhileContext containing `ctxt`, or None if `ctxt` is not in a while loop. If `stop_ctxt` is not `None`, this returns `ctxt` if it matches `stop_ctxt` in its traversal." -6736,GetContainingXLAContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,67,function,"Returns the first ancestor XLAContext of `ctxt`. +7453,GetContainingXLAContext,tensorflow/tensorflow/python/keras/utils/control_flow_util.py,67,function,"Returns the first ancestor XLAContext of `ctxt`. Returns `ctxt` if `ctxt` is a XLAContext, or None if `ctxt` is not in a while loop. @@ -53858,8 +62800,8 @@ Args: Returns: `ctxt` if `ctxt` is a XLAContext, the most nested XLAContext containing `ctxt`, or None if `ctxt` is not in a while loop." -6737,convert_data_format,tensorflow/tensorflow/python/keras/utils/conv_utils.py,28,function, -6738,normalize_tuple,tensorflow/tensorflow/python/keras/utils/conv_utils.py,51,function,"Transforms a single integer or iterable of integers into an integer tuple. +7454,convert_data_format,tensorflow/tensorflow/python/keras/utils/conv_utils.py,28,function, +7455,normalize_tuple,tensorflow/tensorflow/python/keras/utils/conv_utils.py,51,function,"Transforms a single integer or iterable of integers into an integer tuple. Arguments: value: The value to validate and convert. Could an int, or any iterable of @@ -53874,7 +62816,7 @@ Returns: Raises: ValueError: If something else than an int/long or iterable thereof was passed." -6739,conv_output_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,90,function,"Determines output length of a convolution given input length. +7456,conv_output_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,90,function,"Determines output length of a convolution given input length. Arguments: input_length: integer. @@ -53885,7 +62827,7 @@ Arguments: Returns: The output length (integer)." -6740,conv_input_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,116,function,"Determines input length of a convolution given output length. +7457,conv_input_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,116,function,"Determines input length of a convolution given output length. Arguments: output_length: integer. @@ -53895,7 +62837,7 @@ Arguments: Returns: The input length (integer)." -6741,deconv_output_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,140,function,"Determines output length of a transposed convolution given input length. +7458,deconv_output_length,tensorflow/tensorflow/python/keras/utils/conv_utils.py,140,function,"Determines output length of a transposed convolution given input length. Arguments: input_length: Integer. @@ -53908,9 +62850,9 @@ Arguments: Returns: The output length (integer)." -6742,normalize_data_format,tensorflow/tensorflow/python/keras/utils/conv_utils.py,189,function, -6743,normalize_padding,tensorflow/tensorflow/python/keras/utils/conv_utils.py,200,function, -6744,convert_kernel,tensorflow/tensorflow/python/keras/utils/conv_utils.py,211,function,"Converts a Numpy kernel matrix from Theano format to TensorFlow format. +7459,normalize_data_format,tensorflow/tensorflow/python/keras/utils/conv_utils.py,189,function, +7460,normalize_padding,tensorflow/tensorflow/python/keras/utils/conv_utils.py,200,function, +7461,convert_kernel,tensorflow/tensorflow/python/keras/utils/conv_utils.py,211,function,"Converts a Numpy kernel matrix from Theano format to TensorFlow format. Also works reciprocally, since the transformation is its own inverse. @@ -53924,7 +62866,7 @@ Returns: Raises: ValueError: in case of invalid kernel shape or invalid data_format." -6745,conv_kernel_mask,tensorflow/tensorflow/python/keras/utils/conv_utils.py,236,function,"Compute a mask representing the connectivity of a convolution operation. +7462,conv_kernel_mask,tensorflow/tensorflow/python/keras/utils/conv_utils.py,236,function,"Compute a mask representing the connectivity of a convolution operation. Assume a convolution with given parameters is applied to an input having N spatial dimensions with `input_shape = (d_in1, ..., d_inN)` to produce an @@ -53968,7 +62910,7 @@ Raises: ValueError: if `input_shape`, `kernel_shape` and `strides` don't have the same number of dimensions. NotImplementedError: if `padding` is not in {`""same""`, `""valid""`}." -6746,conv_kernel_idxs,tensorflow/tensorflow/python/keras/utils/conv_utils.py,315,function,"Yields output-input tuples of indices in a CNN layer. +7463,conv_kernel_idxs,tensorflow/tensorflow/python/keras/utils/conv_utils.py,315,function,"Yields output-input tuples of indices in a CNN layer. The generator iterates over all `(output_idx, input_idx)` tuples, where `output_idx` is an integer index in a flattened tensor representing a single @@ -54014,7 +62956,7 @@ Raises: and kernel number of dimensions do not match. NotImplementedError: if `padding` is neither `""same""` nor `""valid""`." -6747,conv_connected_inputs,tensorflow/tensorflow/python/keras/utils/conv_utils.py,409,function,"Return locations of the input connected to an output position. +7464,conv_connected_inputs,tensorflow/tensorflow/python/keras/utils/conv_utils.py,409,function,"Return locations of the input connected to an output position. Assume a convolution with given parameters is applied to an input having N spatial dimensions with `input_shape = (d_in1, ..., d_inN)`. This method @@ -54050,7 +62992,7 @@ Returns: N ranges `[[p_in_left1, ..., p_in_right1], ..., [p_in_leftN, ..., p_in_rightN]]` specifying the region in the input connected to output_position." -6748,conv_output_shape,tensorflow/tensorflow/python/keras/utils/conv_utils.py,468,function,"Return the output shape of an N-D convolution. +7465,conv_output_shape,tensorflow/tensorflow/python/keras/utils/conv_utils.py,468,function,"Return the output shape of an N-D convolution. Forces dimensions where input is empty (size 0) to remain empty. @@ -54067,10 +63009,7 @@ Args: Returns: tuple of size N: `(d_out1, ..., d_outN)`, spatial shape of the output." -6749,_get_const_output_shape,tensorflow/tensorflow/python/keras/utils/conv_utils_test.py,30,function, -6750,TestBasicConvUtilsTest,tensorflow/tensorflow/python/keras/utils/conv_utils_test.py,55,class, -6751,TestConvUtils,tensorflow/tensorflow/python/keras/utils/conv_utils_test.py,164,class, -6752,urlretrieve,tensorflow/tensorflow/python/keras/utils/data_utils.py,71,function,"Replacement for `urlretrieve` for Python 2. +7466,urlretrieve,tensorflow/tensorflow/python/keras/utils/data_utils.py,71,function,"Replacement for `urlretrieve` for Python 2. Under Python 2, `urlretrieve` relies on `FancyURLopener` from legacy `urllib` module, known to have issues with proxy management. @@ -54083,22 +63022,8 @@ Arguments: hook will be passed three arguments; a count of blocks transferred so far, a block size in bytes, and the total size of the file. data: `data` argument passed to `urlopen`." -6753,is_generator_or_sequence,tensorflow/tensorflow/python/keras/utils/data_utils.py,111,function,Check if `x` is a Keras generator type. -6754,_extract_archive,tensorflow/tensorflow/python/keras/utils/data_utils.py,119,function,"Extracts an archive if it matches tar, tar.gz, tar.bz, or zip formats. - -Arguments: - file_path: path to the archive file - path: path to extract the archive file - archive_format: Archive format to try for extracting the file. - Options are 'auto', 'tar', 'zip', and None. - 'tar' includes tar, tar.gz, and tar.bz files. - The default 'auto' is ['tar', 'zip']. - None or an empty list will return no matches found. - -Returns: - True if a match was found and an archive extraction was completed, - False otherwise." -6755,get_file,tensorflow/tensorflow/python/keras/utils/data_utils.py,169,function,"Downloads a file from a URL if it not already in the cache. +7467,is_generator_or_sequence,tensorflow/tensorflow/python/keras/utils/data_utils.py,111,function,Check if `x` is a Keras generator type. +7468,get_file,tensorflow/tensorflow/python/keras/utils/data_utils.py,169,function,"Downloads a file from a URL if it not already in the cache. By default the file at the url `origin` is downloaded to the cache_dir `~/.keras`, placed in the cache_subdir `datasets`, @@ -54145,25 +63070,7 @@ Arguments: Returns: Path to the downloaded file" -6756,_makedirs_exist_ok,tensorflow/tensorflow/python/keras/utils/data_utils.py,300,function, -6757,_hash_file,tensorflow/tensorflow/python/keras/utils/data_utils.py,312,function,"Calculates a file sha256 or md5 hash. - -Example: - -```python -_hash_file('/path/to/file.zip') -'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' -``` - -Arguments: - fpath: path to the file being validated - algorithm: hash algorithm, one of `'auto'`, `'sha256'`, or `'md5'`. - The default `'auto'` detects the hash algorithm in use. - chunk_size: Bytes to read at a time, important for large files. - -Returns: - The file hash" -6758,validate_file,tensorflow/tensorflow/python/keras/utils/data_utils.py,343,function,"Validates a file against a sha256 or md5 hash. +7469,validate_file,tensorflow/tensorflow/python/keras/utils/data_utils.py,343,function,"Validates a file against a sha256 or md5 hash. Arguments: fpath: path to the file being validated @@ -54175,9 +63082,10 @@ Arguments: Returns: Whether the file is valid" -6759,ThreadsafeIter,tensorflow/tensorflow/python/keras/utils/data_utils.py,368,class,Wrap an iterator with a lock and propagate exceptions to all threads. -6760,threadsafe_generator,tensorflow/tensorflow/python/keras/utils/data_utils.py,402,function, -6761,Sequence,tensorflow/tensorflow/python/keras/utils/data_utils.py,412,class,"Base object for fitting to a sequence of data, such as a dataset. +7470,ThreadsafeIter,tensorflow/tensorflow/python/keras/utils/data_utils.py,368,class,Wrap an iterator with a lock and propagate exceptions to all threads. +7471,next,tensorflow/tensorflow/python/keras/utils/data_utils.py,387,method, +7472,threadsafe_generator,tensorflow/tensorflow/python/keras/utils/data_utils.py,402,function, +7473,Sequence,tensorflow/tensorflow/python/keras/utils/data_utils.py,412,class,"Base object for fitting to a sequence of data, such as a dataset. Every `Sequence` must implement the `__getitem__` and the `__len__` methods. If you want to modify your dataset between epochs you may implement @@ -54220,18 +63128,20 @@ class CIFAR10Sequence(Sequence): resize(imread(file_name), (200, 200)) for file_name in batch_x]), np.array(batch_y) ```" -6762,iter_sequence_infinite,tensorflow/tensorflow/python/keras/utils/data_utils.py,490,function,"Iterates indefinitely over a Sequence. +7474,on_epoch_end,tensorflow/tensorflow/python/keras/utils/data_utils.py,479,method,"Method called at the end of every epoch. + " +7475,iter_sequence_infinite,tensorflow/tensorflow/python/keras/utils/data_utils.py,490,function,"Iterates indefinitely over a Sequence. Arguments: seq: `Sequence` instance. Yields: Batches of data from the `Sequence`." -6763,dont_use_multiprocessing_pool,tensorflow/tensorflow/python/keras/utils/data_utils.py,520,function, -6764,get_pool_class,tensorflow/tensorflow/python/keras/utils/data_utils.py,532,function, -6765,get_worker_id_queue,tensorflow/tensorflow/python/keras/utils/data_utils.py,543,function,Lazily create the queue to track worker ids. -6766,init_pool,tensorflow/tensorflow/python/keras/utils/data_utils.py,551,function, -6767,terminate_keras_multiprocessing_pools,tensorflow/tensorflow/python/keras/utils/data_utils.py,559,function,"Destroy Keras' multiprocessing pools to prevent deadlocks. +7476,dont_use_multiprocessing_pool,tensorflow/tensorflow/python/keras/utils/data_utils.py,520,function, +7477,get_pool_class,tensorflow/tensorflow/python/keras/utils/data_utils.py,532,function, +7478,get_worker_id_queue,tensorflow/tensorflow/python/keras/utils/data_utils.py,543,function,Lazily create the queue to track worker ids. +7479,init_pool,tensorflow/tensorflow/python/keras/utils/data_utils.py,551,function, +7480,terminate_keras_multiprocessing_pools,tensorflow/tensorflow/python/keras/utils/data_utils.py,559,function,"Destroy Keras' multiprocessing pools to prevent deadlocks. In general multiprocessing.Pool can interact quite badly with other, seemingly unrelated, parts of a codebase due to Pool's reliance on fork. This method @@ -54246,7 +63156,7 @@ Args: Returns: A list of human readable strings describing all issues encountered. It is up to the caller to decide whether to treat this as an error condition." -6768,get_index,tensorflow/tensorflow/python/keras/utils/data_utils.py,665,function,"Get the value from the Sequence `uid` at index `i`. +7481,get_index,tensorflow/tensorflow/python/keras/utils/data_utils.py,665,function,"Get the value from the Sequence `uid` at index `i`. To allow multiple Sequences to be used at the same time, we use `uid` to get a specific one. A single Sequence would cause the validation to @@ -54258,7 +63168,7 @@ Arguments: Returns: The value at index `i`." -6769,SequenceEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,683,class,"Base class to enqueue inputs. +7482,SequenceEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,683,class,"Base class to enqueue inputs. The task of an Enqueuer is to use parallelism to speed up preprocessing. This is done with processes or threads. @@ -54276,7 +63186,26 @@ Example: ``` The `enqueuer.get()` should be an infinite stream of datas." -6770,OrderedEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,812,class,"Builds a Enqueuer from a Sequence. +7483,is_running,tensorflow/tensorflow/python/keras/utils/data_utils.py,734,method, +7484,start,tensorflow/tensorflow/python/keras/utils/data_utils.py,737,method,"Starts the handler's workers. + +Arguments: + workers: Number of workers. + max_queue_size: queue size + (when full, workers could block on `put()`)" +7485,stop,tensorflow/tensorflow/python/keras/utils/data_utils.py,762,method,"Stops running threads and wait for them to exit, if necessary. + +Should be called by the same thread which called `start()`. + +Arguments: + timeout: maximum time to wait on `thread.join()`" +7486,get,tensorflow/tensorflow/python/keras/utils/data_utils.py,800,method,"Creates a generator to extract data from the queue. + +Skip the data if it is `None`. +# Returns + Generator yielding tuples `(inputs, targets)` + or `(inputs, targets, sample_weights)`." +7487,OrderedEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,812,class,"Builds a Enqueuer from a Sequence. Used in `fit_generator`, `evaluate_generator`, `predict_generator`. @@ -54284,7 +63213,16 @@ Arguments: sequence: A `tf.keras.utils.data_utils.Sequence` object. use_multiprocessing: use multiprocessing if True, otherwise threading shuffle: whether to shuffle the data at the beginning of each epoch" -6771,init_pool_generator,tensorflow/tensorflow/python/keras/utils/data_utils.py,903,function,"Initializer function for pool workers. +7488,get,tensorflow/tensorflow/python/keras/utils/data_utils.py,879,method,"Creates a generator to extract data from the queue. + +Skip the data if it is `None`. + +Yields: + The next element in the queue, i.e. a tuple + `(inputs, targets)` or + `(inputs, targets, sample_weights)`." +7489,pool_fn,tensorflow/tensorflow/python/keras/utils/data_utils.py,836,method, +7490,init_pool_generator,tensorflow/tensorflow/python/keras/utils/data_utils.py,903,function,"Initializer function for pool workers. Args: gens: State which should be made available to worker processes. @@ -54292,7 +63230,7 @@ Args: id_queue: A multiprocessing Queue of worker ids. This is used to indicate that a worker process was created by Keras and can be terminated using the cleanup_all_keras_forkpools utility." -6772,next_sample,tensorflow/tensorflow/python/keras/utils/data_utils.py,930,function,"Gets the next value from the generator `uid`. +7491,next_sample,tensorflow/tensorflow/python/keras/utils/data_utils.py,930,function,"Gets the next value from the generator `uid`. To allow multiple generators to be used at the same time, we use `uid` to get a specific one. A single generator would cause the validation to @@ -54303,7 +63241,7 @@ Arguments: Returns: The next value of generator `uid`." -6773,GeneratorEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,947,class,"Builds a queue out of a data generator. +7492,GeneratorEnqueuer,tensorflow/tensorflow/python/keras/utils/data_utils.py,947,class,"Builds a queue out of a data generator. The provided generator can be finite in which case the class will throw a `StopIteration` exception. @@ -54316,13 +63254,19 @@ Arguments: wait_time: time to sleep in-between calls to `put()` random_seed: Initial seed for workers, will be incremented by one for each worker." -6774,TestGetFileAndValidateIt,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,35,class, -6775,TestSequence,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,91,class, -6776,FaultSequence,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,107,class, -6777,create_generator_from_sequence_threads,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,117,function, -6778,create_generator_from_sequence_pcs,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,122,function, -6779,TestEnqueuers,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,127,class, -6780,CustomObjectScope,tensorflow/tensorflow/python/keras/utils/generic_utils.py,53,class,"Exposes custom classes/functions to Keras deserialization internals. +7493,get,tensorflow/tensorflow/python/keras/utils/data_utils.py,997,method,"Creates a generator to extract data from the queue. + +Skip the data if it is `None`. + +Yields: + The next element in the queue, i.e. a tuple + `(inputs, targets)` or + `(inputs, targets, sample_weights)`." +7494,pool_fn,tensorflow/tensorflow/python/keras/utils/data_utils.py,978,method, +7495,FaultSequence,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,107,class, +7496,create_generator_from_sequence_threads,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,117,function, +7497,create_generator_from_sequence_pcs,tensorflow/tensorflow/python/keras/utils/data_utils_test.py,122,function, +7498,CustomObjectScope,tensorflow/tensorflow/python/keras/utils/generic_utils.py,53,class,"Exposes custom classes/functions to Keras deserialization internals. Under a scope `with custom_object_scope(objects_dict)`, Keras methods such as `tf.keras.models.load_model` or `tf.keras.models.model_from_config` @@ -54344,7 +63288,7 @@ with custom_object_scope({'my_regularizer': my_regularizer}): Arguments: *args: Dictionary or dictionaries of `{name: object}` pairs." -6781,get_custom_objects,tensorflow/tensorflow/python/keras/utils/generic_utils.py,94,function,"Retrieves a live reference to the global dictionary of custom objects. +7499,get_custom_objects,tensorflow/tensorflow/python/keras/utils/generic_utils.py,94,function,"Retrieves a live reference to the global dictionary of custom objects. Updating and clearing custom objects using `custom_object_scope` is preferred, but `get_custom_objects` can @@ -54359,8 +63303,8 @@ get_custom_objects()['MyObject'] = MyObject Returns: Global dictionary of names to classes (`_GLOBAL_CUSTOM_OBJECTS`)." -6782,serialize_keras_class_and_config,tensorflow/tensorflow/python/keras/utils/generic_utils.py,114,function,Returns the serialization of the class with the given config. -6783,register_keras_serializable,tensorflow/tensorflow/python/keras/utils/generic_utils.py,120,function,"Registers an object with the Keras serialization framework. +7500,serialize_keras_class_and_config,tensorflow/tensorflow/python/keras/utils/generic_utils.py,114,function,Returns the serialization of the class with the given config. +7501,register_keras_serializable,tensorflow/tensorflow/python/keras/utils/generic_utils.py,120,function,"Registers an object with the Keras serialization framework. This decorator injects the decorated class or function into the Keras custom object dictionary, so that it can be serialized and deserialized without @@ -54380,7 +63324,7 @@ Arguments: Returns: A decorator that registers the decorated class with the passed names." -6784,get_registered_name,tensorflow/tensorflow/python/keras/utils/generic_utils.py,169,function,"Returns the name registered to an object within the Keras framework. +7502,get_registered_name,tensorflow/tensorflow/python/keras/utils/generic_utils.py,169,function,"Returns the name registered to an object within the Keras framework. This function is part of the Keras serialization and deserialization framework. It maps objects to the string names associated with those objects @@ -54392,8 +63336,8 @@ Args: Returns: The name associated with the object, or the default Python name if the object is not registered." -6785,skip_failed_serialization,tensorflow/tensorflow/python/keras/utils/generic_utils.py,190,function, -6786,get_registered_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,201,function,"Returns the class associated with `name` if it is registered with Keras. +7503,skip_failed_serialization,tensorflow/tensorflow/python/keras/utils/generic_utils.py,190,function, +7504,get_registered_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,201,function,"Returns the class associated with `name` if it is registered with Keras. This function is part of the Keras serialization and deserialization framework. It maps strings to the objects associated with them for @@ -54417,18 +63361,18 @@ Args: Returns: An instantiable class associated with 'name', or None if no such class exists." -6787,serialize_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,237,function,Serialize a Keras object into a JSON-compatible representation. -6788,get_custom_objects_by_name,tensorflow/tensorflow/python/keras/utils/generic_utils.py,275,function,Returns the item if it is in either local or global custom objects. -6789,class_and_config_for_serialized_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,284,function,Returns the class name and config for a serialized keras object. -6790,deserialize_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,336,function,Turns the serialized form of a Keras object back into an actual object. -6791,func_dump,tensorflow/tensorflow/python/keras/utils/generic_utils.py,393,function,"Serializes a user defined function. +7505,serialize_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,237,function,Serialize a Keras object into a JSON-compatible representation. +7506,get_custom_objects_by_name,tensorflow/tensorflow/python/keras/utils/generic_utils.py,275,function,Returns the item if it is in either local or global custom objects. +7507,class_and_config_for_serialized_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,284,function,Returns the class name and config for a serialized keras object. +7508,deserialize_keras_object,tensorflow/tensorflow/python/keras/utils/generic_utils.py,336,function,Turns the serialized form of a Keras object back into an actual object. +7509,func_dump,tensorflow/tensorflow/python/keras/utils/generic_utils.py,393,function,"Serializes a user defined function. Arguments: func: the function to serialize. Returns: A tuple `(code, defaults, closure)`." -6792,func_load,tensorflow/tensorflow/python/keras/utils/generic_utils.py,416,function,"Deserializes a user defined function. +7510,func_load,tensorflow/tensorflow/python/keras/utils/generic_utils.py,416,function,"Deserializes a user defined function. Arguments: code: bytecode of the function. @@ -54438,7 +63382,7 @@ Arguments: Returns: A function object." -6793,has_arg,tensorflow/tensorflow/python/keras/utils/generic_utils.py,465,function,"Checks if a callable accepts a given keyword argument. +7511,has_arg,tensorflow/tensorflow/python/keras/utils/generic_utils.py,465,function,"Checks if a callable accepts a given keyword argument. Arguments: fn: Callable to inspect. @@ -54448,7 +63392,7 @@ Arguments: Returns: bool, whether `fn` accepts a `name` keyword argument." -6794,Progbar,tensorflow/tensorflow/python/keras/utils/generic_utils.py,484,class,"Displays a progress bar. +7512,Progbar,tensorflow/tensorflow/python/keras/utils/generic_utils.py,484,class,"Displays a progress bar. Arguments: target: Total number of steps expected, None if unknown. @@ -54459,7 +63403,17 @@ Arguments: others will be averaged by the progbar before display. interval: Minimum visual progress update interval (in seconds). unit_name: Display name for step counts (usually ""step"" or ""sample"")." -6795,make_batches,tensorflow/tensorflow/python/keras/utils/generic_utils.py,668,function,"Returns a list of batch indices (tuples of indices). +7513,update,tensorflow/tensorflow/python/keras/utils/generic_utils.py,529,method,"Updates the progress bar. + +Arguments: + current: Index of current step. + values: List of tuples: `(name, value_for_last_step)`. If `name` is in + `stateful_metrics`, `value_for_last_step` will be displayed as-is. + Else, an average of the metric over time will be displayed. + finalize: Whether this is the last update for the progress bar. If + `None`, defaults to `current >= self.target`." +7514,add,tensorflow/tensorflow/python/keras/utils/generic_utils.py,664,method, +7515,make_batches,tensorflow/tensorflow/python/keras/utils/generic_utils.py,668,function,"Returns a list of batch indices (tuples of indices). Arguments: size: Integer, total size of the data to slice into batches. @@ -54467,7 +63421,7 @@ Arguments: Returns: A list of tuples of array indices." -6796,slice_arrays,tensorflow/tensorflow/python/keras/utils/generic_utils.py,683,function,"Slice an array or list of arrays. +7516,slice_arrays,tensorflow/tensorflow/python/keras/utils/generic_utils.py,683,function,"Slice an array or list of arrays. This takes an array-like, or a list of array-likes, and outputs: @@ -54486,7 +63440,7 @@ Returns: Raises: ValueError: If the value of start is a list and stop is not None." -6797,to_list,tensorflow/tensorflow/python/keras/utils/generic_utils.py,729,function,"Normalizes a list/tensor into a list. +7517,to_list,tensorflow/tensorflow/python/keras/utils/generic_utils.py,729,function,"Normalizes a list/tensor into a list. If a tensor is passed, we return a list of size 1 containing the tensor. @@ -54496,23 +63450,16 @@ Arguments: Returns: A list." -6798,to_snake_case,tensorflow/tensorflow/python/keras/utils/generic_utils.py,746,function, -6799,is_all_none,tensorflow/tensorflow/python/keras/utils/generic_utils.py,756,function, -6800,check_for_unexpected_keys,tensorflow/tensorflow/python/keras/utils/generic_utils.py,765,function, -6801,validate_kwargs,tensorflow/tensorflow/python/keras/utils/generic_utils.py,773,function,Checks that all keyword arguments are in the set of allowed keys. -6802,validate_config,tensorflow/tensorflow/python/keras/utils/generic_utils.py,782,function,Determines whether config appears to be a valid layer config. -6803,default,tensorflow/tensorflow/python/keras/utils/generic_utils.py,787,function,Decorates a method to detect overrides in subclasses. -6804,is_default,tensorflow/tensorflow/python/keras/utils/generic_utils.py,793,function,Check if a method is decorated with the `default` wrapper. -6805,populate_dict_with_module_objects,tensorflow/tensorflow/python/keras/utils/generic_utils.py,798,function, -6806,LazyLoader,tensorflow/tensorflow/python/keras/utils/generic_utils.py,806,class,"Lazily import a module, mainly to avoid pulling in large dependencies." -6807,HasArgTest,tensorflow/tensorflow/python/keras/utils/generic_utils_test.py,29,class, -6808,TestCustomObjectScope,tensorflow/tensorflow/python/keras/utils/generic_utils_test.py,67,class, -6809,SerializeKerasObjectTest,tensorflow/tensorflow/python/keras/utils/generic_utils_test.py,85,class, -6810,SliceArraysTest,tensorflow/tensorflow/python/keras/utils/generic_utils_test.py,358,class, -6811,_path_to_string,tensorflow/tensorflow/python/keras/utils/io_utils.py,40,function, -6812,_path_to_string,tensorflow/tensorflow/python/keras/utils/io_utils.py,46,function, -6813,_path_to_string,tensorflow/tensorflow/python/keras/utils/io_utils.py,53,function, -6814,path_to_string,tensorflow/tensorflow/python/keras/utils/io_utils.py,57,function,"Convert `PathLike` objects to their string representation. +7518,to_snake_case,tensorflow/tensorflow/python/keras/utils/generic_utils.py,746,function, +7519,is_all_none,tensorflow/tensorflow/python/keras/utils/generic_utils.py,756,function, +7520,check_for_unexpected_keys,tensorflow/tensorflow/python/keras/utils/generic_utils.py,765,function, +7521,validate_kwargs,tensorflow/tensorflow/python/keras/utils/generic_utils.py,773,function,Checks that all keyword arguments are in the set of allowed keys. +7522,validate_config,tensorflow/tensorflow/python/keras/utils/generic_utils.py,782,function,Determines whether config appears to be a valid layer config. +7523,default,tensorflow/tensorflow/python/keras/utils/generic_utils.py,787,function,Decorates a method to detect overrides in subclasses. +7524,is_default,tensorflow/tensorflow/python/keras/utils/generic_utils.py,793,function,Check if a method is decorated with the `default` wrapper. +7525,populate_dict_with_module_objects,tensorflow/tensorflow/python/keras/utils/generic_utils.py,798,function, +7526,LazyLoader,tensorflow/tensorflow/python/keras/utils/generic_utils.py,806,class,"Lazily import a module, mainly to avoid pulling in large dependencies." +7527,path_to_string,tensorflow/tensorflow/python/keras/utils/io_utils.py,57,function,"Convert `PathLike` objects to their string representation. If given a non-string typed path object, converts it to its string representation. Depending on the python version used, this function @@ -54530,7 +63477,7 @@ Args: Returns: A string representation of the path argument, if Python support exists." -6815,HDF5Matrix,tensorflow/tensorflow/python/keras/utils/io_utils.py,81,class,"Representation of HDF5 dataset to be used instead of a Numpy array. +7528,HDF5Matrix,tensorflow/tensorflow/python/keras/utils/io_utils.py,81,class,"Representation of HDF5 dataset to be used instead of a Numpy array. THIS CLASS IS DEPRECATED. Training with HDF5Matrix may not be optimized for performance, and might @@ -54538,19 +63485,32 @@ not work with every distribution strategy. We recommend using https://github.com/tensorflow/io to load your HDF5 data into a tf.data Dataset and passing that dataset to Keras." -6816,ask_to_proceed_with_overwrite,tensorflow/tensorflow/python/keras/utils/io_utils.py,236,function,"Produces a prompt asking about overwriting a file. +7529,shape,tensorflow/tensorflow/python/keras/utils/io_utils.py,181,method,"Gets a numpy-style shape tuple giving the dataset dimensions. + +Returns: + A numpy-style shape tuple." +7530,dtype,tensorflow/tensorflow/python/keras/utils/io_utils.py,190,method,"Gets the datatype of the dataset. + +Returns: + A numpy dtype string." +7531,ndim,tensorflow/tensorflow/python/keras/utils/io_utils.py,199,method,"Gets the number of dimensions (rank) of the dataset. + +Returns: + An integer denoting the number of dimensions (rank) of the dataset." +7532,size,tensorflow/tensorflow/python/keras/utils/io_utils.py,208,method,"Gets the total dataset size (number of elements). + +Returns: + An integer denoting the number of elements in the dataset." +7533,ask_to_proceed_with_overwrite,tensorflow/tensorflow/python/keras/utils/io_utils.py,236,function,"Produces a prompt asking about overwriting a file. Arguments: filepath: the path to the file to be overwritten. Returns: True if we can proceed with overwrite, False otherwise." -6817,create_dataset,tensorflow/tensorflow/python/keras/utils/io_utils_test.py,40,function, -6818,TestIOUtils,tensorflow/tensorflow/python/keras/utils/io_utils_test.py,53,class, -6819,_to_matrix,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,25,function,"If input tensor is a vector (i.e., has rank 1), converts it to matrix." -6820,_align_matrices,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,36,function,Aligns x and y tensors to allow computations over pairs of their rows. -6821,inner_product,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,54,function, -6822,exact_gaussian_kernel,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,60,function,"Computes exact Gaussian kernel value(s) for tensors x and y and stddev. +7534,create_dataset,tensorflow/tensorflow/python/keras/utils/io_utils_test.py,40,function, +7535,inner_product,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,54,function, +7536,exact_gaussian_kernel,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,60,function,"Computes exact Gaussian kernel value(s) for tensors x and y and stddev. The Gaussian kernel for vectors u, v is defined as follows: K(u, v) = exp(-||u-v||^2 / (2* stddev^2)) @@ -54572,7 +63532,7 @@ Returns: Raises: ValueError: if the shapes of x, y are not compatible." -6823,exact_laplacian_kernel,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,90,function,"Computes exact Laplacian kernel value(s) for tensors x and y using stddev. +7537,exact_laplacian_kernel,tensorflow/tensorflow/python/keras/utils/kernelized_utils.py,90,function,"Computes exact Laplacian kernel value(s) for tensors x and y using stddev. The Laplacian kernel for vectors u, v is defined as follows: K(u, v) = exp(-||u-v|| / stddev) @@ -54594,10 +63554,7 @@ Returns: Raises: ValueError: if the shapes of x, y are not compatible." -6824,_exact_gaussian,tensorflow/tensorflow/python/keras/utils/kernelized_utils_test.py,30,function, -6825,_exact_laplacian,tensorflow/tensorflow/python/keras/utils/kernelized_utils_test.py,35,function, -6826,KernelizedUtilsTest,tensorflow/tensorflow/python/keras/utils/kernelized_utils_test.py,40,class, -6827,get_source_inputs,tensorflow/tensorflow/python/keras/utils/layer_utils.py,34,function,"Returns the list of input tensors necessary to compute `tensor`. +7538,get_source_inputs,tensorflow/tensorflow/python/keras/utils/layer_utils.py,34,function,"Returns the list of input tensors necessary to compute `tensor`. Output will always be a list of tensors (potentially with 1 element). @@ -54610,15 +63567,15 @@ Arguments: Returns: List of input tensors." -6828,validate_string_arg,tensorflow/tensorflow/python/keras/utils/layer_utils.py,72,function,Validates the correctness of a string-based arg. -6829,count_params,tensorflow/tensorflow/python/keras/utils/layer_utils.py,95,function,"Count the total number of scalars composing the weights. +7539,validate_string_arg,tensorflow/tensorflow/python/keras/utils/layer_utils.py,72,function,Validates the correctness of a string-based arg. +7540,count_params,tensorflow/tensorflow/python/keras/utils/layer_utils.py,95,function,"Count the total number of scalars composing the weights. Arguments: weights: An iterable containing the weights on which to compute params Returns: The total number of scalars composing the weights" -6830,print_summary,tensorflow/tensorflow/python/keras/utils/layer_utils.py,112,function,"Prints a summary of a model. +7541,print_summary,tensorflow/tensorflow/python/keras/utils/layer_utils.py,112,function,"Prints a summary of a model. Arguments: model: Keras model instance. @@ -54632,7 +63589,7 @@ Arguments: You can set it to a custom function in order to capture the string summary. It defaults to `print` (prints to stdout)." -6831,gather_trainable_weights,tensorflow/tensorflow/python/keras/utils/layer_utils.py,274,function,"Lists the trainable weights for an object with sub-layers. +7542,gather_trainable_weights,tensorflow/tensorflow/python/keras/utils/layer_utils.py,274,function,"Lists the trainable weights for an object with sub-layers. Args: trainable: Whether the object collecting the variables is trainable. @@ -54643,7 +63600,7 @@ Args: Returns: A list of collected trainable weights/variables." -6832,gather_non_trainable_weights,tensorflow/tensorflow/python/keras/utils/layer_utils.py,297,function,"Lists the non-trainable weights for an object with sub-layers. +7543,gather_non_trainable_weights,tensorflow/tensorflow/python/keras/utils/layer_utils.py,297,function,"Lists the non-trainable weights for an object with sub-layers. Args: trainable: Whether the object collecting the variables is trainable. @@ -54654,7 +63611,7 @@ Args: Returns: A list of collected non-trainable weights/variables." -6833,convert_all_kernels_in_model,tensorflow/tensorflow/python/keras/utils/layer_utils.py,333,function,"Converts all convolution kernels in a model from Theano to TensorFlow. +7544,convert_all_kernels_in_model,tensorflow/tensorflow/python/keras/utils/layer_utils.py,333,function,"Converts all convolution kernels in a model from Theano to TensorFlow. Also works from TensorFlow to Theano. @@ -54662,7 +63619,7 @@ This is used for converting legacy Theano-saved model files. Arguments: model: target model for the conversion." -6834,convert_dense_weights_data_format,tensorflow/tensorflow/python/keras/utils/layer_utils.py,360,function,"Utility useful when changing a convnet's `data_format`. +7545,convert_dense_weights_data_format,tensorflow/tensorflow/python/keras/utils/layer_utils.py,360,function,"Utility useful when changing a convnet's `data_format`. When porting the weights of a convnet from one data format to the other, if the convnet includes a `Flatten` layer @@ -54680,8 +63637,8 @@ Arguments: Set it ""channels_last"" if converting a ""channels_first"" model to ""channels_last"", or reciprocally." -6835,is_builtin_layer,tensorflow/tensorflow/python/keras/utils/layer_utils.py,399,function, -6836,remove_squeezable_dimensions,tensorflow/tensorflow/python/keras/utils/losses_utils.py,38,function,"Squeeze last dim if ranks differ from expected by exactly 1. +7546,is_builtin_layer,tensorflow/tensorflow/python/keras/utils/layer_utils.py,399,function, +7547,remove_squeezable_dimensions,tensorflow/tensorflow/python/keras/utils/losses_utils.py,38,function,"Squeeze last dim if ranks differ from expected by exactly 1. In the common case where we expect shapes to match, `expected_rank_diff` defaults to 0, and we squeeze the last dimension of the larger rank if they @@ -54704,7 +63661,7 @@ Args: Returns: Tuple of `labels` and `predictions`, possibly with last dim squeezed." -6837,squeeze_or_expand_dimensions,tensorflow/tensorflow/python/keras/utils/losses_utils.py,99,function,"Squeeze or expand last dimension if needed. +7548,squeeze_or_expand_dimensions,tensorflow/tensorflow/python/keras/utils/losses_utils.py,99,function,"Squeeze or expand last dimension if needed. 1. Squeezes last dim of `y_pred` or `y_true` if their rank differs by 1 (using `remove_squeezable_dimensions`). @@ -54726,18 +63683,8 @@ Returns: the last dimension squeezed, `sample_weight` could be extended by one dimension. If `sample_weight` is None, (y_pred, y_true) is returned." -6838,_safe_mean,tensorflow/tensorflow/python/keras/utils/losses_utils.py,188,function,"Computes a safe mean of the losses. - -Args: - losses: `Tensor` whose elements contain individual loss measurements. - num_present: The number of measurable elements in `losses`. - -Returns: - A scalar representing the mean of `losses`. If `num_present` is zero, - then zero is returned." -6839,_num_elements,tensorflow/tensorflow/python/keras/utils/losses_utils.py,203,function,Computes the number of elements in `losses` tensor. -6840,reduce_weighted_loss,tensorflow/tensorflow/python/keras/utils/losses_utils.py,209,function,Reduces the individual weighted loss measurements. -6841,compute_weighted_loss,tensorflow/tensorflow/python/keras/utils/losses_utils.py,221,function,"Computes the weighted loss. +7549,reduce_weighted_loss,tensorflow/tensorflow/python/keras/utils/losses_utils.py,209,function,Reduces the individual weighted loss measurements. +7550,compute_weighted_loss,tensorflow/tensorflow/python/keras/utils/losses_utils.py,221,function,"Computes the weighted loss. Args: losses: `Tensor` of shape `[batch_size, d1, ... dN]`. @@ -54753,8 +63700,8 @@ Raises: Returns: Weighted loss `Tensor` of the same type as `losses`. If `reduction` is `NONE`, this has the same shape as `losses`; otherwise, it is scalar." -6842,scale_loss_for_distribution,tensorflow/tensorflow/python/keras/utils/losses_utils.py,278,function,Scales and returns the given loss value by the number of replicas. -6843,cast_losses_to_common_dtype,tensorflow/tensorflow/python/keras/utils/losses_utils.py,287,function,"Cast a list of losses to a common dtype. +7551,scale_loss_for_distribution,tensorflow/tensorflow/python/keras/utils/losses_utils.py,278,function,Scales and returns the given loss value by the number of replicas. +7552,cast_losses_to_common_dtype,tensorflow/tensorflow/python/keras/utils/losses_utils.py,287,function,"Cast a list of losses to a common dtype. If any loss is floating-point, they will all be casted to the most-precise floating-point loss. Otherwise the losses are not casted. We also skip casting @@ -54765,7 +63712,7 @@ Args: Returns: `losses`, but they have been casted to a common dtype." -6844,Reduction,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,48,class,"Types of metrics reduction. +7553,Reduction,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,48,class,"Types of metrics reduction. Contains the following values: @@ -54773,14 +63720,14 @@ Contains the following values: * `SUM_OVER_BATCH_SIZE`: Scalar sum of weighted values divided by number of elements. * `WEIGHTED_MEAN`: Scalar sum of weighted values divided by sum of weights." -6845,update_state_wrapper,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,63,function,"Decorator to wrap metric `update_state()` with `add_update()`. +7554,update_state_wrapper,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,63,function,"Decorator to wrap metric `update_state()` with `add_update()`. Args: update_state_fn: function that accumulates metric statistics. Returns: Decorated function that wraps `update_state_fn()` with `add_update()`." -6846,result_wrapper,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,98,function,"Decorator to wrap metric `result()` function in `merge_call()`. +7555,result_wrapper,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,98,function,"Decorator to wrap metric `result()` function in `merge_call()`. Result computation is an idempotent operation that simply calculates the metric value using the state variables. @@ -54796,12 +63743,13 @@ Args: Returns: Decorated function that wraps `result_fn()` in distribution strategy `merge_call()`." -6847,weakmethod,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,154,function,Creates a weak reference to the bound method. -6848,assert_thresholds_range,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,169,function, -6849,parse_init_thresholds,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,178,function, -6850,ConfusionMatrix,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,185,class, -6851,AUCCurve,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,192,class,Type of AUC Curve (ROC or PR). -6852,AUCSummationMethod,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,207,class,"Type of AUC summation method. +7556,weakmethod,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,154,function,Creates a weak reference to the bound method. +7557,assert_thresholds_range,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,169,function, +7558,parse_init_thresholds,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,178,function, +7559,ConfusionMatrix,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,185,class, +7560,AUCCurve,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,192,class,Type of AUC Curve (ROC or PR). +7561,from_str,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,198,method, +7562,AUCSummationMethod,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,207,class,"Type of AUC summation method. https://en.wikipedia.org/wiki/Riemann_sum) @@ -54813,7 +63761,8 @@ Contains the following values: summation for decreasing intervals. * 'majoring': Applies right summation for increasing intervals and left summation for decreasing intervals." -6853,update_confusion_matrix_variables,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,237,function,"Returns op to update the given confusion matrix variables. +7563,from_str,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,226,method, +7564,update_confusion_matrix_variables,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,237,function,"Returns op to update the given confusion matrix variables. For every pair of values in y_true and y_pred: @@ -54862,18 +63811,7 @@ Raises: ValueError: If `y_pred` and `y_true` have mismatched shapes, or if `sample_weight` is not `None` and its shape doesn't match `y_pred`, or if `variables_to_update` contains invalid keys." -6854,_filter_top_k,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,460,function,"Filters top-k values in the last dim of x and set the rest to NEG_INF. - -Used for computing top-k prediction values in dense labels (which has the same -shape as predictions) for recall and precision top-k metrics. - -Args: - x: tensor with any dimensions. - k: the number of values to keep. - -Returns: - tensor with same shape and dtype as x." -6855,ragged_assert_compatible_and_get_flat_values,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,479,function,"If ragged, it checks the compatibility and then returns the flat_values. +7565,ragged_assert_compatible_and_get_flat_values,tensorflow/tensorflow/python/keras/utils/metrics_utils.py,479,function,"If ragged, it checks the compatibility and then returns the flat_values. Note: If two tensors are dense, it does not check their compatibility. Note: Although two ragged tensors with different ragged ranks could have @@ -54888,11 +63826,7 @@ Returns: A tuple in which the first element is the list of tensors and the second is the mask tensor. ([Values], mask). Mask and the element in Values are equal to the flat_values of the input arguments (if they were ragged)." -6856,RaggedSizeOpTest,tensorflow/tensorflow/python/keras/utils/metrics_utils_test.py,35,class, -6857,FilterTopKTest,tensorflow/tensorflow/python/keras/utils/metrics_utils_test.py,254,class, -6858,_get_available_devices,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils.py,30,function, -6859,_normalize_device_name,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils.py,34,function, -6860,multi_gpu_model,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils.py,42,function,"Replicates a model on different GPUs. +7566,multi_gpu_model,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils.py,42,function,"Replicates a model on different GPUs. Specifically, this function implements single-machine multi-GPU data parallelism. It works in the following way: @@ -55005,9 +63939,8 @@ Example 3: Training models with weights merge on GPU (recommended for NV-link) Raises: ValueError: if the `gpus` argument does not match available devices." -6861,check_if_compatible_devices,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils_test.py,32,function, -6862,TestMultiGPUModel,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils_test.py,42,class, -6863,to_categorical,tensorflow/tensorflow/python/keras/utils/np_utils.py,25,function,"Converts a class vector (integers) to binary class matrix. +7567,check_if_compatible_devices,tensorflow/tensorflow/python/keras/utils/multi_gpu_utils_test.py,32,function, +7568,to_categorical,tensorflow/tensorflow/python/keras/utils/np_utils.py,25,function,"Converts a class vector (integers) to binary class matrix. E.g. for use with categorical_crossentropy. @@ -55048,7 +63981,7 @@ tf.Tensor( Raises: Value Error: If input contains string value" -6864,normalize,tensorflow/tensorflow/python/keras/utils/np_utils.py,85,function,"Normalizes a Numpy array. +7569,normalize,tensorflow/tensorflow/python/keras/utils/np_utils.py,85,function,"Normalizes a Numpy array. Arguments: x: Numpy array to normalize. @@ -55057,8 +63990,7 @@ Arguments: Returns: A normalized copy of the array." -6865,TestNPUtils,tensorflow/tensorflow/python/keras/utils/np_utils_test.py,27,class, -6866,smart_cond,tensorflow/tensorflow/python/keras/utils/tf_utils.py,44,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. +7570,smart_cond,tensorflow/tensorflow/python/keras/utils/tf_utils.py,44,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. If `pred` is a bool or has a constant value, we return either `true_fn()` or `false_fn()`, otherwise we use `tf.cond` to dynamically route to both. @@ -55075,7 +64007,7 @@ Returns: Raises: TypeError: If `true_fn` or `false_fn` is not callable." -6867,constant_value,tensorflow/tensorflow/python/keras/utils/tf_utils.py,70,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. +7571,constant_value,tensorflow/tensorflow/python/keras/utils/tf_utils.py,70,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. Arguments: pred: A scalar, either a Python bool or a TensorFlow boolean variable @@ -55087,8 +64019,8 @@ Returns: Raises: TypeError: If `pred` is not a Variable, Tensor or bool, or Python integer 1 or 0." -6868,is_tensor_or_tensor_list,tensorflow/tensorflow/python/keras/utils/tf_utils.py,96,function, -6869,get_reachable_from_inputs,tensorflow/tensorflow/python/keras/utils/tf_utils.py,104,function,"Returns the set of tensors/ops reachable from `inputs`. +7572,is_tensor_or_tensor_list,tensorflow/tensorflow/python/keras/utils/tf_utils.py,96,function, +7573,get_reachable_from_inputs,tensorflow/tensorflow/python/keras/utils/tf_utils.py,104,function,"Returns the set of tensors/ops reachable from `inputs`. Stops if all targets have been found (target is optional). @@ -55100,7 +64032,7 @@ Args: Returns: A set of tensors reachable from the inputs (includes the inputs themselves)." -6870,map_structure_with_atomic,tensorflow/tensorflow/python/keras/utils/tf_utils.py,159,function,"Maps the atomic elements of a nested structure. +7574,map_structure_with_atomic,tensorflow/tensorflow/python/keras/utils/tf_utils.py,159,function,"Maps the atomic elements of a nested structure. Arguments: is_atomic_fn: A function that determines if an element of `nested` is @@ -55114,8 +64046,8 @@ Returns: Raises: ValueError: If an element that is neither atomic nor a sequence is encountered." -6871,get_shapes,tensorflow/tensorflow/python/keras/utils/tf_utils.py,194,function,Gets shapes from tensors. -6872,convert_shapes,tensorflow/tensorflow/python/keras/utils/tf_utils.py,202,function,"Converts nested shape representations to desired format. +7575,get_shapes,tensorflow/tensorflow/python/keras/utils/tf_utils.py,194,function,Gets shapes from tensors. +7576,convert_shapes,tensorflow/tensorflow/python/keras/utils/tf_utils.py,202,function,"Converts nested shape representations to desired format. Performs: @@ -55139,8 +64071,9 @@ Returns: Raises: ValueError: when the input tensor shape can't be converted to tuples, eg unknown tensor shape." -6873,ListWrapper,tensorflow/tensorflow/python/keras/utils/tf_utils.py,253,class,A wrapper for lists to be treated as elements for `nest`. -6874,convert_inner_node_data,tensorflow/tensorflow/python/keras/utils/tf_utils.py,263,function,"Either wraps or unwraps innermost node data lists in `ListWrapper` objects. +7577,ListWrapper,tensorflow/tensorflow/python/keras/utils/tf_utils.py,253,class,A wrapper for lists to be treated as elements for `nest`. +7578,as_list,tensorflow/tensorflow/python/keras/utils/tf_utils.py,259,method, +7579,convert_inner_node_data,tensorflow/tensorflow/python/keras/utils/tf_utils.py,263,function,"Either wraps or unwraps innermost node data lists in `ListWrapper` objects. Arguments: nested: A nested data structure. @@ -55149,7 +64082,7 @@ Arguments: Returns: Structure of same type as nested, with lists wrapped/unwrapped." -6875,shape_type_conversion,tensorflow/tensorflow/python/keras/utils/tf_utils.py,308,function,"Decorator that handles tuple/TensorShape conversion. +7580,shape_type_conversion,tensorflow/tensorflow/python/keras/utils/tf_utils.py,308,function,"Decorator that handles tuple/TensorShape conversion. Used in `compute_output_shape` and `build`. @@ -55158,8 +64091,8 @@ Arguments: Returns: Wrapped function." -6876,are_all_symbolic_tensors,tensorflow/tensorflow/python/keras/utils/tf_utils.py,334,function, -6877,is_symbolic_tensor,tensorflow/tensorflow/python/keras/utils/tf_utils.py,341,function,"Returns whether a tensor is symbolic (from a TF graph) or an eager tensor. +7581,are_all_symbolic_tensors,tensorflow/tensorflow/python/keras/utils/tf_utils.py,334,function, +7582,is_symbolic_tensor,tensorflow/tensorflow/python/keras/utils/tf_utils.py,341,function,"Returns whether a tensor is symbolic (from a TF graph) or an eager tensor. A Variable can be seen as either: it is considered symbolic when we are in a graph scope, and eager when we are in an eager scope. @@ -55169,7 +64102,7 @@ Arguments: Returns: True for symbolic tensors, False for eager tensors." -6878,register_symbolic_tensor_type,tensorflow/tensorflow/python/keras/utils/tf_utils.py,373,function,"Allows users to specify types regarded as symbolic `Tensor`s. +7583,register_symbolic_tensor_type,tensorflow/tensorflow/python/keras/utils/tf_utils.py,373,function,"Allows users to specify types regarded as symbolic `Tensor`s. Used in conjunction with `tf.register_tensor_conversion_function`, calling `tf.keras.utils.register_symbolic_tensor_type(cls)` allows non-`Tensor` @@ -55196,10 +64129,10 @@ layer = tf.keras.layers.Lambda(lambda input_: Foo(input_)) Arguments: cls: A `class` type which shall be regarded as a symbolic `Tensor`." -6879,type_spec_from_value,tensorflow/tensorflow/python/keras/utils/tf_utils.py,406,function,Grab type_spec without converting array-likes to tensors. -6880,is_ragged,tensorflow/tensorflow/python/keras/utils/tf_utils.py,418,function,Returns true if `tensor` is a ragged tensor or ragged tensor value. -6881,is_tensor_or_variable,tensorflow/tensorflow/python/keras/utils/tf_utils.py,425,function, -6882,assert_no_legacy_layers,tensorflow/tensorflow/python/keras/utils/tf_utils.py,429,function,"Prevent tf.layers.Layers from being used with Keras. +7584,type_spec_from_value,tensorflow/tensorflow/python/keras/utils/tf_utils.py,406,function,Grab type_spec without converting array-likes to tensors. +7585,is_ragged,tensorflow/tensorflow/python/keras/utils/tf_utils.py,418,function,Returns true if `tensor` is a ragged tensor or ragged tensor value. +7586,is_tensor_or_variable,tensorflow/tensorflow/python/keras/utils/tf_utils.py,425,function, +7587,assert_no_legacy_layers,tensorflow/tensorflow/python/keras/utils/tf_utils.py,429,function,"Prevent tf.layers.Layers from being used with Keras. Certain legacy layers inherit from their keras analogs; however they are not supported with keras and can lead to subtle and hard to diagnose bugs. @@ -55209,17 +64142,17 @@ Args: Raises: TypeError: If any elements of layers are tf.layers.Layers" -6883,maybe_init_scope,tensorflow/tensorflow/python/keras/utils/tf_utils.py,455,function,"Open an `init_scope` if in V2 mode and using the keras graph. +7588,maybe_init_scope,tensorflow/tensorflow/python/keras/utils/tf_utils.py,455,function,"Open an `init_scope` if in V2 mode and using the keras graph. Arguments: layer: The Layer/Model that is currently active. Yields: None" -6884,graph_context_for_symbolic_tensors,tensorflow/tensorflow/python/keras/utils/tf_utils.py,474,function,Returns graph context manager if any of the inputs is a symbolic tensor. -6885,dataset_is_infinite,tensorflow/tensorflow/python/keras/utils/tf_utils.py,483,function,True if the passed dataset is infinite. -6886,get_tensor_spec,tensorflow/tensorflow/python/keras/utils/tf_utils.py,493,function,Returns a `TensorSpec` given a single `Tensor` or `TensorSpec`. -6887,to_numpy_or_python_type,tensorflow/tensorflow/python/keras/utils/tf_utils.py,522,function,"Converts a structure of `Tensor`s to `NumPy` arrays or Python scalar types. +7589,graph_context_for_symbolic_tensors,tensorflow/tensorflow/python/keras/utils/tf_utils.py,474,function,Returns graph context manager if any of the inputs is a symbolic tensor. +7590,dataset_is_infinite,tensorflow/tensorflow/python/keras/utils/tf_utils.py,483,function,True if the passed dataset is infinite. +7591,get_tensor_spec,tensorflow/tensorflow/python/keras/utils/tf_utils.py,493,function,Returns a `TensorSpec` given a single `Tensor` or `TensorSpec`. +7592,to_numpy_or_python_type,tensorflow/tensorflow/python/keras/utils/tf_utils.py,522,function,"Converts a structure of `Tensor`s to `NumPy` arrays or Python scalar types. For each tensor, it calls `tensor.numpy()`. If the result is a scalar value, it converts it to a Python type, such as a float or int, by calling @@ -55235,23 +64168,17 @@ Args: Returns: `tensors`, but scalar tensors are converted to Python types and non-scalar tensors are converted to Numpy arrays." -6888,_astuple,tensorflow/tensorflow/python/keras/utils/tf_utils.py,549,function,Converts the given attrs to tuple non-recursively. -6889,TestIsSymbolicTensor,tensorflow/tensorflow/python/keras/utils/tf_utils_test.py,40,class, -6890,ConvertInnerNodeDataTest,tensorflow/tensorflow/python/keras/utils/tf_utils_test.py,155,class, -6891,AttrsTest,tensorflow/tensorflow/python/keras/utils/tf_utils_test.py,167,class, -6892,TestIsRagged,tensorflow/tensorflow/python/keras/utils/tf_utils_test.py,186,class, -6893,ModelVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,51,class,Chooses between Keras v1 and v2 Model class. -6894,LayerVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,60,class,Chooses between Keras v1 and v2 Layer class. -6895,TensorBoardVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,69,class,Chooses between Keras v1 and v2 TensorBoard callback class. -6896,should_use_v2,tensorflow/tensorflow/python/keras/utils/version_utils.py,84,function,Determine if v1 or v2 version should be used. -6897,swap_class,tensorflow/tensorflow/python/keras/utils/version_utils.py,98,function,Swaps in v2_cls or v1_cls depending on graph mode. -6898,disallow_legacy_graph,tensorflow/tensorflow/python/keras/utils/version_utils.py,114,function, -6899,is_v1_layer_or_model,tensorflow/tensorflow/python/keras/utils/version_utils.py,125,function, -6900,SplitUtilsTest,tensorflow/tensorflow/python/keras/utils/version_utils_test.py,37,class, -6901,check_pydot,tensorflow/tensorflow/python/keras/utils/vis_utils.py,44,function,Returns True if PyDot and Graphviz are available. -6902,is_wrapped_model,tensorflow/tensorflow/python/keras/utils/vis_utils.py,57,function, -6903,add_edge,tensorflow/tensorflow/python/keras/utils/vis_utils.py,64,function, -6904,model_to_dot,tensorflow/tensorflow/python/keras/utils/vis_utils.py,70,function,"Convert a Keras model to dot format. +7593,ModelVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,51,class,Chooses between Keras v1 and v2 Model class. +7594,LayerVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,60,class,Chooses between Keras v1 and v2 Layer class. +7595,TensorBoardVersionSelector,tensorflow/tensorflow/python/keras/utils/version_utils.py,69,class,Chooses between Keras v1 and v2 TensorBoard callback class. +7596,should_use_v2,tensorflow/tensorflow/python/keras/utils/version_utils.py,84,function,Determine if v1 or v2 version should be used. +7597,swap_class,tensorflow/tensorflow/python/keras/utils/version_utils.py,98,function,Swaps in v2_cls or v1_cls depending on graph mode. +7598,disallow_legacy_graph,tensorflow/tensorflow/python/keras/utils/version_utils.py,114,function, +7599,is_v1_layer_or_model,tensorflow/tensorflow/python/keras/utils/version_utils.py,125,function, +7600,check_pydot,tensorflow/tensorflow/python/keras/utils/vis_utils.py,44,function,Returns True if PyDot and Graphviz are available. +7601,is_wrapped_model,tensorflow/tensorflow/python/keras/utils/vis_utils.py,57,function, +7602,add_edge,tensorflow/tensorflow/python/keras/utils/vis_utils.py,64,function, +7603,model_to_dot,tensorflow/tensorflow/python/keras/utils/vis_utils.py,70,function,"Convert a Keras model to dot format. Arguments: model: A Keras model instance. @@ -55273,7 +64200,7 @@ Returns: Raises: ImportError: if graphviz or pydot are not available." -6905,plot_model,tensorflow/tensorflow/python/keras/utils/vis_utils.py,281,function,"Converts a Keras model to dot format and save to a file. +7604,plot_model,tensorflow/tensorflow/python/keras/utils/vis_utils.py,281,function,"Converts a Keras model to dot format and save to a file. Example: @@ -55307,8 +64234,7 @@ Arguments: Returns: A Jupyter notebook Image object if Jupyter is installed. This enables in-line display of the model plots in notebooks." -6906,ModelToDotFormatTest,tensorflow/tensorflow/python/keras/utils/vis_utils_test.py,28,class, -6907,BaseWrapper,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,33,class,"Base class for the Keras scikit-learn wrapper. +7605,BaseWrapper,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,33,class,"Base class for the Keras scikit-learn wrapper. Warning: This class should not be used directly. Use descendant classes instead. @@ -55346,65 +64272,163 @@ When using scikit-learn's `grid_search` API, legal tunable parameters are those you could pass to `sk_params`, including fitting parameters. In other words, you could use `grid_search` to search for the best `batch_size` or `epochs` as well as the model parameters." -6908,KerasClassifier,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,191,class,"Implementation of the scikit-learn classifier API for Keras. - " -6909,KerasRegressor,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,314,class,"Implementation of the scikit-learn regressor API for Keras. - " -6910,build_fn_clf,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,37,function, -6911,assert_classification_works,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,50,function, -6912,build_fn_reg,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,73,function, -6913,assert_regression_works,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,86,function, -6914,ScikitLearnAPIWrapperTest,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,103,class, -6915,AckermannTest,tensorflow/tensorflow/python/kernel_tests/ackermann_test.py,28,class, -6916,AddNTest,tensorflow/tensorflow/python/kernel_tests/aggregate_ops_test.py,34,class, -6917,ArgMaxTest,tensorflow/tensorflow/python/kernel_tests/argmax_op_test.py,31,class, -6918,BatchMatrixTransposeTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,56,class, -6919,BooleanMaskTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,124,class, -6920,OperatorShapeTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,317,class, -6921,ReverseV2Test,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,349,class, -6922,MeshgridTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,525,class, -6923,StridedSliceChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,566,class,Check a given tensor against the numpy result. -6924,StridedSliceTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,630,class,Test the strided slice operation with variants of slices. -6925,StridedSliceShapeChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,851,class, -6926,StridedSliceShapeTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,861,class,Test the shape inference of StridedSliceShapes. -6927,GradSliceChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,917,class,Tests that we can compute a gradient for var^2. -6928,StridedSliceGradTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,956,class,Test that strided slice's custom gradient produces correct gradients. -6929,StridedSliceGradTypeTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1005,class,Test varied index types and host located memory. -6930,BenchmarkSlice,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1057,class, -6931,StridedSliceBenchmark,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1066,class,Benchmark new strided slice operation on non-trivial case. -6932,StridedSliceAssignChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1110,class, -6933,SliceAssignTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1145,class, -6934,ShapeSizeRankTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1251,class, -6935,SequenceMaskTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1287,class, -6936,ConcatSliceResourceTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1368,class, -6937,IdentityTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1382,class, -6938,PadTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1408,class, -6939,InvertPermutationTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1423,class, -6940,UnravelIndexTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1436,class, -6941,GuaranteeConstOpTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1470,class, -6942,SnapshotOpTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1506,class, -6943,QuantizeAndDequantizeTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1519,class, -6944,SortedSearchTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1566,class, -6945,BatchGatherNdTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1785,class, -6946,RepeatTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,2000,class, -6947,TileVariantTest,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,2029,class, -6948,AsStringOpTest,tensorflow/tensorflow/python/kernel_tests/as_string_op_test.py,29,class, -6949,_upsample_filters,tensorflow/tensorflow/python/kernel_tests/atrous_conv2d_test.py,34,function,"Upsamples the filters by a factor of rate along the spatial dimensions. +7606,check_params,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,79,method,"Checks for user typos in `params`. -Args: - filters: [h, w, in_depth, out_depth]. Original filters. - rate: An int, specifying the upsampling rate. +Arguments: + params: dictionary; the parameters to be checked + +Raises: + ValueError: if any member of `params` is not a valid argument." +7607,get_params,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,108,method,"Gets parameters for this estimator. + +Arguments: + **params: ignored (exists for API compatibility). Returns: - filters_up: [h_up, w_up, in_depth, out_depth]. Upsampled filters with - h_up = h + (h - 1) * (rate - 1) - w_up = w + (w - 1) * (rate - 1) - containing (rate - 1) zeros between consecutive filter values along - the filters' spatial dimensions." -6950,AtrousConv2DTest,tensorflow/tensorflow/python/kernel_tests/atrous_conv2d_test.py,60,class, -6951,AtrousConv2DTransposeTest,tensorflow/tensorflow/python/kernel_tests/atrous_conv2d_test.py,165,class, -6952,AtrousDepthwiseConv2DTest,tensorflow/tensorflow/python/kernel_tests/atrous_conv2d_test.py,204,class, -6953,upsample_filters,tensorflow/tensorflow/python/kernel_tests/atrous_convolution_test.py,36,function,"Upsamples the filters by a factor of rate along the spatial dimensions. + Dictionary of parameter names mapped to their values." +7608,set_params,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,121,method,"Sets the parameters of this estimator. + +Arguments: + **params: Dictionary of parameter names mapped to their values. + +Returns: + self" +7609,fit,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,134,method,"Constructs a new model with `build_fn` & fit the model to `(x, y)`. + +Arguments: + x : array-like, shape `(n_samples, n_features)` + Training samples where `n_samples` is the number of samples + and `n_features` is the number of features. + y : array-like, shape `(n_samples,)` or `(n_samples, n_outputs)` + True labels for `x`. + **kwargs: dictionary arguments + Legal arguments are the arguments of `Sequential.fit` + +Returns: + history : object + details about the training history at each epoch." +7610,filter_sk_params,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,170,method,"Filters `sk_params` and returns those in `fn`'s arguments. + +Arguments: + fn : arbitrary function + override: dictionary, values to override `sk_params` + +Returns: + res : dictionary containing variables + in both `sk_params` and `fn`'s arguments." +7611,KerasClassifier,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,191,class,"Implementation of the scikit-learn classifier API for Keras. + " +7612,fit,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,195,method,"Constructs a new model with `build_fn` & fit the model to `(x, y)`. + +Arguments: + x : array-like, shape `(n_samples, n_features)` + Training samples where `n_samples` is the number of samples + and `n_features` is the number of features. + y : array-like, shape `(n_samples,)` or `(n_samples, n_outputs)` + True labels for `x`. + **kwargs: dictionary arguments + Legal arguments are the arguments of `Sequential.fit` + +Returns: + history : object + details about the training history at each epoch. + +Raises: + ValueError: In case of invalid shape for `y` argument." +7613,predict,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,225,method,"Returns the class predictions for the given test data. + +Arguments: + x: array-like, shape `(n_samples, n_features)` + Test samples where `n_samples` is the number of samples + and `n_features` is the number of features. + **kwargs: dictionary arguments + Legal arguments are the arguments + of `Sequential.predict_classes`. + +Returns: + preds: array-like, shape `(n_samples,)` + Class predictions." +7614,predict_proba,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,244,method,"Returns class probability estimates for the given test data. + +Arguments: + x: array-like, shape `(n_samples, n_features)` + Test samples where `n_samples` is the number of samples + and `n_features` is the number of features. + **kwargs: dictionary arguments + Legal arguments are the arguments + of `Sequential.predict_classes`. + +Returns: + proba: array-like, shape `(n_samples, n_outputs)` + Class probability estimates. + In the case of binary classification, + to match the scikit-learn API, + will return an array of shape `(n_samples, 2)` + (instead of `(n_sample, 1)` as in Keras)." +7615,score,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,272,method,"Returns the mean accuracy on the given test data and labels. + +Arguments: + x: array-like, shape `(n_samples, n_features)` + Test samples where `n_samples` is the number of samples + and `n_features` is the number of features. + y: array-like, shape `(n_samples,)` or `(n_samples, n_outputs)` + True labels for `x`. + **kwargs: dictionary arguments + Legal arguments are the arguments of `Sequential.evaluate`. + +Returns: + score: float + Mean accuracy of predictions on `x` wrt. `y`. + +Raises: + ValueError: If the underlying model isn't configured to + compute accuracy. You should pass `metrics=[""accuracy""]` to + the `.compile()` method of the model." +7616,KerasRegressor,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,314,class,"Implementation of the scikit-learn regressor API for Keras. + " +7617,predict,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,318,method,"Returns predictions for the given test data. + +Arguments: + x: array-like, shape `(n_samples, n_features)` + Test samples where `n_samples` is the number of samples + and `n_features` is the number of features. + **kwargs: dictionary arguments + Legal arguments are the arguments of `Sequential.predict`. + +Returns: + preds: array-like, shape `(n_samples,)` + Predictions." +7618,score,tensorflow/tensorflow/python/keras/wrappers/scikit_learn.py,335,method,"Returns the mean loss on the given test data and labels. + +Arguments: + x: array-like, shape `(n_samples, n_features)` + Test samples where `n_samples` is the number of samples + and `n_features` is the number of features. + y: array-like, shape `(n_samples,)` + True labels for `x`. + **kwargs: dictionary arguments + Legal arguments are the arguments of `Sequential.evaluate`. + +Returns: + score: float + Mean accuracy of predictions on `x` wrt. `y`." +7619,build_fn_clf,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,37,function, +7620,assert_classification_works,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,50,function, +7621,build_fn_reg,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,73,function, +7622,assert_regression_works,tensorflow/tensorflow/python/keras/wrappers/scikit_learn_test.py,86,function, +7623,StridedSliceChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,566,class,Check a given tensor against the numpy result. +7624,eval_if_tensor,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,586,method, +7625,StridedSliceShapeChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,851,class, +7626,GradSliceChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,917,class,Tests that we can compute a gradient for var^2. +7627,BenchmarkSlice,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1057,class, +7628,StridedSliceBenchmark,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1066,class,Benchmark new strided slice operation on non-trivial case. +7629,run_and_time,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1069,method, +7630,make_variable,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1080,method, +7631,benchmark_strided_slice_skip,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1089,method, +7632,benchmark_strided_slice_easy,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1096,method, +7633,benchmark_slice_easy,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1103,method, +7634,StridedSliceAssignChecker,tensorflow/tensorflow/python/kernel_tests/array_ops_test.py,1110,class, +7635,upsample_filters,tensorflow/tensorflow/python/kernel_tests/atrous_convolution_test.py,36,function,"Upsamples the filters by a factor of rate along the spatial dimensions. Args: filters: spatial_shape + [in_channels, out_channels] @@ -55418,152 +64442,46 @@ Returns: output_spatial_shape[i] = (spatial_shape[i] - 1) * rate[i] + 1 containing (rate[i] - 1) zeros between consecutive filter values along spatial dimension i." -6954,AtrousConvolutionTest,tensorflow/tensorflow/python/kernel_tests/atrous_convolution_test.py,61,class, -6955,ExtractGlimpseTest,tensorflow/tensorflow/python/kernel_tests/attention_ops_test.py,31,class, -6956,BandedTriangularSolveOpTest,tensorflow/tensorflow/python/kernel_tests/banded_triangular_solve_op_test.py,29,class, -6957,BarrierTest,tensorflow/tensorflow/python/kernel_tests/barrier_ops_test.py,33,class, -6958,Base64OpsTest,tensorflow/tensorflow/python/kernel_tests/base64_ops_test.py,35,class, -6959,GPUBinaryOpsTest,tensorflow/tensorflow/python/kernel_tests/basic_gpu_test.py,40,class, -6960,MathBuiltinUnaryTest,tensorflow/tensorflow/python/kernel_tests/basic_gpu_test.py,92,class, -6961,BroadcastSimpleTest,tensorflow/tensorflow/python/kernel_tests/basic_gpu_test.py,156,class, -6962,GpuMultiSessionMemoryTest,tensorflow/tensorflow/python/kernel_tests/basic_gpu_test.py,236,class,Tests concurrent sessions executing on the same GPU. -6963,GatherTest,tensorflow/tensorflow/python/kernel_tests/batch_gather_op_test.py,34,class, -6964,GetRandomNormalInput,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,35,function, -6965,BatchMatmulOpTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,46,class, -6966,_GetBatchMatmulOpTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,131,function, -6967,_GetBatchMatmulOpBroadcastingTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,141,function, -6968,BatchMatmulGradientTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,151,class, -6969,_GetBatchMatmulGradientTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,183,function, -6970,_GetBatchMatmulGradientWithBroadcastingTest,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,195,function, -6971,BatchMatMulBenchmark,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,212,class, -6972,_AsType,tensorflow/tensorflow/python/kernel_tests/batch_scatter_ops_test.py,32,function, -6973,_NumpyUpdate,tensorflow/tensorflow/python/kernel_tests/batch_scatter_ops_test.py,36,function, -6974,ScatterTest,tensorflow/tensorflow/python/kernel_tests/batch_scatter_ops_test.py,47,class, -6975,PythonOpImpl,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,37,class, -6976,CppOpImpl,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,44,class, -6977,BatchToSpaceDepthToSpace,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,51,class, -6978,BatchToSpaceDepthToSpaceCpp,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,69,class, -6979,BatchToSpaceErrorHandlingTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,73,class, -6980,BatchToSpaceErrorHandlingCppTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,132,class, -6981,BatchToSpaceNDErrorHandlingTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,137,class, -6982,BatchToSpaceGradientTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,248,class, -6983,BatchToSpaceGradientCppTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,303,class, -6984,BatchToSpaceNDGradientTest,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,307,class, -6985,BcastOpsTest,tensorflow/tensorflow/python/kernel_tests/bcast_ops_test.py,29,class, -6986,SomeRandomBenchmark,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,41,class,This Benchmark should automatically be registered in the registry. -6987,TestReportingBenchmark,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,57,class,This benchmark (maybe) reports some stuff. -6988,BenchmarkTest,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,84,class, -6989,BetaincTest,tensorflow/tensorflow/python/kernel_tests/betainc_op_test.py,36,class, -6990,BiasAddTestBase,tensorflow/tensorflow/python/kernel_tests/bias_op_base.py,39,class, -6991,BiasAddDeterministicTest,tensorflow/tensorflow/python/kernel_tests/bias_op_deterministic_test.py,39,class, -6992,BincountTest,tensorflow/tensorflow/python/kernel_tests/bincount_op_test.py,36,class, -6993,BincountOpTest,tensorflow/tensorflow/python/kernel_tests/bincount_op_test.py,140,class, -6994,SparseBincountOpTest,tensorflow/tensorflow/python/kernel_tests/bincount_op_test.py,334,class, -6995,RaggedBincountOpTest,tensorflow/tensorflow/python/kernel_tests/bincount_op_test.py,501,class, -6996,BitcastTest,tensorflow/tensorflow/python/kernel_tests/bitcast_op_test.py,29,class, -6997,BroadcastToTest,tensorflow/tensorflow/python/kernel_tests/broadcast_to_ops_test.py,32,class, -6998,BucketizationOpTest,tensorflow/tensorflow/python/kernel_tests/bucketize_op_test.py,32,class, -6999,RangeSamplerOpsTest,tensorflow/tensorflow/python/kernel_tests/candidate_sampler_ops_test.py,32,class, -7000,CastOpTest,tensorflow/tensorflow/python/kernel_tests/cast_op_test.py,34,class, -7001,SparseTensorCastTest,tensorflow/tensorflow/python/kernel_tests/cast_op_test.py,184,class, -7002,SaturateCastTest,tensorflow/tensorflow/python/kernel_tests/cast_op_test.py,199,class, -7003,AssertV2Asserts,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,45,class, -7004,AssertProperIterableTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,108,class, -7005,AssertEqualTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,155,class, -7006,AssertNoneEqualTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,319,class, -7007,AssertAllCloseTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,411,class, -7008,AssertLessTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,536,class, -7009,AssertLessEqualTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,614,class, -7010,AssertGreaterTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,685,class, -7011,AssertGreaterEqualTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,756,class, -7012,AssertNegativeTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,829,class, -7013,AssertPositiveTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,879,class, -7014,EnsureShapeTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,926,class, -7015,EnsureShapeBenchmark,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1023,class, -7016,AssertRankTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1092,class, -7017,AssertRankInTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1223,class, -7018,AssertRankAtLeastTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1341,class, -7019,AssertNonNegativeTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1433,class, -7020,AssertNonPositiveTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1469,class, -7021,AssertIntegerTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1505,class, -7022,AssertTypeTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1521,class, -7023,AssertShapesTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1561,class, -7024,IsStrictlyIncreasingTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1906,class, -7025,IsNonDecreasingTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1940,class, -7026,FloatDTypeTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1973,class, -7027,AssertScalarTest,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,2027,class, -7028,GenerateVocabRemappingTest,tensorflow/tensorflow/python/kernel_tests/checkpoint_ops_test.py,40,class,Tests for the generate_vocab_remapping() method. -7029,LoadAndRemapMatrixTest,tensorflow/tensorflow/python/kernel_tests/checkpoint_ops_test.py,109,class,Tests for the load_and_remap_matrix() op. -7030,LoadAndRemapMatrixWithMaxRowsTest,tensorflow/tensorflow/python/kernel_tests/checkpoint_ops_test.py,297,class,"Tests for the load_and_remap_matrix() op. - -(Specifically focused on the max_rows_in_memory arg and its effects on -TensorBundle's BundleReader and TensorSlice logic)." -7031,_GradWithInverseL,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,43,function, -7032,TriAngSolveCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,54,function, -7033,MatrixInverseCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,75,function, -7034,TriAngInvCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,80,function, -7035,CholeskyOpTest,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,91,class, -7036,CholeskyGradTest,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,197,class, -7037,CholeskyBenchmark,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,300,class, -7038,ClipTest,tensorflow/tensorflow/python/kernel_tests/clip_ops_test.py,35,class, -7039,CompareAndBitpackTest,tensorflow/tensorflow/python/kernel_tests/compare_and_bitpack_op_test.py,27,class, -7040,ConcatOpTest,tensorflow/tensorflow/python/kernel_tests/concat_op_test.py,37,class, -7041,ConcatOffsetTest,tensorflow/tensorflow/python/kernel_tests/concat_op_test.py,645,class, -7042,CondV2Test,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,50,class, -7043,CondV2CollectionTest,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1239,class, -7044,CondV2ContainerTest,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1296,class, -7045,CondV2ColocationGroupAndDeviceTest,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1381,class, -7046,_cond,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1525,function, -7047,_is_old_cond,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1532,function, -7048,_has_node_with_op,tensorflow/tensorflow/python/kernel_tests/cond_v2_test.py,1537,function,Whether any node in `run_metadata.partition_graphs` matches `op_type`. -7049,ConditionalAccumulatorTest,tensorflow/tensorflow/python/kernel_tests/conditional_accumulator_test.py,40,class, -7050,ConfusionMatrixTest,tensorflow/tensorflow/python/kernel_tests/confusion_matrix_test.py,34,class, -7051,RemoveSqueezableDimensionsTest,tensorflow/tensorflow/python/kernel_tests/confusion_matrix_test.py,247,class, -7052,ConstantTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,38,class, -7053,AsTensorTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,315,class, -7054,ZerosTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,327,class, -7055,ZerosLikeTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,390,class, -7056,OnesTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,447,class, -7057,OnesLikeTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,501,class, -7058,FillTest,tensorflow/tensorflow/python/kernel_tests/constant_op_eager_test.py,523,class, -7059,ConstantTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,43,class, -7060,AsTensorTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,292,class, -7061,IdentityOpTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,382,class, -7062,ZerosTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,394,class, -7063,ZerosLikeTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,460,class, -7064,OnesTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,566,class, -7065,OnesLikeTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,644,class, -7066,FillTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,676,class, -7067,PlaceholderTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,765,class, -7068,PlaceholderWithDefaultTest,tensorflow/tensorflow/python/kernel_tests/constant_op_test.py,951,class, -7069,check_consumers,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,90,function,Sanity check on the consumer list of the tensors. -7070,all_fetchables,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,104,function, -7071,all_feedables,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,114,function, -7072,opt_cfg,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,124,function, -7073,isum,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,134,function, -7074,enqueue_print_op,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,143,function,Enqueues an op that prints a message to be captured in the test. -7075,filter_test_messages,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,148,function,Returns a list of messages printed by enqueue_print_op. -7076,tf_function_in_tf2,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,154,function, -7077,ControlFlowTest,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,163,class, -7078,ControlFlowContextCheckTest,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4647,class, -7079,TupleTest,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4772,class, -7080,AssertTest,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4859,class, -7081,WhileOpBenchmark,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4903,class,Evaluate the performance of while_loop op. -7082,EagerTest,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,5018,class, -7083,ControlFlowUtilTest,tensorflow/tensorflow/python/kernel_tests/control_flow_util_test.py,34,class, -7084,ControlFlowUtilV2Test,tensorflow/tensorflow/python/kernel_tests/control_flow_util_v2_test.py,31,class, -7085,Conv1DTest,tensorflow/tensorflow/python/kernel_tests/conv1d_test.py,30,class, -7086,Conv1DTransposeTest,tensorflow/tensorflow/python/kernel_tests/conv1d_transpose_test.py,33,class, -7087,Conv2DBackpropFilterGradTest,tensorflow/tensorflow/python/kernel_tests/conv2d_backprop_filter_grad_test.py,33,class, -7088,Conv2DTransposeTest,tensorflow/tensorflow/python/kernel_tests/conv2d_transpose_test.py,37,class, -7089,Conv3DBackpropFilterV2GradTest,tensorflow/tensorflow/python/kernel_tests/conv3d_backprop_filter_v2_grad_test.py,33,class, -7090,Conv3DTransposeTest,tensorflow/tensorflow/python/kernel_tests/conv3d_transpose_test.py,33,class, -7091,GetTestConfigs,tensorflow/tensorflow/python/kernel_tests/conv_ops_3d_test.py,38,function,"Get all the valid tests configs to run. - -Returns: - all the valid test configs as tuples of data_format and use_gpu." -7092,Conv3DTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_3d_test.py,51,class, -7093,GetShrunkInceptionShapes,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,52,function,"Iterator for smaller versions of convolution shapes in 2015 Inception. +7636,GetRandomNormalInput,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,35,function, +7637,BatchMatMulBenchmark,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,212,class, +7638,benchmarkBatchMatMulBroadcast,tensorflow/tensorflow/python/kernel_tests/batch_matmul_op_test.py,229,method, +7639,PythonOpImpl,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,37,class, +7640,batch_to_space,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,40,method, +7641,CppOpImpl,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,44,class, +7642,batch_to_space,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,47,method, +7643,BatchToSpaceDepthToSpace,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,51,class, +7644,BatchToSpaceDepthToSpaceCpp,tensorflow/tensorflow/python/kernel_tests/batchtospace_op_test.py,69,class, +7645,SomeRandomBenchmark,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,41,class,This Benchmark should automatically be registered in the registry. +7646,notBenchmarkMethod,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,47,method, +7647,benchmark1,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,50,method, +7648,benchmark2,tensorflow/tensorflow/python/kernel_tests/benchmark_test.py,53,method, +7649,AssertV2Asserts,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,45,class, +7650,failing_fn,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,99,method, +7651,EnsureShapeBenchmark,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1023,class, +7652,benchmark_const_op,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1057,method, +7653,benchmark_single_ensure_op,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1064,method, +7654,benchmark_n_ops,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1077,method, +7655,benchmark_n_ensure_ops,tensorflow/tensorflow/python/kernel_tests/check_ops_test.py,1083,method, +7656,TriAngSolveCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,54,function, +7657,MatrixInverseCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,75,function, +7658,TriAngInvCompositeGrad,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,80,function, +7659,CholeskyBenchmark,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,300,class, +7660,benchmarkCholeskyOp,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,326,method, +7661,benchmarkGradVariants,tensorflow/tensorflow/python/kernel_tests/cholesky_op_test.py,355,method, +7662,check_consumers,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,90,function,Sanity check on the consumer list of the tensors. +7663,all_fetchables,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,104,function, +7664,all_feedables,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,114,function, +7665,opt_cfg,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,124,function, +7666,isum,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,134,function, +7667,enqueue_print_op,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,143,function,Enqueues an op that prints a message to be captured in the test. +7668,tf_function_in_tf2,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,154,function, +7669,WhileOpBenchmark,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4903,class,Evaluate the performance of while_loop op. +7670,benchmarkWhileOpCrossDevicePlacement,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4988,method, +7671,benchmarkWhileOpSameDevicePlacement,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4995,method, +7672,benchmarkWhileOpUnrollCrossDevicePlacement,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,5002,method, +7673,benchmarkWhileOpUnrollSameDevicePlacement,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,5009,method, +7674,loop_body,tensorflow/tensorflow/python/kernel_tests/control_flow_ops_py_test.py,4945,method, +7675,GetShrunkInceptionShapes,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,52,function,"Iterator for smaller versions of convolution shapes in 2015 Inception. Relative to inception, each depth value is `depth // shrink`. @@ -55573,166 +64491,49 @@ Args: Yields: Tuple (input_size, filter_size, out_size, stride, padding), the convolution parameters of Inception layers." -7094,GetTestConfigs,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,150,function,"Get all the valid tests configs to run. +7676,Conv2DBenchmark,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2924,class, +7677,benchmarkGPUConvStackFirst,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2926,method, +7678,benchmarkExplicitVsManualPadding,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2966,method,"Compare performance of EXPLICIT padding and calling tf.pad. -Returns: - all the valid test configs as tuples of data_format and use_gpu." -7095,Conv2DTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,163,class, -7096,DepthwiseConv2DTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2600,class, -7097,SeparableConv2DTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2694,class, -7098,DeepConv2DTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2877,class, -7099,Conv2DBenchmark,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,2924,class, -7100,GetInceptionFwdTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3145,function, -7101,GetInceptionFwdDilatedConvTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3160,function, -7102,GetInceptionBackInputTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3177,function, -7103,GetInceptionBackFilterTest,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3194,function, -7104,CriticalSectionTest,tensorflow/tensorflow/python/kernel_tests/critical_section_test.py,43,class, -7105,CrossOpTest,tensorflow/tensorflow/python/kernel_tests/cross_grad_test.py,28,class, -7106,grouper,tensorflow/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py,34,function,Collect data into fixed-length chunks or blocks. -7107,flatten,tensorflow/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py,41,function,Flatten one level of nesting. -7108,CTCGreedyDecoderTest,tensorflow/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py,46,class, -7109,SimpleSparseTensorFrom,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,43,function,"Create a very simple SparseTensor with dimensions (batch, time). +A Conv2D op with EXPLICIT padding is benchmarked, and a tf.pad with the same +padding followed by an equivalent Conv2D op is benchmarked." +7679,benchmarkExplicitVsSamePaddingGraph,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3016,method,"Compare performance of EXPLICIT and SAME padding in graph mode. + +A Conv2D op with SAME padding is benchmarked, and an equivalent Conv2D op +with explicit padding is benchmarked, where the padding is the same as in +the SAME case. The purpose is to ensure EXPLICIT padding is just as +efficient as the SAME case" +7680,benchmarkExplicitVsSamePaddingEager,tensorflow/tensorflow/python/kernel_tests/conv_ops_test.py,3065,method,"Compare performance of EXPLICIT and SAME padding in eager mode. + +A Conv2D op with SAME padding is benchmarked, and an equivalent Conv2D op +with explicit padding is benchmarked, where the padding is the same as in +the SAME case. Currently, EXPLICIT padding is slightly slower, due to the +fact the Python padding list must be checked and processed before the Conv2D +op can run." +7681,grouper,tensorflow/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py,34,function,Collect data into fixed-length chunks or blocks. +7682,flatten,tensorflow/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py,41,function,Flatten one level of nesting. +7683,SimpleSparseTensorFrom,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,43,function,"Create a very simple SparseTensor with dimensions (batch, time). Args: x: a list of lists of type int Returns: x_ix and x_val, the indices and values of the SparseTensor<2>." -7110,_ctc_loss_v2,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,66,function,Call ctc_loss_v2 with v1 args. -7111,CTCLossTest,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,84,class, -7112,CTCLossTestV2,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,309,class, -7113,_ctc_loss_v3,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,943,function, -7114,CTCLossTestV3,tensorflow/tensorflow/python/kernel_tests/ctc_loss_op_test.py,959,class, -7115,ConvolutionTest,tensorflow/tensorflow/python/kernel_tests/cudnn_deterministic_base.py,66,class, -7116,CumulativeLogsumexpTest,tensorflow/tensorflow/python/kernel_tests/cumulative_logsumexp_test.py,32,class, -7117,_sparsify,tensorflow/tensorflow/python/kernel_tests/cwise_ops_binary_test.py,49,function, -7118,_default_tolerance,tensorflow/tensorflow/python/kernel_tests/cwise_ops_binary_test.py,61,function,"Returns a sensible default tolerance for comparing results of a given type. - -Args: - dtype: A datatype." -7119,BinaryOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_binary_test.py,77,class, -7120,ComparisonOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_binary_test.py,823,class, -7121,_sparsify,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,56,function, -7122,_default_tolerance,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,68,function,"Returns a sensible default tolerance for comparing results of a given type. - -Args: - dtype: A datatype." -7123,ComparisonOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,84,class, -7124,LogicalOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,226,class, -7125,SelectOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,332,class, -7126,BatchSelectOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,636,class,Test broadcasting of Select when 'c' is a vec and 't' &'e' are rank2+. -7127,MinMaxOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,749,class, -7128,MathOpsOverloadTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,828,class, -7129,IsFiniteInfNanTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,920,class, -7130,RoundingTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,975,class, -7131,ComplexMakeRealImagTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,1021,class, -7132,PolyvalTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_test.py,1238,class, -7133,_sparsify,tensorflow/tensorflow/python/kernel_tests/cwise_ops_unary_test.py,46,function, -7134,_default_tolerance,tensorflow/tensorflow/python/kernel_tests/cwise_ops_unary_test.py,58,function,"Returns a sensible default tolerance for comparing results of a given type. - -Args: - dtype: A datatype." -7135,UnaryOpTest,tensorflow/tensorflow/python/kernel_tests/cwise_ops_unary_test.py,74,class, -7136,DecodeBmpOpTest,tensorflow/tensorflow/python/kernel_tests/decode_bmp_op_test.py,28,class, -7137,DecodeCompressedOpTest,tensorflow/tensorflow/python/kernel_tests/decode_compressed_op_test.py,33,class, -7138,DecodeCSVOpTest,tensorflow/tensorflow/python/kernel_tests/decode_csv_op_test.py,30,class, -7139,DecodeImageOpTest,tensorflow/tensorflow/python/kernel_tests/decode_image_op_test.py,35,class, -7140,DecodeJpegBenchmark,tensorflow/tensorflow/python/kernel_tests/decode_jpeg_op_test.py,37,class,Evaluate tensorflow DecodeJpegOp performance. -7141,DecodePngOpTest,tensorflow/tensorflow/python/kernel_tests/decode_png_op_test.py,29,class, -7142,DecodeRawOpTest,tensorflow/tensorflow/python/kernel_tests/decode_raw_op_test.py,30,class, -7143,DenormalTest,tensorflow/tensorflow/python/kernel_tests/denormal_test.py,29,class, -7144,AssignOpTest,tensorflow/tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py,31,class, -7145,AssignOpTest,tensorflow/tensorflow/python/kernel_tests/dense_update_ops_test.py,31,class, -7146,DepthToSpaceTest,tensorflow/tensorflow/python/kernel_tests/depthtospace_op_test.py,38,class, -7147,DepthToSpaceGradientTest,tensorflow/tensorflow/python/kernel_tests/depthtospace_op_test.py,337,class, -7148,_DepthwiseConv2dNumpyBasic,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,37,function,"Compute depthwise_conv2d using Numpy. - -This allows use to test TensorFlow's depthwise_conv2d by comparing to the -Numpy version. - -Args: - x1: The input Numpy array, in NHWC format. - x2: The filter Numpy array. - strides: A Python list of 4 elements representing the strides. - -Returns: - The depthwise conv2d output as a Numpy array." -7149,_DepthwiseConv2dNumpy,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,74,function,"Compute depthwise_conv2d using Numpy. - -This allows use to test TensorFlow's depthwise_conv2d by comparing to the -Numpy version. - -Unlike `_DepthwiseConv2dNumpyBasic`, this supports more advanced features -like padding. - -Args: - x1: The input Numpy array. - x2: The filter Numpy array. - strides: A Python list of 4 elements representing the strides. - padding: The padding. ""SAME"", ""VALID"", or a list of explicit paddings. - data_format: ""NHWC"" or ""NCHW"". - dilations: A list of 2 elements, representing the dilations. - -Returns: - The depthwise conv2d as a Numpy array." -7150,ConfigsToTest,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,141,function,"Iterator for different convolution shapes, strides and paddings. - -Returns: - List of tuples (input_size, filter_size, out_size, stride, padding, - dilations), the depthwise convolution parameters." -7151,ConfigsToTestExplicit,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,169,function,"Iterator for different convolution shapes, strides and explicit paddings. - -Returns: - List of tuples (input_size, filter_size, out_size, stride, padding, - dilations), the depthwise convolution parameters." -7152,CheckGradConfigsToTest,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,206,function,"Iterator for different convolution shapes, strides and paddings. - -compute_gradient_error() is very expensive. So the configs should be -relatively small. - -Returns: - List of tuples (input_size, filter_size, out_size, stride, padding, - dilations), the depthwise convolution parameters." -7153,CheckGradConfigsToTestExplicit,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,234,function,"Iterator for different convolution shapes, strides and explicit paddings. - -compute_gradient_error() is very expensive. So the configs should be -relatively small. - -Returns: - List of tuples (input_size, filter_size, out_size, stride, padding, - dilations), the depthwise convolution parameters." -7154,DepthwiseConv2DTest,tensorflow/tensorflow/python/kernel_tests/depthwise_conv_op_test.py,267,class, -7155,DeterminantOpTest,tensorflow/tensorflow/python/kernel_tests/determinant_op_test.py,36,class, -7156,MatrixDeterminantBenchmark,tensorflow/tensorflow/python/kernel_tests/determinant_op_test.py,166,class, -7157,zip_to_first_list_length,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,39,function, -7158,repack_diagonals,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,45,function, -7159,repack_diagonals_in_tests,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,82,function, -7160,square_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,99,function, -7161,tall_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,177,function, -7162,fat_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,264,function, -7163,all_tests,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,323,function, -7164,MatrixDiagTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,327,class, -7165,MatrixSetDiagTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,580,class, -7166,MatrixDiagPartTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,774,class, -7167,DiagTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,930,class, -7168,DiagPartOpTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,1075,class, -7169,DiagGradOpTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,1156,class, -7170,DiagGradPartOpTest,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,1177,class, -7171,DivisionTestCase,tensorflow/tensorflow/python/kernel_tests/division_future_test.py,32,class, -7172,DivisionTestCase,tensorflow/tensorflow/python/kernel_tests/division_past_test.py,32,class, -7173,DrawBoundingBoxOpTest,tensorflow/tensorflow/python/kernel_tests/draw_bounding_box_op_test.py,32,class, -7174,DuplicateOpTest,tensorflow/tensorflow/python/kernel_tests/duplicate_op_test.py,29,class, -7175,DynamicPartitionTest,tensorflow/tensorflow/python/kernel_tests/dynamic_partition_op_test.py,36,class, -7176,DynamicStitchTestBase,tensorflow/tensorflow/python/kernel_tests/dynamic_stitch_op_test.py,34,class, -7177,DynamicStitchTest,tensorflow/tensorflow/python/kernel_tests/dynamic_stitch_op_test.py,227,class, -7178,ParallelDynamicStitchTest,tensorflow/tensorflow/python/kernel_tests/dynamic_stitch_op_test.py,234,class, -7179,ConstantOf,tensorflow/tensorflow/python/kernel_tests/edit_distance_op_test.py,30,function, -7180,EditDistanceTest,tensorflow/tensorflow/python/kernel_tests/edit_distance_op_test.py,38,class, -7181,_AddTest,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,35,function, -7182,EigTest,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,42,class, -7183,SortEigenValues,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,96,function, -7184,SortEigenDecomposition,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,101,function, -7185,EquilibrateEigenVectorPhases,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,108,function,"Equilibrate the phase of the Eigenvectors in the columns of `x` and `y`. +7684,DecodeJpegBenchmark,tensorflow/tensorflow/python/kernel_tests/decode_jpeg_op_test.py,37,class,Evaluate tensorflow DecodeJpegOp performance. +7685,benchmarkDecodeJpegSmall,tensorflow/tensorflow/python/kernel_tests/decode_jpeg_op_test.py,123,method,Evaluate single DecodeImageOp for small size image. +7686,benchmarkDecodeJpegMedium,tensorflow/tensorflow/python/kernel_tests/decode_jpeg_op_test.py,147,method,Evaluate single DecodeImageOp for medium size image. +7687,benchmarkDecodeJpegLarge,tensorflow/tensorflow/python/kernel_tests/decode_jpeg_op_test.py,171,method,Evaluate single DecodeImageOp for large size image. +7688,MatrixDeterminantBenchmark,tensorflow/tensorflow/python/kernel_tests/determinant_op_test.py,166,class, +7689,benchmarkMatrixDeterminantOp,tensorflow/tensorflow/python/kernel_tests/determinant_op_test.py,191,method, +7690,zip_to_first_list_length,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,39,function, +7691,repack_diagonals,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,45,function, +7692,square_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,99,function, +7693,tall_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,177,function, +7694,fat_cases,tensorflow/tensorflow/python/kernel_tests/diag_op_test.py,264,function, +7695,ConstantOf,tensorflow/tensorflow/python/kernel_tests/edit_distance_op_test.py,30,function, +7696,SortEigenValues,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,96,function, +7697,SortEigenDecomposition,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,101,function, +7698,EquilibrateEigenVectorPhases,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,108,function,"Equilibrate the phase of the Eigenvectors in the columns of `x` and `y`. Eigenvectors are only unique up to an arbitrary phase. This function rotates x such that it matches y. Precondition: The columns of x and y differ by a @@ -55744,116 +64545,15 @@ Args: Returns: `np.ndarray` containing an equilibrated version of x." -7186,_GetEigTest,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,127,function, -7187,EigGradTest,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,192,class, -7188,_GetEigGradTest,tensorflow/tensorflow/python/kernel_tests/eig_op_test.py,196,function, -7189,EinsumOpTest,tensorflow/tensorflow/python/kernel_tests/einsum_op_test.py,38,class, -7190,EinsumGradTest,tensorflow/tensorflow/python/kernel_tests/einsum_op_test.py,290,class, -7191,EinsumBenchmark,tensorflow/tensorflow/python/kernel_tests/einsum_op_test.py,397,class, -7192,_AsLong,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,49,function,Casts arrays elements to long type. Used to convert from numpy tf. -7193,ScatterAddSubTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,54,class, -7194,_PName,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,136,function, -7195,_EmbeddingParams,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,140,function, -7196,_EmbeddingParamsAsPartitionedVariable,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,170,function, -7197,_EmbeddingResult,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,188,function, -7198,EmbeddingLookupTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,245,class, -7199,EmbeddingLookupSparseTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,653,class, -7200,SafeEmbeddingLookupSparseTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,795,class, -7201,DynamicStitchOpTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,1033,class, -7202,ParallelDynamicStitchOpTest,tensorflow/tensorflow/python/kernel_tests/embedding_ops_test.py,1120,class, -7203,ExtractImagePatchesGradTest,tensorflow/tensorflow/python/kernel_tests/extract_image_patches_grad_test.py,34,class,Gradient-checking for ExtractImagePatches op. -7204,ExtractImagePatches,tensorflow/tensorflow/python/kernel_tests/extract_image_patches_op_test.py,28,class,Functional tests for ExtractImagePatches op. -7205,ExtractVolumePatchesGradTest,tensorflow/tensorflow/python/kernel_tests/extract_volume_patches_grad_test.py,35,class,Gradient-checking for ExtractVolumePatches op. -7206,ExtractVolumePatches,tensorflow/tensorflow/python/kernel_tests/extract_volume_patches_op_test.py,27,class,Functional tests for ExtractVolumePatches op. -7207,FIFOQueueTest,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,48,class, -7208,GPUCompatibleFIFOQueueTests,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,403,class, -7209,UnconvertedFIFOQueueTests,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,435,class, -7210,FIFOQueueParallelTests,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,771,class, -7211,FIFOQueueDictTest,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,1640,class, -7212,FIFOQueueWithTimeoutTest,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,1694,class, -7213,QueueContainerTest,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,1728,class, -7214,FIFOQueueBenchmark,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,1738,class,Benchmark FIFOQueue operations. -7215,FingerprintTest,tensorflow/tensorflow/python/kernel_tests/fingerprint_op_test.py,29,class, -7216,FractionalAvgTest,tensorflow/tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py,36,class, -7217,FractionalAvgPoolGradTest,tensorflow/tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py,314,class,"Tests for FractionalAvgPoolGrad. - -Two types of tests for FractionalAvgPoolGrad. -1) Test fractional_avg_pool_grad() directly. - This type of test relies on gen_nn_ops.avg_pool_grad() returns the -correct result. For example: - * input_tensor_shape = (1, 10, 10, 1) - * window_size = (1, 2, 2, 1) - * stride_size = (1, 2, 2, 1) - * padding: not really important, since 10/2 is divisible -avg pooling should generate the same result as fractional avg pooling with: - * row_sequence = [0, 2, 4, 6, 8, 10] - * col_sequence = [0, 2, 4, 6, 8, 10] - * overlapping = False -This also means their gradients in such case will be the same. - -Similarly, when - * input_tensor_shape = (1, 7, 7, 1) - * window_size = (1, 3, 3, 1) - * stride_size = (1, 2, 2, 1) - * padding: not important -avg pooling should generate the same result as fractional avg pooling with: - * row_sequence = [0, 2, 4, 7] - * col_sequence = [0, 2, 4, 7] - * overlapping = True -2) Test through compute_gradient_error()" -7218,FractionalMaxPoolTest,tensorflow/tensorflow/python/kernel_tests/fractional_max_pool_op_test.py,36,class, -7219,FractionalMaxPoolGradTest,tensorflow/tensorflow/python/kernel_tests/fractional_max_pool_op_test.py,311,class,"Tests for FractionalMaxPoolGrad. - -Two types of tests for FractionalMaxPoolGrad. -1) Test fractional_max_pool_grad() directly. - This type of test relies on gen_nn_ops.max_pool_grad() returns the correct -result. For example: - * input_tensor_shape = (1, 10, 10, 1) - * window_size = (1, 2, 2, 1) - * stride_size = (1, 2, 2, 1) - * padding: not really import, since 10/2 is divisible -max pooling should generate the same result as fractional max pooling with: - * row_sequence = [0, 2, 4, 6, 8, 10] - * col_sequence = [0, 2, 4, 6, 8, 10] - * overlapping = False -This also means their gradients in such case will be the same. - - Similarly, when - * input_tensor_shape = (1, 7, 7, 1) - * window_size = (1, 3, 3, 1) - * stride_size = (1, 2, 2, 1) - * padding: not important -max pooling should generate the same result as fractional max pooling with: - * row_sequence = [0, 2, 4, 7] - * col_sequence = [0, 2, 4, 7] - * overlapping = True -2) Test through compute_gradient_error()" -7220,simple_scoped_fn,tensorflow/tensorflow/python/kernel_tests/functional_ops_test.py,50,function,"Simple function: (a, x) -> 2(x+a), but with ""2"" as a variable in scope." -7221,FunctionalOpsTest,tensorflow/tensorflow/python/kernel_tests/functional_ops_test.py,62,class, -7222,PartitionedCallTest,tensorflow/tensorflow/python/kernel_tests/functional_ops_test.py,972,class, -7223,FunctionalOpsCaseTest,tensorflow/tensorflow/python/kernel_tests/functional_ops_test.py,1178,class, -7224,NoReferenceCycleTests,tensorflow/tensorflow/python/kernel_tests/garbage_collection_test.py,32,class, -7225,GatherNdTest,tensorflow/tensorflow/python/kernel_tests/gather_nd_op_test.py,39,class, -7226,GatherNdOpBenchmark,tensorflow/tensorflow/python/kernel_tests/gather_nd_op_test.py,387,class, -7227,_to_str_elements,tensorflow/tensorflow/python/kernel_tests/gather_op_test.py,43,function,Converts the inner list elements to strings. -7228,GatherTest,tensorflow/tensorflow/python/kernel_tests/gather_op_test.py,51,class, -7229,GradientCorrectnessTest,tensorflow/tensorflow/python/kernel_tests/gradient_correctness_test.py,31,class, -7230,SliceTest,tensorflow/tensorflow/python/kernel_tests/huge_slice_op_test.py,29,class, -7231,IdentityNOpTest,tensorflow/tensorflow/python/kernel_tests/identity_n_op_py_test.py,29,class, -7232,IdentityOpTest,tensorflow/tensorflow/python/kernel_tests/identity_op_py_test.py,33,class, -7233,InTopKTest,tensorflow/tensorflow/python/kernel_tests/in_topk_op_test.py,28,class, -7234,identicaltest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,43,function,"Tests if two initializations are identical to within tiny tolerances. - -Args: - tc: An instance of TensorFlowTestCase. - init1: An Initializer that generates a tensor of a given shape - init2: An Initializer that generates a tensor of a given shape - shape: Shape of the tensor to initialize or `None` to use a vector of length - 100. - -Returns: - True or False as determined by test." -7235,duplicated_initializer,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,65,function,"Tests duplicated random initializer within the same graph. +7699,EinsumBenchmark,tensorflow/tensorflow/python/kernel_tests/einsum_op_test.py,397,class, +7700,benchmarkEinsum,tensorflow/tensorflow/python/kernel_tests/einsum_op_test.py,426,method, +7701,ExtractImagePatches,tensorflow/tensorflow/python/kernel_tests/extract_image_patches_op_test.py,28,class,Functional tests for ExtractImagePatches op. +7702,ExtractVolumePatches,tensorflow/tensorflow/python/kernel_tests/extract_volume_patches_op_test.py,27,class,Functional tests for ExtractVolumePatches op. +7703,FIFOQueueBenchmark,tensorflow/tensorflow/python/kernel_tests/fifo_queue_test.py,1738,class,Benchmark FIFOQueue operations. +7704,simple_scoped_fn,tensorflow/tensorflow/python/kernel_tests/functional_ops_test.py,50,function,"Simple function: (a, x) -> 2(x+a), but with ""2"" as a variable in scope." +7705,GatherNdOpBenchmark,tensorflow/tensorflow/python/kernel_tests/gather_nd_op_test.py,387,class, +7706,benchmark_gather_nd_op,tensorflow/tensorflow/python/kernel_tests/gather_nd_op_test.py,389,method, +7707,duplicated_initializer,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,65,function,"Tests duplicated random initializer within the same graph. This test generates two random kernels from the same initializer to the same graph, and checks if the results are close enough. Even given the same global, @@ -55869,266 +64569,43 @@ Args: Returns: True or False as determined by test." -7236,_init_sampler,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,92,function,"Returns a func to generate a random tensor of shape [num]. - -Args: - tc: An instance of TensorFlowTestCase. - init: An Initializer that generates a tensor of a given shape - num: Size of 1D tensor to create. - -Returns: - Function to generate a random tensor." -7237,ConstantInitializersTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,111,class, -7238,RandomNormalInitializationTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,257,class, -7239,TruncatedNormalInitializationTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,287,class, -7240,RandomUniformInitializationTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,321,class, -7241,UniformUnitScalingInitializationTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,343,class, -7242,VarianceScalingInitializationTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,391,class, -7243,RangeTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,461,class, -7244,LinSpaceTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,547,class, -7245,LinSpaceNdTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,617,class, -7246,DeviceTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,761,class, -7247,OrthogonalInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,777,class, -7248,ConvolutionDeltaOrthogonalInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,838,class, -7249,ConvolutionOrthogonal1dInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,948,class, -7250,ConvolutionOrthogonal2dInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,1073,class, -7251,ConvolutionOrthogonal3dInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,1177,class, -7252,IdentityInitializerTest,tensorflow/tensorflow/python/kernel_tests/init_ops_test.py,1310,class, -7253,InplaceOpsTest,tensorflow/tensorflow/python/kernel_tests/inplace_ops_test.py,32,class, -7254,InvalidOpTest,tensorflow/tensorflow/python/kernel_tests/invalid_op_test.py,28,class, -7255,IoOpsTest,tensorflow/tensorflow/python/kernel_tests/io_ops_test.py,32,class, -7256,LargeConcatOpTest,tensorflow/tensorflow/python/kernel_tests/large_concat_op_test.py,26,class,"Tests that belong in concat_op_test.py, but run over large tensors." -7257,_AddTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,34,function, -7258,ShapeTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,41,class, -7259,MatrixUnaryFunctorGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,58,class, -7260,_GetMatrixUnaryFunctorGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,62,function, -7261,MatrixBinaryFunctorGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,94,class, -7262,_GetMatrixBinaryFunctorGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,98,function, -7263,_GetBandedTriangularSolveGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg_grad_test.py,135,function, -7264,_AddTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,38,function, -7265,_RandomPDMatrix,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,45,function,Random positive definite matrix. -7266,CholeskySolveTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,53,class, -7267,LogdetTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,75,class, -7268,SlogdetTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,107,class, -7269,AdjointTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,139,class, -7270,EyeTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,154,class, -7271,_MatrixRankTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,273,class, -7272,MatrixRankStatic32Test,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,325,class, -7273,MatrixRankDynamic64Test,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,331,class, -7274,_PinvTest,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,336,class, -7275,PinvTestDynamic32DefaultRcond,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,388,class, -7276,PinvTestStatic64DefaultRcond,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,395,class, -7277,PinvTestDynamic32CustomtRcond,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,402,class, -7278,PinvTestStatic64CustomRcond,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,409,class, -7279,make_tensor_hiding_attributes,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,415,function, -7280,_LUReconstruct,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,423,class, -7281,LUReconstructStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,456,class, -7282,LUReconstructDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,461,class, -7283,_LUMatrixInverse,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,465,class, -7284,LUMatrixInverseStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,500,class, -7285,LUMatrixInverseDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,505,class, -7286,_LUSolve,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,509,class, -7287,LUSolveStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,556,class, -7288,LUSolveDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,561,class, -7289,ListOpsTest,tensorflow/tensorflow/python/kernel_tests/list_ops_test.py,50,class, -7290,ListDiffTest,tensorflow/tensorflow/python/kernel_tests/listdiff_op_test.py,35,class, -7291,PrintV2LoggingLevelTest,tensorflow/tensorflow/python/kernel_tests/logging_ops_logging_level_test.py,30,class, -7292,LoggingOpsTest,tensorflow/tensorflow/python/kernel_tests/logging_ops_test.py,42,class, -7293,PrintV2Test,tensorflow/tensorflow/python/kernel_tests/logging_ops_test.py,73,class, -7294,PrintGradientTest,tensorflow/tensorflow/python/kernel_tests/logging_ops_test.py,365,class, -7295,BaseLookupTableTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,57,class, -7296,StaticHashTableTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,76,class, -7297,KeyValueTensorInitializerTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,454,class, -7298,DatasetInitializerTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,493,class, -7299,InitializeTableFromFileOpTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,581,class, -7300,StaticVocabularyTableTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,911,class, -7301,DenseHashTableOpTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,1138,class, -7302,IndexTableFromFile,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,1913,class, -7303,IndexTableFromTensor,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2177,class, -7304,IndexToStringTableFromFileTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2268,class, -7305,IndexToStringTableFromTensorTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2381,class, -7306,IdTableWithHashBucketsTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2425,class, -7307,MutableHashTableOpTest,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2809,class, -7308,MutableHashTableBenchmark,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3405,class, -7309,DenseHashTableBenchmark,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3453,class, -7310,AbsoluteDifferenceLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,42,class, -7311,SoftmaxCrossEntropyLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,117,class, -7312,SparseSoftmaxCrossEntropyLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,231,class, -7313,SigmoidCrossEntropyLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,496,class, -7314,LogLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,655,class, -7315,HingeLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,828,class, -7316,HuberLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,866,class, -7317,MeanSquaredErrorTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,926,class, -7318,MeanPairwiseSquaredErrorTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,1006,class, -7319,CosineDistanceLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,1235,class, -7320,AddLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,1345,class, -7321,ComputeWeightedLossTest,tensorflow/tensorflow/python/kernel_tests/losses_test.py,1359,class, -7322,LRNOpTest,tensorflow/tensorflow/python/kernel_tests/lrn_op_test.py,36,class, -7323,LuOpTest,tensorflow/tensorflow/python/kernel_tests/lu_op_test.py,39,class, -7324,LuBenchmark,tensorflow/tensorflow/python/kernel_tests/lu_op_test.py,238,class, -7325,RollTest,tensorflow/tensorflow/python/kernel_tests/manip_ops_test.py,41,class, -7326,simple_scoped_fn,tensorflow/tensorflow/python/kernel_tests/map_fn_test.py,41,function,"Simple function: (a, x) -> 2(x+a), but with ""2"" as a variable in scope." -7327,MapFnTest,tensorflow/tensorflow/python/kernel_tests/map_fn_test.py,53,class, -7328,MapStageTest,tensorflow/tensorflow/python/kernel_tests/map_stage_op_test.py,31,class, -7329,MatVecTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,40,class,"Simple test for matvec, which is sugar on top of matmul." -7330,_AddTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,51,function, -7331,_GetTransposedMatrices,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,58,function, -7332,MatMulTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,67,class, -7333,_GetMatMulTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,71,function, -7334,MatMulGradientTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,111,class, -7335,_GetMatMulGradientTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,115,function, -7336,MatMulStatsTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,147,class, -7337,infix_matmul,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,179,function, -7338,MatMulInfixOperatorTest,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,195,class, -7339,_AddTest,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,35,function, -7340,MatrixBandPartTest,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,42,class, -7341,_GetMatrixBandPartTest,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,46,function, -7342,MatrixBandPartGradTest,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,72,class, -7343,_GetMatrixBandPartGradTest,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,76,function, -7344,MatrixBandPartBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,93,class, -7345,np_expm,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,38,function,Slow but accurate Taylor series matrix exponential. -7346,ExponentialOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,50,class, -7347,MatrixExponentialBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,163,class, -7348,_TestRandomSmall,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,216,function, -7349,_TestL1Norms,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,227,function, -7350,InverseOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_inverse_op_test.py,36,class, -7351,MatrixInverseBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_inverse_op_test.py,156,class, -7352,LogarithmOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py,39,class, -7353,MatrixLogarithmBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py,148,class, -7354,_AddTest,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,39,function, -7355,_GenerateTestData,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,46,function, -7356,_SolveWithNumpy,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,61,function, -7357,MatrixSolveLsOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,80,class, -7358,_GetSmallMatrixSolveLsOpTests,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,186,function, -7359,_GetLargeMatrixSolveLsOpTests,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,233,function, -7360,MatrixSolveLsBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,289,class, -7361,MatrixSolveOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_solve_op_test.py,39,class, -7362,MatrixSolveBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_solve_op_test.py,145,class, -7363,SquareRootOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_square_root_op_test.py,32,class, -7364,MatrixTriangularSolveOpTest,tensorflow/tensorflow/python/kernel_tests/matrix_triangular_solve_op_test.py,29,class, -7365,_enqueue_vector,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,46,function, -7366,_binary_2d_label_to_2d_sparse_value,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,55,function,"Convert dense 2D binary indicator to sparse ID. - -Only 1 values in `labels` are included in result. - -Args: - labels: Dense 2D binary indicator, shape [batch_size, num_classes]. - -Returns: - `SparseTensorValue` of shape [batch_size, num_classes], where num_classes - is the number of `1` values in each row of `labels`. Values are indices - of `1` values along the last dimension of `labels`." -7367,_binary_2d_label_to_1d_sparse_value,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,89,function,"Convert dense 2D binary indicator to sparse ID. - -Only 1 values in `labels` are included in result. - -Args: - labels: Dense 2D binary indicator, shape [batch_size, num_classes]. Each - row must contain exactly 1 `1` value. - -Returns: - `SparseTensorValue` of shape [batch_size]. Values are indices of `1` values - along the last dimension of `labels`. - -Raises: - ValueError: if there is not exactly 1 `1` value per row of `labels`." -7368,_binary_3d_label_to_sparse_value,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,128,function,"Convert dense 3D binary indicator tensor to sparse tensor. - -Only 1 values in `labels` are included in result. - -Args: - labels: Dense 2D binary indicator tensor. - -Returns: - `SparseTensorValue` whose values are indices along the last dimension of - `labels`." -7369,_assert_nan,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,158,function, -7370,_assert_metric_variables,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,162,function, -7371,_test_values,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,170,function, -7372,MeanTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,174,class, -7373,MeanTensorTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,354,class, -7374,AccuracyTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,555,class, -7375,PrecisionTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,752,class, -7376,RecallTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,951,class, -7377,AUCTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,1085,class, -7378,SpecificityAtSensitivityTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,1437,class, -7379,SensitivityAtSpecificityTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,1583,class, -7380,PrecisionRecallThresholdsTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,1710,class, -7381,_test_precision_at_k,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2018,function, -7382,_test_precision_at_top_k,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2049,function, -7383,_test_average_precision_at_k,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2081,function, -7384,SingleLabelPrecisionAtKTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2108,class, -7385,MultiLabelPrecisionAtKTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2156,class, -7386,_test_recall_at_k,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2528,function, -7387,_test_recall_at_top_k,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2559,function, -7388,SingleLabelRecallAtKTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2591,class, -7389,MultiLabel2dRecallAtKTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2717,class, -7390,MultiLabel3dRecallAtKTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2814,class, -7391,MeanAbsoluteErrorTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,2960,class, -7392,MeanRelativeErrorTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3024,class, -7393,MeanSquaredErrorTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3115,class, -7394,RootMeanSquaredErrorTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3301,class, -7395,_reweight,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3396,function, -7396,MeanCosineDistanceTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3401,class, -7397,PcntBelowThreshTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3551,class, -7398,MeanIOUTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3625,class, -7399,MeanPerClassAccuracyTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,3944,class, -7400,FalseNegativesTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4180,class, -7401,FalseNegativesAtThresholdsTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4233,class, -7402,FalsePositivesTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4285,class, -7403,FalsePositivesAtThresholdsTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4338,class, -7404,TrueNegativesTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4392,class, -7405,TrueNegativesAtThresholdsTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4445,class, -7406,TruePositivesTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4497,class, -7407,TruePositivesAtThresholdsTest,tensorflow/tensorflow/python/kernel_tests/metrics_test.py,4550,class, -7408,DilationTest,tensorflow/tensorflow/python/kernel_tests/morphological_ops_test.py,31,class, -7409,ErosionTest,tensorflow/tensorflow/python/kernel_tests/morphological_ops_test.py,307,class, -7410,ConfigsToTest,tensorflow/tensorflow/python/kernel_tests/neon_depthwise_conv_op_test.py,32,function,"Iterator for different convolution shapes, strides and paddings. - -Yields: - Tuple (input_size, filter_size, out_size, stride, padding), the depthwise - convolution parameters." -7411,CheckGradConfigsToTest,tensorflow/tensorflow/python/kernel_tests/neon_depthwise_conv_op_test.py,56,function,"Iterator for different convolution shapes, strides and paddings. - -compute_gradient_error() is very expensive. So the configs should be -relatively small. - -Yields: - Tuple (input_size, filter_size, out_size, stride, padding), the depthwise - convolution parameters." -7412,DepthwiseConv2DTest,tensorflow/tensorflow/python/kernel_tests/neon_depthwise_conv_op_test.py,83,class, -7413,_AddTest,tensorflow/tensorflow/python/kernel_tests/norm_op_test.py,30,function, -7414,NormOpTest,tensorflow/tensorflow/python/kernel_tests/norm_op_test.py,37,class, -7415,_GetNormOpTest,tensorflow/tensorflow/python/kernel_tests/norm_op_test.py,67,function, -7416,_AddTest,tensorflow/tensorflow/python/kernel_tests/normalize_op_test.py,28,function, -7417,_Normalize,tensorflow/tensorflow/python/kernel_tests/normalize_op_test.py,36,function, -7418,NormalizeOpTest,tensorflow/tensorflow/python/kernel_tests/normalize_op_test.py,57,class, -7419,_GetNormalizeOpTest,tensorflow/tensorflow/python/kernel_tests/normalize_op_test.py,61,function, -7420,NthElementTest,tensorflow/tensorflow/python/kernel_tests/nth_element_op_test.py,32,class, -7421,VerifyTensorAllFiniteTest,tensorflow/tensorflow/python/kernel_tests/numerics_test.py,34,class, -7422,NumericsTest,tensorflow/tensorflow/python/kernel_tests/numerics_test.py,68,class, -7423,OneHotTest,tensorflow/tensorflow/python/kernel_tests/one_hot_op_test.py,29,class, -7424,PadOpTest,tensorflow/tensorflow/python/kernel_tests/pad_op_test.py,32,class, -7425,PaddingFIFOQueueTest,tensorflow/tensorflow/python/kernel_tests/padding_fifo_queue_test.py,39,class, -7426,QueueFromListTest,tensorflow/tensorflow/python/kernel_tests/padding_fifo_queue_test.py,1598,class, -7427,empty_sparse,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,50,function, -7428,flatten,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,57,function,Flatten one level of nesting. -7429,flatten_values_tensors_or_sparse,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,62,function,Flatten each SparseTensor object into 3 Tensors for session.run(). -7430,_compare_output_to_expected,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,69,function, -7431,ParseExampleTest,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,90,class, -7432,ParseSingleExampleTest,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,850,class, -7433,flatten,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,61,function,Flatten one level of nesting. -7434,_compare_output_to_expected,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,66,function, -7435,ParseExampleTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,82,class, -7436,ParseSingleExampleTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,1180,class, -7437,ParseSequenceExampleTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,1419,class, -7438,DecodeRawTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,2291,class, -7439,DecodeJSONExampleTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,2362,class, -7440,ParseTensorOpTest,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,2449,class, -7441,PartitionerCreatorsTest,tensorflow/tensorflow/python/kernel_tests/partitioned_variables_test.py,40,class, -7442,_IotaInitializer,tensorflow/tensorflow/python/kernel_tests/partitioned_variables_test.py,310,function, -7443,PartitionedVariablesTestCase,tensorflow/tensorflow/python/kernel_tests/partitioned_variables_test.py,319,class, -7444,pool_direct_single_axis,tensorflow/tensorflow/python/kernel_tests/pool_test.py,34,function,"Numpy implementation of pooling along a single axis. +7708,make_tensor_hiding_attributes,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,415,function, +7709,LUReconstructStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,456,class, +7710,LUReconstructDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,461,class, +7711,LUMatrixInverseStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,500,class, +7712,LUMatrixInverseDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,505,class, +7713,LUSolveStatic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,556,class, +7714,LUSolveDynamic,tensorflow/tensorflow/python/kernel_tests/linalg_ops_test.py,561,class, +7715,IndexTableFromFile,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,1913,class, +7716,IndexTableFromTensor,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,2177,class, +7717,MutableHashTableBenchmark,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3405,class, +7718,benchmark_single_repeated_scalar_insert_scalar,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3410,method, +7719,benchmark_many_repeated_scalar_insert_scalar,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3420,method, +7720,benchmark_single_repeated_batch_32_insert_scalar,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3431,method, +7721,benchmark_many_repeated_batch_32_insert_scalar,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3441,method, +7722,DenseHashTableBenchmark,tensorflow/tensorflow/python/kernel_tests/lookup_ops_test.py,3453,class, +7723,LuBenchmark,tensorflow/tensorflow/python/kernel_tests/lu_op_test.py,238,class, +7724,benchmarkLuOp,tensorflow/tensorflow/python/kernel_tests/lu_op_test.py,264,method, +7725,simple_scoped_fn,tensorflow/tensorflow/python/kernel_tests/map_fn_test.py,41,function,"Simple function: (a, x) -> 2(x+a), but with ""2"" as a variable in scope." +7726,infix_matmul,tensorflow/tensorflow/python/kernel_tests/matmul_op_test.py,179,function, +7727,MatrixBandPartBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,93,class, +7728,benchmarkMatrixBandPartOp,tensorflow/tensorflow/python/kernel_tests/matrix_band_part_op_test.py,112,method, +7729,np_expm,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,38,function,Slow but accurate Taylor series matrix exponential. +7730,MatrixExponentialBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,163,class, +7731,benchmarkMatrixExponentialOp,tensorflow/tensorflow/python/kernel_tests/matrix_exponential_op_test.py,188,method, +7732,MatrixInverseBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_inverse_op_test.py,156,class, +7733,benchmarkMatrixInverseOp,tensorflow/tensorflow/python/kernel_tests/matrix_inverse_op_test.py,181,method, +7734,MatrixLogarithmBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py,148,class, +7735,benchmarkMatrixLogarithmOp,tensorflow/tensorflow/python/kernel_tests/matrix_logarithm_op_test.py,173,method, +7736,MatrixSolveLsBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,289,class, +7737,benchmarkMatrixSolveLsOp,tensorflow/tensorflow/python/kernel_tests/matrix_solve_ls_op_test.py,327,method, +7738,MatrixSolveBenchmark,tensorflow/tensorflow/python/kernel_tests/matrix_solve_op_test.py,145,class, +7739,benchmarkMatrixSolveOp,tensorflow/tensorflow/python/kernel_tests/matrix_solve_op_test.py,175,method, +7740,empty_sparse,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,50,function, +7741,flatten,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,57,function,Flatten one level of nesting. +7742,flatten_values_tensors_or_sparse,tensorflow/tensorflow/python/kernel_tests/parse_single_example_op_test.py,62,function,Flatten each SparseTensor object into 3 Tensors for session.run(). +7743,flatten,tensorflow/tensorflow/python/kernel_tests/parsing_ops_test.py,61,function,Flatten one level of nesting. +7744,pool_direct_single_axis,tensorflow/tensorflow/python/kernel_tests/pool_test.py,34,function,"Numpy implementation of pooling along a single axis. This is intended for testing only, and therefore isn't particularly efficient. @@ -56149,7 +64626,7 @@ Returns: Raises: ValueError: if arguments are invalid." -7445,pool_direct,tensorflow/tensorflow/python/kernel_tests/pool_test.py,99,function,"Numpy implementation of pooling. +7745,pool_direct,tensorflow/tensorflow/python/kernel_tests/pool_test.py,99,function,"Numpy implementation of pooling. This is intended for testing only, and therefore isn't particularly efficient. @@ -56170,206 +64647,87 @@ Returns: Raises: ValueError: if arguments are invalid." -7446,PoolingTest,tensorflow/tensorflow/python/kernel_tests/pool_test.py,146,class, -7447,GetTestConfigs,tensorflow/tensorflow/python/kernel_tests/pooling_ops_3d_test.py,32,function,"Get all the valid tests configs to run. - -Returns: - all the valid test configs as tuples of data_format and use_gpu." -7448,PoolingTest,tensorflow/tensorflow/python/kernel_tests/pooling_ops_3d_test.py,46,class, -7449,GetDeviceScope,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,44,function, -7450,GetTestConfigs,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,53,function,"Get all the valid tests configs to run. - -Args: - include_nchw_vect_c: Whether to include NCHW_VECT_C in the test configs. - -Returns: - all the valid test configs as tuples of data_format and use_gpu." -7451,GetShrunkInceptionMaxPoolShapes,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,80,function,"Iterator for some of the max pool ops in the Inception 2015 model. +7746,GetDeviceScope,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,44,function, +7747,GetShrunkInceptionMaxPoolShapes,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,80,function,"Iterator for some of the max pool ops in the Inception 2015 model. Args: shrink: Factor to shrink depth relative to Inception. Yields: Tuple (name, input_size, filter_size, out_size, strides, padding)" -7452,PoolingTest,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,107,class, -7453,GetMaxPoolFwdTest,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,1960,function, -7454,GetMaxPoolGradTest,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,1971,function, -7455,GetMaxPoolGradGradTest,tensorflow/tensorflow/python/kernel_tests/pooling_ops_test.py,1983,function, -7456,PriorityQueueTest,tensorflow/tensorflow/python/kernel_tests/priority_queue_test.py,39,class, -7457,np_func,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,48,function, -7458,matmul,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,52,function, -7459,PyFuncTestBase,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,56,class, -7460,PyFuncTest,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,87,class,Encapsulates tests for py_func only. -7461,PyFuncAndEagerPyFuncTest,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,482,class,Encapsulates tests shared between py_func and eager_py_func. -7462,EagerPyFuncTest,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,541,class,Encapsulates tests for eager_py_func only. -7463,_AddTest,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,41,function, -7464,QrOpTest,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,48,class, -7465,_GetQrOpTest,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,83,function, -7466,QrGradOpTest,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,173,class, -7467,_GetQrGradOpTest,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,193,function, -7468,QRBenchmark,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,226,class, -7469,TFCompressionTestCase,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,80,class, -7470,IdentityReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,143,class, -7471,WholeFileReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,288,class, -7472,TextLineReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,346,class, -7473,FixedLengthRecordReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,415,class, -7474,TFRecordReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,624,class, -7475,AsyncReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,711,class, -7476,LMDBReaderTest,tensorflow/tensorflow/python/kernel_tests/reader_ops_test.py,753,class, -7477,RecordInputOpTest,tensorflow/tensorflow/python/kernel_tests/record_input_test.py,30,class, -7478,ReduceBenchmarks,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,38,class,Benchmarks for reductions. -7479,_input_array,tensorflow/tensorflow/python/kernel_tests/reduce_join_op_test.py,34,function,"Creates an ndarray where each element is the binary of its linear index. - -Args: - num_dims: The number of dimensions to create. - -Returns: - An ndarray of shape [2] * num_dims." -7480,_joined_array,tensorflow/tensorflow/python/kernel_tests/reduce_join_op_test.py,48,function,"Creates an ndarray with the result from reduce_join on input_array. - -Args: - num_dims: The number of dimensions of the original input array. - reduce_dim: The dimension to reduce. - -Returns: - An ndarray of shape [2] * (num_dims - 1)." -7481,UnicodeTestCase,tensorflow/tensorflow/python/kernel_tests/reduce_join_op_test.py,68,class,Test case with Python3-compatible string comparator. -7482,ReduceJoinTestHelperTest,tensorflow/tensorflow/python/kernel_tests/reduce_join_op_test.py,76,class,Tests for helper functions. -7483,ReduceJoinTest,tensorflow/tensorflow/python/kernel_tests/reduce_join_op_test.py,98,class, -7484,_powerset,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,42,function,"Helper for generating all possible reduction_axes arguments. - -Example: -powerset([0,1,2]): () (0,) (1,) (2,) (0,1) (0,2) (1,2) (0,1,2) - -Args: - iterable: An iterable of items to generate the powerset of. - -Returns: - The powerset of all items in iterable." -7485,ReducedShapeTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,59,class, -7486,ReductionUnknownShape,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,100,class, -7487,BaseReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,119,class, -7488,SumReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,180,class, -7489,MeanReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,405,class, -7490,EuclideanNormReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,527,class, -7491,ProdReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,612,class, -7492,MinReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,712,class, -7493,MaxReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,831,class, -7494,AllReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,964,class, -7495,AnyReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,1013,class, -7496,CountNonzeroReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,1062,class, -7497,BaseReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test_big.py,30,class, -7498,BigReductionTest,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test_big.py,36,class,Test reductions for sum and boolean all over a wide range of shapes. -7499,RegexFullMatchOpVariantsTest,tensorflow/tensorflow/python/kernel_tests/regex_full_match_op_test.py,34,class, -7500,RegexFullMatchOpTest,tensorflow/tensorflow/python/kernel_tests/regex_full_match_op_test.py,71,class, -7501,RegexReplaceOpVariantsTest,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,34,class, -7502,as_string,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,94,function, -7503,as_tensor,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,98,function, -7504,RegexReplaceTest,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,102,class, -7505,_elu_grad_grad,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,41,function, -7506,ReluTest,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,47,class, -7507,Relu6Test,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,231,class, -7508,LeakyReluTest,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,290,class, -7509,EluTest,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,411,class, -7510,SeluTest,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,512,class, -7511,CreluTest,tensorflow/tensorflow/python/kernel_tests/relu_op_test.py,596,class, -7512,ReshapeTest,tensorflow/tensorflow/python/kernel_tests/reshape_op_test.py,33,class, -7513,ResourceVariableOpsTest,tensorflow/tensorflow/python/kernel_tests/resource_variable_ops_test.py,62,class, -7514,ReverseSequenceTest,tensorflow/tensorflow/python/kernel_tests/reverse_sequence_op_test.py,33,class, -7515,Plus1RNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,54,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." -7516,DummyMultiDimensionalLSTM,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,69,class,"LSTM Cell generating (output, new_state) = (input + 1, state + 1). +7748,np_func,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,48,function, +7749,matmul,tensorflow/tensorflow/python/kernel_tests/py_func_test.py,52,function, +7750,QRBenchmark,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,226,class, +7751,benchmarkQROp,tensorflow/tensorflow/python/kernel_tests/qr_op_test.py,248,method, +7752,ReduceBenchmarks,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,38,class,Benchmarks for reductions. +7753,benchmark_reduce_sum_grad_eager,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,54,method, +7754,benchmark_reduce_sum_grad_eager_cpu,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,63,method, +7755,benchmark_reduce_sum_grad_graph,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,72,method, +7756,benchmark_reduce_sum_grad_graph_cpu,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,88,method, +7757,fn,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,58,method, +7758,fn,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,67,method, +7759,fn,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,83,method, +7760,fn,tensorflow/tensorflow/python/kernel_tests/reduce_benchmark_test.py,100,method, +7761,ReductionUnknownShape,tensorflow/tensorflow/python/kernel_tests/reduction_ops_test.py,100,class, +7762,as_string,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,94,function, +7763,as_tensor,tensorflow/tensorflow/python/kernel_tests/regex_replace_op_test.py,98,function, +7764,Plus1RNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,54,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." +7765,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,58,method, +7766,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,62,method, +7767,DummyMultiDimensionalLSTM,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,69,class,"LSTM Cell generating (output, new_state) = (input + 1, state + 1). The input to this cell may have an arbitrary number of dimensions that follow the preceding 'Time' and 'Batch' dimensions." -7517,NestedRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,104,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1). +7768,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,92,method, +7769,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,96,method, +7770,NestedRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,104,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1). The input, output and state of this cell is a tuple of two tensors." -7518,TestStateSaver,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,124,class, -7519,TestStateSaverWithCounters,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,159,class,"Class wrapper around TestStateSaver. - -A dummy class used for testing of static_state_saving_rnn. It helps test if -save_state and state functions got called same number of time when we -evaluate output of rnn cell and state or either of them separately. It -inherits from the TestStateSaver and adds the counters for calls of functions." -7520,RNNTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,193,class, -7521,LSTMTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,359,class, -7522,BidirectionalRNNTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,1327,class, -7523,MultiDimensionalLSTMTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,1633,class, -7524,NestedLSTMTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,1745,class, -7525,StateSaverRNNTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,1869,class, -7526,GRUTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,1965,class, -7527,RawRNNTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2048,class, -7528,DeviceWrapperCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2356,class,Class to ensure cell calculation happens on a specific device. -7529,TensorArrayOnCorrectDeviceTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2379,class, -7530,RNNCellTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2490,class, -7531,DropoutWrapperTest,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,3065,class, -7532,Plus1RNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,52,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." -7533,ScalarStateRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,67,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." -7534,UnbalancedOutputRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,85,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." -7535,TensorArrayStateRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,104,class,RNN Cell its state as a TensorArray. -7536,RNNTest,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,125,class, -7537,_static_vs_dynamic_rnn_benchmark_static,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,362,function, -7538,_static_vs_dynamic_rnn_benchmark_dynamic,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,384,function, -7539,graph_creation_static_vs_dynamic_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,403,function, -7540,_timer,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,441,function, -7541,static_vs_dynamic_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,455,function, -7542,_half_seq_len_vs_unroll_half_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,495,function, -7543,half_seq_len_vs_unroll_half_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,517,function, -7544,_concat_state_vs_tuple_state_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,560,function, -7545,concat_state_vs_tuple_state_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,585,function, -7546,_dynamic_rnn_swap_memory_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,628,function, -7547,dynamic_rnn_swap_memory_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,651,function, -7548,rnn_long_sequence_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,685,function, -7549,BenchmarkRNN,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,723,class, -7550,SaveTest,tensorflow/tensorflow/python/kernel_tests/save_restore_ops_test.py,32,class, -7551,ShardedFileOpsTest,tensorflow/tensorflow/python/kernel_tests/save_restore_ops_test.py,44,class, -7552,ShapeInferenceTest,tensorflow/tensorflow/python/kernel_tests/save_restore_ops_test.py,56,class, -7553,ScalarTest,tensorflow/tensorflow/python/kernel_tests/scalar_test.py,37,class, -7554,numpy_reverse,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,33,function, -7555,handle_options,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,44,function,Adds tf options to numpy scan ops. -7556,CumsumTest,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,73,class, -7557,CumprodTest,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,197,class, -7558,_AsType,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,44,function, -7559,_FlatInnerDims,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,48,function, -7560,_FlatOuterDims,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,55,function, -7561,_NumpyScatterNd,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,62,function, -7562,_NumpyUpdate,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,79,function, -7563,_NumpyAdd,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,83,function, -7564,_NumpySub,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,87,function, -7565,_NumpyMul,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,91,function, -7566,_NumpyDiv,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,95,function, -7567,_NumpyMin,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,99,function, -7568,_NumpyMax,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,103,function, -7569,StatefulScatterNdTest,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,107,class, -7570,ScatterNdTest,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,413,class, -7571,ScatterNdNonAliasingAddTest,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,714,class, -7572,ScatterNdTensorTest,tensorflow/tensorflow/python/kernel_tests/scatter_nd_ops_test.py,727,class, -7573,_AsType,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,31,function, -7574,_NumpyAdd,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,35,function, -7575,_NumpyAddScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,42,function, -7576,_NumpySub,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,47,function, -7577,_NumpySubScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,52,function, -7578,_NumpyMul,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,57,function, -7579,_NumpyMulScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,62,function, -7580,_NumpyDiv,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,67,function, -7581,_NumpyDivScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,72,function, -7582,_NumpyMin,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,77,function, -7583,_NumpyMinScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,82,function, -7584,_NumpyMax,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,87,function, -7585,_NumpyMaxScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,92,function, -7586,_NumpyUpdate,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,97,function, -7587,_NumpyUpdateScalar,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,102,function, -7588,ScatterTest,tensorflow/tensorflow/python/kernel_tests/scatter_ops_test.py,128,class, -7589,SegmentReductionHelper,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,37,class, -7590,SegmentReductionOpTest,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,87,class, -7591,UnsortedSegmentTest,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,259,class, -7592,SparseSegmentReductionHelper,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,492,class, -7593,SparseSegmentReductionOpTest,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,511,class, -7594,SegmentReductionOpBenchmark,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,938,class, -7595,_AddTest,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,34,function, -7596,SelfAdjointEigTest,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,41,class, -7597,SortEigenDecomposition,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,95,function, -7598,EquilibrateEigenVectorPhases,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,103,function,"Equilibrate the phase of the Eigenvectors in the columns of `x` and `y`. +7771,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,111,method, +7772,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,115,method, +7773,DeviceWrapperCell,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2356,class,Class to ensure cell calculation happens on a specific device. +7774,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2364,method, +7775,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_cell_test.py,2368,method, +7776,Plus1RNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,52,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." +7777,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,56,method, +7778,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,60,method, +7779,call,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,63,method, +7780,ScalarStateRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,67,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." +7781,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,71,method, +7782,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,75,method, +7783,zero_state,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,78,method, +7784,call,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,81,method, +7785,UnbalancedOutputRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,85,class,"RNN Cell generating (output, new_state) = (input + 1, state + 1)." +7786,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,89,method, +7787,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,93,method, +7788,zero_state,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,96,method, +7789,call,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,99,method, +7790,TensorArrayStateRNNCell,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,104,class,RNN Cell its state as a TensorArray. +7791,output_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,108,method, +7792,state_size,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,112,method, +7793,zero_state,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,115,method, +7794,call,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,120,method, +7795,graph_creation_static_vs_dynamic_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,403,function, +7796,static_vs_dynamic_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,455,function, +7797,half_seq_len_vs_unroll_half_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,517,function, +7798,concat_state_vs_tuple_state_rnn_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,585,function, +7799,dynamic_rnn_swap_memory_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,651,function, +7800,rnn_long_sequence_benchmark,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,685,function, +7801,BenchmarkRNN,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,723,class, +7802,benchmarkGraphCreationStaticVsDynamicLSTM,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,725,method, +7803,benchmarkStaticUnrollVsDynamicFlowLSTM,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,739,method, +7804,benchmarkDynamicLSTMNoMemorySwapVsMemorySwap,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,761,method, +7805,benchmarkStaticUnrollHalfSequenceLengthVsHalfUnroll,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,780,method, +7806,benchmarkStaticUnrollStateConcatVsStateTuple,tensorflow/tensorflow/python/kernel_tests/rnn_test.py,804,method, +7807,numpy_reverse,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,33,function, +7808,handle_options,tensorflow/tensorflow/python/kernel_tests/scan_ops_test.py,44,function,Adds tf options to numpy scan ops. +7809,SegmentReductionHelper,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,37,class, +7810,SparseSegmentReductionHelper,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,492,class, +7811,SegmentReductionOpBenchmark,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,938,class, +7812,benchmarkSegmentSumGPU,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,983,method, +7813,benchmarkUnsortedSegmentSumGPU,tensorflow/tensorflow/python/kernel_tests/segment_reduction_ops_test.py,991,method, +7814,SortEigenDecomposition,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,95,function, +7815,EquilibrateEigenVectorPhases,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,103,function,"Equilibrate the phase of the Eigenvectors in the columns of `x` and `y`. Eigenvectors are only unique up to an arbitrary phase. This function rotates x such that it matches y. Precondition: The columns of x and y differ by a @@ -56381,22 +64739,7 @@ Args: Returns: `np.ndarray` containing an equilibrated version of x." -7599,_GetSelfAdjointEigTest,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,122,function, -7600,SelfAdjointEigGradTest,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,180,class, -7601,_GetSelfAdjointEigGradTest,tensorflow/tensorflow/python/kernel_tests/self_adjoint_eig_op_test.py,184,function, -7602,SessionOpsTest,tensorflow/tensorflow/python/kernel_tests/session_ops_test.py,32,class, -7603,_values,tensorflow/tensorflow/python/kernel_tests/sets_test.py,40,function, -7604,_constant,tensorflow/tensorflow/python/kernel_tests/sets_test.py,46,function, -7605,_dense_to_sparse,tensorflow/tensorflow/python/kernel_tests/sets_test.py,50,function, -7606,SetOpsTest,tensorflow/tensorflow/python/kernel_tests/sets_test.py,71,class, -7607,_sparsify,tensorflow/tensorflow/python/kernel_tests/shape_ops_test.py,39,function, -7608,ShapeOpsTest,tensorflow/tensorflow/python/kernel_tests/shape_ops_test.py,51,class, -7609,TileTest,tensorflow/tensorflow/python/kernel_tests/shape_ops_test.py,421,class, -7610,SliceTest,tensorflow/tensorflow/python/kernel_tests/slice_op_test.py,35,class, -7611,SoftmaxTest,tensorflow/tensorflow/python/kernel_tests/softmax_op_test.py,36,class, -7612,SoftplusTest,tensorflow/tensorflow/python/kernel_tests/softplus_op_test.py,32,class, -7613,SoftsignTest,tensorflow/tensorflow/python/kernel_tests/softsign_op_test.py,31,class, -7614,space_to_batch_direct,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,34,function,"Direct Python implementation of space-to-batch conversion. +7816,space_to_batch_direct,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,34,function,"Direct Python implementation of space-to-batch conversion. This is used for tests only. @@ -56407,106 +64750,30 @@ Args: Returns: Converted tensor." -7615,PythonOpImpl,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,75,class, -7616,CppOpImpl,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,86,class, -7617,SpaceToBatchTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,97,class,"Tests input-output pairs for the SpaceToBatch and BatchToSpace ops. - -This uses the Python compatibility wrapper that forwards to space_to_batch_nd." -7618,SpaceToBatchCppTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,189,class,"Tests input-output pairs for the SpaceToBatch and BatchToSpace ops. - -This uses the C++ ops." -7619,SpaceToBatchNDTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,197,class,Tests input-output pairs for the SpaceToBatchND and BatchToSpaceND ops. -7620,SpaceToBatchSpaceToDepth,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,317,class, -7621,SpaceToBatchSpaceToDepthCpp,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,334,class, -7622,SpaceToBatchErrorHandlingTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,338,class, -7623,SpaceToBatchErrorHandlingCppTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,415,class, -7624,SpaceToBatchNDErrorHandlingTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,420,class, -7625,SpaceToBatchGradientTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,524,class, -7626,SpaceToBatchGradientCppTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,579,class, -7627,SpaceToBatchNDGradientTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,583,class, -7628,RequiredSpaceToBatchPaddingsTest,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,627,class, -7629,SpaceToDepthTest,tensorflow/tensorflow/python/kernel_tests/spacetodepth_op_test.py,35,class, -7630,SpaceToDepthGradientTest,tensorflow/tensorflow/python/kernel_tests/spacetodepth_op_test.py,344,class, -7631,_sparsify,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,39,function, -7632,SparseAddTest,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,51,class, -7633,_s2d_add_vs_sparse_add,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,217,function, -7634,SparseAddBenchmark,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,239,class, -7635,SparseConcatTest,tensorflow/tensorflow/python/kernel_tests/sparse_concat_op_test.py,32,class, -7636,_indexedslice,tensorflow/tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py,35,function, -7637,IndexedSlicesConditionalAccumulatorTest,tensorflow/tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py,47,class, -7638,BaseSparseCrossOpTest,tensorflow/tensorflow/python/kernel_tests/sparse_cross_op_test.py,35,class, -7639,SparseCrossOpTest,tensorflow/tensorflow/python/kernel_tests/sparse_cross_op_test.py,79,class, -7640,SparseCrossV2OpTest,tensorflow/tensorflow/python/kernel_tests/sparse_cross_op_test.py,507,class, -7641,SparseCrossHashedOpTest,tensorflow/tensorflow/python/kernel_tests/sparse_cross_op_test.py,881,class, -7642,RandMatrix,tensorflow/tensorflow/python/kernel_tests/sparse_matmul_op_test.py,31,function, -7643,SparseMatMulTest,tensorflow/tensorflow/python/kernel_tests/sparse_matmul_op_test.py,41,class, -7644,MatMulGradientTest,tensorflow/tensorflow/python/kernel_tests/sparse_matmul_op_test.py,135,class, -7645,_sparsify,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,41,function, -7646,SparseToIndicatorTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,53,class, -7647,SparseMergeTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,113,class, -7648,SparseMergeHighDimTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,227,class, -7649,SparseRetainTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,287,class, -7650,SparseResetShapeTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,332,class, -7651,SparseFillEmptyRowsTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,473,class, -7652,SparseAddTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,606,class, -7653,SparseReduceTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,622,class, -7654,SparseMathOpsTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,790,class, -7655,SparseSoftmaxTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,891,class, -7656,SparseMinimumMaximumTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,955,class, -7657,SparseTransposeTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,1021,class, -7658,SparsePlaceholderTest,tensorflow/tensorflow/python/kernel_tests/sparse_ops_test.py,1043,class, -7659,SparseReorderTest,tensorflow/tensorflow/python/kernel_tests/sparse_reorder_op_test.py,33,class, -7660,SparseReshapeTest,tensorflow/tensorflow/python/kernel_tests/sparse_reshape_op_test.py,34,class, -7661,EmptySparseTensorReshapeTest,tensorflow/tensorflow/python/kernel_tests/sparse_reshape_op_test.py,333,class,"Tests for reshaping 0-sized SparseTensors, compared w/ dense tensors." -7662,SerializeSparseTest,tensorflow/tensorflow/python/kernel_tests/sparse_serialization_ops_test.py,31,class, -7663,SparseSliceOpTest,tensorflow/tensorflow/python/kernel_tests/sparse_slice_op_test.py,31,class, -7664,SparseSplitOpTest,tensorflow/tensorflow/python/kernel_tests/sparse_split_op_test.py,29,class, -7665,SparseTensorDenseMatMulGradientTest,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_grad_test.py,32,class, -7666,_maybe_complex,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,42,function, -7667,SparseTensorDenseMatMulTest,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,48,class, -7668,_sparse_tensor_dense_vs_dense_matmul_benchmark_dense,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,254,function, -7669,_sparse_tensor_dense_vs_dense_matmul_benchmark_sparse,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,283,function, -7670,sparse_tensor_dense_vs_dense_matmul_benchmark,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,310,function, -7671,main,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,389,function, -7672,SparseTensorsMapTest,tensorflow/tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py,43,class, -7673,BenchmarkSparseTensorsMapVsSerialization,tensorflow/tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py,190,class, -7674,SparseToDenseTest,tensorflow/tensorflow/python/kernel_tests/sparse_to_dense_op_py_test.py,31,class, -7675,SparseXentTest,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,45,class, -7676,_sparse_vs_dense_xent_benchmark_dense,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,281,function, -7677,_sparse_vs_dense_xent_benchmark_sparse,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,300,function, -7678,sparse_vs_dense_xent_benchmark,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,313,function, -7679,main,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,356,function, -7680,SparseMaskTest,tensorflow/tensorflow/python/kernel_tests/sparsemask_op_test.py,28,class, -7681,SplitOpTest,tensorflow/tensorflow/python/kernel_tests/split_op_test.py,37,class, -7682,np_split_squeeze,tensorflow/tensorflow/python/kernel_tests/stack_op_test.py,34,function, -7683,StackOpTest,tensorflow/tensorflow/python/kernel_tests/stack_op_test.py,43,class, -7684,AutomaticStackingTest,tensorflow/tensorflow/python/kernel_tests/stack_op_test.py,271,class, -7685,StackOpTest,tensorflow/tensorflow/python/kernel_tests/stack_ops_test.py,34,class, -7686,StackOpRefTest,tensorflow/tensorflow/python/kernel_tests/stack_ops_test.py,175,class,Tests for deprecated non-resource variant of stack ops. -7687,StageTest,tensorflow/tensorflow/python/kernel_tests/stage_op_test.py,30,class, -7688,StringsToBytesOpTest,tensorflow/tensorflow/python/kernel_tests/string_bytes_split_op_test.py,33,class, -7689,StringFormatOpTest,tensorflow/tensorflow/python/kernel_tests/string_format_op_test.py,33,class, -7690,StringJoinOpTest,tensorflow/tensorflow/python/kernel_tests/string_join_op_test.py,25,class, -7691,StringLengthOpTest,tensorflow/tensorflow/python/kernel_tests/string_length_op_test.py,26,class, -7692,StringLowerOpTest,tensorflow/tensorflow/python/kernel_tests/string_lower_op_test.py,26,class,Test cases for tf.strings.lower. -7693,StringSplitOpTest,tensorflow/tensorflow/python/kernel_tests/string_split_op_test.py,37,class, -7694,StringSplitV2OpTest,tensorflow/tensorflow/python/kernel_tests/string_split_op_test.py,234,class, -7695,StringStripOpTest,tensorflow/tensorflow/python/kernel_tests/string_strip_op_test.py,25,class,Test cases for tf.strings.strip. -7696,StringToHashBucketOpTest,tensorflow/tensorflow/python/kernel_tests/string_to_hash_bucket_op_test.py,28,class, -7697,StringToNumberOpTest,tensorflow/tensorflow/python/kernel_tests/string_to_number_op_test.py,30,class, -7698,StringUpperOpTest,tensorflow/tensorflow/python/kernel_tests/string_upper_op_test.py,26,class,Test cases for tf.strings.upper. -7699,SubstrOpTest,tensorflow/tensorflow/python/kernel_tests/substr_op_test.py,30,class, -7700,SummaryOpsCoreTest,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,50,class, -7701,SummaryWriterTest,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,677,class, -7702,SummaryOpsTest,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,954,class, -7703,events_from_file,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1210,function,"Returns all events in a single event file. +7817,PythonOpImpl,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,75,class, +7818,space_to_batch,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,78,method, +7819,batch_to_space,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,82,method, +7820,CppOpImpl,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,86,class, +7821,space_to_batch,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,89,method, +7822,batch_to_space,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,93,method, +7823,SpaceToBatchSpaceToDepth,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,317,class, +7824,SpaceToBatchSpaceToDepthCpp,tensorflow/tensorflow/python/kernel_tests/spacetobatch_op_test.py,334,class, +7825,SparseAddBenchmark,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,239,class, +7826,benchmarkSparseAddDense,tensorflow/tensorflow/python/kernel_tests/sparse_add_op_test.py,241,method, +7827,RandMatrix,tensorflow/tensorflow/python/kernel_tests/sparse_matmul_op_test.py,31,function, +7828,sparse_tensor_dense_vs_dense_matmul_benchmark,tensorflow/tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py,310,function, +7829,BenchmarkSparseTensorsMapVsSerialization,tensorflow/tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py,190,class, +7830,benchmarkVeryLarge2DFloatSparseTensor,tensorflow/tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py,192,method, +7831,sparse_vs_dense_xent_benchmark,tensorflow/tensorflow/python/kernel_tests/sparse_xent_op_test.py,313,function, +7832,np_split_squeeze,tensorflow/tensorflow/python/kernel_tests/stack_op_test.py,34,function, +7833,events_from_file,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1210,function,"Returns all events in a single event file. Args: filepath: Path to the event file. Returns: A list of all tf.Event protos in the event file." -7704,events_from_logdir,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1228,function,"Returns all events in the single eventfile in logdir. +7834,events_from_logdir,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1228,function,"Returns all events in the single eventfile in logdir. Args: logdir: The directory in which the single event file is sought. @@ -56516,64 +64783,27 @@ Returns: Raises: AssertionError: If logdir does not contain exactly one file." -7705,to_numpy,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1246,function, -7706,SummaryV1AudioOpTest,tensorflow/tensorflow/python/kernel_tests/summary_v1_audio_op_test.py,30,class, -7707,SummaryV1ImageOpTest,tensorflow/tensorflow/python/kernel_tests/summary_v1_image_op_test.py,34,class, -7708,SummaryV1OpsTest,tensorflow/tensorflow/python/kernel_tests/summary_v1_ops_test.py,35,class, -7709,SummaryV1TensorOpTest,tensorflow/tensorflow/python/kernel_tests/summary_v1_tensor_op_test.py,33,class, -7710,_AddTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,42,function, -7711,SvdOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,49,class, -7712,_GetSvdOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,90,function, -7713,SvdGradOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,201,class, -7714,_NormalizingSvd,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,205,function, -7715,_GetSvdGradOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,227,function, -7716,SvdGradGradOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,267,class, -7717,_GetSvdGradGradOpTest,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,271,function, -7718,SVDBenchmark,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,314,class, -7719,TemplateMirroredStrategyTest,tensorflow/tensorflow/python/kernel_tests/template_mirrored_strategy_test.py,30,class, -7720,variable_scoped_function,tensorflow/tensorflow/python/kernel_tests/template_test.py,39,function, -7721,internally_variable_scoped_function,tensorflow/tensorflow/python/kernel_tests/template_test.py,45,function, -7722,function_with_create,tensorflow/tensorflow/python/kernel_tests/template_test.py,51,function,Creates a variable as a side effect using tf.Variable. -7723,function_with_side_create,tensorflow/tensorflow/python/kernel_tests/template_test.py,58,function,Creates a variable as a side effect using tf.get_variable. -7724,variable_scoped_function_with_local_variable,tensorflow/tensorflow/python/kernel_tests/template_test.py,65,function, -7725,TemplateTest,tensorflow/tensorflow/python/kernel_tests/template_test.py,72,class, -7726,_make_converter,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,52,function, -7727,_make_ta,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,65,function, -7728,TensorArrayTest,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,72,class, -7729,TensorArrayBenchmark,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1798,class, -7730,TensorPriorityTest,tensorflow/tensorflow/python/kernel_tests/tensor_priority_test.py,26,class, -7731,_add_test,tensorflow/tensorflow/python/kernel_tests/tensordot_op_test.py,35,function, -7732,TensordotTest,tensorflow/tensorflow/python/kernel_tests/tensordot_op_test.py,42,class, -7733,_get_tensordot_tests,tensorflow/tensorflow/python/kernel_tests/tensordot_op_test.py,143,function, -7734,TopKTest,tensorflow/tensorflow/python/kernel_tests/topk_op_test.py,40,class, -7735,TopKBenchmark,tensorflow/tensorflow/python/kernel_tests/topk_op_test.py,224,class, -7736,TraceTest,tensorflow/tensorflow/python/kernel_tests/trace_op_test.py,27,class, -7737,TransposeTest,tensorflow/tensorflow/python/kernel_tests/transpose_op_test.py,35,class, -7738,TridiagonalMulOpTest,tensorflow/tensorflow/python/kernel_tests/tridiagonal_matmul_op_test.py,39,class, -7739,flags,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,53,function, -7740,_tfconst,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,63,function, -7741,_tf_ones,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,67,function, -7742,TridiagonalSolveOpTest,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,71,class, -7743,decor,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,746,function, -7744,_nested_encode,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,37,function,Encode each string in a nested list with `encoding`. -7745,_nested_codepoints,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,45,function,Replace each string in a nested list with a list of its codepoints. -7746,_nested_offsets,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,58,function,Replace each string in a nested list with a list of start offsets. -7747,_nested_splitchars,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,73,function,Replace each string in a nested list with a list of char substrings. -7748,_make_sparse_tensor,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,86,function, -7749,UnicodeDecodeTest,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,93,class, -7750,UnicodeSplitTest,tensorflow/tensorflow/python/kernel_tests/unicode_decode_op_test.py,447,class, -7751,UnicodeEncodeOpTest,tensorflow/tensorflow/python/kernel_tests/unicode_encode_op_test.py,36,class, -7752,UnicodeScriptOpTest,tensorflow/tensorflow/python/kernel_tests/unicode_script_op_test.py,30,class, -7753,UnicodeScriptBenchmarks,tensorflow/tensorflow/python/kernel_tests/unicode_script_op_test.py,61,class, -7754,UnicodeTranscodeOpTest,tensorflow/tensorflow/python/kernel_tests/unicode_transcode_op_test.py,33,class, -7755,UniqueTest,tensorflow/tensorflow/python/kernel_tests/unique_op_test.py,29,class, -7756,UniqueWithCountsTest,tensorflow/tensorflow/python/kernel_tests/unique_op_test.py,110,class, -7757,UnicodeTestCase,tensorflow/tensorflow/python/kernel_tests/unsorted_segment_join_op_test.py,32,class,Test case with Python3-compatible string comparator. -7758,UnsortedSegmentJoinOpTest,tensorflow/tensorflow/python/kernel_tests/unsorted_segment_join_op_test.py,42,class, -7759,np_split_squeeze,tensorflow/tensorflow/python/kernel_tests/unstack_op_test.py,31,function, -7760,UnstackOpTest,tensorflow/tensorflow/python/kernel_tests/unstack_op_test.py,40,class, -7761,VariableOpTest,tensorflow/tensorflow/python/kernel_tests/variable_ops_test.py,46,class, -7762,run_inside_wrap_function_in_eager_mode,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,48,function,"Decorator to execute the same graph code in eager and graph modes. +7835,to_numpy,tensorflow/tensorflow/python/kernel_tests/summary_ops_test.py,1246,function, +7836,SVDBenchmark,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,314,class, +7837,benchmarkSVDOp,tensorflow/tensorflow/python/kernel_tests/svd_op_test.py,337,method, +7838,variable_scoped_function,tensorflow/tensorflow/python/kernel_tests/template_test.py,39,function, +7839,internally_variable_scoped_function,tensorflow/tensorflow/python/kernel_tests/template_test.py,45,function, +7840,function_with_create,tensorflow/tensorflow/python/kernel_tests/template_test.py,51,function,Creates a variable as a side effect using tf.Variable. +7841,function_with_side_create,tensorflow/tensorflow/python/kernel_tests/template_test.py,58,function,Creates a variable as a side effect using tf.get_variable. +7842,variable_scoped_function_with_local_variable,tensorflow/tensorflow/python/kernel_tests/template_test.py,65,function, +7843,TensorArrayBenchmark,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1798,class, +7844,benchmarkWriteInWhile,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1814,method, +7845,benchmarkWriteInWhileWithControlFlowV2,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1818,method, +7846,benchmarkWriteInDatasetMapFn,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1821,method, +7847,benchmarkWriteInDatasetParallelMapFn,tensorflow/tensorflow/python/kernel_tests/tensor_array_ops_test.py,1827,method, +7848,TopKBenchmark,tensorflow/tensorflow/python/kernel_tests/topk_op_test.py,224,class, +7849,benchmarkTopK,tensorflow/tensorflow/python/kernel_tests/topk_op_test.py,226,method, +7850,flags,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,53,function, +7851,decor,tensorflow/tensorflow/python/kernel_tests/tridiagonal_solve_op_test.py,746,function, +7852,UnicodeScriptBenchmarks,tensorflow/tensorflow/python/kernel_tests/unicode_script_op_test.py,61,class, +7853,benchmark_unicode_script,tensorflow/tensorflow/python/kernel_tests/unicode_script_op_test.py,80,method, +7854,np_split_squeeze,tensorflow/tensorflow/python/kernel_tests/unstack_op_test.py,31,function, +7855,run_inside_wrap_function_in_eager_mode,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,48,function,"Decorator to execute the same graph code in eager and graph modes. In graph mode, we just execute the graph_function passed as argument. In eager mode, we wrap the function using wrap_function and then execute the wrapped @@ -56584,305 +64814,77 @@ Args: Returns: decorated function" -7763,VariableScopeTest,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,72,class, -7764,axis0_into1_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1375,function, -7765,axis0_into2_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1380,function, -7766,axis0_into3_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1386,function, -7767,VariableScopeWithPartitioningTest,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1392,class, -7768,VariableScopeWithCustomGetterTest,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1521,class, -7769,PartitionInfoTest,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1738,class, -7770,VariableScopeMultithreadedTest,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1801,class, -7771,VariablesTestCase,tensorflow/tensorflow/python/kernel_tests/variables_test.py,47,class, -7772,IsInitializedTest,tensorflow/tensorflow/python/kernel_tests/variables_test.py,633,class, -7773,ObsoleteIsInitializedTest,tensorflow/tensorflow/python/kernel_tests/variables_test.py,683,class, -7774,PartitionedVariableTest,tensorflow/tensorflow/python/kernel_tests/variables_test.py,714,class, -7775,VariableContainerTest,tensorflow/tensorflow/python/kernel_tests/variables_test.py,872,class, -7776,AggregationModesTest,tensorflow/tensorflow/python/kernel_tests/variables_test.py,897,class, -7777,_test_values,tensorflow/tensorflow/python/kernel_tests/weights_broadcast_test.py,32,function, -7778,AssertBroadcastableTest,tensorflow/tensorflow/python/kernel_tests/weights_broadcast_test.py,36,class, -7779,BroadcastWeightsTest,tensorflow/tensorflow/python/kernel_tests/weights_broadcast_test.py,164,class, -7780,WhereOpTest,tensorflow/tensorflow/python/kernel_tests/where_op_test.py,38,class, -7781,WhereBenchmark,tensorflow/tensorflow/python/kernel_tests/where_op_test.py,271,class, -7782,random_gamma,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,56,function, -7783,random_gamma_with_alpha_beta,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,60,function, -7784,random_poisson_v2,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,65,function, -7785,random_poisson_v2_with_lam,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,69,function, -7786,fill,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,73,function, -7787,WhileV2Test,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,77,class, -7788,ScalarShape,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,1814,function, -7789,GetOptimizedGraph,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,1818,function, -7790,XentTest,tensorflow/tensorflow/python/kernel_tests/xent_op_test.py,41,class, -7791,XentBenchmark,tensorflow/tensorflow/python/kernel_tests/xent_op_test.py,329,class, -7792,ZeroDivisionTest,tensorflow/tensorflow/python/kernel_tests/zero_division_test.py,28,class, -7793,TrainingPredictionOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/prediction_ops_test.py,30,class,Tests prediction ops for training. -7794,PredictionOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/prediction_ops_test.py,2159,class,Tests prediction ops for inference. -7795,FeatureContribsOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/prediction_ops_test.py,2636,class,Tests feature contribs ops for model understanding. -7796,QuantileOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/quantile_ops_test.py,40,class, -7797,ResourceOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/resource_ops_test.py,30,class,Tests resource_ops. -7798,StatsOpsTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/stats_ops_test.py,36,class,Tests stats_ops. -7799,BestMultiDimFeatureSplitMultiClassV2Op,tensorflow/tensorflow/python/kernel_tests/boosted_trees/stats_ops_test.py,1673,class,Tests multi-class/multi-regression for best splits using V2 op. -7800,UpdateTreeEnsembleOpTest,tensorflow/tensorflow/python/kernel_tests/boosted_trees/training_ops_test.py,34,class,Tests for growing tree ensemble from split candidates. -7801,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,36,function, -7802,make_bernoulli,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,48,function, -7803,entropy,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,54,function, -7804,BernoulliTest,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,59,class, -7805,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/beta_test.py,36,function, -7806,BetaTest,tensorflow/tensorflow/python/kernel_tests/distributions/beta_test.py,50,class, -7807,BaseBijectorTest,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,35,class,Tests properties of the Bijector base-class. -7808,IntentionallyMissingError,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,83,class, -7809,BrokenBijector,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,87,class,Forward and inverse are not inverses of each other. -7810,BijectorTestEventNdims,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,118,class, -7811,BijectorCachingTestBase,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,148,class, -7812,BijectorCachingTest,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,188,class,Test caching with BrokenBijector. -7813,ExpOnlyJacobian,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,196,class,Only used for jacobian calculations. -7814,ConstantJacobian,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,213,class,Only used for jacobian calculations. -7815,BijectorReduceEventDimsTest,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,230,class,Test caching with BrokenBijector. -7816,make_categorical,tensorflow/tensorflow/python/kernel_tests/distributions/categorical_test.py,40,function, -7817,CategoricalTest,tensorflow/tensorflow/python/kernel_tests/distributions/categorical_test.py,46,class, -7818,DirichletMultinomialTest,tensorflow/tensorflow/python/kernel_tests/distributions/dirichlet_multinomial_test.py,35,class, -7819,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/dirichlet_test.py,35,function, -7820,DirichletTest,tensorflow/tensorflow/python/kernel_tests/distributions/dirichlet_test.py,49,class, -7821,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/exponential_test.py,34,function, -7822,ExponentialTest,tensorflow/tensorflow/python/kernel_tests/distributions/exponential_test.py,47,class, -7823,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/gamma_test.py,36,function, -7824,GammaTest,tensorflow/tensorflow/python/kernel_tests/distributions/gamma_test.py,50,class, -7825,IdentityBijectorTest,tensorflow/tensorflow/python/kernel_tests/distributions/identity_bijector_test.py,27,class,Tests correctness of the Y = g(X) = X transformation. -7826,KLTest,tensorflow/tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py,34,class, -7827,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/laplace_test.py,35,function, -7828,LaplaceTest,tensorflow/tensorflow/python/kernel_tests/distributions/laplace_test.py,48,class, -7829,MultinomialTest,tensorflow/tensorflow/python/kernel_tests/distributions/multinomial_test.py,32,class, -7830,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/normal_test.py,42,function, -7831,NormalTest,tensorflow/tensorflow/python/kernel_tests/distributions/normal_test.py,53,class, -7832,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,39,function, -7833,_check_strictly_increasing,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,53,function, -7834,_make_grid,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,58,function,"Returns a uniform grid + noise, reshaped to shape argument." -7835,_value_and_gradient,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,70,function,Calls `fn` and computes the gradient of the result wrt `arg`. -7836,NdtriTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,85,class, -7837,NdtrTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,151,class, -7838,LogNdtrTestLower,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,226,class, -7839,LogNdtrTestMid,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,238,class, -7840,LogNdtrTestUpper,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,249,class, -7841,NdtrGradientTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,263,class, -7842,LogNdtrGradientTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,356,class, -7843,ErfInvTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,360,class, -7844,LogCDFLaplaceTest,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,385,class, -7845,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/student_t_test.py,37,function, -7846,StudentTTest,tensorflow/tensorflow/python/kernel_tests/distributions/student_t_test.py,50,class, -7847,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/uniform_test.py,37,function, -7848,UniformTest,tensorflow/tensorflow/python/kernel_tests/distributions/uniform_test.py,49,class, -7849,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,43,function, -7850,_logit,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,55,function, -7851,AssertCloseTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,60,class, -7852,MaybeGetStaticTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,93,class, -7853,GetLogitsAndProbsTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,123,class, -7854,EmbedCheckCategoricalEventShapeTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,271,class, -7855,EmbedCheckIntegerCastingClosedTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,312,class, -7856,LogCombinationsTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,352,class, -7857,DynamicShapeTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,380,class, -7858,RotateTransposeTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,485,class, -7859,PickVectorTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,524,class, -7860,PreferStaticRankTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,543,class, -7861,PreferStaticShapeTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,588,class, -7862,PreferStaticValueTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,633,class, -7863,FillTriangularTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,679,class, -7864,FillTriangularInverseTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,785,class, -7865,ReduceWeightedLogSumExp,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,809,class, -7866,GenNewSeedTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,906,class, -7867,SoftplusTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,916,class, -7868,ArgumentsTest,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,1022,class, -7869,_BadAdder,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,35,class,Adder that will fail if used. -7870,LinearOperatorAdditionCorrectnessTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,48,class,"Tests correctness of addition with combinations of a few Adders. - -Tests here are done with the _DEFAULT_ADDITION_TIERS, which means -add_operators should reduce all operators resulting in one single operator. - -This shows that we are able to correctly combine adders using the tiered -system. All Adders should be tested separately, and there is no need to test -every Adder within this class." -7871,LinearOperatorOrderOfAdditionTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,176,class,Test that the order of addition is done as specified by tiers. -7872,AddAndReturnScaledIdentityTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,265,class, -7873,AddAndReturnDiagTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,326,class, -7874,AddAndReturnTriLTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,371,class, -7875,AddAndReturnMatrixTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_addition_test.py,395,class, -7876,LinearOperatorAdjointTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_adjoint_test.py,37,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7877,LinearOperatorAdjointNonSquareTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_adjoint_test.py,251,class,Tests done in the base class NonSquareLinearOperatorDerivedClassTest. -7878,AdjointTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py,43,class, -7879,CholeskyTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py,85,class, -7880,MatmulTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py,135,class, -7881,SolveTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py,181,class, -7882,InverseTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_algebra_test.py,230,class, -7883,_block_diag_dense,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_block_diag_test.py,38,function,"Convert a list of blocks, into a dense block diagonal matrix." -7884,SquareLinearOperatorBlockDiagTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_block_diag_test.py,63,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7885,_block_lower_triangular_dense,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_block_lower_triangular_test.py,38,function,Convert a list of blocks into a dense blockwise lower-triangular matrix. -7886,SquareLinearOperatorBlockLowerTriangularTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_block_lower_triangular_test.py,60,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7887,LinearOperatorCirculantBaseTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,39,class,Common class for circulant tests. -7888,LinearOperatorCirculantTestSelfAdjointOperator,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,102,class,"Test of LinearOperatorCirculant when operator is self-adjoint. - -Real spectrum <==> Self adjoint operator. -Note that when the spectrum is real, the operator may still be complex." -7889,LinearOperatorCirculantTestHermitianSpectrum,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,169,class,"Test of LinearOperatorCirculant when the spectrum is Hermitian. - -Hermitian spectrum <==> Real valued operator. We test both real and complex -dtypes here though. So in some cases the matrix will be complex but with -zero imaginary part." -7890,LinearOperatorCirculantTestNonHermitianSpectrum,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,245,class,"Test of LinearOperatorCirculant when the spectrum is not Hermitian. - -Non-Hermitian spectrum <==> Complex valued operator. -We test only complex dtypes here." -7891,LinearOperatorCirculant2DBaseTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,394,class,Common class for 2D circulant tests. -7892,LinearOperatorCirculant2DTestHermitianSpectrum,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,474,class,"Test of LinearOperatorCirculant2D when the spectrum is Hermitian. - -Hermitian spectrum <==> Real valued operator. We test both real and complex -dtypes here though. So in some cases the matrix will be complex but with -zero imaginary part." -7893,LinearOperatorCirculant2DTestNonHermitianSpectrum,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,534,class,"Test of LinearOperatorCirculant when the spectrum is not Hermitian. - -Non-Hermitian spectrum <==> Complex valued operator. -We test only complex dtypes here." -7894,LinearOperatorCirculant3DTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_circulant_test.py,660,class,Simple test of the 3D case. See also the 1D and 2D tests. -7895,SquareLinearOperatorCompositionTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py,34,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7896,NonSquareLinearOperatorCompositionTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_composition_test.py,142,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7897,LinearOperatorDiagTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_diag_test.py,34,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7898,SquareLinearOperatorFullMatrixTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_full_matrix_test.py,36,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7899,SquareLinearOperatorFullMatrixSymmetricPositiveDefiniteTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_full_matrix_test.py,122,class,"Most tests done in the base class LinearOperatorDerivedClassTest. - -In this test, the operator is constructed with hints that invoke the use of -a Cholesky decomposition for solves/determinant." -7900,NonSquareLinearOperatorFullMatrixTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_full_matrix_test.py,221,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7901,LinearOperatorHouseholderTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_householder_test.py,35,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7902,LinearOperatorIdentityTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_identity_test.py,38,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7903,LinearOperatorScaledIdentityTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_identity_test.py,281,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7904,LinearOperatorInversionTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_inversion_test.py,35,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7905,_kronecker_dense,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_kronecker_test.py,38,function,"Convert a list of factors, into a dense Kronecker product." -7906,KroneckerDenseTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_kronecker_test.py,56,class,Test of `_kronecker_dense` function. -7907,SquareLinearOperatorKroneckerTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_kronecker_test.py,82,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7908,BaseLinearOperatorLowRankUpdatetest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,35,class,Base test for this type of operator. -7909,LinearOperatorLowRankUpdatetestWithDiagUseCholesky,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,176,class,"A = L + UDU^H, D > 0, L > 0 ==> A > 0 and we can use a Cholesky." -7910,LinearOperatorLowRankUpdatetestWithDiagCannotUseCholesky,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,195,class,"A = L + UDU^H, D !> 0, L > 0 ==> A !> 0 and we cannot use a Cholesky." -7911,LinearOperatorLowRankUpdatetestNoDiagUseCholesky,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,219,class,"A = L + UU^H, L > 0 ==> A > 0 and we can use a Cholesky." -7912,LinearOperatorLowRankUpdatetestNoDiagCannotUseCholesky,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,238,class,"A = L + UV^H, L > 0 ==> A is not symmetric and we cannot use a Cholesky." -7913,LinearOperatorLowRankUpdatetestWithDiagNotSquare,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,263,class,"A = L + UDU^H, D > 0, L > 0 ==> A > 0 and we can use a Cholesky." -7914,LinearOperatorLowRankUpdateBroadcastsShape,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,273,class,Test that the operator's shape is the broadcast of arguments. -7915,LinearOperatorLowerTriangularTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_lower_triangular_test.py,32,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7916,LinearOperatorPermutationTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_permutation_test.py,37,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7917,LinearOperatorShape,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_test.py,37,class,LinearOperator that implements the methods ._shape and _shape_tensor. -7918,LinearOperatorMatmulSolve,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_test.py,65,class,LinearOperator that wraps a [batch] matrix and implements matmul/solve. -7919,LinearOperatorTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_test.py,100,class, -7920,LinearOperatorToeplitzTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_toeplitz_test.py,42,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7921,_LinearOperatorTriDiagBase,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_tridiag_test.py,31,class, -7922,LinearOperatorTriDiagCompactTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_tridiag_test.py,105,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7923,LinearOperatorTriDiagSequenceTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_tridiag_test.py,126,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7924,LinearOperatorTriDiagMatrixTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_tridiag_test.py,160,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7925,AssertZeroImagPartTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,34,class, -7926,AssertNoEntriesWithModulusZeroTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,59,class, -7927,BroadcastMatrixBatchDimsTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,94,class, -7928,MatrixSolveWithBroadcastTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,192,class, -7929,DomainDimensionStubOperator,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,277,class, -7930,AssertCompatibleMatrixDimensionsTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,286,class, -7931,DummyOperatorWithHint,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,305,class, -7932,UseOperatorOrProvidedHintUnlessContradictingTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,311,class, -7933,BlockwiseTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,348,class, -7934,LinearOperatorZerosTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py,35,class,Most tests done in the base class LinearOperatorDerivedClassTest. -7935,LinearOperatorZerosNotSquareTest,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_zeros_test.py,201,class, -7936,_add_test,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/conjugate_gradient_test.py,30,function, -7937,ConjugateGradientTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/conjugate_gradient_test.py,37,class, -7938,_get_conjugate_gradient_test,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/conjugate_gradient_test.py,41,function, -7939,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_dense_mat_mul_grad_test.py,36,function, -7940,_add_test,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_dense_mat_mul_grad_test.py,42,function, -7941,CSRSparseMatrixDenseMatMulGradTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_dense_mat_mul_grad_test.py,51,class, -7942,create_mat_mul_test_fn,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_dense_mat_mul_grad_test.py,114,function, -7943,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_grad_test.py,35,function, -7944,_add_test,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_grad_test.py,41,function, -7945,CSRSparseMatrixGradTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_grad_test.py,50,class, -7946,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,53,function, -7947,_swap,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,59,function, -7948,twist_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,63,function,Permute the rows and columns of a 2D or (batched) 3D Tensor. -7949,CSRSparseMatrixOpsTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,93,class, -7950,CSRSparseMatrixOpsBenchmark,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1336,class, -7951,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py,36,function, -7952,_add_test,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py,42,function, -7953,CSRSparseMatrixGradTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py,51,class, -7954,create_sparse_mat_mul_test_fn,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py,115,function, -7955,CSRSparseMatrixTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_test.py,33,class, -7956,SparseMatrixMatmulTest,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_test.py,145,class, -7957,DecodeProtoOpTest,tensorflow/tensorflow/python/kernel_tests/proto/decode_proto_op_test.py,28,class, -7958,DecodeProtoOpTestBase,tensorflow/tensorflow/python/kernel_tests/proto/decode_proto_op_test_base.py,37,class,Base class for testing proto decoding ops. -7959,DescriptorSourceTest,tensorflow/tensorflow/python/kernel_tests/proto/descriptor_source_test.py,27,class, -7960,DescriptorSourceTestBase,tensorflow/tensorflow/python/kernel_tests/proto/descriptor_source_test_base.py,33,class,Base class for testing descriptor sources. -7961,EncodeProtoOpTest,tensorflow/tensorflow/python/kernel_tests/proto/encode_proto_op_test.py,28,class, -7962,EncodeProtoOpTestBase,tensorflow/tensorflow/python/kernel_tests/proto/encode_proto_op_test_base.py,39,class,Base class for testing proto encoding ops. -7963,ProtoOpTestBase,tensorflow/tensorflow/python/kernel_tests/proto/proto_op_test_base.py,31,class,Base class for testing proto decoding and encoding ops. -7964,MultinomialTest,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_big_test.py,31,class, -7965,composed_sampler,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,40,function, -7966,MultinomialTest,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,55,class, -7967,native_op_vs_composed_ops,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,216,function, -7968,MultinomialBenchmark,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,237,class, -7969,_get_stddev_inside_bounds_before_using_randn,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,43,function, -7970,TruncatedNormalMoments,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,51,class, -7971,calculate_moments,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,96,function, -7972,z_test,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,103,function, -7973,ParameterizedTruncatedNormalTest,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,114,class, -7974,parameterized_vs_naive,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,394,function, -7975,randn_sampler_switchover,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,419,function, -7976,TruncatedNormalBenchmark,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,471,class, -7977,RandomBinomialTest,tensorflow/tensorflow/python/kernel_tests/random/random_binomial_test.py,36,class,This is a large test due to the moments computation taking some time. -7978,RandomCropTest,tensorflow/tensorflow/python/kernel_tests/random/random_crop_test.py,28,class, -7979,RandomGammaTest,tensorflow/tensorflow/python/kernel_tests/random/random_gamma_test.py,36,class,This is a medium test due to the moments computation taking some time. -7980,AddLeadingUnitDimensionsTest,tensorflow/tensorflow/python/kernel_tests/random/random_grad_test.py,35,class, -7981,RandomGammaGradTest,tensorflow/tensorflow/python/kernel_tests/random/random_grad_test.py,59,class,"Tests for derivative of a sample ~ Gamma(alpha, beta) wrt alpha and beta. - -The sample is an ""implicit"" function of alpha, beta and the independent random -noise u. The derivatives we are looking for are -d sample(alpha, beta, u) / dalpha (and dbeta). - -The derivative w.r.t. beta is computed by the standard automatic -differentiation, so we trust that it is computed correctly. - -The derivative w.r.t. alpha is computed by Eigen function, so we test it in -several ways. Unfortunately, the standard derivative checking by perturbing -the parameter is impossible here, because we cannot fix the value of u -in the random sampler. Instead, we compare the derivative for the given pair -of (sample, alpha) to the values computed in various ways, and also check -some statistical properties of the derivative." -7982,RandomOpTestCommon,tensorflow/tensorflow/python/kernel_tests/random/random_ops_test.py,35,class, -7983,RandomNormalTest,tensorflow/tensorflow/python/kernel_tests/random/random_ops_test.py,63,class, -7984,TruncatedNormalTest,tensorflow/tensorflow/python/kernel_tests/random/random_ops_test.py,160,class, -7985,RandomUniformTest,tensorflow/tensorflow/python/kernel_tests/random/random_ops_test.py,262,class, -7986,RandomShapeTest,tensorflow/tensorflow/python/kernel_tests/random/random_ops_test.py,419,class, -7987,RandomPoissonTest,tensorflow/tensorflow/python/kernel_tests/random/random_poisson_test.py,38,class,This is a large test due to the moments computation taking some time. -7988,RandomShuffleQueueTest,tensorflow/tensorflow/python/kernel_tests/random/random_shuffle_queue_test.py,40,class, -7989,invert_philox,tensorflow/tensorflow/python/kernel_tests/random/stateless_random_ops_test.py,38,function,Invert the Philox bijection. -7990,StatelessOpsTest,tensorflow/tensorflow/python/kernel_tests/random/stateless_random_ops_test.py,55,class, -7991,test_moment_matching,tensorflow/tensorflow/python/kernel_tests/random/util.py,28,function,"Return z-test scores for sample moments to match analytic moments. - -Given `samples`, check that the first sample `number_moments` match -the given `dist` moments by doing a z-test. - -Args: - samples: Samples from target distribution. - number_moments: Python `int` describing how many sample moments to check. - dist: SciPy distribution object that provides analytic moments. - stride: Distance between samples to check for statistical properties. - A stride of 0 means to use all samples, while other strides test for - spatial correlation. -Returns: - Array of z_test scores." -7992,chi_squared,tensorflow/tensorflow/python/kernel_tests/random/util.py,79,function,Pearson's Chi-squared test. -7993,normal_cdf,tensorflow/tensorflow/python/kernel_tests/random/util.py,88,function,Cumulative distribution function for a standard normal distribution. -7994,anderson_darling,tensorflow/tensorflow/python/kernel_tests/random/util.py,93,function,Anderson-Darling test for a standard normal distribution. -7995,test_truncated_normal,tensorflow/tensorflow/python/kernel_tests/random/util.py,103,function,Tests truncated normal distribution's statistics. -7996,try_import,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,33,function, -7997,_modify_input_for_dct,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,45,function,Pad or trim the provided NumPy array's innermost axis to length n. -7998,_np_dct1,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,64,function,Computes the DCT-I manually with NumPy. -7999,_np_dct2,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,80,function,Computes the DCT-II manually with NumPy. -8000,_np_dct3,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,101,function,Computes the DCT-III manually with NumPy. -8001,_np_dct4,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,123,function,Computes the DCT-IV manually with NumPy. -8002,DCTOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,150,class, -8003,BaseFFTOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/fft_ops_test.py,44,class, -8004,FFTOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/fft_ops_test.py,122,class, -8005,RFFTOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/fft_ops_test.py,299,class, -8006,FFTShiftTest,tensorflow/tensorflow/python/kernel_tests/signal/fft_ops_test.py,603,class, -8007,hertz_to_mel,tensorflow/tensorflow/python/kernel_tests/signal/mel_ops_test.py,40,function,"Convert frequencies to mel scale using HTK formula. +7856,axis0_into1_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1375,function, +7857,axis0_into2_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1380,function, +7858,axis0_into3_partitioner,tensorflow/tensorflow/python/kernel_tests/variable_scope_test.py,1386,function, +7859,WhereBenchmark,tensorflow/tensorflow/python/kernel_tests/where_op_test.py,271,class, +7860,benchmarkWhere,tensorflow/tensorflow/python/kernel_tests/where_op_test.py,273,method, +7861,benchmarkBatchSelect,tensorflow/tensorflow/python/kernel_tests/where_op_test.py,298,method, +7862,random_gamma,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,56,function, +7863,random_gamma_with_alpha_beta,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,60,function, +7864,random_poisson_v2,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,65,function, +7865,random_poisson_v2_with_lam,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,69,function, +7866,fill,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,73,function, +7867,ScalarShape,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,1814,function, +7868,GetOptimizedGraph,tensorflow/tensorflow/python/kernel_tests/while_v2_test.py,1818,function, +7869,XentBenchmark,tensorflow/tensorflow/python/kernel_tests/xent_op_test.py,329,class, +7870,benchmarkZeroDimension,tensorflow/tensorflow/python/kernel_tests/xent_op_test.py,331,method, +7871,benchmarkSingleClass,tensorflow/tensorflow/python/kernel_tests/xent_op_test.py,356,method, +7872,BestMultiDimFeatureSplitMultiClassV2Op,tensorflow/tensorflow/python/kernel_tests/boosted_trees/stats_ops_test.py,1673,class,Tests multi-class/multi-regression for best splits using V2 op. +7873,frobenius,tensorflow/tensorflow/python/kernel_tests/boosted_trees/stats_ops_test.py,1729,method, +7874,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,36,function, +7875,make_bernoulli,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,48,function, +7876,entropy,tensorflow/tensorflow/python/kernel_tests/distributions/bernoulli_test.py,54,function, +7877,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/beta_test.py,36,function, +7878,IntentionallyMissingError,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,83,class, +7879,BrokenBijector,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,87,class,Forward and inverse are not inverses of each other. +7880,ExpOnlyJacobian,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,196,class,Only used for jacobian calculations. +7881,ConstantJacobian,tensorflow/tensorflow/python/kernel_tests/distributions/bijector_test.py,213,class,Only used for jacobian calculations. +7882,make_categorical,tensorflow/tensorflow/python/kernel_tests/distributions/categorical_test.py,40,function, +7883,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/dirichlet_test.py,35,function, +7884,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/exponential_test.py,34,function, +7885,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/gamma_test.py,36,function, +7886,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/laplace_test.py,35,function, +7887,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/normal_test.py,42,function, +7888,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/special_math_test.py,39,function, +7889,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/student_t_test.py,37,function, +7890,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/uniform_test.py,37,function, +7891,try_import,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,43,function, +7892,ReduceWeightedLogSumExp,tensorflow/tensorflow/python/kernel_tests/distributions/util_test.py,809,class, +7893,LinearOperatorLowRankUpdateBroadcastsShape,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_low_rank_update_test.py,273,class,Test that the operator's shape is the broadcast of arguments. +7894,LinearOperatorShape,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_test.py,37,class,LinearOperator that implements the methods ._shape and _shape_tensor. +7895,LinearOperatorMatmulSolve,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_test.py,65,class,LinearOperator that wraps a [batch] matrix and implements matmul/solve. +7896,DummyOperatorWithHint,tensorflow/tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py,305,class, +7897,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_dense_mat_mul_grad_test.py,36,function, +7898,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_grad_test.py,35,function, +7899,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,53,function, +7900,twist_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,63,function,Permute the rows and columns of a 2D or (batched) 3D Tensor. +7901,CSRSparseMatrixOpsBenchmark,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1336,class, +7902,benchmark_sparse_matrix_mat_mul_gpu,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1338,method, +7903,benchmark_sparse_matrix_mat_vec_mul,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1405,method, +7904,benchmark_sparse_matrix_sparse_matmul,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1478,method, +7905,benchmark_sparse_dense_conversion,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1529,method, +7906,benchmark_sparse_cholesky,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py,1582,method, +7907,dense_to_csr_sparse_matrix,tensorflow/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_sparse_mat_mul_grad_test.py,36,function, +7908,composed_sampler,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,40,function, +7909,native_op_vs_composed_ops,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,216,function, +7910,MultinomialBenchmark,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,237,class, +7911,benchmarkNativeOpVsComposedOps,tensorflow/tensorflow/python/kernel_tests/random/multinomial_op_test.py,239,method, +7912,TruncatedNormalMoments,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,51,class, +7913,calculate_moments,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,96,function, +7914,parameterized_vs_naive,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,394,function, +7915,randn_sampler_switchover,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,419,function, +7916,TruncatedNormalBenchmark,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,471,class, +7917,benchmarkParameterizedOpVsNaiveOpCpu,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,473,method, +7918,benchmarkParameterizedOpVsNaiveOpGpu,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,476,method, +7919,benchmarkRandnSamplerCPU,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,498,method, +7920,benchmarkRandnSamplerGPU,tensorflow/tensorflow/python/kernel_tests/random/parameterized_truncated_normal_op_test.py,501,method, +7921,invert_philox,tensorflow/tensorflow/python/kernel_tests/random/stateless_random_ops_test.py,38,function,Invert the Philox bijection. +7922,chi_squared,tensorflow/tensorflow/python/kernel_tests/random/util.py,79,function,Pearson's Chi-squared test. +7923,normal_cdf,tensorflow/tensorflow/python/kernel_tests/random/util.py,88,function,Cumulative distribution function for a standard normal distribution. +7924,anderson_darling,tensorflow/tensorflow/python/kernel_tests/random/util.py,93,function,Anderson-Darling test for a standard normal distribution. +7925,try_import,tensorflow/tensorflow/python/kernel_tests/signal/dct_ops_test.py,33,function, +7926,hertz_to_mel,tensorflow/tensorflow/python/kernel_tests/signal/mel_ops_test.py,40,function,"Convert frequencies to mel scale using HTK formula. Copied from https://github.com/tensorflow/models/blob/master/research/audioset/mel_features.py. @@ -56893,7 +64895,7 @@ Args: Returns: Object of same size as frequencies_hertz containing corresponding values on the mel scale." -8008,spectrogram_to_mel_matrix,tensorflow/tensorflow/python/kernel_tests/signal/mel_ops_test.py,57,function,"Return a matrix that can post-multiply spectrogram rows to make mel. +7927,spectrogram_to_mel_matrix,tensorflow/tensorflow/python/kernel_tests/signal/mel_ops_test.py,57,function,"Return a matrix that can post-multiply spectrogram rows to make mel. Copied from https://github.com/tensorflow/models/blob/master/research/audioset/mel_features.py. @@ -56931,12 +64933,7 @@ Returns: Raises: ValueError: if frequency edges are incorrectly ordered." -8009,LinearToMelTest,tensorflow/tensorflow/python/kernel_tests/signal/mel_ops_test.py,136,class, -8010,MFCCTest,tensorflow/tensorflow/python/kernel_tests/signal/mfcc_ops_test.py,37,class, -8011,ReconstructionOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/reconstruction_ops_test.py,37,class, -8012,FrameTest,tensorflow/tensorflow/python/kernel_tests/signal/shape_ops_test.py,37,class, -8013,SpectralOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/spectral_ops_test.py,39,class, -8014,grappler_optimize,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,29,function,"Tries to optimize the provided graph using grappler. +7928,grappler_optimize,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,29,function,"Tries to optimize the provided graph using grappler. Args: graph: A `tf.Graph` instance containing the graph to optimize. @@ -56948,7 +64945,7 @@ Args: Returns: A `tf.compat.v1.GraphDef` containing the rewritten graph." -8015,tflite_convert,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,53,function,"Converts the provided fn to tf.lite model. +7929,tflite_convert,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,53,function,"Converts the provided fn to tf.lite model. Args: fn: A callable that expects a list of inputs like input_templates that @@ -56959,7 +64956,7 @@ Args: Returns: The serialized tf.lite model." -8016,evaluate_tflite_model,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,72,function,"Evaluates the provided tf.lite model with the given input ndarrays. +7930,evaluate_tflite_model,tensorflow/tensorflow/python/kernel_tests/signal/test_util.py,72,function,"Evaluates the provided tf.lite model with the given input ndarrays. Args: tflite_model: bytes. The serialized tf.lite model. @@ -56971,22 +64968,8 @@ Returns: Raises: ValueError: If the number of input arrays does not match the number of inputs the model expects." -8017,_scipy_raised_cosine,tensorflow/tensorflow/python/kernel_tests/signal/window_ops_test.py,44,function,"A simple implementation of a raised cosine window that matches SciPy. - -https://en.wikipedia.org/wiki/Window_function#Hann_window -https://github.com/scipy/scipy/blob/v0.14.0/scipy/signal/windows.py#L615 - -Args: - length: The window length. - symmetric: Whether to create a symmetric window. - a: The alpha parameter of the raised cosine window. - b: The beta parameter of the raised cosine window. - -Returns: - A raised cosine window of length `length`." -8018,WindowOpsTest,tensorflow/tensorflow/python/kernel_tests/signal/window_ops_test.py,71,class, -8019,convert_data_format,tensorflow/tensorflow/python/layers/utils.py,26,function, -8020,normalize_tuple,tensorflow/tensorflow/python/layers/utils.py,49,function,"Transforms a single integer or iterable of integers into an integer tuple. +7931,convert_data_format,tensorflow/tensorflow/python/layers/utils.py,26,function, +7932,normalize_tuple,tensorflow/tensorflow/python/layers/utils.py,49,function,"Transforms a single integer or iterable of integers into an integer tuple. Arguments: value: The value to validate and convert. Could an int, or any iterable @@ -57001,9 +64984,9 @@ Returns: Raises: ValueError: If something else than an int/long or iterable thereof was passed." -8021,normalize_data_format,tensorflow/tensorflow/python/layers/utils.py,88,function, -8022,normalize_padding,tensorflow/tensorflow/python/layers/utils.py,97,function, -8023,conv_output_length,tensorflow/tensorflow/python/layers/utils.py,105,function,"Determines output length of a convolution given input length. +7933,normalize_data_format,tensorflow/tensorflow/python/layers/utils.py,88,function, +7934,normalize_padding,tensorflow/tensorflow/python/layers/utils.py,97,function, +7935,conv_output_length,tensorflow/tensorflow/python/layers/utils.py,105,function,"Determines output length of a convolution given input length. Arguments: input_length: integer. @@ -57014,7 +64997,7 @@ Arguments: Returns: The output length (integer)." -8024,conv_input_length,tensorflow/tensorflow/python/layers/utils.py,131,function,"Determines input length of a convolution given output length. +7936,conv_input_length,tensorflow/tensorflow/python/layers/utils.py,131,function,"Determines input length of a convolution given output length. Arguments: output_length: integer. @@ -57024,7 +65007,7 @@ Arguments: Returns: The input length (integer)." -8025,deconv_output_length,tensorflow/tensorflow/python/layers/utils.py,155,function,"Determines output length of a transposed convolution given input length. +7937,deconv_output_length,tensorflow/tensorflow/python/layers/utils.py,155,function,"Determines output length of a transposed convolution given input length. Arguments: input_length: integer. @@ -57034,7 +65017,7 @@ Arguments: Returns: The output length (integer)." -8026,smart_cond,tensorflow/tensorflow/python/layers/utils.py,177,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. +7938,smart_cond,tensorflow/tensorflow/python/layers/utils.py,177,function,"Return either `true_fn()` if predicate `pred` is true else `false_fn()`. If `pred` is a bool or has a constant value, we return either `true_fn()` or `false_fn()`, otherwise we use `tf.cond` to dynamically route to both. @@ -57051,7 +65034,7 @@ Returns: Raises: TypeError: If `true_fn` or `false_fn` is not callable." -8027,constant_value,tensorflow/tensorflow/python/layers/utils.py,203,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. +7939,constant_value,tensorflow/tensorflow/python/layers/utils.py,203,function,"Return the bool value for `pred`, or None if `pred` had a dynamic value. Arguments: pred: A scalar, either a Python bool or a TensorFlow boolean variable @@ -57063,12 +65046,8 @@ Returns: Raises: TypeError: If `pred` is not a Variable, Tensor or bool, or Python integer 1 or 0." -8028,ConvUtilsTest,tensorflow/tensorflow/python/layers/utils_test.py,28,class, -8029,ConstantValueTest,tensorflow/tensorflow/python/layers/utils_test.py,94,class, -8030,float_values,tensorflow/tensorflow/python/lib/core/bfloat16_test.py,35,function,Returns values that should round trip exactly to float and back. -8031,Bfloat16Test,tensorflow/tensorflow/python/lib/core/bfloat16_test.py,47,class, -8032,Bfloat16NumPyTest,tensorflow/tensorflow/python/lib/core/bfloat16_test.py,187,class, -8033,FileIO,tensorflow/tensorflow/python/lib/io/file_io.py,37,class,"FileIO class that exposes methods to read / write to / from files. +7940,float_values,tensorflow/tensorflow/python/lib/core/bfloat16_test.py,35,function,Returns values that should round trip exactly to float and back. +7941,FileIO,tensorflow/tensorflow/python/lib/io/file_io.py,37,class,"FileIO class that exposes methods to read / write to / from files. The constructor takes the following arguments: name: [path-like object](https://docs.python.org/3/glossary.html#term-path-like-object) @@ -57079,7 +65058,40 @@ Can be used as an iterator to iterate over lines in the file. The default buffer size used for the BufferedInputStream used for reading the file line by line is 1024 * 512 bytes." -8034,file_exists,tensorflow/tensorflow/python/lib/io/file_io.py,237,function,"Determines whether a path exists or not. +7942,name,tensorflow/tensorflow/python/lib/io/file_io.py,65,method,Returns the file name. +7943,mode,tensorflow/tensorflow/python/lib/io/file_io.py,70,method,Returns the mode in which the file was opened. +7944,size,tensorflow/tensorflow/python/lib/io/file_io.py,96,method,Returns the size of the file. +7945,write,tensorflow/tensorflow/python/lib/io/file_io.py,100,method,Writes file_content to the file. Appends to the end of the file. +7946,read,tensorflow/tensorflow/python/lib/io/file_io.py,105,method,"Returns the contents of a file as a string. + +Starts reading from current position in file. + +Args: + n: Read `n` bytes if `n != -1`. If `n = -1`, reads to end of file. + +Returns: + `n` bytes of the file (or whole file) in bytes mode or `n` bytes of the + string if in string (regular) mode." +7947,seek,tensorflow/tensorflow/python/lib/io/file_io.py,127,method,"Seeks to the offset in the file. + +Args: + offset: The byte count relative to the whence argument. + whence: Valid values for whence are: + 0: start of the file (default) + 1: relative to the current position of the file + 2: relative to the end of file. `offset` is usually negative." +7948,readline,tensorflow/tensorflow/python/lib/io/file_io.py,168,method,"Reads the next line, keeping \n. At EOF, returns ''." +7949,readlines,tensorflow/tensorflow/python/lib/io/file_io.py,173,method,Returns all lines from the file in a list. +7950,tell,tensorflow/tensorflow/python/lib/io/file_io.py,184,method,Returns the current position in the file. +7951,next,tensorflow/tensorflow/python/lib/io/file_io.py,211,method, +7952,flush,tensorflow/tensorflow/python/lib/io/file_io.py,214,method,"Flushes the Writable file. + +This only ensures that the data has made its way out of the process without +any guarantees on whether it's written to disk. This means that the +data would survive an application crash but not necessarily an OS crash." +7953,close,tensorflow/tensorflow/python/lib/io/file_io.py,224,method,Closes FileIO. Should be called for the WritableFile to be flushed. +7954,seekable,tensorflow/tensorflow/python/lib/io/file_io.py,231,method,Returns True as FileIO supports random access ops of seek()/tell() +7955,file_exists,tensorflow/tensorflow/python/lib/io/file_io.py,237,function,"Determines whether a path exists or not. Args: filename: string, a path @@ -57090,7 +65102,7 @@ Returns: Raises: errors.OpError: Propagates any errors reported by the FileSystem API." -8035,file_exists_v2,tensorflow/tensorflow/python/lib/io/file_io.py,254,function,"Determines whether a path exists or not. +7956,file_exists_v2,tensorflow/tensorflow/python/lib/io/file_io.py,254,function,"Determines whether a path exists or not. Args: path: string, a path @@ -57101,7 +65113,7 @@ Returns: Raises: errors.OpError: Propagates any errors reported by the FileSystem API." -8036,delete_file,tensorflow/tensorflow/python/lib/io/file_io.py,275,function,"Deletes the file located at 'filename'. +7957,delete_file,tensorflow/tensorflow/python/lib/io/file_io.py,275,function,"Deletes the file located at 'filename'. Args: filename: string, a filename @@ -57109,7 +65121,7 @@ Args: Raises: errors.OpError: Propagates any errors reported by the FileSystem API. E.g., `NotFoundError` if the file does not exist." -8037,delete_file_v2,tensorflow/tensorflow/python/lib/io/file_io.py,289,function,"Deletes the path located at 'path'. +7958,delete_file_v2,tensorflow/tensorflow/python/lib/io/file_io.py,289,function,"Deletes the path located at 'path'. Args: path: string, a path @@ -57117,7 +65129,7 @@ Args: Raises: errors.OpError: Propagates any errors reported by the FileSystem API. E.g., `NotFoundError` if the path does not exist." -8038,read_file_to_string,tensorflow/tensorflow/python/lib/io/file_io.py,302,function,"Reads the entire contents of a file to a string. +7959,read_file_to_string,tensorflow/tensorflow/python/lib/io/file_io.py,302,function,"Reads the entire contents of a file to a string. Args: filename: string, path to a file @@ -57130,7 +65142,7 @@ Returns: Raises: errors.OpError: Raises variety of errors that are subtypes e.g. `NotFoundError` etc." -8039,write_string_to_file,tensorflow/tensorflow/python/lib/io/file_io.py,324,function,"Writes a string to a given file. +7960,write_string_to_file,tensorflow/tensorflow/python/lib/io/file_io.py,324,function,"Writes a string to a given file. Args: filename: string, path to a file @@ -57138,7 +65150,7 @@ Args: Raises: errors.OpError: If there are errors during the operation." -8040,get_matching_files,tensorflow/tensorflow/python/lib/io/file_io.py,339,function,"Returns a list of files that match the given pattern(s). +7961,get_matching_files,tensorflow/tensorflow/python/lib/io/file_io.py,339,function,"Returns a list of files that match the given pattern(s). Args: filename: string or iterable of strings. The glob pattern(s). @@ -57148,7 +65160,7 @@ Returns: Raises: * errors.OpError: If there are filesystem / directory listing errors." -8041,get_matching_files_v2,tensorflow/tensorflow/python/lib/io/file_io.py,355,function,"Returns a list of files that match the given pattern(s). +7962,get_matching_files_v2,tensorflow/tensorflow/python/lib/io/file_io.py,355,function,"Returns a list of files that match the given pattern(s). The patterns are defined as strings. Supported patterns are defined here. Note that the pattern can be a Python iteratable of string patterns. @@ -57196,7 +65208,7 @@ Returns: Raises: errors.OpError: If there are filesystem / directory listing errors." -8042,create_dir,tensorflow/tensorflow/python/lib/io/file_io.py,423,function,"Creates a directory with the name `dirname`. +7963,create_dir,tensorflow/tensorflow/python/lib/io/file_io.py,423,function,"Creates a directory with the name `dirname`. Args: dirname: string, name of the directory to be created @@ -57206,7 +65218,7 @@ Notes: The parent directories need to exist. Use `tf.io.gfile.makedirs` Raises: errors.OpError: If the operation fails." -8043,create_dir_v2,tensorflow/tensorflow/python/lib/io/file_io.py,439,function,"Creates a directory with the name given by `path`. +7964,create_dir_v2,tensorflow/tensorflow/python/lib/io/file_io.py,439,function,"Creates a directory with the name given by `path`. Args: path: string, name of the directory to be created @@ -57216,7 +65228,7 @@ Notes: The parent directories need to exist. Use `tf.io.gfile.makedirs` Raises: errors.OpError: If the operation fails." -8044,recursive_create_dir,tensorflow/tensorflow/python/lib/io/file_io.py,455,function,"Creates a directory and all parent/intermediate directories. +7965,recursive_create_dir,tensorflow/tensorflow/python/lib/io/file_io.py,455,function,"Creates a directory and all parent/intermediate directories. It succeeds if dirname already exists and is writable. @@ -57225,7 +65237,7 @@ Args: Raises: errors.OpError: If the operation fails." -8045,recursive_create_dir_v2,tensorflow/tensorflow/python/lib/io/file_io.py,470,function,"Creates a directory and all parent/intermediate directories. +7966,recursive_create_dir_v2,tensorflow/tensorflow/python/lib/io/file_io.py,470,function,"Creates a directory and all parent/intermediate directories. It succeeds if path already exists and is writable. @@ -57234,7 +65246,7 @@ Args: Raises: errors.OpError: If the operation fails." -8046,copy,tensorflow/tensorflow/python/lib/io/file_io.py,485,function,"Copies data from `oldpath` to `newpath`. +7967,copy,tensorflow/tensorflow/python/lib/io/file_io.py,485,function,"Copies data from `oldpath` to `newpath`. Args: oldpath: string, name of the file who's contents need to be copied @@ -57244,7 +65256,7 @@ Args: Raises: errors.OpError: If the operation fails." -8047,copy_v2,tensorflow/tensorflow/python/lib/io/file_io.py,501,function,"Copies data from `src` to `dst`. +7968,copy_v2,tensorflow/tensorflow/python/lib/io/file_io.py,501,function,"Copies data from `src` to `dst`. Args: src: string, name of the file whose contents need to be copied @@ -57254,7 +65266,7 @@ Args: Raises: errors.OpError: If the operation fails." -8048,rename,tensorflow/tensorflow/python/lib/io/file_io.py,518,function,"Rename or move a file / directory. +7969,rename,tensorflow/tensorflow/python/lib/io/file_io.py,518,function,"Rename or move a file / directory. Args: oldname: string, pathname for a file @@ -57264,7 +65276,7 @@ Args: Raises: errors.OpError: If the operation fails." -8049,rename_v2,tensorflow/tensorflow/python/lib/io/file_io.py,534,function,"Rename or move a file / directory. +7970,rename_v2,tensorflow/tensorflow/python/lib/io/file_io.py,534,function,"Rename or move a file / directory. Args: src: string, pathname for a file @@ -57274,7 +65286,7 @@ Args: Raises: errors.OpError: If the operation fails." -8050,atomic_write_string_to_file,tensorflow/tensorflow/python/lib/io/file_io.py,550,function,"Writes to `filename` atomically. +7971,atomic_write_string_to_file,tensorflow/tensorflow/python/lib/io/file_io.py,550,function,"Writes to `filename` atomically. This means that when `filename` appears in the filesystem, it will contain all of `contents`. With write_string_to_file, it is possible for the file @@ -57287,35 +65299,35 @@ Args: contents: string, contents that need to be written to the file overwrite: boolean, if false it's an error for `filename` to be occupied by an existing file." -8051,delete_recursively,tensorflow/tensorflow/python/lib/io/file_io.py,578,function,"Deletes everything under dirname recursively. +7972,delete_recursively,tensorflow/tensorflow/python/lib/io/file_io.py,578,function,"Deletes everything under dirname recursively. Args: dirname: string, a path to a directory Raises: errors.OpError: If the operation fails." -8052,delete_recursively_v2,tensorflow/tensorflow/python/lib/io/file_io.py,591,function,"Deletes everything under path recursively. +7973,delete_recursively_v2,tensorflow/tensorflow/python/lib/io/file_io.py,591,function,"Deletes everything under path recursively. Args: path: string, a path Raises: errors.OpError: If the operation fails." -8053,is_directory,tensorflow/tensorflow/python/lib/io/file_io.py,604,function,"Returns whether the path is a directory or not. +7974,is_directory,tensorflow/tensorflow/python/lib/io/file_io.py,604,function,"Returns whether the path is a directory or not. Args: dirname: string, path to a potential directory Returns: True, if the path is a directory; False otherwise" -8054,is_directory_v2,tensorflow/tensorflow/python/lib/io/file_io.py,617,function,"Returns whether the path is a directory or not. +7975,is_directory_v2,tensorflow/tensorflow/python/lib/io/file_io.py,617,function,"Returns whether the path is a directory or not. Args: path: string, path to a potential directory Returns: True, if the path is a directory; False otherwise" -8055,has_atomic_move,tensorflow/tensorflow/python/lib/io/file_io.py,632,function,"Checks whether the file system supports atomic moves. +7976,has_atomic_move,tensorflow/tensorflow/python/lib/io/file_io.py,632,function,"Checks whether the file system supports atomic moves. Returns whether or not the file system of the given path supports the atomic move operation for a file or folder. If atomic move is supported, it is @@ -57330,7 +65342,7 @@ Returns: False, if the file system does not support atomic move. In such cases we need to be careful about using moves. In some cases it is safer not to use temporary locations in this case." -8056,list_directory,tensorflow/tensorflow/python/lib/io/file_io.py,657,function,"Returns a list of entries contained within a directory. +7977,list_directory,tensorflow/tensorflow/python/lib/io/file_io.py,657,function,"Returns a list of entries contained within a directory. The list is in arbitrary order. It does not contain the special entries ""."" and "".."". @@ -57343,7 +65355,7 @@ Returns: Raises: errors.NotFoundError if directory doesn't exist" -8057,list_directory_v2,tensorflow/tensorflow/python/lib/io/file_io.py,676,function,"Returns a list of entries contained within a directory. +7978,list_directory_v2,tensorflow/tensorflow/python/lib/io/file_io.py,676,function,"Returns a list of entries contained within a directory. The list is in arbitrary order. It does not contain the special entries ""."" and "".."". @@ -57356,7 +65368,7 @@ Returns: Raises: errors.NotFoundError if directory doesn't exist" -8058,walk,tensorflow/tensorflow/python/lib/io/file_io.py,706,function,"Recursive directory tree generator for directories. +7979,walk,tensorflow/tensorflow/python/lib/io/file_io.py,706,function,"Recursive directory tree generator for directories. Args: top: string, a Directory name @@ -57368,7 +65380,7 @@ Yields: all its subdirectories and leaf files. That is, each yield looks like: `(dirname, [subdirname, subdirname, ...], [filename, filename, ...])`. Each item is a string." -8059,walk_v2,tensorflow/tensorflow/python/lib/io/file_io.py,724,function,"Recursive directory tree generator for directories. +7980,walk_v2,tensorflow/tensorflow/python/lib/io/file_io.py,724,function,"Recursive directory tree generator for directories. Args: top: string, a Directory name @@ -57382,7 +65394,7 @@ Yields: all its subdirectories and leaf files. That is, each yield looks like: `(dirname, [subdirname, subdirname, ...], [filename, filename, ...])`. Each item is a string." -8060,stat,tensorflow/tensorflow/python/lib/io/file_io.py,782,function,"Returns file statistics for a given path. +7981,stat,tensorflow/tensorflow/python/lib/io/file_io.py,782,function,"Returns file statistics for a given path. Args: filename: string, path to a file @@ -57392,7 +65404,7 @@ Returns: Raises: errors.OpError: If the operation fails." -8061,stat_v2,tensorflow/tensorflow/python/lib/io/file_io.py,798,function,"Returns file statistics for a given path. +7982,stat_v2,tensorflow/tensorflow/python/lib/io/file_io.py,798,function,"Returns file statistics for a given path. Args: path: string, path to a file @@ -57402,7 +65414,7 @@ Returns: Raises: errors.OpError: If the operation fails." -8062,filecmp,tensorflow/tensorflow/python/lib/io/file_io.py,813,function,"Compare two files, returning True if they are the same, False otherwise. +7983,filecmp,tensorflow/tensorflow/python/lib/io/file_io.py,813,function,"Compare two files, returning True if they are the same, False otherwise. We check size first and return False quickly if the files are different sizes. If they are the same size, we continue to generating a crc for the whole file. @@ -57418,7 +65430,7 @@ Args: Returns: True if the files are the same, False otherwise." -8063,file_crc32,tensorflow/tensorflow/python/lib/io/file_io.py,842,function,"Get the crc32 of the passed file. +7984,file_crc32,tensorflow/tensorflow/python/lib/io/file_io.py,842,function,"Get the crc32 of the passed file. The crc32 of a file can be used for error checking; two files with the same crc32 are considered equivalent. Note that the entire file must be read @@ -57431,11 +65443,20 @@ Args: Returns: hexadecimal as string, the crc32 of the passed file." -8064,PathLike,tensorflow/tensorflow/python/lib/io/file_io_test.py,33,class,Backport of pathlib.Path for Python < 3.6 -8065,FileIoTest,tensorflow/tensorflow/python/lib/io/file_io_test.py,51,class, -8066,TFRecordCompressionType,tensorflow/tensorflow/python/lib/io/tf_record.py,32,class,The type of compression for the record. -8067,TFRecordOptions,tensorflow/tensorflow/python/lib/io/tf_record.py,43,class,Options used for manipulating TFRecord files. -8068,tf_record_iterator,tensorflow/tensorflow/python/lib/io/tf_record.py,157,function,"An iterator that read the records from a TFRecords file. +7985,PathLike,tensorflow/tensorflow/python/lib/io/file_io_test.py,33,class,Backport of pathlib.Path for Python < 3.6 +7986,TFRecordCompressionType,tensorflow/tensorflow/python/lib/io/tf_record.py,32,class,The type of compression for the record. +7987,TFRecordOptions,tensorflow/tensorflow/python/lib/io/tf_record.py,43,class,Options used for manipulating TFRecord files. +7988,get_compression_type_string,tensorflow/tensorflow/python/lib/io/tf_record.py,102,method,"Convert various option types to a unified string. + +Args: + options: `TFRecordOption`, `TFRecordCompressionType`, or string. + +Returns: + Compression type as string (e.g. `'ZLIB'`, `'GZIP'`, or `''`). + +Raises: + ValueError: If compression_type is invalid." +7989,tf_record_iterator,tensorflow/tensorflow/python/lib/io/tf_record.py,157,function,"An iterator that read the records from a TFRecords file. Args: path: The path to the TFRecords file. @@ -57446,7 +65467,7 @@ Returns: Raises: IOError: If `path` cannot be opened for reading." -8069,tf_record_random_reader,tensorflow/tensorflow/python/lib/io/tf_record.py,174,function,"Creates a reader that allows random-access reads from a TFRecords file. +7990,tf_record_random_reader,tensorflow/tensorflow/python/lib/io/tf_record.py,174,function,"Creates a reader that allows random-access reads from a TFRecords file. The created reader object has the following method: @@ -57482,7 +65503,7 @@ Returns: Raises: IOError: If `path` cannot be opened for reading." -8070,TFRecordWriter,tensorflow/tensorflow/python/lib/io/tf_record.py,218,class,"A class to write records to a TFRecords file. +7991,TFRecordWriter,tensorflow/tensorflow/python/lib/io/tf_record.py,218,class,"A class to write records to a TFRecords file. [TFRecords tutorial](https://www.tensorflow.org/tutorials/load_data/tfrecord) @@ -57542,15 +65563,13 @@ x = 0.4376, y = 0.8918 This class implements `__enter__` and `__exit__`, and can be used in `with` blocks like a normal file. (See the usage example above.)" -8071,TFCompressionTestCase,tensorflow/tensorflow/python/lib/io/tf_record_test.py,67,class,TFCompression Test -8072,TFRecordWriterTest,tensorflow/tensorflow/python/lib/io/tf_record_test.py,131,class,TFRecordWriter Test -8073,TFRecordWriterZlibTest,tensorflow/tensorflow/python/lib/io/tf_record_test.py,294,class,TFRecordWriter Zlib test -8074,TFRecordIteratorTest,tensorflow/tensorflow/python/lib/io/tf_record_test.py,360,class,TFRecordIterator test -8075,TFRecordRandomReaderTest,tensorflow/tensorflow/python/lib/io/tf_record_test.py,478,class, -8076,TFRecordWriterCloseAndFlushTests,tensorflow/tensorflow/python/lib/io/tf_record_test.py,518,class,TFRecordWriter close and flush tests -8077,TFRecordWriterCloseAndFlushGzipTests,tensorflow/tensorflow/python/lib/io/tf_record_test.py,577,class, -8078,TFRecordWriterCloseAndFlushZlibTests,tensorflow/tensorflow/python/lib/io/tf_record_test.py,584,class, -8079,Module,tensorflow/tensorflow/python/module/module.py,35,class,"Base neural network module class. +7992,write,tensorflow/tensorflow/python/lib/io/tf_record.py,307,method,"Write a string record to the file. + +Args: + record: str" +7993,flush,tensorflow/tensorflow/python/lib/io/tf_record.py,315,method,Flush the file. +7994,close,tensorflow/tensorflow/python/lib/io/tf_record.py,319,method,Close the file. +7995,Module,tensorflow/tensorflow/python/module/module.py,35,class,"Base neural network module class. A module is a named container for `tf.Variable`s, other `tf.Module`s and functions which apply to user input. For example a dense layer in a neural @@ -57616,119 +65635,109 @@ with `@tf.Module.with_name_scope`. , )" -8080,_is_variable,tensorflow/tensorflow/python/module/module.py,300,function, -8081,_is_trainable_variable,tensorflow/tensorflow/python/module/module.py,304,function, -8082,_is_module,tensorflow/tensorflow/python/module/module.py,308,function, -8083,valid_identifier,tensorflow/tensorflow/python/module/module.py,315,function, -8084,camel_to_snake,tensorflow/tensorflow/python/module/module.py,319,function, -8085,_flatten_module,tensorflow/tensorflow/python/module/module.py,323,function,Implementation of `flatten`. -8086,TestModuleNaming,tensorflow/tensorflow/python/module/module_test.py,41,class, -8087,VariableNamingTest,tensorflow/tensorflow/python/module/module_test.py,195,class, -8088,NameScopeTest,tensorflow/tensorflow/python/module/module_test.py,204,class, -8089,VariableTrackingTest,tensorflow/tensorflow/python/module/module_test.py,227,class, -8090,ModuleTrackingTest,tensorflow/tensorflow/python/module/module_test.py,264,class, -8091,ForwardMethodsTest,tensorflow/tensorflow/python/module/module_test.py,280,class, -8092,AbcTest,tensorflow/tensorflow/python/module/module_test.py,302,class, -8093,get_name_scope,tensorflow/tensorflow/python/module/module_test.py,317,function, -8094,ErrorModuleError,tensorflow/tensorflow/python/module/module_test.py,323,class, -8095,ErrorModule,tensorflow/tensorflow/python/module/module_test.py,327,class, -8096,RecursiveModule,tensorflow/tensorflow/python/module/module_test.py,339,class, -8097,AbstractModule,tensorflow/tensorflow/python/module/module_test.py,351,class, -8098,ConcreteModule,tensorflow/tensorflow/python/module/module_test.py,358,class, -8099,TreeModule,tensorflow/tensorflow/python/module/module_test.py,365,class, -8100,ReturnsNameScopeModule,tensorflow/tensorflow/python/module/module_test.py,378,class, -8101,SubclassedReturnsNameScopeModule,tensorflow/tensorflow/python/module/module_test.py,389,class, -8102,PropertyThrowsWhenCalledModule,tensorflow/tensorflow/python/module/module_test.py,396,class, -8103,ModuleOverridingNameScope,tensorflow/tensorflow/python/module/module_test.py,403,class, -8104,ModuleWithFunctionAnnotatedCall,tensorflow/tensorflow/python/module/module_test.py,410,class, -8105,PropertyModule,tensorflow/tensorflow/python/module/module_test.py,423,class, -8106,FlattenTest,tensorflow/tensorflow/python/module/module_test.py,453,class, -8107,LayerModule,tensorflow/tensorflow/python/module/module_test.py,523,class, -8108,MemberType,tensorflow/tensorflow/python/module/module_test.py,549,class,A simple type to search for. -8109,SimpleModule,tensorflow/tensorflow/python/module/module_test.py,554,class, -8110,AccumulateNBenchmark,tensorflow/tensorflow/python/ops/accumulate_n_benchmark.py,39,class, -8111,_PackGrad,tensorflow/tensorflow/python/ops/array_grad.py,42,function,Gradient for pack op. -8112,_UnpackGrad,tensorflow/tensorflow/python/ops/array_grad.py,48,function,Gradient for unpack op. -8113,_ConcatGradHelper,tensorflow/tensorflow/python/ops/array_grad.py,53,function,"Gradient for concat op. +7996,name,tensorflow/tensorflow/python/module/module.py,130,method,"Returns the name of this module as passed or determined in the ctor. -Args: - op: An operation. - grad: `Tensor` or `IndexedSlices` representing the gradients with respect to - each output of the op. - start_value_index: An integer index of the first value in the op.inputs. - end_value_index: An integer index of the last value in the op.inputs. - dim_index: An integer index of concat_dim or axis parameter in op.inputs. +NOTE: This is not the same as the `self.name_scope.name` which includes +parent module names." +7997,name_scope,tensorflow/tensorflow/python/module/module.py,139,method,Returns a `tf.name_scope` instance for this class. +7998,variables,tensorflow/tensorflow/python/module/module.py,148,method,"Sequence of variables owned by this module and its submodules. + +Note: this method uses reflection to find variables on the current instance +and submodules. For performance reasons you may wish to cache the result +of calling this method if you don't expect the return value to change. Returns: - Tensors representing the partial gradients with respect to each input - of the op. + A sequence of variables for the current module (sorted by attribute + name) followed by variables from all submodules recursively (breadth + first)." +7999,trainable_variables,tensorflow/tensorflow/python/module/module.py,163,method,"Sequence of trainable variables owned by this module and its submodules. -Raises: - ValueError: if concat_dim/axis is not statically known." -8114,_ConcatGrad,tensorflow/tensorflow/python/ops/array_grad.py,217,function, -8115,_ConcatGradV2,tensorflow/tensorflow/python/ops/array_grad.py,227,function, -8116,_SliceGrad,tensorflow/tensorflow/python/ops/array_grad.py,236,function,Gradient for Slice op. -8117,_StridedSliceGrad,tensorflow/tensorflow/python/ops/array_grad.py,264,function,Gradient for StridedSlice op. -8118,_StridedSliceGradGrad,tensorflow/tensorflow/python/ops/array_grad.py,299,function,Gradient for StridedSliceGrad op. -8119,_SplitGrad,tensorflow/tensorflow/python/ops/array_grad.py,318,function, -8120,_SplitVGrad,tensorflow/tensorflow/python/ops/array_grad.py,323,function, -8121,_DiagGrad,tensorflow/tensorflow/python/ops/array_grad.py,336,function, -8122,_DiagPartGrad,tensorflow/tensorflow/python/ops/array_grad.py,341,function, -8123,_MatrixDiagGrad,tensorflow/tensorflow/python/ops/array_grad.py,346,function, -8124,_MatrixDiagV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,351,function, -8125,_MatrixDiagV3Grad,tensorflow/tensorflow/python/ops/array_grad.py,357,function, -8126,_MatrixDiagPartGrad,tensorflow/tensorflow/python/ops/array_grad.py,363,function, -8127,_MatrixDiagPartV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,372,function,Gradient for MatrixDiagPartV2. -8128,_MatrixDiagPartV3Grad,tensorflow/tensorflow/python/ops/array_grad.py,387,function,Gradient for MatrixDiagPartV3. -8129,_MatrixSetDiagGrad,tensorflow/tensorflow/python/ops/array_grad.py,405,function,Gradient for MatrixSetDiag. -8130,_MatrixSetDiagGradV2,tensorflow/tensorflow/python/ops/array_grad.py,428,function,Gradient for MatrixSetDiagV2. -8131,_MatrixSetDiagGradV3,tensorflow/tensorflow/python/ops/array_grad.py,464,function,Gradient for MatrixSetDiagV3. -8132,_MatrixBandPartGrad,tensorflow/tensorflow/python/ops/array_grad.py,504,function, -8133,_FillGrad,tensorflow/tensorflow/python/ops/array_grad.py,515,function, -8134,_PreventGradientGrad,tensorflow/tensorflow/python/ops/array_grad.py,524,function, -8135,_IndexedSlicesToTensorNoWarning,tensorflow/tensorflow/python/ops/array_grad.py,529,function,Converts an IndexedSlices to a Tensor without sparse->dense warnings. -8136,_GatherGrad,tensorflow/tensorflow/python/ops/array_grad.py,544,function,Gradient for Gather op. -8137,_GetBatchIndices,tensorflow/tensorflow/python/ops/array_grad.py,567,function,Addds the batch offsets to the given indices and returns the results. -8138,_BatchGatherGrad,tensorflow/tensorflow/python/ops/array_grad.py,588,function,Returns the gradient of GatherV2 with batch dimensions. -8139,_GatherV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,619,function,Gradient for GatherV2 op. -8140,_GatherNdGrad,tensorflow/tensorflow/python/ops/array_grad.py,692,function, -8141,_ResourceGatherNdGrad,tensorflow/tensorflow/python/ops/array_grad.py,705,function, -8142,_CheckNumericsGrad,tensorflow/tensorflow/python/ops/array_grad.py,718,function,Gradient for check_numerics op. -8143,_CheckNumericsV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,727,function,Gradient for check_numerics op. -8144,_IdGrad,tensorflow/tensorflow/python/ops/array_grad.py,737,function, -8145,_RefIdGrad,tensorflow/tensorflow/python/ops/array_grad.py,742,function, -8146,_IdNGrad,tensorflow/tensorflow/python/ops/array_grad.py,747,function, -8147,_ReshapeGrad,tensorflow/tensorflow/python/ops/array_grad.py,755,function, -8148,_ReshapeToInput,tensorflow/tensorflow/python/ops/array_grad.py,766,function,Reshapes the gradient to the shape of the original input. -8149,_ExpandDimsGrad,tensorflow/tensorflow/python/ops/array_grad.py,773,function, -8150,_SqueezeGrad,tensorflow/tensorflow/python/ops/array_grad.py,778,function, -8151,_TransposeGrad,tensorflow/tensorflow/python/ops/array_grad.py,783,function,Returns unshuffle(grad). -8152,_ConjugateTransposeGrad,tensorflow/tensorflow/python/ops/array_grad.py,790,function,Returns conj(unshuffle(grad)). -8153,_TileGrad,tensorflow/tensorflow/python/ops/array_grad.py,809,function,Sum reduces grad along the tiled dimensions. -8154,_PadGrad,tensorflow/tensorflow/python/ops/array_grad.py,839,function,Gradient for Pad. -8155,_ReverseSequenceGrad,tensorflow/tensorflow/python/ops/array_grad.py,864,function, -8156,_ReverseGrad,tensorflow/tensorflow/python/ops/array_grad.py,876,function, -8157,_ReverseV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,882,function, -8158,_SpaceToBatchGrad,tensorflow/tensorflow/python/ops/array_grad.py,888,function, -8159,_SpaceToBatchNDGrad,tensorflow/tensorflow/python/ops/array_grad.py,897,function, -8160,_BatchToSpaceGrad,tensorflow/tensorflow/python/ops/array_grad.py,905,function, -8161,_BatchToSpaceNDGrad,tensorflow/tensorflow/python/ops/array_grad.py,914,function, -8162,_SpaceToDepthGrad,tensorflow/tensorflow/python/ops/array_grad.py,922,function, -8163,_DepthToSpaceGrad,tensorflow/tensorflow/python/ops/array_grad.py,933,function, -8164,_MirrorPadGrad,tensorflow/tensorflow/python/ops/array_grad.py,947,function, -8165,_MirrorPadGradGrad,tensorflow/tensorflow/python/ops/array_grad.py,953,function, -8166,_QuantizeAndDequantizeGrad,tensorflow/tensorflow/python/ops/array_grad.py,959,function, -8167,_QuantizeAndDequantizeV2Grad,tensorflow/tensorflow/python/ops/array_grad.py,964,function, -8168,_QuantizeAndDequantizeV3Grad,tensorflow/tensorflow/python/ops/array_grad.py,969,function, -8169,_ExtractImagePatchesGrad,tensorflow/tensorflow/python/ops/array_grad.py,975,function, -8170,_ExtractVolumePatchesGrad,tensorflow/tensorflow/python/ops/array_grad.py,1032,function, -8171,_ScatterNdGrad,tensorflow/tensorflow/python/ops/array_grad.py,1095,function, -8172,_TensorScatterUpdateGrad,tensorflow/tensorflow/python/ops/array_grad.py,1102,function, -8173,_TensorScatterAddGrad,tensorflow/tensorflow/python/ops/array_grad.py,1112,function, -8174,_TensorScatterSubGrad,tensorflow/tensorflow/python/ops/array_grad.py,1120,function, -8175,_ScatterNdNonAliasingAddGrad,tensorflow/tensorflow/python/ops/array_grad.py,1128,function, -8176,_BroadcastToGrad,tensorflow/tensorflow/python/ops/array_grad.py,1135,function, -8177,reshape,tensorflow/tensorflow/python/ops/array_ops.py,61,function,"Reshapes a tensor. +Note: this method uses reflection to find variables on the current instance +and submodules. For performance reasons you may wish to cache the result +of calling this method if you don't expect the return value to change. + +Returns: + A sequence of variables for the current module (sorted by attribute + name) followed by variables from all submodules recursively (breadth + first)." +8000,submodules,tensorflow/tensorflow/python/module/module.py,178,method,"Sequence of all sub-modules. + +Submodules are modules which are properties of this module, or found as +properties of modules which are properties of this module (and so on). + +>>> a = tf.Module() +>>> b = tf.Module() +>>> c = tf.Module() +>>> a.b = b +>>> b.c = c +>>> list(a.submodules) == [b, c] +True +>>> list(b.submodules) == [c] +True +>>> list(c.submodules) == [] +True + +Returns: + A sequence of all submodules." +8001,with_name_scope,tensorflow/tensorflow/python/module/module.py,267,method,"Decorator to automatically enter the module name scope. + +>>> class MyModule(tf.Module): +... @tf.Module.with_name_scope +... def __call__(self, x): +... if not hasattr(self, 'w'): +... self.w = tf.Variable(tf.random.normal([x.shape[1], 3])) +... return tf.matmul(x, self.w) + +Using the above module would produce `tf.Variable`s and `tf.Tensor`s whose +names included the module name: + +>>> mod = MyModule() +>>> mod(tf.ones([1, 2])) + +>>> mod.w + + +Args: + method: The method to wrap. + +Returns: + The original method wrapped such that it enters the module's name scope." +8002,method_with_name_scope,tensorflow/tensorflow/python/module/module.py,293,method, +8003,valid_identifier,tensorflow/tensorflow/python/module/module.py,315,function, +8004,camel_to_snake,tensorflow/tensorflow/python/module/module.py,319,function, +8005,get_name_scope,tensorflow/tensorflow/python/module/module_test.py,317,function, +8006,ErrorModuleError,tensorflow/tensorflow/python/module/module_test.py,323,class, +8007,ErrorModule,tensorflow/tensorflow/python/module/module_test.py,327,class, +8008,RecursiveModule,tensorflow/tensorflow/python/module/module_test.py,339,class, +8009,AbstractModule,tensorflow/tensorflow/python/module/module_test.py,351,class, +8010,ConcreteModule,tensorflow/tensorflow/python/module/module_test.py,358,class, +8011,TreeModule,tensorflow/tensorflow/python/module/module_test.py,365,class, +8012,new_leaf,tensorflow/tensorflow/python/module/module_test.py,372,method, +8013,ReturnsNameScopeModule,tensorflow/tensorflow/python/module/module_test.py,378,class, +8014,alternative_forward,tensorflow/tensorflow/python/module/module_test.py,381,method, +8015,SubclassedReturnsNameScopeModule,tensorflow/tensorflow/python/module/module_test.py,389,class, +8016,alternative_alternative_forward,tensorflow/tensorflow/python/module/module_test.py,392,method, +8017,PropertyThrowsWhenCalledModule,tensorflow/tensorflow/python/module/module_test.py,396,class, +8018,raise_assertion_error,tensorflow/tensorflow/python/module/module_test.py,399,method, +8019,ModuleOverridingNameScope,tensorflow/tensorflow/python/module/module_test.py,403,class, +8020,name_scope,tensorflow/tensorflow/python/module/module_test.py,406,method, +8021,ModuleWithFunctionAnnotatedCall,tensorflow/tensorflow/python/module/module_test.py,410,class, +8022,forward,tensorflow/tensorflow/python/module/module_test.py,414,method, +8023,forward_ag,tensorflow/tensorflow/python/module/module_test.py,419,method, +8024,PropertyModule,tensorflow/tensorflow/python/module/module_test.py,423,class, +8025,some_property,tensorflow/tensorflow/python/module/module_test.py,431,method, +8026,some_property,tensorflow/tensorflow/python/module/module_test.py,437,method, +8027,no_name_scope_property,tensorflow/tensorflow/python/module/module_test.py,441,method, +8028,no_name_scope_property,tensorflow/tensorflow/python/module/module_test.py,446,method, +8029,LayerModule,tensorflow/tensorflow/python/module/module_test.py,523,class, +8030,variables,tensorflow/tensorflow/python/module/module_test.py,538,method, +8031,key_function,tensorflow/tensorflow/python/module/module_test.py,539,method, +8032,MemberType,tensorflow/tensorflow/python/module/module_test.py,549,class,A simple type to search for. +8033,SimpleModule,tensorflow/tensorflow/python/module/module_test.py,554,class, +8034,AccumulateNBenchmark,tensorflow/tensorflow/python/ops/accumulate_n_benchmark.py,39,class, +8035,benchmarkAccumulateN,tensorflow/tensorflow/python/ops/accumulate_n_benchmark.py,130,method, +8036,reshape,tensorflow/tensorflow/python/ops/array_ops.py,61,function,"Reshapes a tensor. Given `tensor`, this operation returns a new `tf.Tensor` that has the same values as `tensor` in the same order, except with a new shape given by @@ -57860,7 +65869,7 @@ Args: Returns: A `Tensor`. Has the same type as `tensor`." -8178,fill,tensorflow/tensorflow/python/ops/array_ops.py,202,function,"Creates a tensor filled with a scalar value. +8037,fill,tensorflow/tensorflow/python/ops/array_ops.py,202,function,"Creates a tensor filled with a scalar value. See also `tf.ones`, `tf.zeros`, `tf.one_hot`, `tf.eye`. @@ -57895,7 +65904,7 @@ Similar to `np.full`. In `numpy`, more parameters are supported. Passing a number argument as the shape (`np.full(5, value)`) is valid in `numpy` for specifying a 1-D shaped result, while TensorFlow does not support this syntax. @end_compatibility" -8179,identity,tensorflow/tensorflow/python/ops/array_ops.py,246,function,"Return a Tensor with the same shape and contents as input. +8038,identity,tensorflow/tensorflow/python/ops/array_ops.py,246,function,"Return a Tensor with the same shape and contents as input. The return value is not the same Tensor as the original, but contains the same values. This operation is fast when used on the same device. @@ -57928,7 +65937,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -8180,expand_dims,tensorflow/tensorflow/python/ops/array_ops.py,298,function,"Returns a tensor with a length 1 axis inserted at index `axis`. +8039,expand_dims,tensorflow/tensorflow/python/ops/array_ops.py,298,function,"Returns a tensor with a length 1 axis inserted at index `axis`. Given a tensor `input`, this operation inserts a dimension of length 1 at the dimension index `axis` of `input`'s shape. The dimension index follows Python @@ -57990,7 +65999,7 @@ Returns: Raises: ValueError: if either both or neither of `dim` and `axis` are specified." -8181,expand_dims_v2,tensorflow/tensorflow/python/ops/array_ops.py,370,function,"Returns a tensor with a length 1 axis inserted at index `axis`. +8040,expand_dims_v2,tensorflow/tensorflow/python/ops/array_ops.py,370,function,"Returns a tensor with a length 1 axis inserted at index `axis`. Given a tensor `input`, this operation inserts a dimension of length 1 at the dimension index `axis` of `input`'s shape. The dimension index follows Python @@ -58053,8 +66062,8 @@ Returns: Raises: ValueError: If `axis` is not specified. InvalidArgumentError: If `axis` is out of range `[-(D+1), D]`." -8182,listdiff,tensorflow/tensorflow/python/ops/array_ops.py,446,function, -8183,setdiff1d,tensorflow/tensorflow/python/ops/array_ops.py,461,function,"Computes the difference between two lists of numbers or strings. +8041,listdiff,tensorflow/tensorflow/python/ops/array_ops.py,446,function, +8042,setdiff1d,tensorflow/tensorflow/python/ops/array_ops.py,461,function,"Computes the difference between two lists of numbers or strings. Given a list x and a list y, this operation returns a list out that represents all values that are in x but not in y. The returned list @@ -58088,7 +66097,7 @@ Returns: A tuple of Tensor objects (out, idx). out: A Tensor. Has the same type as x. idx: A Tensor of type out_idx." -8184,broadcast_dynamic_shape,tensorflow/tensorflow/python/ops/array_ops.py,505,function,"Computes the shape of a broadcast given symbolic shapes. +8043,broadcast_dynamic_shape,tensorflow/tensorflow/python/ops/array_ops.py,505,function,"Computes the shape of a broadcast given symbolic shapes. When `shape_x` and `shape_y` are Tensors representing shapes (i.e. the result of calling tf.shape on another Tensor) this computes a Tensor which is the @@ -58115,7 +66124,7 @@ Returns: Raises: InvalidArgumentError: If the two shapes are incompatible for broadcasting." -8185,broadcast_static_shape,tensorflow/tensorflow/python/ops/array_ops.py,539,function,"Computes the shape of a broadcast given known shapes. +8044,broadcast_static_shape,tensorflow/tensorflow/python/ops/array_ops.py,539,function,"Computes the shape of a broadcast given known shapes. When `shape_x` and `shape_y` are fully known `TensorShape`s this computes a `TensorShape` which is the shape of the result of a broadcasting op applied in @@ -58144,7 +66153,7 @@ Returns: Raises: ValueError: If the two shapes can not be broadcasted." -8186,shape_v2,tensorflow/tensorflow/python/ops/array_ops.py,575,function,"Returns the shape of a tensor. +8045,shape_v2,tensorflow/tensorflow/python/ops/array_ops.py,575,function,"Returns the shape of a tensor. See also `tf.size`, `tf.rank`. @@ -58183,7 +66192,7 @@ Args: Returns: A `Tensor` of type `out_type`." -8187,shape,tensorflow/tensorflow/python/ops/array_ops.py,622,function,"Returns the shape of a tensor. +8046,shape,tensorflow/tensorflow/python/ops/array_ops.py,622,function,"Returns the shape of a tensor. This operation returns a 1-D integer tensor representing the shape of `input`. @@ -58202,7 +66211,7 @@ Args: Returns: A `Tensor` of type `out_type`." -8188,shape_internal,tensorflow/tensorflow/python/ops/array_ops.py,647,function,"Returns the shape of a tensor. +8047,shape_internal,tensorflow/tensorflow/python/ops/array_ops.py,647,function,"Returns the shape of a tensor. Args: input: A `Tensor` or `SparseTensor`. @@ -58213,7 +66222,7 @@ Args: Returns: A `Tensor` of type `out_type`." -8189,shape_n,tensorflow/tensorflow/python/ops/array_ops.py,677,function,"Returns shape of tensors. +8048,shape_n,tensorflow/tensorflow/python/ops/array_ops.py,677,function,"Returns shape of tensors. Args: input: A list of at least 1 `Tensor` object with the same type. @@ -58224,7 +66233,7 @@ Args: Returns: A list with the same length as `input` of `Tensor` objects with type `out_type`." -8190,size_v2,tensorflow/tensorflow/python/ops/array_ops.py,697,function,"Returns the size of a tensor. +8049,size_v2,tensorflow/tensorflow/python/ops/array_ops.py,697,function,"Returns the size of a tensor. See also `tf.shape`. @@ -58249,7 +66258,7 @@ Returns: @compatibility(numpy) Equivalent to np.size() @end_compatibility" -8191,size,tensorflow/tensorflow/python/ops/array_ops.py,731,function,"Returns the size of a tensor. +8050,size,tensorflow/tensorflow/python/ops/array_ops.py,731,function,"Returns the size of a tensor. Returns a 0-D `Tensor` representing the number of elements in `input` of type `out_type`. Defaults to tf.int32. @@ -58273,7 +66282,7 @@ Returns: @compatibility(numpy) Equivalent to np.size() @end_compatibility" -8192,size_internal,tensorflow/tensorflow/python/ops/array_ops.py,761,function,"Returns the size of a tensor. +8051,size_internal,tensorflow/tensorflow/python/ops/array_ops.py,761,function,"Returns the size of a tensor. Args: input: A `Tensor` or `SparseTensor`. @@ -58284,7 +66293,7 @@ Args: Returns: A `Tensor` of type `out_type`. Defaults to `tf.int32`." -8193,rank,tensorflow/tensorflow/python/ops/array_ops.py,801,function,"Returns the rank of a tensor. +8052,rank,tensorflow/tensorflow/python/ops/array_ops.py,801,function,"Returns the rank of a tensor. See also `tf.shape`. @@ -58312,7 +66321,7 @@ Returns: @compatibility(numpy) Equivalent to np.ndim @end_compatibility" -8194,rank_internal,tensorflow/tensorflow/python/ops/array_ops.py,835,function,"Returns the rank of a tensor. +8053,rank_internal,tensorflow/tensorflow/python/ops/array_ops.py,835,function,"Returns the rank of a tensor. Args: input: A `Tensor` or `SparseTensor`. @@ -58321,75 +66330,7 @@ Args: Returns: A `Tensor` of type `int32`." -8195,_check_index,tensorflow/tensorflow/python/ops/array_ops.py,868,function,Check if a given value is a valid index into a tensor. -8196,_is_undefined_dimension,tensorflow/tensorflow/python/ops/array_ops.py,884,function, -8197,_slice_helper,tensorflow/tensorflow/python/ops/array_ops.py,890,function,"Overload for Tensor.__getitem__. - -This operation extracts the specified region from the tensor. -The notation is similar to NumPy with the restriction that -currently only support basic indexing. That means that -using a non-scalar tensor as input is not currently allowed. - -Some useful examples: - -```python -# Strip leading and trailing 2 elements -foo = tf.constant([1,2,3,4,5,6]) -print(foo[2:-2].eval()) # => [3,4] - -# Skip every other row and reverse the order of the columns -foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) -print(foo[::2,::-1].eval()) # => [[3,2,1], [9,8,7]] - -# Use scalar tensors as indices on both dimensions -print(foo[tf.constant(0), tf.constant(2)].eval()) # => 3 - -# Insert another dimension -foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) -print(foo[tf.newaxis, :, :].eval()) # => [[[1,2,3], [4,5,6], [7,8,9]]] -print(foo[:, tf.newaxis, :].eval()) # => [[[1,2,3]], [[4,5,6]], [[7,8,9]]] -print(foo[:, :, tf.newaxis].eval()) # => [[[1],[2],[3]], [[4],[5],[6]], -[[7],[8],[9]]] - -# Ellipses (3 equivalent operations) -foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) -print(foo[tf.newaxis, :, :].eval()) # => [[[1,2,3], [4,5,6], [7,8,9]]] -print(foo[tf.newaxis, ...].eval()) # => [[[1,2,3], [4,5,6], [7,8,9]]] -print(foo[tf.newaxis].eval()) # => [[[1,2,3], [4,5,6], [7,8,9]]] - -# Masks -foo = tf.constant([[1,2,3], [4,5,6], [7,8,9]]) -print(foo[foo > 2].eval()) # => [3, 4, 5, 6, 7, 8, 9] -``` - -Notes: - - `tf.newaxis` is `None` as in NumPy. - - An implicit ellipsis is placed at the end of the `slice_spec` - - NumPy advanced indexing is currently not supported. - -Purpose in the API: - - This method is exposed in TensorFlow's API so that library developers - can register dispatching for `Tensor.__getitem__` to allow it to handle - custom composite tensors & other custom objects. - - The API symbol is not intended to be called by users directly and does - appear in TensorFlow's generated documentation. - -Args: - tensor: An ops.Tensor object. - slice_spec: The arguments to Tensor.__getitem__. - var: In the case of variable slice assignment, the Variable object to slice - (i.e. tensor is the read-only view of this variable). - -Returns: - The appropriate slice of ""tensor"", based on ""slice_spec"". - -Raises: - ValueError: If a slice range is negative size. - TypeError: If the slice indices aren't int, slice, ellipsis, - tf.newaxis or scalar int32/int64 tensors." -8198,slice,tensorflow/tensorflow/python/ops/array_ops.py,1048,function,"Extracts a slice from a tensor. +8054,slice,tensorflow/tensorflow/python/ops/array_ops.py,1048,function,"Extracts a slice from a tensor. See also `tf.strided_slice`. @@ -58436,7 +66377,7 @@ Args: Returns: A `Tensor` the same type as `input_`." -8199,strided_slice,tensorflow/tensorflow/python/ops/array_ops.py,1104,function,"Extracts a strided slice of a tensor (generalized Python array indexing). +8055,strided_slice,tensorflow/tensorflow/python/ops/array_ops.py,1104,function,"Extracts a strided slice of a tensor (generalized Python array indexing). See also `tf.slice`. @@ -58520,46 +66461,7 @@ Args: Returns: A `Tensor` the same type as `input`." -8200,_SliceHelperVar,tensorflow/tensorflow/python/ops/array_ops.py,1245,function,"Creates a slice helper object given a variable. - -This allows creating a sub-tensor from part of the current contents -of a variable. See `tf.Tensor.__getitem__` for detailed examples -of slicing. - -This function in addition also allows assignment to a sliced range. -This is similar to `__setitem__` functionality in Python. However, -the syntax is different so that the user can capture the assignment -operation for grouping or passing to `sess.run()`. -For example, - -```python -import tensorflow as tf -A = tf.Variable([[1,2,3], [4,5,6], [7,8,9]], dtype=tf.float32) -with tf.compat.v1.Session() as sess: - sess.run(tf.compat.v1.global_variables_initializer()) - print(sess.run(A[:2, :2])) # => [[1,2], [4,5]] - - op = A[:2,:2].assign(22. * tf.ones((2, 2))) - print(sess.run(op)) # => [[22, 22, 3], [22, 22, 6], [7,8,9]] -``` - -Note that assignments currently do not support NumPy broadcasting -semantics. - -Args: - var: An `ops.Variable` object. - slice_spec: The arguments to `Tensor.__getitem__`. - -Returns: - The appropriate slice of ""tensor"", based on ""slice_spec"". - As an operator. The operator also has a `assign()` method - that can be used to generate an assignment operator. - -Raises: - ValueError: If a slice range is negative size. - TypeError: TypeError: If the slice indices aren't int, slice, - ellipsis, tf.newaxis or int32/int64 tensors." -8201,parallel_stack,tensorflow/tensorflow/python/ops/array_ops.py,1296,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` tensor in parallel. +8056,parallel_stack,tensorflow/tensorflow/python/ops/array_ops.py,1296,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` tensor in parallel. Requires that the shape of inputs be known at graph construction time. @@ -58596,7 +66498,7 @@ Args: Returns: output: A stacked `Tensor` with the same type as `values`." -8202,stack,tensorflow/tensorflow/python/ops/array_ops.py,1348,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` tensor. +8057,stack,tensorflow/tensorflow/python/ops/array_ops.py,1348,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` tensor. See also `tf.concat`, `tf.tile`, `tf.repeat`. @@ -58639,28 +66541,7 @@ Returns: Raises: ValueError: If `axis` is out of the range [-(R+1), R+1)." -8203,_autopacking_helper,tensorflow/tensorflow/python/ops/array_ops.py,1411,function,"Converts the given list or tuple to a tensor by packing. - -Args: - list_or_tuple: A (possibly nested) list or tuple containing a tensor. - dtype: The element type of the returned tensor. - name: A name for the returned tensor. - -Returns: - A `tf.Tensor` with value equivalent to `list_or_tuple`." -8204,_get_dtype_from_nested_lists,tensorflow/tensorflow/python/ops/array_ops.py,1461,function,"Returns the dtype of any tensor-like object in `list_or_tuple`, if found. - -Args: - list_or_tuple: A list or tuple representing an object that can be converted - to a `tf.Tensor`. - -Returns: - The dtype of any tensor-like object in `list_or_tuple`, or `None` if no - such object exists." -8205,_cast_nested_seqs_to_dtype,tensorflow/tensorflow/python/ops/array_ops.py,1482,function, -8206,_should_not_autopack,tensorflow/tensorflow/python/ops/array_ops.py,1497,function, -8207,_autopacking_conversion_function,tensorflow/tensorflow/python/ops/array_ops.py,1507,function,Tensor conversion function that automatically packs arguments. -8208,unstack,tensorflow/tensorflow/python/ops/array_ops.py,1533,function,"Unpacks the given dimension of a rank-`R` tensor into rank-`(R-1)` tensors. +8058,unstack,tensorflow/tensorflow/python/ops/array_ops.py,1533,function,"Unpacks the given dimension of a rank-`R` tensor into rank-`(R-1)` tensors. Unpacks `num` tensors from `value` by chipping it along the `axis` dimension. If `num` is not specified (the default), it is inferred from `value`'s shape. @@ -58692,7 +66573,7 @@ Returns: Raises: ValueError: If `num` is unspecified and cannot be inferred. ValueError: If `axis` is out of the range [-R, R)." -8209,concat,tensorflow/tensorflow/python/ops/array_ops.py,1582,function,"Concatenates tensors along one dimension. +8059,concat,tensorflow/tensorflow/python/ops/array_ops.py,1582,function,"Concatenates tensors along one dimension. See also `tf.tile`, `tf.stack`, `tf.repeat`. @@ -58767,7 +66648,7 @@ Args: Returns: A `Tensor` resulting from concatenation of the input tensors." -8210,boolean_mask,tensorflow/tensorflow/python/ops/array_ops.py,1677,function,"Apply boolean mask to tensor. +8060,boolean_mask,tensorflow/tensorflow/python/ops/array_ops.py,1677,function,"Apply boolean mask to tensor. Numpy equivalent is `tensor[mask]`. @@ -58811,7 +66692,7 @@ Returns: Raises: ValueError: If shapes do not conform." -8211,boolean_mask_v2,tensorflow/tensorflow/python/ops/array_ops.py,1771,function,"Apply boolean mask to tensor. +8061,boolean_mask_v2,tensorflow/tensorflow/python/ops/array_ops.py,1771,function,"Apply boolean mask to tensor. Numpy equivalent is `tensor[mask]`. @@ -58864,7 +66745,7 @@ tensor = [[1, 2], [3, 4], [5, 6]] mask = np.array([True, False, True]) boolean_mask(tensor, mask) # [[1, 2], [5, 6]] ```" -8212,sparse_mask,tensorflow/tensorflow/python/ops/array_ops.py,1831,function,"Masks elements of `IndexedSlices`. +8062,sparse_mask,tensorflow/tensorflow/python/ops/array_ops.py,1831,function,"Masks elements of `IndexedSlices`. Given an `IndexedSlices` instance `a`, returns another `IndexedSlices` that contains a subset of the slices of `a`. Only the slices at indices not @@ -58897,7 +66778,7 @@ Args: Returns: The masked `IndexedSlices` instance." -8213,unique,tensorflow/tensorflow/python/ops/array_ops.py,1875,function,"Finds unique elements in a 1-D tensor. +8063,unique,tensorflow/tensorflow/python/ops/array_ops.py,1875,function,"Finds unique elements in a 1-D tensor. See also `tf.unique_with_counts`. @@ -58930,7 +66811,7 @@ Returns: A tuple of Tensor objects (y, idx). y: A Tensor. Has the same type as x. idx: A Tensor of type out_idx." -8214,unique_with_counts,tensorflow/tensorflow/python/ops/array_ops.py,1923,function,"Finds unique elements in a 1-D tensor. +8064,unique_with_counts,tensorflow/tensorflow/python/ops/array_ops.py,1923,function,"Finds unique elements in a 1-D tensor. See also `tf.unique`. @@ -58968,7 +66849,7 @@ Returns: y: A Tensor. Has the same type as x. idx: A Tensor of type out_idx. count: A Tensor of type out_idx." -8215,split,tensorflow/tensorflow/python/ops/array_ops.py,1976,function,"Splits a tensor `value` into a list of sub tensors. +8065,split,tensorflow/tensorflow/python/ops/array_ops.py,1976,function,"Splits a tensor `value` into a list of sub tensors. See also `tf.unstack`. @@ -59020,7 +66901,7 @@ Returns: Raises: ValueError: If `num` is unspecified and cannot be inferred." -8216,transpose_v2,tensorflow/tensorflow/python/ops/array_ops.py,2054,function,"Transposes `a`, where `a` is a Tensor. +8066,transpose_v2,tensorflow/tensorflow/python/ops/array_ops.py,2054,function,"Transposes `a`, where `a` is a Tensor. Permutes the dimensions according to the value of `perm`. @@ -59094,7 +66975,7 @@ Args: Returns: A transposed `Tensor`." -8217,transpose,tensorflow/tensorflow/python/ops/array_ops.py,2135,function,"Transposes `a`. +8067,transpose,tensorflow/tensorflow/python/ops/array_ops.py,2135,function,"Transposes `a`. Permutes the dimensions according to `perm`. @@ -59158,7 +67039,7 @@ Args: Returns: A transposed `Tensor`." -8218,matrix_transpose,tensorflow/tensorflow/python/ops/array_ops.py,2227,function,"Transposes last two dimensions of tensor `a`. +8068,matrix_transpose,tensorflow/tensorflow/python/ops/array_ops.py,2227,function,"Transposes last two dimensions of tensor `a`. For example: @@ -59209,7 +67090,7 @@ Returns: Raises: ValueError: If `a` is determined statically to have `rank < 2`." -8219,matrix_diag,tensorflow/tensorflow/python/ops/array_ops.py,2306,function,"Returns a batched diagonal tensor with given batched diagonal values. +8069,matrix_diag,tensorflow/tensorflow/python/ops/array_ops.py,2306,function,"Returns a batched diagonal tensor with given batched diagonal values. Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th diagonals of a matrix, with everything else padded with `padding`. `num_rows` @@ -59352,7 +67233,7 @@ Args: Returns: A Tensor. Has the same type as `diagonal`." -8220,matrix_diag_part,tensorflow/tensorflow/python/ops/array_ops.py,2476,function,"Returns the batched diagonal part of a batched tensor. +8070,matrix_diag_part,tensorflow/tensorflow/python/ops/array_ops.py,2476,function,"Returns the batched diagonal part of a batched tensor. Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched `input`. @@ -59473,7 +67354,7 @@ Args: Returns: A Tensor containing diagonals of `input`. Has the same type as `input`." -8221,matrix_set_diag,tensorflow/tensorflow/python/ops/array_ops.py,2616,function,"Returns a batched matrix tensor with new batched diagonal values. +8071,matrix_set_diag,tensorflow/tensorflow/python/ops/array_ops.py,2616,function,"Returns a batched matrix tensor with new batched diagonal values. Given `input` and `diagonal`, this operation returns a tensor with the same shape and values as `input`, except for the specified diagonals of the @@ -59596,11 +67477,7 @@ Args: aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses ""LEFT_RIGHT"", which is the opposite alignment." -8222,_constant_if_small,tensorflow/tensorflow/python/ops/array_ops.py,2753,function, -8223,_tag_zeros_tensor,tensorflow/tensorflow/python/ops/array_ops.py,2763,function,"Tags the result of function by setting _is_zeros_tensor attribute. - -This is useful to compute Hessians of fused ops such as cross_entropy." -8224,zeros,tensorflow/tensorflow/python/ops/array_ops.py,2780,function,"Creates a tensor with all elements set to zero. +8072,zeros,tensorflow/tensorflow/python/ops/array_ops.py,2780,function,"Creates a tensor with all elements set to zero. See also `tf.zeros_like`, `tf.ones`, `tf.fill`, `tf.eye`. @@ -59621,7 +67498,7 @@ Args: Returns: A `Tensor` with all elements set to zero." -8225,zeros_like,tensorflow/tensorflow/python/ops/array_ops.py,2836,function,"Creates a tensor with all elements set to zero. +8073,zeros_like,tensorflow/tensorflow/python/ops/array_ops.py,2836,function,"Creates a tensor with all elements set to zero. See also `tf.zeros`. @@ -59653,7 +67530,7 @@ Args: Returns: A `Tensor` with all elements set to zero." -8226,zeros_like_v2,tensorflow/tensorflow/python/ops/array_ops.py,2875,function,"Creates a tensor with all elements set to zero. +8074,zeros_like_v2,tensorflow/tensorflow/python/ops/array_ops.py,2875,function,"Creates a tensor with all elements set to zero. See also `tf.zeros`. @@ -59688,8 +67565,8 @@ Args: Returns: A `Tensor` with all elements set to zero." -8227,zeros_like_impl,tensorflow/tensorflow/python/ops/array_ops.py,2919,function,Internal implementation for the v1/v2 zeros_like API calls. -8228,ones_like,tensorflow/tensorflow/python/ops/array_ops.py,2951,function,"Creates a tensor with all elements set to 1. +8075,zeros_like_impl,tensorflow/tensorflow/python/ops/array_ops.py,2919,function,Internal implementation for the v1/v2 zeros_like API calls. +8076,ones_like,tensorflow/tensorflow/python/ops/array_ops.py,2951,function,"Creates a tensor with all elements set to 1. See also `tf.ones`. @@ -59715,7 +67592,7 @@ Args: Returns: A `Tensor` with all elements set to 1." -8229,ones_like_v2,tensorflow/tensorflow/python/ops/array_ops.py,2984,function,"Creates a tensor of all ones that has the same shape as the input. +8077,ones_like_v2,tensorflow/tensorflow/python/ops/array_ops.py,2984,function,"Creates a tensor of all ones that has the same shape as the input. See also `tf.ones`. @@ -59740,8 +67617,8 @@ Args: Returns: A `Tensor` with all elements set to one." -8230,ones_like_impl,tensorflow/tensorflow/python/ops/array_ops.py,3017,function,Internal implementation for the v1/v2 ones_like API calls. -8231,ones,tensorflow/tensorflow/python/ops/array_ops.py,3032,function,"Creates a tensor with all elements set to one (1). +8078,ones_like_impl,tensorflow/tensorflow/python/ops/array_ops.py,3017,function,Internal implementation for the v1/v2 ones_like API calls. +8079,ones,tensorflow/tensorflow/python/ops/array_ops.py,3032,function,"Creates a tensor with all elements set to one (1). See also `tf.ones_like`, `tf.zeros`, `tf.fill`, `tf.eye`. @@ -59763,7 +67640,7 @@ Args: Returns: A `Tensor` with all elements set to one (1)." -8232,placeholder,tensorflow/tensorflow/python/ops/array_ops.py,3087,function,"Inserts a placeholder for a tensor that will be always fed. +8080,placeholder,tensorflow/tensorflow/python/ops/array_ops.py,3087,function,"Inserts a placeholder for a tensor that will be always fed. **Important**: This tensor will produce an error if evaluated. Its value must be fed using the `feed_dict` optional argument to `Session.run()`, @@ -59798,7 +67675,7 @@ Returns: Raises: RuntimeError: if eager execution is enabled" -8233,placeholder_with_default,tensorflow/tensorflow/python/ops/array_ops.py,3132,function,"A placeholder op that passes through `input` when its output is not fed. +8081,placeholder_with_default,tensorflow/tensorflow/python/ops/array_ops.py,3132,function,"A placeholder op that passes through `input` when its output is not fed. Args: input: A `Tensor`. The default value to produce when output is not fed. @@ -59808,7 +67685,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -8234,sparse_placeholder,tensorflow/tensorflow/python/ops/array_ops.py,3149,function,"Inserts a placeholder for a sparse tensor that will be always fed. +8082,sparse_placeholder,tensorflow/tensorflow/python/ops/array_ops.py,3149,function,"Inserts a placeholder for a sparse tensor that will be always fed. **Important**: This sparse tensor will produce an error if evaluated. Its value must be fed using the `feed_dict` optional argument to @@ -59852,7 +67729,7 @@ Returns: Raises: RuntimeError: if eager execution is enabled" -8235,pad_v2,tensorflow/tensorflow/python/ops/array_ops.py,3250,function,"Pads a tensor. +8083,pad_v2,tensorflow/tensorflow/python/ops/array_ops.py,3250,function,"Pads a tensor. This operation pads a `tensor` according to the `paddings` you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of @@ -59904,7 +67781,7 @@ Returns: Raises: ValueError: When mode is not one of ""CONSTANT"", ""REFLECT"", or ""SYMMETRIC""." -8236,pad,tensorflow/tensorflow/python/ops/array_ops.py,3309,function,"Pads a tensor. +8084,pad,tensorflow/tensorflow/python/ops/array_ops.py,3309,function,"Pads a tensor. This operation pads a `tensor` according to the `paddings` you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of @@ -59956,19 +67833,7 @@ Returns: Raises: ValueError: When mode is not one of ""CONSTANT"", ""REFLECT"", or ""SYMMETRIC""." -8237,_get_paddings_constant,tensorflow/tensorflow/python/ops/array_ops.py,3403,function,"Helper to get the constant values of the paddings arg to pad(). - -Used under V1 graph mode to facilitate computation of the shape of the output -tensor of `pad()`. - -Args: - paddings: The same paddings arg as passed to pad(). Can be a Tensor, or - a nested list or tuple of Tensor and/or numbers. - -Returns: - A nested list or numbers or `None`, in which `None` indicates unknown - padding size." -8238,meshgrid,tensorflow/tensorflow/python/ops/array_ops.py,3427,function,"Broadcasts parameters for evaluation on an N-D grid. +8085,meshgrid,tensorflow/tensorflow/python/ops/array_ops.py,3427,function,"Broadcasts parameters for evaluation on an N-D grid. Given N one-dimensional coordinate arrays `*args`, returns a list `outputs` of N-D coordinate arrays for evaluating expressions on an N-D grid. @@ -60007,9 +67872,7 @@ Returns: Raises: TypeError: When no keyword arguments (kwargs) are passed. ValueError: When indexing keyword argument is not one of `xy` or `ij`." -8239,_compute_size_of_strided_dim,tensorflow/tensorflow/python/ops/array_ops.py,3511,function,Computes the size of a single strided slice dimension. -8240,_TileGradShape,tensorflow/tensorflow/python/ops/array_ops.py,3551,function,Shape function for the TileGrad op. -8241,edit_distance,tensorflow/tensorflow/python/ops/array_ops.py,3571,function,"Computes the Levenshtein distance between sequences. +8086,edit_distance,tensorflow/tensorflow/python/ops/array_ops.py,3571,function,"Computes the Levenshtein distance between sequences. This operation takes variable-length sequences (`hypothesis` and `truth`), each provided as a `SparseTensor`, and computes the Levenshtein distance. @@ -60091,10 +67954,7 @@ Returns: Raises: TypeError: If either `hypothesis` or `truth` are not a `SparseTensor`." -8242,_FakeQuantWithMinMaxArgsGradient,tensorflow/tensorflow/python/ops/array_ops.py,3675,function,Gradient for FakeQuantWithMinMaxArgs op. -8243,_FakeQuantWithMinMaxVarsGradient,tensorflow/tensorflow/python/ops/array_ops.py,3687,function,Gradient for FakeQuantWithMinMaxVars op. -8244,_FakeQuantWithMinMaxVarsPerChannelGradient,tensorflow/tensorflow/python/ops/array_ops.py,3699,function,Gradient for FakeQuantWithMinMaxVarsPerChannel op. -8245,required_space_to_batch_paddings,tensorflow/tensorflow/python/ops/array_ops.py,3711,function,"Calculate padding required to make block_shape divide input_shape. +8087,required_space_to_batch_paddings,tensorflow/tensorflow/python/ops/array_ops.py,3711,function,"Calculate padding required to make block_shape divide input_shape. This function can be used to calculate a suitable paddings argument for use with space_to_batch_nd and batch_to_space_nd. @@ -60121,14 +67981,14 @@ Returns: crops[i, 1] = paddings[i, 1] - base_paddings[i, 1] Raises: ValueError if called with incompatible shapes." -8246,space_to_batch,tensorflow/tensorflow/python/ops/array_ops.py,3792,function, -8247,space_to_batch_v2,tensorflow/tensorflow/python/ops/array_ops.py,3815,function, -8248,space_to_depth,tensorflow/tensorflow/python/ops/array_ops.py,3825,function, -8249,space_to_depth_v2,tensorflow/tensorflow/python/ops/array_ops.py,3834,function, -8250,depth_to_space,tensorflow/tensorflow/python/ops/array_ops.py,3844,function, -8251,depth_to_space_v2,tensorflow/tensorflow/python/ops/array_ops.py,3853,function, -8252,batch_to_space,tensorflow/tensorflow/python/ops/array_ops.py,3862,function, -8253,batch_to_space_v2,tensorflow/tensorflow/python/ops/array_ops.py,3880,function,"BatchToSpace for N-D tensors of type T. +8088,space_to_batch,tensorflow/tensorflow/python/ops/array_ops.py,3792,function, +8089,space_to_batch_v2,tensorflow/tensorflow/python/ops/array_ops.py,3815,function, +8090,space_to_depth,tensorflow/tensorflow/python/ops/array_ops.py,3825,function, +8091,space_to_depth_v2,tensorflow/tensorflow/python/ops/array_ops.py,3834,function, +8092,depth_to_space,tensorflow/tensorflow/python/ops/array_ops.py,3844,function, +8093,depth_to_space_v2,tensorflow/tensorflow/python/ops/array_ops.py,3853,function, +8094,batch_to_space,tensorflow/tensorflow/python/ops/array_ops.py,3862,function, +8095,batch_to_space_v2,tensorflow/tensorflow/python/ops/array_ops.py,3880,function,"BatchToSpace for N-D tensors of type T. This operation reshapes the ""batch"" dimension 0 into `M + 1` dimensions of shape `block_shape + [batch]`, interleaves these blocks back into the grid @@ -60255,7 +68115,7 @@ Examples: Returns: A `Tensor`. Has the same type as `input`." -8254,one_hot,tensorflow/tensorflow/python/ops/array_ops.py,4018,function,"Returns a one-hot tensor. +8096,one_hot,tensorflow/tensorflow/python/ops/array_ops.py,4018,function,"Returns a one-hot tensor. See also `tf.fill`, `tf.eye`. @@ -60361,8 +68221,7 @@ Returns: Raises: TypeError: If dtype of either `on_value` or `off_value` don't match `dtype` TypeError: If dtype of `on_value` and `off_value` don't match one another" -8255,_all_dimensions,tensorflow/tensorflow/python/ops/array_ops.py,4179,function,Returns a 1D-tensor listing all dimensions in x. -8256,sequence_mask,tensorflow/tensorflow/python/ops/array_ops.py,4196,function,"Returns a mask tensor representing the first N positions of each cell. +8097,sequence_mask,tensorflow/tensorflow/python/ops/array_ops.py,4196,function,"Returns a mask tensor representing the first N positions of each cell. If `lengths` has shape `[d_1, d_2, ..., d_n]` the resulting tensor `mask` has dtype `dtype` and shape `[d_1, d_2, ..., d_n, maxlen]`, with @@ -60395,7 +68254,7 @@ Returns: A mask tensor of shape `lengths.shape + (maxlen,)`, cast to specified dtype. Raises: ValueError: if `maxlen` is not a scalar." -8257,squeeze,tensorflow/tensorflow/python/ops/array_ops.py,4264,function,"Removes dimensions of size 1 from the shape of a tensor. +8098,squeeze,tensorflow/tensorflow/python/ops/array_ops.py,4264,function,"Removes dimensions of size 1 from the shape of a tensor. Given a tensor `input`, this operation returns a tensor of the same type with all dimensions of size 1 removed. If you don't want to remove all size 1 @@ -60436,7 +68295,7 @@ Returns: Raises: ValueError: When both `squeeze_dims` and `axis` are specified." -8258,squeeze_v2,tensorflow/tensorflow/python/ops/array_ops.py,4317,function,"Removes dimensions of size 1 from the shape of a tensor. +8099,squeeze_v2,tensorflow/tensorflow/python/ops/array_ops.py,4317,function,"Removes dimensions of size 1 from the shape of a tensor. Given a tensor `input`, this operation returns a tensor of the same type with all dimensions of size 1 removed. If you don't want to remove all size 1 @@ -60480,7 +68339,7 @@ Returns: Raises: ValueError: The input cannot be converted to a tensor, or the specified axis cannot be squeezed." -8259,where,tensorflow/tensorflow/python/ops/array_ops.py,4369,function,"Return the elements, either from `x` or `y`, depending on the `condition`. +8100,where,tensorflow/tensorflow/python/ops/array_ops.py,4369,function,"Return the elements, either from `x` or `y`, depending on the `condition`. If both `x` and `y` are None, then this operation returns the coordinates of true elements of `condition`. The coordinates are returned in a 2-D tensor @@ -60519,7 +68378,7 @@ Returns: Raises: ValueError: When exactly one of `x` or `y` is non-None." -8260,where_v2,tensorflow/tensorflow/python/ops/array_ops.py,4423,function,"Return the elements where `condition` is `True` (multiplexing `x` and `y`). +8101,where_v2,tensorflow/tensorflow/python/ops/array_ops.py,4423,function,"Return the elements where `condition` is `True` (multiplexing `x` and `y`). This operator has two modes: in one mode both `x` and `y` are provided, in another mode neither are provided. `condition` is always expected to be a @@ -60602,7 +68461,7 @@ Returns: Raises: ValueError: When exactly one of `x` or `y` is non-None, or the shapes are not all broadcastable." -8261,reverse_sequence,tensorflow/tensorflow/python/ops/array_ops.py,4527,function,"Reverses variable length slices. +8102,reverse_sequence,tensorflow/tensorflow/python/ops/array_ops.py,4527,function,"Reverses variable length slices. This op first slices `input` along the dimension `batch_axis`, and for each slice `i`, reverses the first `seq_lengths[i]` elements along the @@ -60641,7 +68500,7 @@ Args: Returns: A Tensor. Has the same type as input." -8262,reverse_sequence_v2,tensorflow/tensorflow/python/ops/array_ops.py,4587,function,"Reverses variable length slices. +8103,reverse_sequence_v2,tensorflow/tensorflow/python/ops/array_ops.py,4587,function,"Reverses variable length slices. This op first slices `input` along the dimension `batch_axis`, and for each slice `i`, reverses the first `seq_lengths[i]` elements along the @@ -60680,7 +68539,7 @@ Args: Returns: A Tensor. Has the same type as input." -8263,gather,tensorflow/tensorflow/python/ops/array_ops.py,4644,function,"Gather slices from params axis `axis` according to indices. +8104,gather,tensorflow/tensorflow/python/ops/array_ops.py,4644,function,"Gather slices from params axis `axis` according to indices. Gather slices from params axis `axis` according to `indices`. `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). @@ -60748,33 +68607,9 @@ Args: Returns: A `Tensor`. Has the same type as `params`." -8264,gather_v2,tensorflow/tensorflow/python/ops/array_ops.py,4736,function, -8265,batch_gather,tensorflow/tensorflow/python/ops/array_ops.py,4759,function,Gather slices from params according to indices with leading batch dims. -8266,_batch_gather,tensorflow/tensorflow/python/ops/array_ops.py,4770,function,"Gather slices from params according to indices with leading batch dims. - -This operation assumes that the leading `batch_dims` dimensions of `indices` -and `params` are batch dimensions; and performs a `tf.gather` operation within -each batch. (If `batch_dims` is not specified, then it defaults to -`rank(indices)-1`.) In the case in which `batch_dims==0`, this operation -is equivalent to `tf.gather`. - -Args: - params: A Tensor. The tensor from which to gather values. - indices: A Tensor. Must be one of the following types: int32, int64. Index - tensor. Must be in range `[0, params.shape[batch_dims]]`. - batch_dims: An integer or none. The number of batch dimensions. Must be - less than `rank(indices)`. Defaults to `rank(indices) - 1` if None. - axis: A `Tensor`. Must be one of the following types: `int32`, `int64`. The - `axis` in `params` to gather `indices` from. Must be greater than or equal - to `batch_dims`. Defaults to the first non-batch dimension. Supports - negative indexes. - -Returns: - A Tensor. Has the same type as `params`. - -Raises: - ValueError: if `indices` has an unknown shape." -8267,gather_nd,tensorflow/tensorflow/python/ops/array_ops.py,4895,function,"Gather slices from `params` into a Tensor with shape specified by `indices`. +8105,gather_v2,tensorflow/tensorflow/python/ops/array_ops.py,4736,function, +8106,batch_gather,tensorflow/tensorflow/python/ops/array_ops.py,4759,function,Gather slices from params according to indices with leading batch dims. +8107,gather_nd,tensorflow/tensorflow/python/ops/array_ops.py,4895,function,"Gather slices from `params` into a Tensor with shape specified by `indices`. `indices` is an K-dimensional integer tensor, best thought of as a (K-1)-dimensional tensor of indices into `params`, where each element defines @@ -60919,12 +68754,12 @@ Args: Returns: A `Tensor`. Has the same type as `params`." -8268,gather_nd_v2,tensorflow/tensorflow/python/ops/array_ops.py,5058,function, -8269,batch_gather_nd,tensorflow/tensorflow/python/ops/array_ops.py,5065,function,gather_nd implementation with batch support. -8270,quantize_v2,tensorflow/tensorflow/python/ops/array_ops.py,5153,function, -8271,quantize,tensorflow/tensorflow/python/ops/array_ops.py,5204,function,Quantize the input tensor. -8272,dequantize,tensorflow/tensorflow/python/ops/array_ops.py,5244,function, -8273,quantize_and_dequantize,tensorflow/tensorflow/python/ops/array_ops.py,5279,function,"Quantizes then dequantizes a tensor. +8108,gather_nd_v2,tensorflow/tensorflow/python/ops/array_ops.py,5058,function, +8109,batch_gather_nd,tensorflow/tensorflow/python/ops/array_ops.py,5065,function,gather_nd implementation with batch support. +8110,quantize_v2,tensorflow/tensorflow/python/ops/array_ops.py,5153,function, +8111,quantize,tensorflow/tensorflow/python/ops/array_ops.py,5204,function,Quantize the input tensor. +8112,dequantize,tensorflow/tensorflow/python/ops/array_ops.py,5244,function, +8113,quantize_and_dequantize,tensorflow/tensorflow/python/ops/array_ops.py,5279,function,"Quantizes then dequantizes a tensor. Args: input: A `Tensor` to quantize and dequantize. @@ -60950,7 +68785,7 @@ Args: Returns: A `Tensor`. Each element is the result of quantizing and dequantizing the corresponding element of `input`." -8274,searchsorted,tensorflow/tensorflow/python/ops/array_ops.py,5339,function,"Searches input tensor for values on the innermost dimension. +8114,searchsorted,tensorflow/tensorflow/python/ops/array_ops.py,5339,function,"Searches input tensor for values on the innermost dimension. A 2-D example: @@ -60989,7 +68824,7 @@ Raises: ValueError: If the last dimension of `sorted_sequence >= 2^31-1` elements. If the total size of values exceeds `2^31 - 1` elements. If the first `N-1` dimensions of the two tensors don't match." -8275,extract_image_patches_v2,tensorflow/tensorflow/python/ops/array_ops.py,5404,function,"Extract `patches` from `images`. +8115,extract_image_patches_v2,tensorflow/tensorflow/python/ops/array_ops.py,5404,function,"Extract `patches` from `images`. This op collects patches from the input image, as if applying a convolution. All extracted patches are stacked in the depth (last) dimension @@ -61103,7 +68938,7 @@ Args: Returns: A 4-D Tensor of the same type as the input." -8276,extract_image_patches,tensorflow/tensorflow/python/ops/array_ops.py,5528,function,"Extract patches from images and put them in the ""depth"" output dimension. +8116,extract_image_patches,tensorflow/tensorflow/python/ops/array_ops.py,5528,function,"Extract patches from images and put them in the ""depth"" output dimension. Args: `images`: A `Tensor`. Must be one of the following types: `float32`, @@ -61130,7 +68965,7 @@ Args: Returns: A Tensor. Has the same type as images." -8277,fingerprint,tensorflow/tensorflow/python/ops/array_ops.py,5575,function,"Generates fingerprint values. +8117,fingerprint,tensorflow/tensorflow/python/ops/array_ops.py,5575,function,"Generates fingerprint values. Generates fingerprint values of `data`. @@ -61173,8 +69008,8 @@ Returns: A two-dimensional `Tensor` of type `tf.uint8`. The first dimension equals to `data`'s first dimension, and the second dimension size depends on the fingerprint algorithm." -8278,convert_to_int_tensor,tensorflow/tensorflow/python/ops/array_ops.py,5623,function,Converts the given value to an integer Tensor. -8279,get_positive_axis,tensorflow/tensorflow/python/ops/array_ops.py,5634,function,"Validate an `axis` parameter, and normalize it to be positive. +8118,convert_to_int_tensor,tensorflow/tensorflow/python/ops/array_ops.py,5623,function,Converts the given value to an integer Tensor. +8119,get_positive_axis,tensorflow/tensorflow/python/ops/array_ops.py,5634,function,"Validate an `axis` parameter, and normalize it to be positive. If `ndims` is known (i.e., not `None`), then check that `axis` is in the range `-ndims <= axis < ndims`, and return `axis` (if `axis >= 0`) or @@ -61194,7 +69029,7 @@ Returns: Raises: ValueError: If `axis` is out-of-bounds, or if `axis` is negative and `ndims is None`." -8280,repeat_with_axis,tensorflow/tensorflow/python/ops/array_ops.py,5680,function,"Repeats elements of `data`. +8120,repeat_with_axis,tensorflow/tensorflow/python/ops/array_ops.py,5680,function,"Repeats elements of `data`. Args: data: An `N`-dimensional tensor. @@ -61225,9 +69060,8 @@ array([[1, 2], " -8281,tile_one_dimension,tensorflow/tensorflow/python/ops/array_ops.py,5794,function,Tiles a single dimension of a tensor. -8282,_with_nonzero_rank,tensorflow/tensorflow/python/ops/array_ops.py,5807,function,"If `data` is scalar, then add a dimension; otherwise return as-is." -8283,repeat,tensorflow/tensorflow/python/ops/array_ops.py,5822,function,"Repeat elements of `input`. +8121,tile_one_dimension,tensorflow/tensorflow/python/ops/array_ops.py,5794,function,Tiles a single dimension of a tensor. +8122,repeat,tensorflow/tensorflow/python/ops/array_ops.py,5822,function,"Repeat elements of `input`. See also `tf.concat`, `tf.stack`, `tf.tile`. @@ -61270,11 +69104,10 @@ array([[1, 1, 2, 2, 2], >>> repeat([[1,2], [3,4]], repeats=2) " -8284,ArrayOpTest,tensorflow/tensorflow/python/ops/array_ops_test.py,31,class, -8285,batch_norm_op,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,40,function,Fused kernel for batch normalization. -8286,batch_norm_py,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,55,function,Python implementation of batch normalization. -8287,batch_norm_slow,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,61,function, -8288,build_graph,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,68,function,"Build a graph containing a sequence of batch normalizations. +8123,batch_norm_op,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,40,function,Fused kernel for batch normalization. +8124,batch_norm_py,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,55,function,Python implementation of batch normalization. +8125,batch_norm_slow,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,61,function, +8126,build_graph,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,68,function,"Build a graph containing a sequence of batch normalizations. Args: device: string, the device to run on. @@ -61287,9 +69120,10 @@ Args: Returns: An array of tensors to run()" -8289,print_difference,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,117,function,Print the difference in timing between two runs. -8290,BatchNormBenchmark,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,123,class,Benchmark batch normalization. -8291,batch_function,tensorflow/tensorflow/python/ops/batch_ops.py,32,function,"Batches the computation done by the decorated function. +8127,print_difference,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,117,function,Print the difference in timing between two runs. +8128,BatchNormBenchmark,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,123,class,Benchmark batch normalization. +8129,benchmark_batch_norm,tensorflow/tensorflow/python/ops/batch_norm_benchmark.py,177,method, +8130,batch_function,tensorflow/tensorflow/python/ops/batch_ops.py,32,function,"Batches the computation done by the decorated function. So, for example, in the following code @@ -61328,9 +69162,8 @@ Args: Returns: The decorated function will return the unbatched computation output Tensors." -8292,delayed_plus1,tensorflow/tensorflow/python/ops/batch_ops_test.py,37,function,Sleeps for 100ms then returns x+1. -8293,BatchOpsTest,tensorflow/tensorflow/python/ops/batch_ops_test.py,44,class,"Tests for batch_ops.{un,}batch." -8294,bincount,tensorflow/tensorflow/python/ops/bincount_ops.py,36,function,"Counts the number of occurrences of each value in an integer array. +8131,delayed_plus1,tensorflow/tensorflow/python/ops/batch_ops_test.py,37,function,Sleeps for 100ms then returns x+1. +8132,bincount,tensorflow/tensorflow/python/ops/bincount_ops.py,36,function,"Counts the number of occurrences of each value in an integer array. If `minlength` and `maxlength` are not given, returns a vector with length `tf.reduce_max(arr) + 1` if `arr` is non-empty, and length 0 otherwise. @@ -61405,7 +69238,7 @@ Returns: Raises: `InvalidArgumentError` if negative values are provided as an input." -8295,bincount_v1,tensorflow/tensorflow/python/ops/bincount_ops.py,223,function,"Counts the number of occurrences of each value in an integer array. +8133,bincount_v1,tensorflow/tensorflow/python/ops/bincount_ops.py,223,function,"Counts the number of occurrences of each value in an integer array. If `minlength` and `maxlength` are not given, returns a vector with length `tf.reduce_max(arr) + 1` if `arr` is non-empty, and length 0 otherwise. @@ -61427,7 +69260,7 @@ Args: Returns: A vector with the same dtype as `weights` or the given `dtype`. The bin values." -8296,sparse_bincount,tensorflow/tensorflow/python/ops/bincount_ops.py,255,function,"Count the number of times an integer value appears in a tensor. +8134,sparse_bincount,tensorflow/tensorflow/python/ops/bincount_ops.py,255,function,"Count the number of times an integer value appears in a tensor. This op takes an N-dimensional `Tensor`, `RaggedTensor`, or `SparseTensor`, and returns an N-dimensional int64 SparseTensor where element @@ -61550,21 +69383,46 @@ SparseTensor(indices=tf.Tensor( [ 1 10001]], shape=(6, 2), dtype=int64), values=tf.Tensor([2. 0.75 15. 5. 17. 0.9], shape=(6,), dtype=float32), dense_shape=tf.Tensor([ 2 10002], shape=(2,), dtype=int64))" -8297,validate_dense_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,454,function,Validates the passed weight tensor or creates an empty one. -8298,validate_sparse_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,468,function,Validates the passed weight tensor or creates an empty one. -8299,validate_ragged_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,502,function,Validates the passed weight tensor or creates an empty one. -8300,TestSparseCount,tensorflow/tensorflow/python/ops/bincount_ops_test.py,35,class, -8301,TestDenseBincount,tensorflow/tensorflow/python/ops/bincount_ops_test.py,514,class, -8302,TestSparseCountFailureModes,tensorflow/tensorflow/python/ops/bincount_ops_test.py,745,class, -8303,BitwiseOpTest,tensorflow/tensorflow/python/ops/bitwise_ops_test.py,32,class, -8304,PruningMode,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,55,class,Class for working with Pruning modes. -8305,QuantileAccumulatorSaveable,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,70,class,SaveableObject implementation for QuantileAccumulator. -8306,QuantileAccumulator,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,99,class,"SaveableObject implementation for QuantileAccumulator. +8135,validate_dense_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,454,function,Validates the passed weight tensor or creates an empty one. +8136,validate_sparse_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,468,function,Validates the passed weight tensor or creates an empty one. +8137,validate_ragged_weights,tensorflow/tensorflow/python/ops/bincount_ops.py,502,function,Validates the passed weight tensor or creates an empty one. +8138,PruningMode,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,55,class,Class for working with Pruning modes. +8139,from_str,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,62,method, +8140,QuantileAccumulatorSaveable,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,70,class,SaveableObject implementation for QuantileAccumulator. +8141,restore,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,92,method, +8142,make_save_spec,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,82,method, +8143,QuantileAccumulator,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,99,class,"SaveableObject implementation for QuantileAccumulator. The bucket boundaries are serialized and deserialized from checkpointing." -8307,_TreeEnsembleSavable,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,165,class,SaveableObject implementation for TreeEnsemble. -8308,TreeEnsemble,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,210,class,Creates TreeEnsemble resource. -8309,uniform_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,36,function,"Samples a set of classes using a uniform base distribution. +8144,initializer,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,137,method, +8145,is_initialized,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,142,method, +8146,saveable,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,146,method, +8147,add_summaries,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,152,method, +8148,flush,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,158,method, +8149,get_bucket_boundaries,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,161,method, +8150,TreeEnsemble,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,210,class,Creates TreeEnsemble resource. +8151,initializer,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,244,method, +8152,is_initialized,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,249,method, +8153,get_stamp_token,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,257,method,Returns the current stamp token of the resource. +8154,get_states,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,264,method,"Returns states of the tree ensemble. + +Returns: + stamp_token, num_trees, num_finalized_trees, num_attempted_layers and + range of the nodes in the latest layer." +8155,serialize,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,283,method,"Serializes the ensemble into proto and returns the serialized proto. + +Returns: + stamp_token: int64 scalar Tensor to denote the stamp of the resource. + serialized_proto: string scalar Tensor of the serialized proto." +8156,deserialize,tensorflow/tensorflow/python/ops/boosted_trees_ops.py,293,method,"Deserialize the input proto and resets the ensemble from it. + +Args: + stamp_token: int64 scalar Tensor to denote the stamp of the resource. + serialized_proto: string scalar Tensor of the serialized proto. + +Returns: + Operation (for dependencies)." +8157,uniform_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,36,function,"Samples a set of classes using a uniform base distribution. This operation randomly samples a tensor of sampled classes (`sampled_candidates`) from the range of integers `[0, range_max)`. @@ -61610,7 +69468,7 @@ Returns: sampled_expected_count: A tensor of type `float`. Same shape as `sampled_candidates`. The expected counts under the sampling distribution of each of `sampled_candidates`." -8310,log_uniform_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,99,function,"Samples a set of classes using a log-uniform (Zipfian) base distribution. +8158,log_uniform_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,99,function,"Samples a set of classes using a log-uniform (Zipfian) base distribution. This operation randomly samples a tensor of sampled classes (`sampled_candidates`) from the range of integers `[0, range_max)`. @@ -61659,7 +69517,7 @@ Returns: sampled_expected_count: A tensor of type `float`. Same shape as `sampled_candidates`. The expected counts under the sampling distribution of each of `sampled_candidates`." -8311,learned_unigram_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,162,function,"Samples a set of classes from a distribution learned during training. +8159,learned_unigram_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,162,function,"Samples a set of classes from a distribution learned during training. This operation randomly samples a tensor of sampled classes (`sampled_candidates`) from the range of integers `[0, range_max)`. @@ -61705,7 +69563,7 @@ Returns: sampled_expected_count: A tensor of type `float`. Same shape as `sampled_candidates`. The expected counts under the sampling distribution of each of `sampled_candidates`." -8312,fixed_unigram_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,221,function,"Samples a set of classes using the provided (fixed) base distribution. +8160,fixed_unigram_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,221,function,"Samples a set of classes using the provided (fixed) base distribution. This operation randomly samples a tensor of sampled classes (`sampled_candidates`) from the range of integers `[0, range_max)`. @@ -61773,7 +69631,7 @@ Returns: sampled_expected_count: A tensor of type `float`. Same shape as `sampled_candidates`. The expected counts under the sampling distribution of each of `sampled_candidates`." -8313,all_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,313,function,"Generate the set of all classes. +8161,all_candidate_sampler,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,313,function,"Generate the set of all classes. Deterministically generates and returns the set of all possible classes. For testing purposes. There is no need to use this, since you might as @@ -61799,7 +69657,7 @@ Returns: sampled_expected_count: A tensor of type `float`. Same shape as `sampled_candidates`. The expected counts under the sampling distribution of each of `sampled_candidates`. All returned values are 1.0." -8314,compute_accidental_hits,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,350,function,"Compute the position ids in `sampled_candidates` matching `true_classes`. +8162,compute_accidental_hits,tensorflow/tensorflow/python/ops/candidate_sampling_ops.py,350,function,"Compute the position ids in `sampled_candidates` matching `true_classes`. In Candidate Sampling, this operation facilitates virtually removing sampled classes which happen to match target classes. This is done @@ -61837,75 +69695,7 @@ Returns: Values indicate positions in `sampled_candidates`. weights: A `Tensor` of type `float` and shape `[num_accidental_hits]`. Each value is `-FLOAT_MAX`." -8315,_maybe_constant_value_string,tensorflow/tensorflow/python/ops/check_ops.py,73,function, -8316,_assert_static,tensorflow/tensorflow/python/ops/check_ops.py,82,function,Raises a InvalidArgumentError with as much information as possible. -8317,_shape_and_dtype_str,tensorflow/tensorflow/python/ops/check_ops.py,90,function,Returns a string containing tensor's shape and dtype. -8318,_unary_assert_doc,tensorflow/tensorflow/python/ops/check_ops.py,95,function,"Common docstring for assert_* ops that evaluate a unary predicate over every element of a tensor. - -Args: - sym: Mathematical symbol for the check performed on each element, i.e. ""> 0"" - sym_name: English-language name for the op described by sym - -Returns: - Decorator that adds the appropriate docstring to the function for symbol - `sym`." -8319,_binary_assert_doc,tensorflow/tensorflow/python/ops/check_ops.py,158,function,"Common docstring for most of the v1 assert_* ops that compare two tensors element-wise. - -Args: - sym: Binary operation symbol, i.e. ""=="" - -Returns: - Decorator that adds the appropriate docstring to the function for -symbol `sym`." -8320,_make_assert_msg_data,tensorflow/tensorflow/python/ops/check_ops.py,221,function,"Subroutine of _binary_assert that generates the components of the default error message when running in eager mode. - -Args: - sym: Mathematical symbol for the test to apply to pairs of tensor elements, - i.e. ""=="" - x: First input to the assertion after applying `convert_to_tensor()` - y: Second input to the assertion - summarize: Value of the ""summarize"" parameter to the original assert_* call; - tells how many elements of each tensor to print. - test_op: TensorFlow op that returns a Boolean tensor with True in each - position where the assertion is satisfied. - -Returns: - List of tensors and scalars that, when stringified and concatenated, - will produce the error message string." -8321,_pretty_print,tensorflow/tensorflow/python/ops/check_ops.py,275,function,"Format a data item for use in an error message in eager mode. - -Args: - data_item: One of the items in the ""data"" argument to an assert_* function. - Can be a Tensor or a scalar value. - summarize: How many elements to retain of each tensor-valued entry in data. - -Returns: - An appropriate string representation of data_item" -8322,_binary_assert,tensorflow/tensorflow/python/ops/check_ops.py,301,function,"Generic binary elementwise assertion. - -Implements the behavior described in _binary_assert_doc() above. -Args: - sym: Mathematical symbol for the test to apply to pairs of tensor elements, - i.e. ""=="" - opname: Name of the assert op in the public API, i.e. ""assert_equal"" - op_func: Function that, if passed the two Tensor inputs to the assertion (x - and y), will return the test to be passed to reduce_all() i.e. - static_func: Function that, if passed numpy ndarray versions of the two - inputs to the assertion, will return a Boolean ndarray with containing - True in all positions where the assertion PASSES. - i.e. np.equal for assert_equal() - x: Numeric `Tensor`. - y: Numeric `Tensor`, same dtype as and broadcastable to `x`. - data: The tensors to print out if the condition is False. Defaults to - error message and first few entries of `x`, `y`. - summarize: Print this many entries of each tensor. - message: A string to prefix to the default message. - name: A name for this operation (optional). Defaults to the value of - `opname`. - -Returns: - See docstring template in _binary_assert_doc()." -8323,assert_proper_iterable,tensorflow/tensorflow/python/ops/check_ops.py,381,function,"Static assert that values is a ""proper"" iterable. +8163,assert_proper_iterable,tensorflow/tensorflow/python/ops/check_ops.py,381,function,"Static assert that values is a ""proper"" iterable. `Ops` that expect iterables of `Tensor` can call this to validate input. Useful since `Tensor`, `ndarray`, byte/text type are all iterables themselves. @@ -61916,7 +69706,7 @@ Args: Raises: TypeError: If `values` is not iterable or is one of `Tensor`, `SparseTensor`, `np.array`, `tf.compat.bytes_or_text_types`." -8324,assert_negative_v2,tensorflow/tensorflow/python/ops/check_ops.py,410,function,"Assert the condition `x < 0` holds element-wise. +8164,assert_negative_v2,tensorflow/tensorflow/python/ops/check_ops.py,410,function,"Assert the condition `x < 0` holds element-wise. This Op checks that `x[i] < 0` holds for every element of `x`. If `x` is empty, this is trivially satisfied. @@ -61942,8 +69732,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x[i] < 0` is False. The check can be performed immediately during eager execution or if `x` is statically known." -8325,assert_negative,tensorflow/tensorflow/python/ops/check_ops.py,445,function, -8326,assert_positive_v2,tensorflow/tensorflow/python/ops/check_ops.py,464,function,"Assert the condition `x > 0` holds element-wise. +8165,assert_negative,tensorflow/tensorflow/python/ops/check_ops.py,445,function, +8166,assert_positive_v2,tensorflow/tensorflow/python/ops/check_ops.py,464,function,"Assert the condition `x > 0` holds element-wise. This Op checks that `x[i] > 0` holds for every element of `x`. If `x` is empty, this is trivially satisfied. @@ -61969,8 +69759,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x[i] > 0` is False. The check can be performed immediately during eager execution or if `x` is statically known." -8327,assert_positive,tensorflow/tensorflow/python/ops/check_ops.py,499,function, -8328,assert_non_negative_v2,tensorflow/tensorflow/python/ops/check_ops.py,517,function,"Assert the condition `x >= 0` holds element-wise. +8167,assert_positive,tensorflow/tensorflow/python/ops/check_ops.py,499,function, +8168,assert_non_negative_v2,tensorflow/tensorflow/python/ops/check_ops.py,517,function,"Assert the condition `x >= 0` holds element-wise. This Op checks that `x[i] >= 0` holds for every element of `x`. If `x` is empty, this is trivially satisfied. @@ -61997,8 +69787,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x[i] >= 0` is False. The check can be performed immediately during eager execution or if `x` is statically known." -8329,assert_non_negative,tensorflow/tensorflow/python/ops/check_ops.py,554,function, -8330,assert_non_positive_v2,tensorflow/tensorflow/python/ops/check_ops.py,573,function,"Assert the condition `x <= 0` holds element-wise. +8169,assert_non_negative,tensorflow/tensorflow/python/ops/check_ops.py,554,function, +8170,assert_non_positive_v2,tensorflow/tensorflow/python/ops/check_ops.py,573,function,"Assert the condition `x <= 0` holds element-wise. This Op checks that `x[i] <= 0` holds for every element of `x`. If `x` is empty, this is trivially satisfied. @@ -62025,8 +69815,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x[i] <= 0` is False. The check can be performed immediately during eager execution or if `x` is statically known." -8331,assert_non_positive,tensorflow/tensorflow/python/ops/check_ops.py,610,function, -8332,assert_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,629,function,"Assert the condition `x == y` holds element-wise. +8171,assert_non_positive,tensorflow/tensorflow/python/ops/check_ops.py,610,function, +8172,assert_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,629,function,"Assert the condition `x == y` holds element-wise. This Op checks that `x[i] == y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62054,8 +69844,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x == y` is False. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8333,assert_equal,tensorflow/tensorflow/python/ops/check_ops.py,665,function, -8334,assert_none_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,676,function,"Assert the condition `x != y` holds for all elements. +8173,assert_equal,tensorflow/tensorflow/python/ops/check_ops.py,665,function, +8174,assert_none_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,676,function,"Assert the condition `x != y` holds for all elements. This Op checks that `x[i] != y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62086,8 +69876,8 @@ Raises: `x != y` is False for any pair of elements in `x` and `y`. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8335,assert_none_equal,tensorflow/tensorflow/python/ops/check_ops.py,717,function, -8336,assert_near_v2,tensorflow/tensorflow/python/ops/check_ops.py,725,function,"Assert the condition `x` and `y` are close element-wise. +8175,assert_none_equal,tensorflow/tensorflow/python/ops/check_ops.py,717,function, +8176,assert_near_v2,tensorflow/tensorflow/python/ops/check_ops.py,725,function,"Assert the condition `x` and `y` are close element-wise. This Op checks that `x[i] - y[i] < atol + rtol * tf.abs(y[i])` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are @@ -62132,7 +69922,7 @@ Similar to `numpy.testing.assert_allclose`, except tolerance depends on data type. This is due to the fact that `TensorFlow` is often used with `32bit`, `64bit`, and even `16bit` data. @end_compatibility" -8337,assert_near,tensorflow/tensorflow/python/ops/check_ops.py,780,function,"Assert the condition `x` and `y` are close element-wise. +8177,assert_near,tensorflow/tensorflow/python/ops/check_ops.py,780,function,"Assert the condition `x` and `y` are close element-wise. Example of adding a dependency to an operation: @@ -62174,7 +69964,7 @@ Similar to `numpy.testing.assert_allclose`, except tolerance depends on data type. This is due to the fact that `TensorFlow` is often used with `32bit`, `64bit`, and even `16bit` data. @end_compatibility" -8338,assert_less_v2,tensorflow/tensorflow/python/ops/check_ops.py,862,function,"Assert the condition `x < y` holds element-wise. +8178,assert_less_v2,tensorflow/tensorflow/python/ops/check_ops.py,862,function,"Assert the condition `x < y` holds element-wise. This Op checks that `x[i] < y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62203,8 +69993,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x < y` is False. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8339,assert_less,tensorflow/tensorflow/python/ops/check_ops.py,899,function, -8340,assert_less_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,906,function,"Assert the condition `x <= y` holds element-wise. +8179,assert_less,tensorflow/tensorflow/python/ops/check_ops.py,899,function, +8180,assert_less_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,906,function,"Assert the condition `x <= y` holds element-wise. This Op checks that `x[i] <= y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62233,8 +70023,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x <= y` is False. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8341,assert_less_equal,tensorflow/tensorflow/python/ops/check_ops.py,945,function, -8342,assert_greater_v2,tensorflow/tensorflow/python/ops/check_ops.py,952,function,"Assert the condition `x > y` holds element-wise. +8181,assert_less_equal,tensorflow/tensorflow/python/ops/check_ops.py,945,function, +8182,assert_greater_v2,tensorflow/tensorflow/python/ops/check_ops.py,952,function,"Assert the condition `x > y` holds element-wise. This Op checks that `x[i] > y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62263,8 +70053,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x > y` is False. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8343,assert_greater,tensorflow/tensorflow/python/ops/check_ops.py,990,function, -8344,assert_greater_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,997,function,"Assert the condition `x >= y` holds element-wise. +8183,assert_greater,tensorflow/tensorflow/python/ops/check_ops.py,990,function, +8184,assert_greater_equal_v2,tensorflow/tensorflow/python/ops/check_ops.py,997,function,"Assert the condition `x >= y` holds element-wise. This Op checks that `x[i] >= y[i]` holds for every pair of (possibly broadcast) elements of `x` and `y`. If both `x` and `y` are empty, this is @@ -62294,26 +70084,8 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x >= y` is False. The check can be performed immediately during eager execution or if `x` and `y` are statically known." -8345,assert_greater_equal,tensorflow/tensorflow/python/ops/check_ops.py,1037,function, -8346,_assert_rank_condition,tensorflow/tensorflow/python/ops/check_ops.py,1043,function,"Assert `x` has a rank that satisfies a given condition. - -Args: - x: Numeric `Tensor`. - rank: Scalar `Tensor`. - static_condition: A python function that takes `[actual_rank, given_rank]` - and returns `True` if the condition is satisfied, `False` otherwise. - dynamic_condition: An `op` that takes [actual_rank, given_rank] and return - `True` if the condition is satisfied, `False` otherwise. - data: The tensors to print out if the condition is false. Defaults to - error message and first few entries of `x`. - summarize: Print this many entries of each tensor. - -Returns: - Op raising `InvalidArgumentError` if `x` fails dynamic_condition. - -Raises: - ValueError: If static checks determine `x` fails static_condition." -8347,assert_rank_v2,tensorflow/tensorflow/python/ops/check_ops.py,1093,function,"Assert that `x` has rank equal to `rank`. +8185,assert_greater_equal,tensorflow/tensorflow/python/ops/check_ops.py,1037,function, +8186,assert_rank_v2,tensorflow/tensorflow/python/ops/check_ops.py,1093,function,"Assert that `x` has rank equal to `rank`. This Op checks that the rank of `x` is equal to `rank`. @@ -62340,7 +70112,7 @@ Raises: InvalidArgumentError: if the check can be performed immediately and `x` does not have rank `rank`. The check can be performed immediately during eager execution or if the shape of `x` is statically known." -8348,assert_rank,tensorflow/tensorflow/python/ops/check_ops.py,1127,function,"Assert `x` has rank equal to `rank`. +8187,assert_rank,tensorflow/tensorflow/python/ops/check_ops.py,1127,function,"Assert `x` has rank equal to `rank`. Example of adding a dependency to an operation: @@ -62364,7 +70136,7 @@ Returns: Raises: ValueError: If static checks determine `x` has wrong rank." -8349,assert_rank_at_least_v2,tensorflow/tensorflow/python/ops/check_ops.py,1190,function,"Assert that `x` has rank of at least `rank`. +8188,assert_rank_at_least_v2,tensorflow/tensorflow/python/ops/check_ops.py,1190,function,"Assert that `x` has rank of at least `rank`. This Op checks that the rank of `x` is greater or equal to `rank`. @@ -62391,7 +70163,7 @@ Raises: InvalidArgumentError: `x` does not have rank at least `rank`, but the rank cannot be statically determined. ValueError: If static checks determine `x` has mismatched rank." -8350,assert_rank_at_least,tensorflow/tensorflow/python/ops/check_ops.py,1225,function,"Assert `x` has rank equal to `rank` or higher. +8189,assert_rank_at_least,tensorflow/tensorflow/python/ops/check_ops.py,1225,function,"Assert `x` has rank equal to `rank` or higher. Example of adding a dependency to an operation: @@ -62416,28 +70188,7 @@ Returns: Raises: ValueError: If static checks determine `x` has wrong rank." -8351,_static_rank_in,tensorflow/tensorflow/python/ops/check_ops.py,1289,function, -8352,_dynamic_rank_in,tensorflow/tensorflow/python/ops/check_ops.py,1293,function, -8353,_assert_ranks_condition,tensorflow/tensorflow/python/ops/check_ops.py,1303,function,"Assert `x` has a rank that satisfies a given condition. - -Args: - x: Numeric `Tensor`. - ranks: Scalar `Tensor`. - static_condition: A python function that takes - `[actual_rank, given_ranks]` and returns `True` if the condition is - satisfied, `False` otherwise. - dynamic_condition: An `op` that takes [actual_rank, given_ranks] - and return `True` if the condition is satisfied, `False` otherwise. - data: The tensors to print out if the condition is false. Defaults to - error message and first few entries of `x`. - summarize: Print this many entries of each tensor. - -Returns: - Op raising `InvalidArgumentError` if `x` fails dynamic_condition. - -Raises: - ValueError: If static checks determine `x` fails static_condition." -8354,assert_rank_in_v2,tensorflow/tensorflow/python/ops/check_ops.py,1357,function,"Assert that `x` has a rank in `ranks`. +8190,assert_rank_in_v2,tensorflow/tensorflow/python/ops/check_ops.py,1357,function,"Assert that `x` has a rank in `ranks`. This Op checks that the rank of `x` is in `ranks`. @@ -62463,7 +70214,7 @@ Raises: InvalidArgumentError: `x` does not have rank in `ranks`, but the rank cannot be statically determined. ValueError: If static checks determine `x` has mismatched rank." -8355,assert_rank_in,tensorflow/tensorflow/python/ops/check_ops.py,1391,function,"Assert `x` has rank in `ranks`. +8191,assert_rank_in,tensorflow/tensorflow/python/ops/check_ops.py,1391,function,"Assert `x` has rank in `ranks`. Example of adding a dependency to an operation: @@ -62488,7 +70239,7 @@ Returns: Raises: ValueError: If static checks determine `x` has mismatched rank." -8356,assert_integer_v2,tensorflow/tensorflow/python/ops/check_ops.py,1454,function,"Assert that `x` is of integer dtype. +8192,assert_integer_v2,tensorflow/tensorflow/python/ops/check_ops.py,1454,function,"Assert that `x` is of integer dtype. If `x` has a non-integer type, `message`, as well as the dtype of `x` are printed, and `InvalidArgumentError` is raised. @@ -62502,7 +70253,7 @@ Args: Raises: TypeError: If `x.dtype` is not a non-quantized integer type." -8357,assert_integer,tensorflow/tensorflow/python/ops/check_ops.py,1476,function,"Assert that `x` is of integer dtype. +8193,assert_integer,tensorflow/tensorflow/python/ops/check_ops.py,1476,function,"Assert that `x` is of integer dtype. Example of adding a dependency to an operation: @@ -62521,7 +70272,7 @@ Raises: Returns: A `no_op` that does nothing. Type can be determined statically." -8358,assert_type_v2,tensorflow/tensorflow/python/ops/check_ops.py,1515,function,"Asserts that the given `Tensor` is of the specified type. +8194,assert_type_v2,tensorflow/tensorflow/python/ops/check_ops.py,1515,function,"Asserts that the given `Tensor` is of the specified type. This can always be checked statically, so this method returns nothing. @@ -62534,7 +70285,7 @@ Args: Raises: TypeError: If the tensor's data type doesn't match `tf_type`." -8359,assert_type,tensorflow/tensorflow/python/ops/check_ops.py,1536,function,"Statically asserts that the given `Tensor` is of the specified type. +8195,assert_type,tensorflow/tensorflow/python/ops/check_ops.py,1536,function,"Statically asserts that the given `Tensor` is of the specified type. Args: tensor: A `Tensor` or `SparseTensor`. @@ -62548,22 +70299,7 @@ Raises: Returns: A `no_op` that does nothing. Type can be determined statically." -8360,_dimension_sizes,tensorflow/tensorflow/python/ops/check_ops.py,1567,function,"Gets the dimension sizes of a tensor `x`. - -If a size can be determined statically it is returned as an integer, -otherwise as a tensor. - -If `x` is a scalar it is treated as rank 1 size 1. - -Args: - x: A `Tensor`. - -Returns: - Dimension sizes." -8361,_symbolic_dimension_sizes,tensorflow/tensorflow/python/ops/check_ops.py,1598,function, -8362,_has_known_value,tensorflow/tensorflow/python/ops/check_ops.py,1606,function, -8363,_is_symbol_for_any_size,tensorflow/tensorflow/python/ops/check_ops.py,1616,function, -8364,assert_shapes_v2,tensorflow/tensorflow/python/ops/check_ops.py,1627,function,"Assert tensor shapes and dimension size relationships between tensors. +8196,assert_shapes_v2,tensorflow/tensorflow/python/ops/check_ops.py,1627,function,"Assert tensor shapes and dimension size relationships between tensors. This Op checks that a collection of tensors shape relationships satisfies given constraints. @@ -62621,7 +70357,7 @@ Args: Raises: ValueError: If static checks determine any shape constraint is violated." -8365,assert_shapes,tensorflow/tensorflow/python/ops/check_ops.py,1694,function,"Assert tensor shapes and dimension size relationships between tensors. +8197,assert_shapes,tensorflow/tensorflow/python/ops/check_ops.py,1694,function,"Assert tensor shapes and dimension size relationships between tensors. This Op checks that a collection of tensors shape relationships satisfies given constraints. @@ -62707,8 +70443,7 @@ Returns: Raises: ValueError: If static checks determine any shape constraint is violated." -8366,_get_diff_for_monotonic_comparison,tensorflow/tensorflow/python/ops/check_ops.py,1949,function,Gets the difference x[1:] - x[:-1]. -8367,is_numeric_tensor,tensorflow/tensorflow/python/ops/check_ops.py,1969,function,"Returns `True` if the elements of `tensor` are numbers. +8198,is_numeric_tensor,tensorflow/tensorflow/python/ops/check_ops.py,1969,function,"Returns `True` if the elements of `tensor` are numbers. Specifically, returns `True` if the dtype of `tensor` is one of the following: @@ -62726,7 +70461,7 @@ Specifically, returns `True` if the dtype of `tensor` is one of the following: Returns `False` if `tensor` is of a non-numeric type or if `tensor` is not a `tf.Tensor` object." -8368,is_non_decreasing,tensorflow/tensorflow/python/ops/check_ops.py,2001,function,"Returns `True` if `x` is non-decreasing. +8199,is_non_decreasing,tensorflow/tensorflow/python/ops/check_ops.py,2001,function,"Returns `True` if `x` is non-decreasing. Elements of `x` are compared in row-major order. The tensor `[x[0],...]` is non-decreasing if for every adjacent pair we have `x[i] <= x[i+1]`. @@ -62750,7 +70485,7 @@ Returns: Raises: TypeError: if `x` is not a numeric tensor." -8369,is_strictly_increasing,tensorflow/tensorflow/python/ops/check_ops.py,2043,function,"Returns `True` if `x` is strictly increasing. +8200,is_strictly_increasing,tensorflow/tensorflow/python/ops/check_ops.py,2043,function,"Returns `True` if `x` is strictly increasing. Elements of `x` are compared in row-major order. The tensor `[x[0],...]` is strictly increasing if for every adjacent pair we have `x[i] < x[i+1]`. @@ -62775,21 +70510,7 @@ Returns: Raises: TypeError: if `x` is not a numeric tensor." -8370,_assert_same_base_type,tensorflow/tensorflow/python/ops/check_ops.py,2077,function,"Asserts all items are of the same base type. - -Args: - items: List of graph items (e.g., `Variable`, `Tensor`, `SparseTensor`, - `Operation`, or `IndexedSlices`). Can include `None` elements, which - will be ignored. - expected_type: Expected type. If not specified, assert all items are - of the same base type. - -Returns: - Validated type, or none if neither expected_type nor items provided. - -Raises: - ValueError: If any types do not match." -8371,assert_same_float_dtype,tensorflow/tensorflow/python/ops/check_ops.py,2129,function,"Validate and return float type based on `tensors` and `dtype`. +8201,assert_same_float_dtype,tensorflow/tensorflow/python/ops/check_ops.py,2129,function,"Validate and return float type based on `tensors` and `dtype`. For ops such as matrix multiplication, inputs and weights must be of the same float type. This function validates that all `tensors` are the same type, @@ -62808,7 +70529,7 @@ Returns: Raises: ValueError: if neither `tensors` nor `dtype` is supplied, or result is not float, or the common type of the inputs is not a floating point type." -8372,assert_scalar_v2,tensorflow/tensorflow/python/ops/check_ops.py,2161,function,"Asserts that the given `tensor` is a scalar. +8202,assert_scalar_v2,tensorflow/tensorflow/python/ops/check_ops.py,2161,function,"Asserts that the given `tensor` is a scalar. This function raises `ValueError` unless it can be certain that the given `tensor` is a scalar. `ValueError` is also raised if the shape of `tensor` is @@ -62824,7 +70545,7 @@ Args: Raises: ValueError: If the tensor is not scalar (rank 0), or if its shape is unknown." -8373,assert_scalar,tensorflow/tensorflow/python/ops/check_ops.py,2185,function,"Asserts that the given `tensor` is a scalar (i.e. zero-dimensional). +8203,assert_scalar,tensorflow/tensorflow/python/ops/check_ops.py,2185,function,"Asserts that the given `tensor` is a scalar (i.e. zero-dimensional). This function raises `ValueError` unless it can be certain that the given `tensor` is a scalar. `ValueError` is also raised if the shape of `tensor` is @@ -62841,7 +70562,7 @@ Returns: Raises: ValueError: If the tensor is not scalar (rank 0), or if its shape is unknown." -8374,ensure_shape,tensorflow/tensorflow/python/ops/check_ops.py,2219,function,"Updates the shape of a tensor and checks at runtime that the shape holds. +8204,ensure_shape,tensorflow/tensorflow/python/ops/check_ops.py,2219,function,"Updates the shape of a tensor and checks at runtime that the shape holds. For example: @@ -62953,8 +70674,7 @@ Returns: Raises: tf.errors.InvalidArgumentError: If `shape` is incompatible with the shape of `x`." -8375,_ensure_shape_grad,tensorflow/tensorflow/python/ops/check_ops.py,2340,function, -8376,clip_by_value,tensorflow/tensorflow/python/ops/clip_ops.py,38,function,"Clips tensor values to a specified min and max. +8205,clip_by_value,tensorflow/tensorflow/python/ops/clip_ops.py,38,function,"Clips tensor values to a specified min and max. Given a tensor `t`, this operation returns a tensor of the same type and shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`. @@ -63018,8 +70738,7 @@ Raises: broadcasting that would make the returned tensor larger than the input. TypeError: If dtype of the input is `int32` and dtype of the `clip_value_min` or `clip_value_max` is `float32`" -8377,_clip_by_value_grad,tensorflow/tensorflow/python/ops/clip_ops.py,130,function,Returns grad of clip_by_value. -8378,clip_by_norm,tensorflow/tensorflow/python/ops/clip_ops.py,156,function,"Clips tensor values to a maximum L2-norm. +8206,clip_by_norm,tensorflow/tensorflow/python/ops/clip_ops.py,156,function,"Clips tensor values to a maximum L2-norm. Given a tensor `t`, and a maximum clip value `clip_norm`, this operation normalizes `t` so that its L2-norm is less than or equal to `clip_norm`, @@ -63076,7 +70795,7 @@ Raises: ValueError: If the clip_norm tensor is not a 0-D scalar tensor. TypeError: If dtype of the input is not a floating point or complex type." -8379,global_norm,tensorflow/tensorflow/python/ops/clip_ops.py,241,function,"Computes the global norm of multiple tensors. +8207,global_norm,tensorflow/tensorflow/python/ops/clip_ops.py,241,function,"Computes the global norm of multiple tensors. Given a tuple or list of tensors `t_list`, this operation returns the global norm of the elements in all tensors in `t_list`. The global norm is @@ -63095,7 +70814,7 @@ Returns: Raises: TypeError: If `t_list` is not a sequence." -8380,clip_by_global_norm,tensorflow/tensorflow/python/ops/clip_ops.py,291,function,"Clips values of multiple tensors by the ratio of the sum of their norms. +8208,clip_by_global_norm,tensorflow/tensorflow/python/ops/clip_ops.py,291,function,"Clips values of multiple tensors by the ratio of the sum of their norms. Given a tuple or list of tensors `t_list`, and a clipping ratio `clip_norm`, this operation returns a list of clipped tensors `list_clipped` @@ -63142,7 +70861,7 @@ References: On the difficulty of training Recurrent Neural Networks: [Pascanu et al., 2012](http://proceedings.mlr.press/v28/pascanu13.html) ([pdf](http://proceedings.mlr.press/v28/pascanu13.pdf))" -8381,clip_by_average_norm,tensorflow/tensorflow/python/ops/clip_ops.py,389,function,"Clips tensor values to a maximum average L2-norm. +8209,clip_by_average_norm,tensorflow/tensorflow/python/ops/clip_ops.py,389,function,"Clips tensor values to a maximum average L2-norm. Given a tensor `t`, and a maximum clip value `clip_norm`, this operation normalizes `t` so that its average L2-norm is less than or equal to @@ -63165,33 +70884,32 @@ Args: Returns: A clipped `Tensor`." -8382,ClipOpsTest,tensorflow/tensorflow/python/ops/clip_ops_test.py,31,class, -8383,KMeans,tensorflow/tensorflow/python/ops/clustering_ops.py,56,class,Creates the graph for k-means clustering. -8384,_InitializeClustersOpFactory,tensorflow/tensorflow/python/ops/clustering_ops.py,538,class,"Internal class to create the op to initialize the clusters. +8210,KMeans,tensorflow/tensorflow/python/ops/clustering_ops.py,56,class,Creates the graph for k-means clustering. +8211,training_graph,tensorflow/tensorflow/python/ops/clustering_ops.py,327,method,"Generate a training graph for kmeans algorithm. -The op performs this algorithm (see constructor args): +This returns, among other things, an op that chooses initial centers +(init_op), a boolean variable that is set to True when the initial centers +are chosen (cluster_centers_initialized), and an op to perform either an +entire Lloyd iteration or a mini-batch of a Lloyd iteration (training_op). +The caller should use these components as follows. A single worker should +execute init_op multiple times until cluster_centers_initialized becomes +True. Then multiple workers may execute training_op any number of times. -num_remaining = num_clusters - length(cluster_centers) -if num_remaining == 0: - assert that cluster_centers_initialized is true -else: - assert that num_remaining > 0 - new_centers = choose up to num_remaining initial centers - l2-normalize new_centers if using cosine distance - all_centers = concat(cluster_centers, new_centers) - cluster_centers := all_centers - if there is a cluster_centers_updated variable: - cluster_centers_updated := cluster_centers - num_now_remaining = num_clusters - length(cluster_centers) - if num_now_remaining == 0: - cluster_centers_initialized := true" -8385,KmeansPlusPlusInitializationTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,29,class, -8386,KMC2InitializationTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,60,class, -8387,KMC2InitializationLargeTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,80,class, -8388,KMC2InitializationCornercaseTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,103,class, -8389,NearestCentersTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,121,class, -8390,NearestCentersLargeTest,tensorflow/tensorflow/python/ops/clustering_ops_test.py,152,class, -8391,all_reduce,tensorflow/tensorflow/python/ops/collective_ops.py,23,function,"Reduces tensors collectively, across devices. +Returns: + A tuple consisting of: + all_scores: A matrix (or list of matrices) of dimensions (num_input, + num_clusters) where the value is the distance of an input vector and a + cluster center. + cluster_idx: A vector (or list of vectors). Each element in the vector + corresponds to an input row in 'inp' and specifies the cluster id + corresponding to the input. + scores: Similar to cluster_idx but specifies the distance to the + assigned cluster instead. + cluster_centers_initialized: scalar indicating whether clusters have been + initialized. + init_op: an op to initialize the clusters. + training_op: an op that runs an iteration of training." +8212,all_reduce,tensorflow/tensorflow/python/ops/collective_ops.py,23,function,"Reduces tensors collectively, across devices. Args: t: the tensor to be reduced. @@ -63218,7 +70936,7 @@ Returns: Raises: ValueError: if any of the input parameter constraints are not met." -8392,all_gather,tensorflow/tensorflow/python/ops/collective_ops.py,74,function,"Accumulates tensors collectively, across devices, along first dimension. +8213,all_gather,tensorflow/tensorflow/python/ops/collective_ops.py,74,function,"Accumulates tensors collectively, across devices, along first dimension. Args: t: the tensor to participate in the accumulation. @@ -63238,7 +70956,7 @@ Returns: Raises: ValueError: if any of the input parameter constraints are not met." -8393,broadcast_send,tensorflow/tensorflow/python/ops/collective_ops.py,113,function,"Broadcasts one tensor to a group of others, across devices. +8214,broadcast_send,tensorflow/tensorflow/python/ops/collective_ops.py,113,function,"Broadcasts one tensor to a group of others, across devices. Args: t: the tensor to be sent. @@ -63271,7 +70989,7 @@ carry forward from there. Including the same declarations on the send side clarifies a commitment already made. Secondly, having nearly identical use syntax for send and receive sides may simplify tool-driven generation of broadcast." -8394,broadcast_recv,tensorflow/tensorflow/python/ops/collective_ops.py,174,function,"Receives a broadcasts tensor, across devices. +8215,broadcast_recv,tensorflow/tensorflow/python/ops/collective_ops.py,174,function,"Receives a broadcasts tensor, across devices. Args: shape: Shape of the tensor to be received. @@ -63293,11 +71011,9 @@ Returns: Raises: ValueError: if any of the input parameter constraints are not met." -8395,CollectiveOpBenchmark,tensorflow/tensorflow/python/ops/collective_ops_benchmark.py,33,class,Benchmarks for local CPU collective op execution. -8396,CollectiveOpGPUTest,tensorflow/tensorflow/python/ops/collective_ops_gpu_test.py,37,class, -8397,CollectiveOpTest,tensorflow/tensorflow/python/ops/collective_ops_test.py,46,class, -8398,CollectiveOpXlaTest,tensorflow/tensorflow/python/ops/collective_ops_xla_test.py,31,class, -8399,build_graph,tensorflow/tensorflow/python/ops/concat_benchmark.py,35,function,"Build a graph containing a sequence of concat operations. +8216,CollectiveOpBenchmark,tensorflow/tensorflow/python/ops/collective_ops_benchmark.py,33,class,Benchmarks for local CPU collective op execution. +8217,benchmark_collective,tensorflow/tensorflow/python/ops/collective_ops_benchmark.py,36,method,Measures the performance of local CPU collective execution. +8218,build_graph,tensorflow/tensorflow/python/ops/concat_benchmark.py,35,function,"Build a graph containing a sequence of concat operations. Args: device: string, the device to run on. @@ -63309,31 +71025,10 @@ Args: Returns: An array of tensors to run()" -8400,ConcatBenchmark,tensorflow/tensorflow/python/ops/concat_benchmark.py,78,class,Benchmark concat. -8401,cond_v2,tensorflow/tensorflow/python/ops/cond_v2.py,59,function,"Like tf.cond, except emits a single If op." -8402,_IfGrad,tensorflow/tensorflow/python/ops/cond_v2.py,107,function,The gradient of an If op produced by cond_v2. -8403,_build_cond,tensorflow/tensorflow/python/ops/cond_v2.py,192,function,"Creates an If op from the specified predicate, branch functions and inputs. - -Note that this modifies true_graph and false_graph to make the inputs match, -and to output all intermediates values so they're available for the gradient -computation. - -true_graph and false_graph need not have the same input types, but they must -have the same outpute types. - -Args: - pred: boolean Tensor - true_graph: FuncGraph - false_graph: FuncGraph - true_inputs: a list of Tensors to be passed to true_graph as input. - false_inputs: a list of Tensors to be passed to false_graph as input. - building_gradient: Whether this is a gradient If op. - name: the name for the If op. - -Returns: - A list of Tensors which are the outputs of the If op. Does not include added - intermediate outputs." -8404,get_func_graphs,tensorflow/tensorflow/python/ops/cond_v2.py,301,function,"Returns `FuncGraph`s for the input op branches. +8219,ConcatBenchmark,tensorflow/tensorflow/python/ops/concat_benchmark.py,78,class,Benchmark concat. +8220,benchmark_concat,tensorflow/tensorflow/python/ops/concat_benchmark.py,132,method, +8221,cond_v2,tensorflow/tensorflow/python/ops/cond_v2.py,59,function,"Like tf.cond, except emits a single If op." +8222,get_func_graphs,tensorflow/tensorflow/python/ops/cond_v2.py,301,function,"Returns `FuncGraph`s for the input op branches. Args: op: The If or Case Operation. @@ -63341,160 +71036,9 @@ Args: Returns: A tuple of the `FuncGraph`s of the then_branch and else_branch (all branches for Case)." -8405,_grad_fn,tensorflow/tensorflow/python/ops/cond_v2.py,341,function,"The gradient function for each conditional branch. - -This function builds the gradient graph of the corresponding forward-pass -conditional branch in `func_graph`. This is done by differentiating -func_graph's outputs w.r.t. its inputs. - -Args: - func_graph: FuncGraph. The corresponding forward-pass function. - grads: The list of input gradient Tensors. - -Returns: - The output gradient Tensors." -8406,_create_grad_func,tensorflow/tensorflow/python/ops/cond_v2.py,379,function,Returns the FuncGraph representation of _grad_fn. -8407,_resolve_grad_inputs,tensorflow/tensorflow/python/ops/cond_v2.py,387,function,"Returns the tensors to pass as inputs to `grad_graph`. - -The `grad_graph` may have external references to -1. Its outer graph containing the input gradients. These references are kept - as is. -2. Tensors in the forward pass graph. These tensors may not be ""live"" - when the gradient is being computed. We replace such references by their - corresponding tensor in `cond_graph.outer_graph`. In the case of nested - control flow or functions, the gradient logic handling - `grad_graph.outer_graph` will make sure the tensor from - `cond_graph.outer_graph` is also correctly captured. - -Args: - cond_graph: FuncGraph. The forward-pass function. - grad_graph: FuncGraph. The gradients function. - -Returns: - A list of inputs tensors to be passed to grad_graph." -8408,_get_intermediates,tensorflow/tensorflow/python/ops/cond_v2.py,439,function,Returns intermediate tensors of `func_graph` for gradient computation. -8409,_make_intermediates_match,tensorflow/tensorflow/python/ops/cond_v2.py,455,function,"Returns new optionals lists that have matching signatures. - -This is done by mirroring each list in the other using none optionals. -There is no merging of like optionals. - -Args: - branch_graphs: `list` of `FuncGraph`. - branch_optionals: `list` of `list`s of optional `Tensor`s from other - branch_graphs - -Returns: - A `list` of `list`s of `Tensor`s for each branch_graph. Each list has the - same number of `Tensor`s, all of which will be optionals of the same - shape/type." -8410,_make_intermediates_match_xla,tensorflow/tensorflow/python/ops/cond_v2.py,482,function,Like _make_intermediates_match but for the XLA case. -8411,_make_inputs_match,tensorflow/tensorflow/python/ops/cond_v2.py,497,function,"Modifies branch_graphs so they have the same input signature. - -This method reorders and/or adds parameters to each graph in branch_graphs so -they have the same input signature, and updates the 'inputs' and 'captured' -fields of each graph accordingly. It uses the input tensors from the outer -graph to avoid duplicating shared arguments. - -Args: - branch_graphs: a `list` of `FuncGraph` - branch_inputs: a `list` of `list`s of `Tensor`s in the outer graph. The - inputs for the corresponding graph in `branch_graphs`. - -Returns: - A new list of Tensors from the outer graph that are the new inputs for each - branch_graph. This is a deduped version of `sum(branch_inputs)`." -8412,_create_zeros_for_none_grads,tensorflow/tensorflow/python/ops/cond_v2.py,542,function,"Creates zeros for None out grads if atleast one branch has non-None grad. - -Args: - forward_graphs: List of forward FuncGraphs. - grad_graphs: List of grad FuncGraphs." -8413,_make_output_composite_tensors_match,tensorflow/tensorflow/python/ops/cond_v2.py,570,function,"Modifies each branch_graph's outputs to have the same output signature. - -Currently the only transformation implemented is turning a Tensor into an -equivalent IndexedSlices if the other branch returns an IndexedSlices. -Updates branch_graph.{outputs,structured_outputs} for each branch_graph in -branch_graphs. - -Args: - op_type: _COND or _CASE - branch_graphs: `list` of `FuncGraph` - -Raises: - TypeError: if a set of outputs cannot be rewritten." -8414,_make_indexed_slices_indices_types_match,tensorflow/tensorflow/python/ops/cond_v2.py,620,function,Match dtype of IndexedSlices.indices in outputs of branch_graphs. -8415,_get_op_and_outputs,tensorflow/tensorflow/python/ops/cond_v2.py,684,function, -8416,_pack_sequence_as,tensorflow/tensorflow/python/ops/cond_v2.py,693,function,"Packs the outputs of the gradient If/Case op. - -The branch functions may contain None's in the list of `structured_outputs`. -`op_outputs` has those outputs missing. So we need to add those Nones to the -list of `op_outputs` and then pack it in the same structure as -`structured_outputs`. - -Args: - structured_outputs: structured_outputs from one of the branch functions. - op_outputs: List of output tensors of the op. - -Returns: - `op_outputs` packed like `structured_outputs`." -8417,_wrap_intermediates,tensorflow/tensorflow/python/ops/cond_v2.py,720,function, -8418,_create_dummy_input,tensorflow/tensorflow/python/ops/cond_v2.py,725,function,"Creates tensors in func_graph to represent template_tensors. - -Args: - func_graph: FuncGraph. - template_tensor: a tensor in the outer graph. - -Returns: - A tensor in func_graph." -8419,_create_none_optionals,tensorflow/tensorflow/python/ops/cond_v2.py,740,function,"Creates `n` `None` optionals in func_graph. - -Args: - func_graph: FuncGraph. - n: `int` the number of `None` optionals to make. - -Returns: - A list of tensors in func_graph." -8420,_create_fakeparams,tensorflow/tensorflow/python/ops/cond_v2.py,754,function,Create FakeParams for the XLA case. -8421,_check_same_outputs,tensorflow/tensorflow/python/ops/cond_v2.py,761,function,Raises an error if `graphs` have different outputs. -8422,_get_output_shapes,tensorflow/tensorflow/python/ops/cond_v2.py,805,function, -8423,verify_captures,tensorflow/tensorflow/python/ops/cond_v2.py,815,function,Verify that a branch's tensor is not accessed in another branch fn. -8424,_CondGradFuncGraph,tensorflow/tensorflow/python/ops/cond_v2.py,834,class,"FuncGraph for the gradient function of the branch of an If op. - -Handles wrapping and unwrapping intermediate values that are captured by the -gradient computation in optionals. - -Attributes: - op_needs_rewrite: True if any intermediates were captured, meaning the - forward If op needs to be written to output the wrapped intermediates." -8425,indexed_case,tensorflow/tensorflow/python/ops/cond_v2.py,946,function,"Like conv_v2, except emits a Case op instead of an If." -8426,_CaseGrad,tensorflow/tensorflow/python/ops/cond_v2.py,988,function,The gradient of a Case op produced by tf.switch_case. -8427,_build_case,tensorflow/tensorflow/python/ops/cond_v2.py,1081,function,"Creates an `Case` op from `branch_index`, branch graphs and inputs. - -Note that this modifies `branch_graphs` to make the inputs match, and to -output all intermediates values so they're available for the gradient -computation. - -`branch_graphs` need not have the same input types, but they must -have the same outpute types. - -Args: - branch_index: integer Tensor - branch_graphs: List of FuncGraph - branch_inputs: List of lists of Tensors to be passed to corresponding - branch_graph as input. - name: the name for the Case op. - lower_using_switch_merge: Lower this op using switch merge ops (optional). - -Returns: - A list of Tensors which are the outputs of the Case op. Does not include - added intermediate outputs." -8428,_set_read_only_resource_inputs_attr,tensorflow/tensorflow/python/ops/cond_v2.py,1146,function,"Sets the list of resource inputs which are read-only. - -This is used by AutomaticControlDependencies. - -Args: - op: If or Case Operation. - branch_graphs: List of branch FuncGraphs." -8429,remove_squeezable_dimensions,tensorflow/tensorflow/python/ops/confusion_matrix.py,34,function,"Squeeze last dim if ranks differ from expected by exactly 1. +8223,verify_captures,tensorflow/tensorflow/python/ops/cond_v2.py,815,function,Verify that a branch's tensor is not accessed in another branch fn. +8224,indexed_case,tensorflow/tensorflow/python/ops/cond_v2.py,946,function,"Like conv_v2, except emits a Case op instead of an If." +8225,remove_squeezable_dimensions,tensorflow/tensorflow/python/ops/confusion_matrix.py,34,function,"Squeeze last dim if ranks differ from expected by exactly 1. In the common case where we expect shapes to match, `expected_rank_diff` defaults to 0, and we squeeze the last dimension of the larger rank if they @@ -63517,7 +71061,7 @@ Args: Returns: Tuple of `labels` and `predictions`, possibly with last dim squeezed." -8430,confusion_matrix,tensorflow/tensorflow/python/ops/confusion_matrix.py,98,function,"Computes the confusion matrix from predictions and labels. +8226,confusion_matrix,tensorflow/tensorflow/python/ops/confusion_matrix.py,98,function,"Computes the confusion matrix from predictions and labels. The matrix columns represent the prediction labels and the rows represent the real labels. The confusion matrix is always a 2-D array of shape `[n, n]`, @@ -63566,7 +71110,7 @@ Raises: ValueError: If both predictions and labels are not 1-D vectors and have mismatched shapes, or if `weights` is not `None` and its shape doesn't match `predictions`." -8431,confusion_matrix_v1,tensorflow/tensorflow/python/ops/confusion_matrix.py,209,function,"Computes the confusion matrix from predictions and labels. +8227,confusion_matrix_v1,tensorflow/tensorflow/python/ops/confusion_matrix.py,209,function,"Computes the confusion matrix from predictions and labels. The matrix columns represent the prediction labels and the rows represent the real labels. The confusion matrix is always a 2-D array of shape `[n, n]`, @@ -63615,30 +71159,7 @@ Raises: ValueError: If both predictions and labels are not 1-D vectors and have mismatched shapes, or if `weights` is not `None` and its shape doesn't match `predictions`." -8432,_SwitchGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,35,function,"Gradients for a Switch op is calculated using a Merge op. - -If the switch is a loop switch, it will be visited twice. We create -the merge on the first visit, and update the other input of the merge -on the second visit. A next_iteration is also added on second visit." -8433,_MergeGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,96,function,Gradients for a Merge op are calculated using a Switch op. -8434,_RefMergeGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,142,function, -8435,_ExitGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,147,function,Gradients for an exit op are calculated using an Enter op. -8436,_NextIterationGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,189,function,"A forward next_iteration is translated into a backprop identity. - -Note that the backprop next_iteration is added in switch grad." -8437,_RefNextIterationGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,198,function, -8438,_EnterGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,203,function,"Gradients for an Enter are calculated using an Exit op. - -For loop variables, grad is the gradient so just add an exit. -For loop invariants, we need to add an accumulator loop." -8439,_RefEnterGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,238,function, -8440,_LoopCondGrad,tensorflow/tensorflow/python/ops/control_flow_grad.py,243,function,Stop backprop for the predicate of a while loop. -8441,_summarize_eager,tensorflow/tensorflow/python/ops/control_flow_ops.py,80,function,"Returns a summarized string representation of eager `tensor`. - -Args: - tensor: EagerTensor to summarize - summarize: Include these many first elements of `array`" -8442,Assert,tensorflow/tensorflow/python/ops/control_flow_ops.py,117,function,"Asserts that the given condition is true. +8228,Assert,tensorflow/tensorflow/python/ops/control_flow_ops.py,117,function,"Asserts that the given condition is true. If `condition` evaluates to false, print the list of tensors in `data`. `summarize` determines how many entries of the tensors to print. @@ -63669,34 +71190,7 @@ with tf.control_dependencies([assert_op]): ``` @end_compatibility" -8443,_Identity,tensorflow/tensorflow/python/ops/control_flow_ops.py,181,function,"Return a tensor with the same shape and contents as the input tensor. - -Args: - data: A Tensor. - name: A name for this operation (optional). - -Returns: - A Tensor with the same type and value as the input Tensor." -8444,_NextIteration,tensorflow/tensorflow/python/ops/control_flow_ops.py,203,function, -8445,_Enter,tensorflow/tensorflow/python/ops/control_flow_ops.py,216,function,"Creates or finds a child frame, and makes `data` available to it. - -The unique `frame_name` is used by the `Executor` to identify frames. If -`is_constant` is true, `data` is a constant in the child frame; otherwise -it may be changed in the child frame. At most `parallel_iterations` -iterations are run in parallel in the child frame. - -Args: - data: The tensor to be made available to the child frame. - frame_name: The name of the child frame. - is_constant: If true, the output is constant within the child frame. - parallel_iterations: The number of iterations allowed to run in parallel. - use_ref: If true, use ref_enter if data is of ref type. - use_input_shape: If true, set the result's shape based on data's shape. - name: A name for this operation (optional). - -Returns: - The same tensor as `data`." -8446,exit,tensorflow/tensorflow/python/ops/control_flow_ops.py,264,function,"Exits the current frame to its parent frame. +8229,exit,tensorflow/tensorflow/python/ops/control_flow_ops.py,264,function,"Exits the current frame to its parent frame. Exit makes its input `data` available to the parent frame. @@ -63706,7 +71200,7 @@ Args: Returns: The same tensor as `data`." -8447,switch,tensorflow/tensorflow/python/ops/control_flow_ops.py,288,function,"Forwards `data` to an output determined by `pred`. +8230,switch,tensorflow/tensorflow/python/ops/control_flow_ops.py,288,function,"Forwards `data` to an output determined by `pred`. If `pred` is false, the `data` input is forwarded to the first output. Otherwise, the data goes to the second output. @@ -63723,25 +71217,7 @@ Args: Returns: `(output_false, output_true)`: If `pred` is true, data will be forwarded to `output_true`, otherwise it goes to `output_false`." -8448,_SwitchRefOrTensor,tensorflow/tensorflow/python/ops/control_flow_ops.py,323,function,"Forwards `data` to an output determined by `pred`. - -If `pred` is false, the `data` input is forwarded to the first output. -Otherwise, the data goes to the second output. - -This op handles `Tensor`s and `IndexedSlices`. - -Args: - data: The tensor to be forwarded to the appropriate output. - pred: A scalar that specifies which output port will receive data. - name: A name for this operation (optional). - -Returns: - `(output_false, output_true)`: If `pred` is true, data will be forwarded to - `output_true`, otherwise it goes to `output_false`. - -Raises: - TypeError: if data is not a Tensor or IndexedSlices" -8449,merge,tensorflow/tensorflow/python/ops/control_flow_ops.py,367,function,"Returns the value of an available element of `inputs`. +8231,merge,tensorflow/tensorflow/python/ops/control_flow_ops.py,367,function,"Returns the value of an available element of `inputs`. This op tests each of the tensors in `inputs` in turn to determine if any of them is available. If it finds an available tensor, it returns it and its @@ -63764,52 +71240,7 @@ Returns: Raises: ValueError: If any of the inputs is None, or inputs are IndexedSlices and some but not all have a dense_shape property." -8450,_convert_tensorarray_to_flow,tensorflow/tensorflow/python/ops/control_flow_ops.py,432,function, -8451,_convert_flows_to_tensorarrays,tensorflow/tensorflow/python/ops/control_flow_ops.py,439,function, -8452,_ShapeLessThanOrEqual,tensorflow/tensorflow/python/ops/control_flow_ops.py,451,function, -8453,_get_shape_invariant,tensorflow/tensorflow/python/ops/control_flow_ops.py,462,function,"Returns shape invariant(s) for the given variable. - -Args: - var: The tensor whose shape is described. - shape: The shape invariant for the tensor. If not specified, then a default - shape invariant for `var` is returned. - -Returns: - `TensorShape` or `list` of `TensorShape`: The shape invariant for `var` (if - it is a `Tensor`), or the shape invariants for the components that comprise - `var` (if it is a `CompositeTensor`)." -8454,_shape_invariant_to_type_spec,tensorflow/tensorflow/python/ops/control_flow_ops.py,497,function,"Converts a shape invariant to a TypeSpec. - -Args: - var: The tensor whose shape is described by the shape invariant. - shape: A `TypeSpec` or `TensorShape`. If `shape` is already a `TypeSpec`, - then it is simply returned as-is. - -Returns: - A `TypeSpec` for `var`, consistent with the given shape." -8455,_SetShapeInvariants,tensorflow/tensorflow/python/ops/control_flow_ops.py,535,function,"Set the shapes of the tensors in `enter_vars` to `shapes`. - -Args: - input_vars: A list of tensors that are inputs to `enter_vars`. - enter_vars: A list of tensors whose shapes will be set. - shapes: A (possibly nested) list of shapes. - -Raises: - ValueError: If any tensor in `enter_vars` has a less specific shape - than its corresponding shape in `shapes`." -8456,_EnforceShapeInvariant,tensorflow/tensorflow/python/ops/control_flow_ops.py,567,function,"Check if the shapes of the loops variables are invariants. - -Args: - merge_var: The list of tensors representing the initial values of the loop - variables. - next_var: The list of tensors representing the values of the loop variables - after one loop iteration. - -Raises: - ValueError: If any tensor in `merge_var` has a more specific shape than - its corresponding tensor in `next_var`." -8457,_AddNextAndBackEdge,tensorflow/tensorflow/python/ops/control_flow_ops.py,596,function,Add NextIteration and back edge from v to m. -8458,ControlFlowContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,624,class,"The base class for control flow context. +8232,ControlFlowContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,624,class,"The base class for control flow context. The usage pattern is a sequence of (Enter, Exit) followed by a final ExitResult. @@ -63824,9 +71255,49 @@ construction: context is created. Set at the time a context is created. Immutable. 4. A ControlFlowContext has _context_stack. Pushed and popped by ctxt.Enter() and ctxt.Exit()" -8459,CondContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,813,class,The context for the conditional construct. -8460,_UnpackIfSingleton,tensorflow/tensorflow/python/ops/control_flow_ops.py,1091,function, -8461,cond,tensorflow/tensorflow/python/ops/control_flow_ops.py,1105,function,"Return `true_fn()` if the predicate `pred` is true else `false_fn()`. +8233,name,tensorflow/tensorflow/python/ops/control_flow_ops.py,685,method, +8234,outer_context,tensorflow/tensorflow/python/ops/control_flow_ops.py,689,method,Return the context containing this context. +8235,grad_state,tensorflow/tensorflow/python/ops/control_flow_ops.py,694,method, +8236,back_prop,tensorflow/tensorflow/python/ops/control_flow_ops.py,698,method, +8237,to_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,702,method,"Serializes this into `context_def`. + +Args: + context_def: a `ControlFlowContextDef` protocol buffer. + export_scope: Optional `string`. Name scope to remove." +8238,AddName,tensorflow/tensorflow/python/ops/control_flow_ops.py,728,method, +8239,Enter,tensorflow/tensorflow/python/ops/control_flow_ops.py,732,method,Enter this control flow context. +8240,Exit,tensorflow/tensorflow/python/ops/control_flow_ops.py,738,method,Exit this control flow context. +8241,EnterGradientColocation,tensorflow/tensorflow/python/ops/control_flow_ops.py,744,method,Start building a gradient colocated with an op. +8242,ExitGradientColocation,tensorflow/tensorflow/python/ops/control_flow_ops.py,749,method,Start building a gradient colocated with an op. +8243,ExitResult,tensorflow/tensorflow/python/ops/control_flow_ops.py,754,method,Make a list of tensors available in the outer context. +8244,GetWhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,762,method,Return the while context containing this context. +8245,AddInnerOp,tensorflow/tensorflow/python/ops/control_flow_ops.py,791,method,Notifies a scope about an operator added to an inner scope. +8246,GetControlPivot,tensorflow/tensorflow/python/ops/control_flow_ops.py,796,method,"Returns the pivot node for this context, or None." +8247,IsWhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,800,method, +8248,IsCondContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,803,method, +8249,IsXLAContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,806,method, +8250,fn,tensorflow/tensorflow/python/ops/control_flow_ops.py,757,method, +8251,CondContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,813,class,The context for the conditional construct. +8252,pred,tensorflow/tensorflow/python/ops/control_flow_ops.py,873,method, +8253,pivot,tensorflow/tensorflow/python/ops/control_flow_ops.py,877,method, +8254,branch,tensorflow/tensorflow/python/ops/control_flow_ops.py,881,method, +8255,grad_state,tensorflow/tensorflow/python/ops/control_flow_ops.py,885,method, +8256,back_prop,tensorflow/tensorflow/python/ops/control_flow_ops.py,891,method, +8257,GetControlPivot,tensorflow/tensorflow/python/ops/control_flow_ops.py,896,method, +8258,to_proto,tensorflow/tensorflow/python/ops/control_flow_ops.py,899,method,"Converts a `CondContext` to a `CondContextDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `CondContextDef` protocol buffer." +8259,from_proto,tensorflow/tensorflow/python/ops/control_flow_ops.py,927,method,Returns a `CondContext` object created from `context_def`. +8260,to_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,937,method, +8261,AddValue,tensorflow/tensorflow/python/ops/control_flow_ops.py,940,method,Add `val` to the current context and its outer context recursively. +8262,AddOp,tensorflow/tensorflow/python/ops/control_flow_ops.py,976,method, +8263,BuildCondBranch,tensorflow/tensorflow/python/ops/control_flow_ops.py,1063,method,Add the subgraph defined by fn() to the graph. +8264,IsCondContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,1087,method, +8265,cond,tensorflow/tensorflow/python/ops/control_flow_ops.py,1105,function,"Return `true_fn()` if the predicate `pred` is true else `false_fn()`. `true_fn` and `false_fn` both return lists of output tensors. `true_fn` and `false_fn` must have the same non-zero number and type of outputs. @@ -63889,16 +71360,7 @@ r = tf.cond(tf.less(x, y), f1, f2) # r is set to f1(). # Operations in f2 (e.g., tf.add) are not executed. ```" -8462,_cast_indexed_slice_indices,tensorflow/tensorflow/python/ops/control_flow_ops.py,1302,function,"Cast IndexedSlice.indices from int32 to int64 where necessary. - -If `a` and `b` are both IndexedSlices, and their indices have different -dtypes, then cast both their dtypes to `int64` (modifies `a` and `b` -in-place). Otherwise, does nothing. - -Args: - a: A value, which may be an IndexedSlices. - b: A value, which may be an IndexedSlices." -8463,cond_for_tf_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,1326,function,"Return `true_fn()` if the predicate `pred` is true else `false_fn()`. +8266,cond_for_tf_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,1326,function,"Return `true_fn()` if the predicate `pred` is true else `false_fn()`. `true_fn` and `false_fn` both return lists of output tensors. `true_fn` and `false_fn` must have the same non-zero number and type of outputs. @@ -63965,9 +71427,105 @@ r = tf.cond(tf.less(x, y), f1, f2) # r is set to f1(). # Operations in f2 (e.g., tf.add) are not executed. ```" -8464,_resource_safe_shape,tensorflow/tensorflow/python/ops/control_flow_ops.py,1399,function,Returns the shape of t or the variable it points to. -8465,WhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,1411,class,The context for the loop construct. -8466,while_loop_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,2323,function,"Repeat `body` while the condition `cond` is true. +8267,WhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,1411,class,The context for the loop construct. +8268,maximum_iterations,tensorflow/tensorflow/python/ops/control_flow_ops.py,1536,method,The maximum number of iterations that will be executed. +8269,parallel_iterations,tensorflow/tensorflow/python/ops/control_flow_ops.py,1541,method,The number of iterations allowed to run in parallel. +8270,back_prop,tensorflow/tensorflow/python/ops/control_flow_ops.py,1546,method,True iff backprop is enabled for this while loop. +8271,swap_memory,tensorflow/tensorflow/python/ops/control_flow_ops.py,1551,method,True iff GPU-CPU memory swap is enabled for this while loop. +8272,pivot,tensorflow/tensorflow/python/ops/control_flow_ops.py,1556,method,The boolean tensor representing the loop termination condition. +8273,loop_enters,tensorflow/tensorflow/python/ops/control_flow_ops.py,1561,method,The list of enter tensors for loop variables. +8274,loop_exits,tensorflow/tensorflow/python/ops/control_flow_ops.py,1566,method,The list of exit tensors for loop variables. +8275,grad_state,tensorflow/tensorflow/python/ops/control_flow_ops.py,1571,method,The gradient loop state. +8276,to_proto,tensorflow/tensorflow/python/ops/control_flow_ops.py,1575,method,"Converts a `WhileContext` to a `WhileContextDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `WhileContextDef` protocol buffer." +8277,to_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,1615,method, +8278,from_proto,tensorflow/tensorflow/python/ops/control_flow_ops.py,1619,method,"Returns a `WhileContext` object created from `context_def`. + +Args: + context_def: A `WhileContextDef` protocol buffer. + import_scope: Optional `string`. Name scope to add. + +Returns: + A `WhileContext` Python object." +8279,GetWhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,1636,method, +8280,GetControlPivot,tensorflow/tensorflow/python/ops/control_flow_ops.py,1639,method, +8281,AddValue,tensorflow/tensorflow/python/ops/control_flow_ops.py,1644,method,Add `val` to the current context and its outer context recursively. +8282,AddOp,tensorflow/tensorflow/python/ops/control_flow_ops.py,1700,method,Add `op` to the current context. +8283,AddForwardLoopCounter,tensorflow/tensorflow/python/ops/control_flow_ops.py,1799,method,"Adds a loop that counts the number of iterations. + +This is added to the forward loop at the time when we start to +create the loop for backprop gradient computation. Called in +the outer context of this forward context. + +The pseudocode is: + `n = 0; while (_pivot) { n++; }` + +Note that a control dependency is added to `n` to ensure the correct +execution order of stack push ops. + +Args: + outer_grad_state: The outer grad state. None if not nested. + +Returns: + The number of iterations taken by the forward loop and the loop index." +8284,AddBackpropLoopCounter,tensorflow/tensorflow/python/ops/control_flow_ops.py,1848,method,"Add the backprop loop that controls the iterations. + +This is added to the backprop loop. It is used to control the loop +termination of the backprop loop. Called in the outer context of +this grad context. + +The pseudocode is: + `n = count; while (n >= 1) { n--; }` + +Note that a control dependency is added to `final_zero` to ensure the +correct execution order of stack pop ops. + +Args: + count: The number of iterations for backprop. + outer_grad_state: The outer grad state. None if not nested. + +Returns: + The loop index." +8285,AddBackpropAccumulator,tensorflow/tensorflow/python/ops/control_flow_ops.py,1914,method,"Add an accumulation loop for every loop invariant. + +This is added to the backprop loop. It is used to accumulate partial +gradients within each loop iteration. Called when in the gradient while +context. + +The pseudocode is: + ``` + acc = 0.0; + while (_pivot) { + acc += grad; + } + ``` + +Args: + op: The Enter op for a loop invariant. + grad: The partial gradient of an iteration for a loop invariant. + +Returns: + The gradient for a loop invariant." +8286,AddBackpropIndexedSlicesAccumulator,tensorflow/tensorflow/python/ops/control_flow_ops.py,1996,method,"This is used for accumulating gradients that are IndexedSlices. + +This is essentially the equivalent of AddBackpropAccumulator but optimized +for things like updating embeddings from within a while loop. + +Args: + op: The Enter op for a loop invariant. + grad: The partial gradients represented as an IndexedSlices. + +Returns: + The accumulated IndexedSlices gradient of the loop invariant." +8287,BuildLoop,tensorflow/tensorflow/python/ops/control_flow_ops.py,2233,method,Add the loop termination condition and body to the graph. +8288,IsWhileContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,2307,method, +8289,map_fn,tensorflow/tensorflow/python/ops/control_flow_ops.py,2191,method, +8290,while_loop_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,2323,function,"Repeat `body` while the condition `cond` is true. `cond` is a callable returning a boolean scalar tensor. `body` is a callable returning a (possibly nested) tuple, namedtuple or list of tensors of the same @@ -64122,7 +71680,7 @@ with tf.compat.v1.Session() as sess: # while the other thread is on iteration 9987 print(sess.run(out).shape) ```" -8467,while_loop,tensorflow/tensorflow/python/ops/control_flow_ops.py,2504,function,"Repeat `body` while the condition `cond` is true. +8291,while_loop,tensorflow/tensorflow/python/ops/control_flow_ops.py,2504,function,"Repeat `body` while the condition `cond` is true. `cond` is a callable returning a boolean scalar tensor. `body` is a callable returning a (possibly nested) tuple, namedtuple or list of tensors of the same @@ -64282,19 +71840,7 @@ with tf.compat.v1.Session() as sess: # while the other thread is on iteration 9987 print(sess.run(out).shape) ```" -8468,_AsTensorList,tensorflow/tensorflow/python/ops/control_flow_ops.py,2784,function,"Return x as a list of Tensors or IndexedSlices. - -For entries of `x` that are Operations, this returns an Identity of `p` -with a dependency on the operation. - -Args: - x: A Tensor/IndexedSlices/Operation or a list or tuple of them. - p: A Tensor to return for entries in `x` that are Operations. - -Returns: - A list of Tensors or IndexedSlices." -8469,_CheckResults,tensorflow/tensorflow/python/ops/control_flow_ops.py,2814,function, -8470,with_dependencies,tensorflow/tensorflow/python/ops/control_flow_ops.py,2823,function,"Produces the content of `output_tensor` only after `dependencies`. +8292,with_dependencies,tensorflow/tensorflow/python/ops/control_flow_ops.py,2823,function,"Produces the content of `output_tensor` only after `dependencies`. In some cases, a user may want the output of an operation to be consumed externally only after some other dependencies have run @@ -64315,8 +71861,7 @@ Returns: Raises: TypeError: if `output_tensor` is not a `Tensor` or `IndexedSlices`." -8471,_GroupControlDeps,tensorflow/tensorflow/python/ops/control_flow_ops.py,2861,function, -8472,group,tensorflow/tensorflow/python/ops/control_flow_ops.py,2872,function,"Create an op that groups multiple operations. +8293,group,tensorflow/tensorflow/python/ops/control_flow_ops.py,2872,function,"Create an op that groups multiple operations. When this op finishes, all ops in `inputs` have finished. This op has no output. @@ -64350,7 +71895,7 @@ Returns: Raises: ValueError: If an unknown keyword argument is provided." -8473,tuple_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,2951,function,"Group tensors together. +8294,tuple_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,2951,function,"Group tensors together. This creates a tuple of tensors with the same values as the `tensors` argument, except that the value of each tensor is only returned after the @@ -64379,7 +71924,7 @@ Raises: ValueError: If `tensors` does not contain any `Tensor` or `IndexedSlices`. TypeError: If `control_inputs` is not a list of `Operation` or `Tensor` objects." -8474,tuple,tensorflow/tensorflow/python/ops/control_flow_ops.py,2988,function,"Group tensors together. +8295,tuple,tensorflow/tensorflow/python/ops/control_flow_ops.py,2988,function,"Group tensors together. This creates a tuple of tensors with the same values as the `tensors` argument, except that the value of each tensor is only returned after the @@ -64408,103 +71953,7 @@ Raises: ValueError: If `tensors` does not contain any `Tensor` or `IndexedSlices`. TypeError: If `control_inputs` is not a list of `Operation` or `Tensor` objects." -8475,_assert_at_most_n_true,tensorflow/tensorflow/python/ops/control_flow_ops.py,3057,function,"Returns an Assert op that checks that at most n predicates are True. - -Args: - predicates: list of bool scalar tensors. - n: maximum number of true predicates allowed. - msg: Error message." -8476,_case_create_default_action,tensorflow/tensorflow/python/ops/control_flow_ops.py,3078,function,"Creates default action for a list of actions and their predicates. - -It uses the input actions to select an arbitrary as default and makes sure -that corresponding predicates have valid values. - -Args: - predicates: a list of bool scalar tensors - actions: a list of callable objects which return tensors. - -Returns: - a callable" -8477,_case_verify_and_canonicalize_args,tensorflow/tensorflow/python/ops/control_flow_ops.py,3111,function,"Verifies input arguments for the case function. - -Args: - pred_fn_pairs: Dict or list of pairs of a boolean scalar tensor, and a - callable which returns a list of tensors. - exclusive: True iff at most one predicate is allowed to evaluate to `True`. - name: A name for the case operation. - allow_python_preds: if true, pred_fn_pairs may contain Python bools in - addition to boolean Tensors - -Raises: - TypeError: If `pred_fn_pairs` is not a list/dictionary. - TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples. - TypeError: If `fns[i]` is not callable for any i, or `default` is not - callable. - -Returns: - a tuple ." -8478,_case_helper,tensorflow/tensorflow/python/ops/control_flow_ops.py,3174,function,"Implementation of case that allows for different cond functions. - -Args: - cond_fn: method that has signature and semantics of `cond` above. - pred_fn_pairs: Dict or list of pairs of a boolean scalar tensor, and a - callable which returns a list of tensors. - default: Optional callable that returns a list of tensors. - exclusive: True iff at most one predicate is allowed to evaluate to `True`. - name: A name for this operation (optional). - allow_python_preds: if true, pred_fn_pairs may contain Python bools in - addition to boolean Tensors - **cond_kwargs: keyword arguments that will be passed to `cond_fn`. - -Returns: - The tensors returned by the first pair whose predicate evaluated to True, or - those returned by `default` if none does. - -Raises: - TypeError: If `pred_fn_pairs` is not a list/dictionary. - TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples. - TypeError: If `fns[i]` is not callable for any i, or `default` is not - callable." -8479,_indexed_case_verify_and_canonicalize_args,tensorflow/tensorflow/python/ops/control_flow_ops.py,3226,function,"Verifies input arguments for the case function. - -Args: - branch_fns: Dict or list of pairs of an `int` and a callable which - returns a list of tensors. - default: Optional callable that returns a list of tensors. - branch_index: Optional int `Tensor`, which selects for the corresponding - pred_fn_pair. - -Raises: - TypeError: If `branch_fns` is not a list/dictionary. - TypeError: If `branch_fns` is a list but does not contain 2-tuples or - callables. - TypeError: If `fns[i]` is not callable for any i, or `default` is not - callable. - -Returns: - branch_fns: validated list of callables for each branch (default last)." -8480,_indexed_case_helper,tensorflow/tensorflow/python/ops/control_flow_ops.py,3287,function,"Implementation of case that emits the n-way indexed Case op. - -Args: - branch_fns: Dict or list of pairs of a boolean scalar tensor, and a - callable which returns a list of tensors. - default: Optional callable that returns a list of tensors. - branch_index: Optional int `Tensor`, which selects for the corresponding - pred_fn_pair. - name: A name for this operation (optional). - lower_using_switch_merge: Lower this op using switch merge ops (optional). - -Returns: - The tensors returned by the pair whose key matched branch_index, or - those returned by `default` if none does. - -Raises: - TypeError: If `branch_fns` is not a list/dictionary. - TypeError: If `branch_fns` is a list but does not contain 2-tuples or - callables. - TypeError: If `fns[i]` is not callable for any i, or `default` is not - callable." -8481,case_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,3331,function,"Create a case operation. +8296,case_v2,tensorflow/tensorflow/python/ops/control_flow_ops.py,3331,function,"Create a case operation. See also `tf.switch_case`. @@ -64591,7 +72040,7 @@ Raises: TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples. TypeError: If `fns[i]` is not callable for any i, or `default` is not callable." -8482,case,tensorflow/tensorflow/python/ops/control_flow_ops.py,3436,function,"Create a case operation. +8297,case,tensorflow/tensorflow/python/ops/control_flow_ops.py,3436,function,"Create a case operation. See also `tf.switch_case`. @@ -64682,7 +72131,7 @@ Raises: TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples. TypeError: If `fns[i]` is not callable for any i, or `default` is not callable." -8483,switch_case,tensorflow/tensorflow/python/ops/control_flow_ops.py,3544,function,"Create a switch/case operation, i.e. an integer-indexed conditional. +8298,switch_case,tensorflow/tensorflow/python/ops/control_flow_ops.py,3544,function,"Create a switch/case operation, i.e. an integer-indexed conditional. See also `tf.case`. @@ -64749,7 +72198,7 @@ Raises: callables. TypeError: If `fns[i]` is not callable for any i, or `default` is not callable." -8484,execute_fn_for_device,tensorflow/tensorflow/python/ops/control_flow_ops.py,3619,function,"Executes one of the provided callables based on the device placement. +8299,execute_fn_for_device,tensorflow/tensorflow/python/ops/control_flow_ops.py,3619,function,"Executes one of the provided callables based on the device placement. This API is used when the implementations for high level function depend on the underlying device placement. It takes a dictionary of device type to @@ -64778,8 +72227,14 @@ Args: Returns: The tensors returned by the callable identified by device type during execution, or those returned by 'default_fn' if no key matches." -8485,XLAControlFlowContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,3663,class,Base class for XLA and TPU control flow contexts. -8486,from_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,3691,function,"Deserializes `context_def` into the appropriate ControlFlowContext. +8300,XLAControlFlowContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,3663,class,Base class for XLA and TPU control flow contexts. +8301,to_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,3670,method, +8302,IsXLAContext,tensorflow/tensorflow/python/ops/control_flow_ops.py,3676,method, +8303,AddOp,tensorflow/tensorflow/python/ops/control_flow_ops.py,3679,method, +8304,AddValue,tensorflow/tensorflow/python/ops/control_flow_ops.py,3682,method, +8305,RequiresUniqueFunctionRetracing,tensorflow/tensorflow/python/ops/control_flow_ops.py,3685,method,"Returns whether the tf.function should be retraced if the context changes. + " +8306,from_control_flow_context_def,tensorflow/tensorflow/python/ops/control_flow_ops.py,3691,function,"Deserializes `context_def` into the appropriate ControlFlowContext. Args: context_def: ControlFlowContextDef proto @@ -64787,84 +72242,42 @@ Args: Returns: A ControlFlowContext subclass" -8487,CondWithManyIntermediatesBenchmark,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,36,class,Checks the runtime performance of outputting all intermediates. -8488,GroupTestCase,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,69,class, -8489,ShapeTestCase,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,150,class, -8490,WithDependenciesTestCase,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,160,class, -8491,SwitchTestCase,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,191,class, -8492,CondTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,361,class, -8493,ContextTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,469,class, -8494,_get_nested_shape,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,546,function, -8495,_create_tensor_array,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,559,function, -8496,_raw_nested_shape,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,567,function, -8497,DataTypesTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,579,class, -8498,IndexedCaseTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,959,class, -8499,ExecuteFnForDeviceTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,1225,class, -8500,CaseTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,1336,class, -8501,WhileLoopTestCase,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,1410,class, -8502,AssertTest,tensorflow/tensorflow/python/ops/control_flow_ops_test.py,1519,class, -8503,_GetMaxSizeFromNestedMaximumIterations,tensorflow/tensorflow/python/ops/control_flow_state.py,37,function,"Calculate a max_size for use by stack ops inside an XLA while_loop. - -Args: - value: The value inside the while_loop forward context. Used for printing - error messages. - while_ctxt: The forward context inside which value resides. This does not - always match the value's immediate context, as `value` may be inside e.g. - a cond context inside the while_loop. - -Returns: - A tensor containing the `max_size` to feed to a Stack initializer. - -Raises: - ValueError: If `value` is nested inside a `while_loop` that either - lacks a `maximum_iterations` parameter, or the `maximum_iterations` - parameter: - - - is inside a `while_loop` that is a parent of the calling context, and - - cannot be evaluated at graph build time to a constant." -8504,_GradLoopState,tensorflow/tensorflow/python/ops/control_flow_state.py,108,class,"The state used for constructing the gradient graph for a while loop. - -We create a _GradLoopState for each while loop in forward and its -corresponding while loop in backprop. This gives us access to both -the forward and the backprop WhileContexts. - -During the construction of gradient graph, any time when we detect -a forward value that is needed for backprop, we create a history -accumulator and add it to `history_map`. Any time when we backprop -a loop switch op (in _SwitchGrad), we add the grad merge op in -`switch_map`." -8505,_ControlFlowState,tensorflow/tensorflow/python/ops/control_flow_state.py,494,class,Maintain the mapping from the loops to their grad states. -8506,MaybeCreateControlFlowState,tensorflow/tensorflow/python/ops/control_flow_state.py,761,function,"Create the state for all the while loops involved in one gradients(). +8307,CondWithManyIntermediatesBenchmark,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,36,class,Checks the runtime performance of outputting all intermediates. +8308,benchmark_cond_v1_defun,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,97,method, +8309,benchmark_cond_v2_defun,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,103,method, +8310,benchmark_cond_v1_graph,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,109,method, +8311,benchmark_cond_v2_graph,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,115,method, +8312,branch_fn,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,45,method, +8313,cond_fn,tensorflow/tensorflow/python/ops/control_flow_ops_benchmark.py,58,method, +8314,MaybeCreateControlFlowState,tensorflow/tensorflow/python/ops/control_flow_state.py,761,function,"Create the state for all the while loops involved in one gradients(). We create a _ControlFlowState when there are while loops involved in gradients(). In gradients(), control flow logic is only invoked when the _ControlFlowState is not None. Note that this method modifies `between_op_list` and `between_ops`." -8507,_ZerosLikeV1,tensorflow/tensorflow/python/ops/control_flow_state.py,784,function,Branch of ZerosLike for TF1. -8508,_ZerosLikeV2,tensorflow/tensorflow/python/ops/control_flow_state.py,810,function,Branch of ZerosLike for TF2. -8509,ZerosLike,tensorflow/tensorflow/python/ops/control_flow_state.py,834,function,Create zeros_like for the specified output of an op. -8510,enable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_util.py,41,function,"Use control flow v2. +8315,ZerosLike,tensorflow/tensorflow/python/ops/control_flow_state.py,834,function,Create zeros_like for the specified output of an op. +8316,enable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_util.py,41,function,"Use control flow v2. Do not use this symbol. This will be removed." -8511,EnableControlFlowV2,tensorflow/tensorflow/python/ops/control_flow_util.py,50,function,Returns whether control flow v2 should be used in `graph`. -8512,IsInXLAContext,tensorflow/tensorflow/python/ops/control_flow_util.py,58,function, -8513,InXlaContext,tensorflow/tensorflow/python/ops/control_flow_util.py,68,function, -8514,GraphOrParentsInXlaContext,tensorflow/tensorflow/python/ops/control_flow_util.py,73,function, -8515,IsInWhileLoop,tensorflow/tensorflow/python/ops/control_flow_util.py,82,function, -8516,IsInCond,tensorflow/tensorflow/python/ops/control_flow_util.py,87,function, -8517,IsSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,92,function,Return true if `op` is a Switch. -8518,IsMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,97,function,Return true if `op` is a Merge. -8519,IsLoopEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,102,function,Returns true if `op` is an Enter. -8520,IsLoopExit,tensorflow/tensorflow/python/ops/control_flow_util.py,107,function,Return true if `op` is an Exit. -8521,IsCondSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,112,function,Return true if `op` is the Switch for a conditional. -8522,IsCondMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,133,function,Return true if `op` is the Merge for a conditional. -8523,IsLoopSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,150,function,Return true if `op` is the Switch for a while loop. -8524,IsLoopMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,158,function,Return true if `op` is the Merge for a while loop. -8525,IsLoopConstantEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,166,function,Return true iff op is a loop invariant. -8526,GetLoopConstantEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,171,function,Return the enter op if we can infer `value` to be a loop invariant. -8527,GetOutputContext,tensorflow/tensorflow/python/ops/control_flow_util.py,180,function,Return the control flow context for the output of an op. -8528,GetContainingWhileContext,tensorflow/tensorflow/python/ops/control_flow_util.py,191,function,"Returns the first ancestor WhileContext of `ctxt`. +8317,EnableControlFlowV2,tensorflow/tensorflow/python/ops/control_flow_util.py,50,function,Returns whether control flow v2 should be used in `graph`. +8318,IsInXLAContext,tensorflow/tensorflow/python/ops/control_flow_util.py,58,function, +8319,InXlaContext,tensorflow/tensorflow/python/ops/control_flow_util.py,68,function, +8320,GraphOrParentsInXlaContext,tensorflow/tensorflow/python/ops/control_flow_util.py,73,function, +8321,IsInWhileLoop,tensorflow/tensorflow/python/ops/control_flow_util.py,82,function, +8322,IsInCond,tensorflow/tensorflow/python/ops/control_flow_util.py,87,function, +8323,IsSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,92,function,Return true if `op` is a Switch. +8324,IsMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,97,function,Return true if `op` is a Merge. +8325,IsLoopEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,102,function,Returns true if `op` is an Enter. +8326,IsLoopExit,tensorflow/tensorflow/python/ops/control_flow_util.py,107,function,Return true if `op` is an Exit. +8327,IsCondSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,112,function,Return true if `op` is the Switch for a conditional. +8328,IsCondMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,133,function,Return true if `op` is the Merge for a conditional. +8329,IsLoopSwitch,tensorflow/tensorflow/python/ops/control_flow_util.py,150,function,Return true if `op` is the Switch for a while loop. +8330,IsLoopMerge,tensorflow/tensorflow/python/ops/control_flow_util.py,158,function,Return true if `op` is the Merge for a while loop. +8331,IsLoopConstantEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,166,function,Return true iff op is a loop invariant. +8332,GetLoopConstantEnter,tensorflow/tensorflow/python/ops/control_flow_util.py,171,function,Return the enter op if we can infer `value` to be a loop invariant. +8333,GetOutputContext,tensorflow/tensorflow/python/ops/control_flow_util.py,180,function,Return the control flow context for the output of an op. +8334,GetContainingWhileContext,tensorflow/tensorflow/python/ops/control_flow_util.py,191,function,"Returns the first ancestor WhileContext of `ctxt`. Returns `ctxt` if `ctxt` is a WhileContext, or None if `ctxt` is not in a while loop. @@ -64878,7 +72291,7 @@ Returns: `ctxt` if `ctxt` is a WhileContext, the most nested WhileContext containing `ctxt`, or None if `ctxt` is not in a while loop. If `stop_ctxt` is not `None`, this returns `ctxt` if it matches `stop_ctxt` in its traversal." -8529,GetContainingXLAContext,tensorflow/tensorflow/python/ops/control_flow_util.py,213,function,"Returns the first ancestor XLAContext of `ctxt`. +8335,GetContainingXLAContext,tensorflow/tensorflow/python/ops/control_flow_util.py,213,function,"Returns the first ancestor XLAContext of `ctxt`. Returns `ctxt` if `ctxt` is a XLAContext, or None if `ctxt` is not in a while loop. @@ -64889,7 +72302,7 @@ Args: Returns: `ctxt` if `ctxt` is a XLAContext, the most nested XLAContext containing `ctxt`, or None if `ctxt` is not in a while loop." -8530,GetContainingCondContext,tensorflow/tensorflow/python/ops/control_flow_util.py,232,function,"Returns the first ancestor CondContext of `ctxt`. +8336,GetContainingCondContext,tensorflow/tensorflow/python/ops/control_flow_util.py,232,function,"Returns the first ancestor CondContext of `ctxt`. Returns `ctxt` if `ctxt` is a CondContext, or None if `ctxt` is not in a cond. @@ -64899,10 +72312,10 @@ Args: Returns: `ctxt` if `ctxt` is a CondContext, the most nested CondContext containing `ctxt`, or None if `ctxt` is not in a cond." -8531,IsContainingContext,tensorflow/tensorflow/python/ops/control_flow_util.py,250,function,Returns true if `maybe_containing_ctxt` is or contains `ctxt`. -8532,OpInContext,tensorflow/tensorflow/python/ops/control_flow_util.py,258,function, -8533,TensorInContext,tensorflow/tensorflow/python/ops/control_flow_util.py,262,function, -8534,CheckInputFromValidContext,tensorflow/tensorflow/python/ops/control_flow_util.py,266,function,"Returns whether `input_op` can be used from `op`s context. +8337,IsContainingContext,tensorflow/tensorflow/python/ops/control_flow_util.py,250,function,Returns true if `maybe_containing_ctxt` is or contains `ctxt`. +8338,OpInContext,tensorflow/tensorflow/python/ops/control_flow_util.py,258,function, +8339,TensorInContext,tensorflow/tensorflow/python/ops/control_flow_util.py,262,function, +8340,CheckInputFromValidContext,tensorflow/tensorflow/python/ops/control_flow_util.py,266,function,"Returns whether `input_op` can be used from `op`s context. Conceptually, only inputs from op's while context or any ancestor while context (including outside of any context) are valid. In practice, there are @@ -64914,17 +72327,17 @@ Args: Raises: ValueError: if input_op is from an invalid context." -8535,GetWhileContext,tensorflow/tensorflow/python/ops/control_flow_util.py,366,function,Get the WhileContext to which this op belongs. -8536,in_defun,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,44,function,"Returns if the current graph is, or is nested in, a defun." -8537,in_while_loop_defun,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,56,function,Returns if the graph is a while loop FuncGraph. -8538,create_new_tf_function,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,63,function,"Converts func_graph to a TF_Function and adds it to the current graph. +8341,GetWhileContext,tensorflow/tensorflow/python/ops/control_flow_util.py,366,function,Get the WhileContext to which this op belongs. +8342,in_defun,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,44,function,"Returns if the current graph is, or is nested in, a defun." +8343,in_while_loop_defun,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,56,function,Returns if the graph is a while loop FuncGraph. +8344,create_new_tf_function,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,63,function,"Converts func_graph to a TF_Function and adds it to the current graph. Args: func_graph: FuncGraph Returns: The name of the new TF_Function." -8539,unique_fn_name,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,78,function,"Returns a unique name to use for a control flow function. +8345,unique_fn_name,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,78,function,"Returns a unique name to use for a control flow function. Args: scope: A name scope string. @@ -64932,8 +72345,8 @@ Args: Returns: A string, the name to use for the function." -8540,unique_grad_fn_name,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,91,function, -8541,maybe_set_lowering_attr,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,95,function,"Sets the flag to enable lowering on `op` if necessary. +8346,unique_grad_fn_name,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,91,function, +8347,maybe_set_lowering_attr,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,95,function,"Sets the flag to enable lowering on `op` if necessary. Lowering allows cond_v2 and while_v2 to avoid some of the limitations of Functions, allowing users to specify devices & colocation inside of cond_v2 @@ -64953,7 +72366,7 @@ However, we do not lower in the following cases: Args: op: An `If` or `While` Operation. lower_using_switch_merge: Explicit value to lower or not (optional)." -8542,maybe_propagate_compile_time_consts_in_xla,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,131,function,"Tells XLA whether to propagate compile-time consts in the loop body. +8348,maybe_propagate_compile_time_consts_in_xla,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,131,function,"Tells XLA whether to propagate compile-time consts in the loop body. This is needed to make compile time constants available to ops, for example `max_num_elements` in `EmptyTensorList`, inside the loop body. Ideally this @@ -64962,7 +72375,7 @@ while_loops. Args: op: A `While` Operation." -8543,resource_input_index,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,149,function,"Returns the index of the input corresponding to `tensor_name`. +8349,resource_input_index,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,149,function,"Returns the index of the input corresponding to `tensor_name`. This method is used to find the corresponding index of an arbitrary resource tensor in a function (the function could be a loop body). We assume that @@ -64984,7 +72397,7 @@ Args: Returns: The index into input_names corresponding to `tensor_name`." -8544,clear_control_inputs,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,221,function,"Clears the control inputs but preserves the ControlFlowContext. +8350,clear_control_inputs,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,221,function,"Clears the control inputs but preserves the ControlFlowContext. This is needed to preserve the XLAControlFlowControl when clearing control inputs for the gradient accumulators in while_v2. @@ -64993,10 +72406,7 @@ control inputs for the gradient accumulators in while_v2. Yields: A context manager in which the ops created will not have any control inputs by default but the control flow context is the same." -8545,_is_tpu_strategy,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,240,function, -8546,_register_keras_layer_context_function,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,245,function, -8547,_is_building_keras_layer,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,251,function, -8548,output_all_intermediates,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,260,function,"Whether to output all intermediates of a functional control flow op. +8351,output_all_intermediates,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,260,function,"Whether to output all intermediates of a functional control flow op. The default behavior is to output intermediates only when building a Keras Layer in graph mode and that too when certain other conditions are met: @@ -65014,19 +72424,17 @@ Layer in graph mode and that too when certain other conditions are met: Returns: A bool telling whether to output all intermediates." -8549,get_func_graph,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,293,function,Generates and returns a FuncGraph for the given op and input_shapes. -8550,ControlFlowV2DisableTest,tensorflow/tensorflow/python/ops/control_flow_v2_disable_test.py,31,class, -8551,ControlFlowV2EnableTest,tensorflow/tensorflow/python/ops/control_flow_v2_enable_test.py,30,class, -8552,CondBranchFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,25,class,"FuncGraph for branches of tf.cond(). +8352,get_func_graph,tensorflow/tensorflow/python/ops/control_flow_util_v2.py,293,function,Generates and returns a FuncGraph for the given op and input_shapes. +8353,CondBranchFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,25,class,"FuncGraph for branches of tf.cond(). This is used to distinguish cond branches from other functions." -8553,WhileCondFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,38,class,"FuncGraph for the condition of tf.while_loop(). +8354,WhileCondFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,38,class,"FuncGraph for the condition of tf.while_loop(). This is used to distinguish while conditions from other functions." -8554,WhileBodyFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,51,class,"FuncGraph for the body of tf.while_loop(). +8355,WhileBodyFuncGraph,tensorflow/tensorflow/python/ops/control_flow_v2_func_graphs.py,51,class,"FuncGraph for the body of tf.while_loop(). This is used to distinguish while bodies from other functions." -8555,enable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,29,function,"Use control flow v2. +8356,enable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,29,function,"Use control flow v2. control flow v2 (cfv2) is an improved version of control flow in TensorFlow with support for higher order derivatives. Enabling cfv2 will change the @@ -65040,17 +72448,17 @@ feature. Note: v2 control flow is always enabled inside of tf.function. Calling this function is not required." -8556,disable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,51,function,"Opts out of control flow v2. +8357,disable_control_flow_v2,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,51,function,"Opts out of control flow v2. Note: v2 control flow is always enabled inside of tf.function. Calling this function has no effect in that case. If your code needs tf.disable_control_flow_v2() to be called to work properly please file a bug." -8557,control_flow_v2_enabled,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,66,function,"Returns `True` if v2 control flow is enabled. +8358,control_flow_v2_enabled,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,66,function,"Returns `True` if v2 control flow is enabled. Note: v2 control flow is always enabled inside of tf.function." -8558,output_all_intermediates,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,75,function,"Whether to output all intermediates from functional control flow ops. +8359,output_all_intermediates,tensorflow/tensorflow/python/ops/control_flow_v2_toggles.py,75,function,"Whether to output all intermediates from functional control flow ops. The ""default"" behavior to is to output all intermediates when using v2 control flow inside Keras models in graph mode (possibly inside Estimators). This is @@ -65071,8 +72479,7 @@ please file an issue at https://github.com/tensorflow/tensorflow/issues. Args: state: True, False or None. None restores the default behavior." -8559,ControlFlowV2TogglesTest,tensorflow/tensorflow/python/ops/control_flow_v2_toggles_test.py,27,class, -8560,build_graph,tensorflow/tensorflow/python/ops/conv2d_benchmark.py,44,function,"builds a graph containing a sequence of conv2d operations. +8360,build_graph,tensorflow/tensorflow/python/ops/conv2d_benchmark.py,44,function,"builds a graph containing a sequence of conv2d operations. Args: device: String, the device to run on. @@ -65090,31 +72497,9 @@ Args: Returns: An array of tensors to run()" -8561,Conv2DBenchmark,tensorflow/tensorflow/python/ops/conv2d_benchmark.py,94,class,Benchmark conv2d! -8562,_ExecutionSignature,tensorflow/tensorflow/python/ops/critical_section_ops.py,45,class,A class storing an `ExecuteInCriticalResource` op and associated attrs. -8563,_identity,tensorflow/tensorflow/python/ops/critical_section_ops.py,53,function,"Identity op that recognizes `TensorArray`, `Operation`, and `Tensor`." -8564,_get_device_or_colocation,tensorflow/tensorflow/python/ops/critical_section_ops.py,65,function, -8565,_get_colocation,tensorflow/tensorflow/python/ops/critical_section_ops.py,69,function,"Get colocation symbol from op, if any." -8566,_get_critical_section_stack,tensorflow/tensorflow/python/ops/critical_section_ops.py,80,function, -8567,_push_critical_section_stack,tensorflow/tensorflow/python/ops/critical_section_ops.py,89,function,"Push a CriticalSection._signature to the thread-local stack. - -If the signature is already on the stack, raise an error because it means -we're trying to execute inside the same locked CriticalSection, which -will create a deadlock. - -Args: - signature: Tuple of the type `CriticalSection._signature`. Uniquely - identifies a CriticalSection by its `shared_name`, `container`, - and device. - -Yields: - An empty value. The context is guaranteed to run without deadlock. - -Raises: - ValueError: If the signature is already on the stack. - RuntimeError: If another thread or function modifies the current stack - entry during the yield." -8568,CriticalSection,tensorflow/tensorflow/python/ops/critical_section_ops.py,126,class,"Critical section. +8361,Conv2DBenchmark,tensorflow/tensorflow/python/ops/conv2d_benchmark.py,94,class,Benchmark conv2d! +8362,benchmark_conv2d,tensorflow/tensorflow/python/ops/conv2d_benchmark.py,173,method, +8363,CriticalSection,tensorflow/tensorflow/python/ops/critical_section_ops.py,126,class,"Critical section. A `CriticalSection` object is a resource in the graph which executes subgraphs in **serial** order. A common example of a subgraph one may wish to run @@ -65180,9 +72565,36 @@ bad_sum = ex1 + ex2 sess.run(v.initializer) sess.run(bad_sum) # May return 0.0 ```" -8569,_get_context_device_type,tensorflow/tensorflow/python/ops/ctc_ops.py,56,function,"Parse the current context and return the device type, eg CPU/GPU." -8570,_generate_defun_backend,tensorflow/tensorflow/python/ops/ctc_ops.py,64,function, -8571,ctc_loss,tensorflow/tensorflow/python/ops/ctc_ops.py,75,function,"Computes the CTC (Connectionist Temporal Classification) Loss. +8364,name,tensorflow/tensorflow/python/ops/critical_section_ops.py,231,method, +8365,execute,tensorflow/tensorflow/python/ops/critical_section_ops.py,234,method,"Execute function `fn()` inside the critical section. + +`fn` should not accept any arguments. To add extra arguments to when +calling `fn` in the critical section, create a lambda: + +```python +critical_section.execute(lambda: fn(*my_args, **my_kwargs)) +``` + +Args: + fn: The function to execute. Must return at least one tensor. + exclusive_resource_access: Whether the resources required by + `fn` should be exclusive to this `CriticalSection`. Default: `True`. + You may want to set this to `False` if you will be accessing a + resource in read-only mode in two different CriticalSections. + name: The name to use when creating the execute operation. + +Returns: + The tensors returned from `fn()`. + +Raises: + ValueError: If `fn` attempts to lock this `CriticalSection` in any nested + or lazy way that may cause a deadlock. + ValueError: If `exclusive_resource_access == True` and + another `CriticalSection` has an execution requesting the same + resources as `fn``. Note, even if `exclusive_resource_access` is + `True`, if another execution in another `CriticalSection` was created + without `exclusive_resource_access=True`, a `ValueError` will be raised." +8366,ctc_loss,tensorflow/tensorflow/python/ops/ctc_ops.py,75,function,"Computes the CTC (Connectionist Temporal Classification) Loss. This op implements the CTC loss as presented in (Graves et al., 2006). @@ -65284,25 +72696,7 @@ References: with Recurrent Neural Networks: [Graves et al., 2006](https://dl.acm.org/citation.cfm?id=1143891) ([pdf](http://www.cs.toronto.edu/~graves/icml_2006.pdf))" -8572,_ctc_loss_impl,tensorflow/tensorflow/python/ops/ctc_ops.py,198,function, -8573,_CTCLossGradImpl,tensorflow/tensorflow/python/ops/ctc_ops.py,241,function, -8574,_CTCLossGrad,tensorflow/tensorflow/python/ops/ctc_ops.py,260,function,"The derivative provided by CTC Loss. - -Args: - op: the CTCLoss op. - grad_loss: The backprop for cost. - -Returns: - The CTC Loss gradient." -8575,_CTCLossV2Grad,tensorflow/tensorflow/python/ops/ctc_ops.py,275,function,"The derivative provided by CTC Loss V2. - -Args: - op: the CTCLossV2 op. - grad_loss: The backprop for cost. - -Returns: - The CTC Loss V2 gradient." -8576,ctc_greedy_decoder,tensorflow/tensorflow/python/ops/ctc_ops.py,290,function,"Performs greedy decoding on the logits given in input (best path). +8367,ctc_greedy_decoder,tensorflow/tensorflow/python/ops/ctc_ops.py,290,function,"Performs greedy decoding on the logits given in input (best path). Note: Regardless of the value of merge_repeated, if the maximum index of a given time and batch corresponds to the blank index `(num_classes - 1)`, no @@ -65341,7 +72735,7 @@ Returns: neg_sum_logits: A `float` matrix `(batch_size x 1)` containing, for the sequence found, the negative of the sum of the greatest logit at each timeframe." -8577,ctc_beam_search_decoder,tensorflow/tensorflow/python/ops/ctc_ops.py,340,function,"Performs beam search decoding on the logits given in input. +8368,ctc_beam_search_decoder,tensorflow/tensorflow/python/ops/ctc_ops.py,340,function,"Performs beam search decoding on the logits given in input. **Note** The `ctc_greedy_decoder` is a special case of the `ctc_beam_search_decoder` with `top_paths=1` and `beam_width=1` (but @@ -65381,7 +72775,7 @@ Returns: log_probability: A `float` matrix `(batch_size x top_paths)` containing sequence log-probabilities." -8578,ctc_beam_search_decoder_v2,tensorflow/tensorflow/python/ops/ctc_ops.py,403,function,"Performs beam search decoding on the logits given in input. +8369,ctc_beam_search_decoder_v2,tensorflow/tensorflow/python/ops/ctc_ops.py,403,function,"Performs beam search decoding on the logits given in input. **Note** The `ctc_greedy_decoder` is a special case of the `ctc_beam_search_decoder` with `top_paths=1` and `beam_width=1` (but @@ -65412,15 +72806,7 @@ Returns: log_probability: A `float` matrix `[batch_size, top_paths]` containing sequence log-probabilities." -8579,_ctc_state_trans,tensorflow/tensorflow/python/ops/ctc_ops.py,454,function,"Compute CTC alignment model transition matrix. - -Args: - label_seq: tensor of shape [batch_size, max_seq_length] - -Returns: - tensor of shape [batch_size, states, states] with a state transition matrix - computed for each sequence of the batch." -8580,ctc_state_log_probs,tensorflow/tensorflow/python/ops/ctc_ops.py,510,function,"Computes CTC alignment initial and final state log probabilities. +8370,ctc_state_log_probs,tensorflow/tensorflow/python/ops/ctc_ops.py,510,function,"Computes CTC alignment initial and final state log probabilities. Create the initial/final state values directly as log values to avoid having to take a float64 log on tpu (which does not exist). @@ -65431,10 +72817,7 @@ Args: Returns: initial_state_log_probs, final_state_log_probs" -8581,_ilabel_to_state,tensorflow/tensorflow/python/ops/ctc_ops.py,550,function,Project ilabel log probs to state log probs. -8582,_state_to_olabel,tensorflow/tensorflow/python/ops/ctc_ops.py,566,function,Sum state log probs to ilabel log probs. -8583,_state_to_olabel_unique,tensorflow/tensorflow/python/ops/ctc_ops.py,585,function,Sum state log probs to ilabel log probs using unique label indices. -8584,ctc_loss_and_grad,tensorflow/tensorflow/python/ops/ctc_ops.py,629,function,"Computes the CTC loss and gradients. +8371,ctc_loss_and_grad,tensorflow/tensorflow/python/ops/ctc_ops.py,629,function,"Computes the CTC loss and gradients. Most users will want fwd_bwd.ctc_loss @@ -65455,11 +72838,7 @@ Args: Returns: loss: tensor of shape [batch_size] gradient: tensor of shape [frames, batch_size, num_labels]" -8585,_ctc_loss_grad,tensorflow/tensorflow/python/ops/ctc_ops.py,690,function, -8586,_ctc_loss_op_standard,tensorflow/tensorflow/python/ops/ctc_ops.py,697,function, -8587,_ctc_loss_op_cudnn,tensorflow/tensorflow/python/ops/ctc_ops.py,715,function, -8588,_ctc_loss_shape,tensorflow/tensorflow/python/ops/ctc_ops.py,733,function, -8589,ctc_loss_v2,tensorflow/tensorflow/python/ops/ctc_ops.py,740,function,"Computes CTC (Connectionist Temporal Classification) loss. +8372,ctc_loss_v2,tensorflow/tensorflow/python/ops/ctc_ops.py,740,function,"Computes CTC (Connectionist Temporal Classification) loss. This op implements the CTC loss as presented in (Graves et al., 2006). @@ -65503,7 +72882,7 @@ References: with Recurrent Neural Networks: [Graves et al., 2006](https://dl.acm.org/citation.cfm?id=1143891) ([pdf](http://www.cs.toronto.edu/~graves/icml_2006.pdf))" -8590,ctc_loss_v3,tensorflow/tensorflow/python/ops/ctc_ops.py,835,function,"Computes CTC (Connectionist Temporal Classification) loss. +8373,ctc_loss_v3,tensorflow/tensorflow/python/ops/ctc_ops.py,835,function,"Computes CTC (Connectionist Temporal Classification) loss. This op implements the CTC loss as presented in (Graves et al., 2016). @@ -65547,7 +72926,7 @@ References: with Recurrent Neural Networks: [Graves et al., 2016](https://dl.acm.org/citation.cfm?id=1143891) ([pdf](http://www.cs.toronto.edu/~graves/icml_2006.pdf))" -8591,ctc_loss_dense,tensorflow/tensorflow/python/ops/ctc_ops.py,939,function,"Computes CTC (Connectionist Temporal Classification) loss. +8374,ctc_loss_dense,tensorflow/tensorflow/python/ops/ctc_ops.py,939,function,"Computes CTC (Connectionist Temporal Classification) loss. This op implements the CTC loss as presented in (Graves et al., 2006), using the batched forward backward algorithm described in (Sim et al., 2017). @@ -65602,7 +72981,7 @@ References: computation in TensorFlow: [Sim et al., 2017](https://ieeexplore.ieee.org/document/8268944) ([pdf](http://bacchiani.net/resume/papers/ASRU2017.pdf))" -8592,collapse_repeated,tensorflow/tensorflow/python/ops/ctc_ops.py,1067,function,"Merge repeated labels into single labels. +8375,collapse_repeated,tensorflow/tensorflow/python/ops/ctc_ops.py,1067,function,"Merge repeated labels into single labels. Args: labels: Tensor of shape [batch, max value in seq_length] @@ -65617,7 +72996,7 @@ Returns: `[[A, A, B, B, A], [A, B, C, D, E]] => [[A, B, A, 0, 0], [A, B, C, D, E]]` new_seq_length: int tensor of shape [batch] with new sequence lengths." -8593,dense_labels_to_sparse,tensorflow/tensorflow/python/ops/ctc_ops.py,1129,function,"Convert dense labels with sequence lengths to sparse tensor. +8376,dense_labels_to_sparse,tensorflow/tensorflow/python/ops/ctc_ops.py,1129,function,"Convert dense labels with sequence lengths to sparse tensor. Args: dense: tensor of shape [batch, max_length] @@ -65625,7 +73004,7 @@ Args: Returns: tf.sparse.SparseTensor with values only for the valid elements of sequences." -8594,ctc_unique_labels,tensorflow/tensorflow/python/ops/ctc_ops.py,1165,function,"Get unique labels and indices for batched labels for `tf.nn.ctc_loss`. +8377,ctc_unique_labels,tensorflow/tensorflow/python/ops/ctc_ops.py,1165,function,"Get unique labels and indices for batched labels for `tf.nn.ctc_loss`. For use with `tf.nn.ctc_loss` optional argument `unique`: This op can be used to preprocess labels in input pipeline to for better speed/memory use @@ -65644,73 +73023,7 @@ Returns: tuple of - unique labels, tensor of shape `[batch_size, max_label_length]` - indices into unique labels, shape `[batch_size, max_label_length]`" -8595,_sum_states,tensorflow/tensorflow/python/ops/ctc_ops.py,1199,function,"Take logsumexp for each unique state out of all label states. - -Args: - idx: tensor of shape [batch, label_length] For each sequence, indices into a - set of unique labels as computed by calling unique. - states: tensor of shape [frames, batch, label_length] Log probabilities for - each label state. - -Returns: - tensor of shape [frames, batch_size, label_length], log probabilites summed - for each unique label of the sequence." -8596,_forward_backward_log,tensorflow/tensorflow/python/ops/ctc_ops.py,1226,function,"Forward-backward algorithm computed in log domain. - -Args: - state_trans_log_probs: tensor of shape [states, states] or if different - transition matrix per batch [batch_size, states, states] - initial_state_log_probs: tensor of shape [batch_size, states] - final_state_log_probs: tensor of shape [batch_size, states] - observed_log_probs: tensor of shape [frames, batch_size, states] - sequence_length: tensor of shape [batch_size] - -Returns: - forward backward log probabilites: tensor of shape [frames, batch, states] - log_likelihood: tensor of shape [batch_size] - -Raises: - ValueError: If state_trans_log_probs has unknown or incorrect rank." -8597,_scan,tensorflow/tensorflow/python/ops/ctc_ops.py,1316,function,"Repeatedly applies callable `fn` to a sequence of elements. - -Implemented by functional_ops.While, tpu friendly, no gradient. - -This is similar to functional_ops.scan but significantly faster on tpu/gpu -for the forward backward use case. - -Examples: - scan(lambda a, e: a + e, [1.0, 2.0, 3.0], 1.0) => [2.0, 4.0, 7.0] - - Multiple accumulators: - scan(lambda a, e: (a[0] + e, a[1] * e), [1.0, 2.0, 3.0], (0.0, 1.0)) - - Multiple inputs: - scan(lambda a, e: a + (e[0] * e[1]), (elems1, elems2), 0.0) - -Args: - fn: callable, fn(accumulators, element) return new accumulator values. The - (possibly nested) sequence of accumulators is the same as `initial` and - the return value must have the same structure. - elems: A (possibly nested) tensor which will be unpacked along the first - dimension. The resulting slices will be the second argument to fn. The - first dimension of all nested input tensors must be the same. - initial: A tensor or (possibly nested) sequence of tensors with initial - values for the accumulators. - reverse: (optional) True enables scan and output elems in reverse order. - inclusive: (optional) True includes the initial accumulator values in the - output. Length of output will be len(elem sequence) + 1. Not meaningful if - final_only is True. - final_only: (optional) When True, return only the final accumulated values, - not the concatenation of accumulated values for each input. - -Returns: - A (possibly nested) sequence of tensors with the results of applying fn - to tensors unpacked from elems and previous accumulator values." -8598,_get_dim,tensorflow/tensorflow/python/ops/ctc_ops.py,1429,function,Get value of tensor shape[i] preferring static value if available. -8599,_cudnn_rnn_backward,tensorflow/tensorflow/python/ops/cudnn_rnn_grad.py,25,function,Gradients for the CudnnRNN op. -8600,_cudnn_rnn_backward_v2,tensorflow/tensorflow/python/ops/cudnn_rnn_grad.py,51,function, -8601,_cudnn_rnn_backwardv3,tensorflow/tensorflow/python/ops/cudnn_rnn_grad.py,77,function,Gradients for the CudnnRNNV3 op. -8602,copy_handle_data,tensorflow/tensorflow/python/ops/custom_gradient.py,45,function,"Copies HandleData for variant and resource type tensors if available. +8378,copy_handle_data,tensorflow/tensorflow/python/ops/custom_gradient.py,45,function,"Copies HandleData for variant and resource type tensors if available. The CppShapeInferenceResult::HandleData proto contains information about the shapes and types of the element tensors of resource/variant type tensors. @@ -65723,7 +73036,7 @@ unknown shape. Args: source_t: The tensor to copy HandleData from. target_t: The tensor to copy HandleData to." -8603,custom_gradient,tensorflow/tensorflow/python/ops/custom_gradient.py,89,function,"Decorator to define a function with a custom gradient. +8379,custom_gradient,tensorflow/tensorflow/python/ops/custom_gradient.py,89,function,"Decorator to define a function with a custom gradient. This decorator allows fine grained control over the gradients of a sequence for operations. This may be useful for multiple reasons, including providing @@ -65840,7 +73153,7 @@ Args: Returns: A function `h(x)` which returns the same value as `f(x)[0]` and whose gradient (as calculated by `tf.gradients`) is determined by `f(x)[1]`." -8604,Bind,tensorflow/tensorflow/python/ops/custom_gradient.py,225,class,"When called evaluates `d(f, args, kwargs)` but supports binding `f`. +8380,Bind,tensorflow/tensorflow/python/ops/custom_gradient.py,225,class,"When called evaluates `d(f, args, kwargs)` but supports binding `f`. >>> @Bind.decorator ... def my_decorator(f, args, kwargs): @@ -65860,18 +73173,9 @@ my_decorator called with (None, 1, 2) {'c': 3} >>> foo.bar(1, 2, c=3) my_decorator called with (1, 2) {'c': 3} 6" -8605,get_variable_by_name,tensorflow/tensorflow/python/ops/custom_gradient.py,267,function,"Given a variable name, retrieves a handle on the tensorflow Variable." -8606,_get_dependent_variables,tensorflow/tensorflow/python/ops/custom_gradient.py,290,function,"Finds variables involved in the subgraph between input_ops and output_ops. - -Args: - input_ops: Flattened list of input ops - output_ops: Flattened list of output ops - -Returns: - A list of variables" -8607,_graph_mode_decorator,tensorflow/tensorflow/python/ops/custom_gradient.py,315,function,Implement custom gradient decorator for graph mode. -8608,_eager_mode_decorator,tensorflow/tensorflow/python/ops/custom_gradient.py,438,function,Implement custom gradient decorator for eager mode. -8609,recompute_grad,tensorflow/tensorflow/python/ops/custom_gradient.py,492,function,"An eager-compatible version of recompute_grad. +8381,decorator,tensorflow/tensorflow/python/ops/custom_gradient.py,249,method, +8382,get_variable_by_name,tensorflow/tensorflow/python/ops/custom_gradient.py,267,function,"Given a variable name, retrieves a handle on the tensorflow Variable." +8383,recompute_grad,tensorflow/tensorflow/python/ops/custom_gradient.py,492,function,"An eager-compatible version of recompute_grad. For f(*args, **kwargs), this supports gradients with respect to args or kwargs, but kwargs are currently only supported in eager-mode. @@ -65889,7 +73193,7 @@ Args: Returns: A function `g` that wraps `f`, but which recomputes `f` on the backwards pass of a gradient call." -8610,grad_pass_through,tensorflow/tensorflow/python/ops/custom_gradient.py,565,function,"Creates a grad-pass-through op with the forward behavior provided in f. +8384,grad_pass_through,tensorflow/tensorflow/python/ops/custom_gradient.py,565,function,"Creates a grad-pass-through op with the forward behavior provided in f. Use this function to wrap any op, maintaining its behavior in the forward pass, but replacing the original op in the backward graph with an identity. @@ -65927,13 +73231,7 @@ Args: Returns: A function `h(x)` which returns the same values as `f(x)` and whose gradients are the same as those of an identity function." -8611,_DynamicPartitionGrads,tensorflow/tensorflow/python/ops/data_flow_grad.py,31,function,Gradients for DynamicPartition. -8612,_DynamicStitchGrads,tensorflow/tensorflow/python/ops/data_flow_grad.py,50,function,Gradients for DynamicStitch and ParallelDynamicStitch. -8613,_as_type_list,tensorflow/tensorflow/python/ops/data_flow_ops.py,48,function,Convert dtypes to a list of types. -8614,_as_shape_list,tensorflow/tensorflow/python/ops/data_flow_ops.py,59,function,Convert shapes to a list of tuples of int (or None). -8615,_as_name_list,tensorflow/tensorflow/python/ops/data_flow_ops.py,91,function, -8616,_shape_common,tensorflow/tensorflow/python/ops/data_flow_ops.py,102,function,The greatest lower bound (ordered by specificity) TensorShape. -8617,QueueBase,tensorflow/tensorflow/python/ops/data_flow_ops.py,119,class,"Base class for queue implementations. +8385,QueueBase,tensorflow/tensorflow/python/ops/data_flow_ops.py,119,class,"Base class for queue implementations. A queue is a TensorFlow data structure that stores tensors across multiple steps, and exposes operations that enqueue and dequeue @@ -65949,16 +73247,181 @@ See `tf.queue.FIFOQueue` and `tf.queue.RandomShuffleQueue` for concrete implementations of this class, and instructions on how to create them." -8618,_shared_name,tensorflow/tensorflow/python/ops/data_flow_ops.py,613,function, -8619,RandomShuffleQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,625,class,"A queue implementation that dequeues elements in a random order. +8386,from_list,tensorflow/tensorflow/python/ops/data_flow_ops.py,185,method,"Create a queue using the queue reference from `queues[index]`. + +Args: + index: An integer scalar tensor that determines the input that gets + selected. + queues: A list of `QueueBase` objects. + +Returns: + A `QueueBase` object. + +Raises: + TypeError: When `queues` is not a list of `QueueBase` objects, + or when the data types of `queues` are not all the same." +8387,queue_ref,tensorflow/tensorflow/python/ops/data_flow_ops.py,226,method,The underlying queue reference. +8388,name,tensorflow/tensorflow/python/ops/data_flow_ops.py,231,method,The name of the underlying queue. +8389,dtypes,tensorflow/tensorflow/python/ops/data_flow_ops.py,238,method,The list of dtypes for each component of a queue element. +8390,shapes,tensorflow/tensorflow/python/ops/data_flow_ops.py,243,method,The list of shapes for each component of a queue element. +8391,names,tensorflow/tensorflow/python/ops/data_flow_ops.py,248,method,The list of names for each component of a queue element. +8392,enqueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,311,method,"Enqueues one element to this queue. + +If the queue is full when this operation executes, it will block +until the element has been enqueued. + +At runtime, this operation may raise an error if the queue is +`tf.QueueBase.close` before or during its execution. If the +queue is closed before this operation runs, +`tf.errors.CancelledError` will be raised. If this operation is +blocked, and either (i) the queue is closed by a close operation +with `cancel_pending_enqueues=True`, or (ii) the session is +`tf.Session.close`, +`tf.errors.CancelledError` will be raised. + +Args: + vals: A tensor, a list or tuple of tensors, or a dictionary containing + the values to enqueue. + name: A name for the operation (optional). + +Returns: + The operation that enqueues a new tuple of tensors to the queue." +8393,enqueue_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,350,method,"Enqueues zero or more elements to this queue. + +This operation slices each component tensor along the 0th dimension to +make multiple queue elements. All of the tensors in `vals` must have the +same size in the 0th dimension. + +If the queue is full when this operation executes, it will block +until all of the elements have been enqueued. + +At runtime, this operation may raise an error if the queue is +`tf.QueueBase.close` before or during its execution. If the +queue is closed before this operation runs, +`tf.errors.CancelledError` will be raised. If this operation is +blocked, and either (i) the queue is closed by a close operation +with `cancel_pending_enqueues=True`, or (ii) the session is +`tf.Session.close`, +`tf.errors.CancelledError` will be raised. + +Args: + vals: A tensor, a list or tuple of tensors, or a dictionary + from which the queue elements are taken. + name: A name for the operation (optional). + +Returns: + The operation that enqueues a batch of tuples of tensors to the queue." +8394,dequeue,tensorflow/tensorflow/python/ops/data_flow_ops.py,421,method,"Dequeues one element from this queue. + +If the queue is empty when this operation executes, it will block +until there is an element to dequeue. + +At runtime, this operation may raise an error if the queue is +`tf.QueueBase.close` before or during its execution. If the +queue is closed, the queue is empty, and there are no pending +enqueue operations that can fulfill this request, +`tf.errors.OutOfRangeError` will be raised. If the session is +`tf.Session.close`, +`tf.errors.CancelledError` will be raised. + +Args: + name: A name for the operation (optional). + +Returns: + The tuple of tensors that was dequeued." +8395,dequeue_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,459,method,"Dequeues and concatenates `n` elements from this queue. + +This operation concatenates queue-element component tensors along +the 0th dimension to make a single component tensor. All of the +components in the dequeued tuple will have size `n` in the 0th dimension. + +If the queue is closed and there are less than `n` elements left, then an +`OutOfRange` exception is raised. + +At runtime, this operation may raise an error if the queue is +`tf.QueueBase.close` before or during its execution. If the +queue is closed, the queue contains fewer than `n` elements, and +there are no pending enqueue operations that can fulfill this +request, `tf.errors.OutOfRangeError` will be raised. If the +session is `tf.Session.close`, +`tf.errors.CancelledError` will be raised. + +Args: + n: A scalar `Tensor` containing the number of elements to dequeue. + name: A name for the operation (optional). + +Returns: + The list of concatenated tensors that was dequeued." +8396,dequeue_up_to,tensorflow/tensorflow/python/ops/data_flow_ops.py,502,method,"Dequeues and concatenates `n` elements from this queue. + +**Note** This operation is not supported by all queues. If a queue does not +support DequeueUpTo, then a `tf.errors.UnimplementedError` is raised. + +This operation concatenates queue-element component tensors along +the 0th dimension to make a single component tensor. If the queue +has not been closed, all of the components in the dequeued tuple +will have size `n` in the 0th dimension. + +If the queue is closed and there are more than `0` but fewer than +`n` elements remaining, then instead of raising a +`tf.errors.OutOfRangeError` like `tf.QueueBase.dequeue_many`, +less than `n` elements are returned immediately. If the queue is +closed and there are `0` elements left in the queue, then a +`tf.errors.OutOfRangeError` is raised just like in `dequeue_many`. +Otherwise the behavior is identical to `dequeue_many`. + +Args: + n: A scalar `Tensor` containing the number of elements to dequeue. + name: A name for the operation (optional). + +Returns: + The tuple of concatenated tensors that was dequeued." +8397,close,tensorflow/tensorflow/python/ops/data_flow_ops.py,543,method,"Closes this queue. + +This operation signals that no more elements will be enqueued in +the given queue. Subsequent `enqueue` and `enqueue_many` +operations will fail. Subsequent `dequeue` and `dequeue_many` +operations will continue to succeed if sufficient elements remain +in the queue. Subsequently dequeue and dequeue_many operations +that would otherwise block waiting for more elements (if close +hadn't been called) will now fail immediately. + +If `cancel_pending_enqueues` is `True`, all pending requests will also +be canceled. + +Args: + cancel_pending_enqueues: (Optional.) A boolean, defaulting to + `False` (described above). + name: A name for the operation (optional). + +Returns: + The operation that closes the queue." +8398,is_closed,tensorflow/tensorflow/python/ops/data_flow_ops.py,578,method,"Returns true if queue is closed. + +This operation returns true if the queue is closed and false if the queue +is open. + +Args: + name: A name for the operation (optional). + +Returns: + True if the queue is closed and false if the queue is open." +8399,size,tensorflow/tensorflow/python/ops/data_flow_ops.py,597,method,"Compute the number of elements in this queue. + +Args: + name: A name for the operation (optional). + +Returns: + A scalar tensor containing the number of elements in this queue." +8400,RandomShuffleQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,625,class,"A queue implementation that dequeues elements in a random order. See `tf.queue.QueueBase` for a description of the methods on this class." -8620,FIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,711,class,"A queue implementation that dequeues elements in first-in first-out order. +8401,FIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,711,class,"A queue implementation that dequeues elements in first-in first-out order. See `tf.queue.QueueBase` for a description of the methods on this class." -8621,GPUCompatibleFIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,771,class,"A queue implementation that dequeues elements in first-in first-out order. +8402,GPUCompatibleFIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,771,class,"A queue implementation that dequeues elements in first-in first-out order. GPUCompatibleFIFOQueue is like FIFOQueue, but the queue resource may be placed either on a CPU or on a GPU. It is not cross-device: enqueues and dequeues @@ -65966,33 +73429,179 @@ will be colocated with the queue resource. GPUCompatibleFIFOQueue only supports enqueue and dequeue at the moment, not enqueue_many or dequeue_many. See `tf.queue.QueueBase` for a description of the methods on this class." -8622,PaddingFIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,849,class,"A FIFOQueue that supports batching variable-sized tensors by padding. +8403,enqueue_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,832,method,enqueue_many is not supported on GPUCompatibleFIFOQueue. +8404,dequeue_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,838,method,dequeue_many is not supported on GPUCompatibleFIFOQueue. +8405,PaddingFIFOQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,849,class,"A FIFOQueue that supports batching variable-sized tensors by padding. A `PaddingFIFOQueue` may contain components with dynamic shape, while also supporting `dequeue_many`. See the constructor for more details. See `tf.queue.QueueBase` for a description of the methods on this class." -8623,PriorityQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,925,class,"A queue implementation that dequeues elements in prioritized order. +8406,PriorityQueue,tensorflow/tensorflow/python/ops/data_flow_ops.py,925,class,"A queue implementation that dequeues elements in prioritized order. See `tf.queue.QueueBase` for a description of the methods on this class." -8624,Barrier,tensorflow/tensorflow/python/ops/data_flow_ops.py,994,class,Represents a key-value map that persists across graph executions. -8625,ConditionalAccumulatorBase,tensorflow/tensorflow/python/ops/data_flow_ops.py,1240,class,"A conditional accumulator for aggregating gradients. +8407,Barrier,tensorflow/tensorflow/python/ops/data_flow_ops.py,994,class,Represents a key-value map that persists across graph executions. +8408,barrier_ref,tensorflow/tensorflow/python/ops/data_flow_ops.py,1078,method,Get the underlying barrier reference. +8409,name,tensorflow/tensorflow/python/ops/data_flow_ops.py,1083,method,The name of the underlying barrier. +8410,insert_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,1089,method,"For each key, assigns the respective value to the specified component. + +This operation updates each element at component_index. + +Args: + component_index: The component of the value that is being assigned. + keys: A vector of keys, with length n. + values: An any-dimensional tensor of values, which are associated with the + respective keys. The first dimension must have length n. + name: Optional name for the op. + +Returns: + The operation that performs the insertion. +Raises: + InvalidArgumentsError: If inserting keys and values without elements." +8411,take_many,tensorflow/tensorflow/python/ops/data_flow_ops.py,1111,method,"Takes the given number of completed elements from this barrier. + +This operation concatenates completed-element component tensors along +the 0th dimension to make a single component tensor. + +If barrier has no completed elements, this operation will block +until there are 'num_elements' elements to take. + +TODO(b/25743580): the semantics of `allow_small_batch` are experimental +and may be extended to other cases in the future. + +TODO(ebrevdo): If a take_many(allow_small_batch=True) is blocking +already when the barrier is closed, it will block for ever. Fix this +by using asynchronous operations. + +Args: + num_elements: The number of elements to take. + allow_small_batch: If the barrier is closed, don't block if there are less + completed elements than requested, but instead return all available + completed elements. + timeout: This specifies the number of milliseconds to block + before returning with DEADLINE_EXCEEDED. (This option is not + supported yet.) + name: A name for the operation (optional). + +Returns: + A tuple of (index, key, value_list). + ""index"" is a int64 tensor of length num_elements containing the + index of the insert_many call for which the very first component of + the given element was inserted into the Barrier, starting with + the value -2**63. Note, this value is different from the + index of the insert_many call for which the element was completed. + ""key"" is a string tensor of length num_elements containing the keys. + ""value_list"" is a tuple of tensors, each one with size num_elements + in the 0th dimension for each component in the barrier's values." +8412,close,tensorflow/tensorflow/python/ops/data_flow_ops.py,1180,method,"Closes this barrier. + +This operation signals that no more new key values will be inserted in the +given barrier. Subsequent InsertMany operations with new keys will fail. +InsertMany operations that just complement already existing keys with other +components, will continue to succeed. Subsequent TakeMany operations will +continue to succeed if sufficient elements remain in the barrier. Subsequent +TakeMany operations that would block will fail immediately. + +If `cancel_pending_enqueues` is `True`, all pending requests to the +underlying queue will also be canceled, and completing of already +started values is also not acceptable anymore. + +Args: + cancel_pending_enqueues: (Optional.) A boolean, defaulting to + `False` (described above). + name: Optional name for the op. + +Returns: + The operation that closes the barrier." +8413,ready_size,tensorflow/tensorflow/python/ops/data_flow_ops.py,1209,method,"Compute the number of complete elements in the given barrier. + +Args: + name: A name for the operation (optional). + +Returns: + A single-element tensor containing the number of complete elements in the + given barrier." +8414,incomplete_size,tensorflow/tensorflow/python/ops/data_flow_ops.py,1223,method,"Compute the number of incomplete elements in the given barrier. + +Args: + name: A name for the operation (optional). + +Returns: + A single-element tensor containing the number of incomplete elements in + the given barrier." +8415,ConditionalAccumulatorBase,tensorflow/tensorflow/python/ops/data_flow_ops.py,1240,class,"A conditional accumulator for aggregating gradients. Up-to-date gradients (i.e., time step at which gradient was computed is equal to the accumulator's time step) are added to the accumulator. Extraction of the average gradient is blocked until the required number of gradients has been accumulated." -8626,ConditionalAccumulator,tensorflow/tensorflow/python/ops/data_flow_ops.py,1320,class,"A conditional accumulator for aggregating gradients. +8416,accumulator_ref,tensorflow/tensorflow/python/ops/data_flow_ops.py,1271,method,The underlying accumulator reference. +8417,name,tensorflow/tensorflow/python/ops/data_flow_ops.py,1276,method,The name of the underlying accumulator. +8418,dtype,tensorflow/tensorflow/python/ops/data_flow_ops.py,1281,method,The datatype of the gradients accumulated by this accumulator. +8419,num_accumulated,tensorflow/tensorflow/python/ops/data_flow_ops.py,1285,method,"Number of gradients that have currently been aggregated in accumulator. + +Args: + name: Optional name for the operation. + +Returns: + Number of accumulated gradients currently in accumulator." +8420,set_global_step,tensorflow/tensorflow/python/ops/data_flow_ops.py,1300,method,"Sets the global time step of the accumulator. + +The operation logs a warning if we attempt to set to a time step that is +lower than the accumulator's own time step. + +Args: + new_global_step: Value of new time step. Can be a variable or a constant + name: Optional name for the operation. + +Returns: + Operation that sets the accumulator's time step." +8421,ConditionalAccumulator,tensorflow/tensorflow/python/ops/data_flow_ops.py,1320,class,"A conditional accumulator for aggregating gradients. Up-to-date gradients (i.e., time step at which gradient was computed is equal to the accumulator's time step) are added to the accumulator. Extraction of the average gradient is blocked until the required number of gradients has been accumulated." -8627,SparseConditionalAccumulator,tensorflow/tensorflow/python/ops/data_flow_ops.py,1412,class,"A conditional accumulator for aggregating sparse gradients. +8422,apply_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1358,method,"Attempts to apply a gradient to the accumulator. + +The attempt is silently dropped if the gradient is stale, i.e., local_step +is less than the accumulator's global time step. + +Args: + grad: The gradient tensor to be applied. + local_step: Time step at which the gradient was computed. + name: Optional name for the operation. + +Returns: + The operation that (conditionally) applies a gradient to the accumulator. + +Raises: + ValueError: If grad is of the wrong shape" +8423,take_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1382,method,"Attempts to extract the average gradient from the accumulator. + +The operation blocks until sufficient number of gradients have been +successfully applied to the accumulator. + +Once successful, the following actions are also triggered: + +- Counter of accumulated gradients is reset to 0. +- Aggregated gradient is reset to 0 tensor. +- Accumulator's internal time step is incremented by 1. + +Args: + num_required: Number of gradients that needs to have been aggregated + name: Optional name for the operation + +Returns: + A tensor holding the value of the average gradient. + +Raises: + InvalidArgumentError: If num_required < 1" +8424,SparseConditionalAccumulator,tensorflow/tensorflow/python/ops/data_flow_ops.py,1412,class,"A conditional accumulator for aggregating sparse gradients. Sparse gradients are represented by `IndexedSlices`. @@ -66009,8 +73618,115 @@ Args: the given name across multiple sessions. name: Optional name for the accumulator. reduction_type: Reduction type to use when taking the gradient." -8628,BaseStagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,1606,class,Base class for Staging Areas. -8629,StagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,1819,class,"Class for staging inputs. No ordering guarantees. +8425,apply_indexed_slices_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1447,method,"Attempts to apply a gradient to the accumulator. + +The attempt is silently dropped if the gradient is stale, i.e., `local_step` +is less than the accumulator's global time step. + +Args: + grad: The gradient `IndexedSlices` to be applied. + local_step: Time step at which the gradient was computed. + name: Optional name for the operation. + +Returns: + The operation that (conditionally) applies a gradient to the accumulator. + +Raises: + InvalidArgumentError: If grad is of the wrong shape" +8426,apply_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1471,method,"Attempts to apply a sparse gradient to the accumulator. + +The attempt is silently dropped if the gradient is stale, i.e., `local_step` +is less than the accumulator's global time step. + +A sparse gradient is represented by its indices, values and possibly empty +or None shape. Indices must be a vector representing the locations of +non-zero entries in the tensor. Values are the non-zero slices of the +gradient, and must have the same first dimension as indices, i.e., the nnz +represented by indices and values must be consistent. Shape, if not empty or +None, must be consistent with the accumulator's shape (if also provided). + +Example: + A tensor [[0, 0], [0, 1], [2, 3]] can be represented + indices: [1,2] + values: [[0,1],[2,3]] + shape: [3, 2] + +Args: + grad_indices: Indices of the sparse gradient to be applied. + grad_values: Values of the sparse gradient to be applied. + grad_shape: Shape of the sparse gradient to be applied. + local_step: Time step at which the gradient was computed. + name: Optional name for the operation. + +Returns: + The operation that (conditionally) applies a gradient to the accumulator. + +Raises: + InvalidArgumentError: If grad is of the wrong shape" +8427,take_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1519,method,"Attempts to extract the average gradient from the accumulator. + +The operation blocks until sufficient number of gradients have been +successfully applied to the accumulator. + +Once successful, the following actions are also triggered: +- Counter of accumulated gradients is reset to 0. +- Aggregated gradient is reset to 0 tensor. +- Accumulator's internal time step is incremented by 1. + +Args: + num_required: Number of gradients that needs to have been aggregated + name: Optional name for the operation + +Returns: + A tuple of indices, values, and shape representing the average gradient. + +Raises: + InvalidArgumentError: If `num_required` < 1" +8428,take_indexed_slices_grad,tensorflow/tensorflow/python/ops/data_flow_ops.py,1543,method,"Attempts to extract the average gradient from the accumulator. + +The operation blocks until sufficient number of gradients have been +successfully applied to the accumulator. + +Once successful, the following actions are also triggered: +- Counter of accumulated gradients is reset to 0. +- Aggregated gradient is reset to 0 tensor. +- Accumulator's internal time step is incremented by 1. + +Args: + num_required: Number of gradients that needs to have been aggregated + name: Optional name for the operation + +Returns: + An `IndexedSlices` holding the value of the average gradient. + +Raises: + InvalidArgumentError: If `num_required` < 1" +8429,num_accumulated,tensorflow/tensorflow/python/ops/data_flow_ops.py,1572,method,"Number of gradients that have currently been aggregated in accumulator. + +Args: + name: Optional name for the operation. + +Returns: + Number of accumulated gradients currently in accumulator." +8430,set_global_step,tensorflow/tensorflow/python/ops/data_flow_ops.py,1587,method,"Sets the global time step of the accumulator. + +The operation logs a warning if we attempt to set to a time step that is +lower than the accumulator's own time step. + +Args: + new_global_step: Value of new time step. Can be a variable or a constant + name: Optional name for the operation. + +Returns: + Operation that sets the accumulator's time step." +8431,BaseStagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,1606,class,Base class for Staging Areas. +8432,name,tensorflow/tensorflow/python/ops/data_flow_ops.py,1650,method,The name of the staging area. +8433,dtypes,tensorflow/tensorflow/python/ops/data_flow_ops.py,1655,method,The list of dtypes for each component of a staging area element. +8434,shapes,tensorflow/tensorflow/python/ops/data_flow_ops.py,1660,method,The list of shapes for each component of a staging area element. +8435,names,tensorflow/tensorflow/python/ops/data_flow_ops.py,1665,method,The list of names for each component of a staging area element. +8436,capacity,tensorflow/tensorflow/python/ops/data_flow_ops.py,1670,method,The maximum number of elements of this staging area. +8437,memory_limit,tensorflow/tensorflow/python/ops/data_flow_ops.py,1675,method,The maximum number of bytes of this staging area. +8438,StagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,1819,class,"Class for staging inputs. No ordering guarantees. A `StagingArea` is a TensorFlow data structure that stores tensors across multiple steps, and exposes operations that can put and get tensors. @@ -66040,7 +73756,73 @@ devices such as GPUs. All get() and peek() commands block if the requested data is not present in the Staging Area." -8630,MapStagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,2045,class,"A `MapStagingArea` is a TensorFlow data structure that stores tensors +8439,put,tensorflow/tensorflow/python/ops/data_flow_ops.py,1897,method,"Create an op that places a value into the staging area. + +This operation will block if the `StagingArea` has reached +its capacity. + +Args: + values: A single tensor, a list or tuple of tensors, or a dictionary with + tensor values. The number of elements must match the length of the + list provided to the dtypes argument when creating the StagingArea. + name: A name for the operation (optional). + +Returns: + The created op. + +Raises: + ValueError: If the number or type of inputs don't match the staging area." +8440,get,tensorflow/tensorflow/python/ops/data_flow_ops.py,1942,method,"Gets one element from this staging area. + +If the staging area is empty when this operation executes, it will block +until there is an element to dequeue. + +Note that unlike others ops that can block, like the queue Dequeue +operations, this can stop other work from happening. To avoid this, the +intended use is for this to be called only when there will be an element +already available. One method for doing this in a training loop would be to +run a `put()` call during a warmup session.run call, and then call both +`get()` and `put()` in each subsequent step. + +The placement of the returned tensor will be determined by the current +device scope when this function is called. + +Args: + name: A name for the operation (optional). + +Returns: + The tuple of tensors that was gotten." +8441,peek,tensorflow/tensorflow/python/ops/data_flow_ops.py,1976,method,"Peeks at an element in the staging area. + +If the staging area is too small to contain the element at +the specified index, it will block until enough elements +are inserted to complete the operation. + +The placement of the returned tensor will be determined by +the current device scope when this function is called. + +Args: + index: The index of the tensor within the staging area + to look up. + name: A name for the operation (optional). + +Returns: + The tuple of tensors that was gotten." +8442,size,tensorflow/tensorflow/python/ops/data_flow_ops.py,2006,method,"Returns the number of elements in the staging area. + +Args: + name: A name for the operation (optional) + +Returns: + The created op" +8443,clear,tensorflow/tensorflow/python/ops/data_flow_ops.py,2025,method,"Clears the staging area. + +Args: + name: A name for the operation (optional) + +Returns: + The created op" +8444,MapStagingArea,tensorflow/tensorflow/python/ops/data_flow_ops.py,2045,class,"A `MapStagingArea` is a TensorFlow data structure that stores tensors across multiple steps, and exposes operations that can put and get tensors. Each `MapStagingArea` element is a (key, value) pair. @@ -66097,7 +73879,88 @@ Partial gets from the map are also supported. This removes the partially requested tensors from the entry, but the entry is only removed from the map once all tensors associated with it are removed." -8631,RecordInput,tensorflow/tensorflow/python/ops/data_flow_ops.py,2430,class,"RecordInput asynchronously reads and randomly yields TFRecords. +8445,put,tensorflow/tensorflow/python/ops/data_flow_ops.py,2163,method,"Create an op that stores the (key, vals) pair in the staging area. + +Incomplete puts are possible, preferably using a dictionary for vals +as the appropriate dtypes and shapes can be inferred from the value names +dictionary key values. If vals is a list or tuple, indices must +also be specified so that the op knows at which element position +to perform the insert. + +This operation will block if the capacity or memory limit of this +container is reached. + +Args: + key: Key associated with the data + vals: Tensor (or a dict/tuple of Tensors) to place + into the staging area. + indices: (Optional) if vals is a tuple/list, this is required. + name: A name for the operation (optional) + +Returns: + The created op + +Raises: + ValueError: If the number or type of inputs don't match the staging + area." +8446,peek,tensorflow/tensorflow/python/ops/data_flow_ops.py,2237,method,"Peeks at staging area data associated with the key. + +If the key is not in the staging area, it will block +until the associated (key, value) is inserted. + +Args: + key: Key associated with the required data + indices: Partial list of tensors to retrieve (optional). + A list of integer or string indices. + String indices are only valid if the Staging Area + has names associated with it. + name: A name for the operation (optional) + +Returns: + The created op" +8447,get,tensorflow/tensorflow/python/ops/data_flow_ops.py,2272,method,"If the key is provided, the associated (key, value) is returned from the staging area. + +If the key is not in the staging area, this method will block until +the associated (key, value) is inserted. +If no key is provided and the staging area is ordered, +the (key, value) with the smallest key will be returned. +Otherwise, a random (key, value) will be returned. + +If the staging area is empty when this operation executes, +it will block until there is an element to dequeue. + +Args: + key: Key associated with the required data (Optional) + indices: Partial list of tensors to retrieve (optional). + A list of integer or string indices. + String indices are only valid if the Staging Area + has names associated with it. + name: A name for the operation (optional) + +Returns: + The created op" +8448,size,tensorflow/tensorflow/python/ops/data_flow_ops.py,2372,method,"Returns the number of elements in the staging area. + +Args: + name: A name for the operation (optional) + +Returns: + The created op" +8449,incomplete_size,tensorflow/tensorflow/python/ops/data_flow_ops.py,2391,method,"Returns the number of incomplete elements in the staging area. + +Args: + name: A name for the operation (optional) + +Returns: + The created op" +8450,clear,tensorflow/tensorflow/python/ops/data_flow_ops.py,2410,method,"Clears the staging area. + +Args: + name: A name for the operation (optional) + +Returns: + The created op" +8451,RecordInput,tensorflow/tensorflow/python/ops/data_flow_ops.py,2430,class,"RecordInput asynchronously reads and randomly yields TFRecords. A RecordInput Op will continuously read a batch of records asynchronously into a buffer of some fixed capacity. It can also asynchronously yield @@ -66108,11 +73971,14 @@ placed into the buffer so that sufficient randomization can take place. The order the files are read will be shifted each epoch by `shift_amount` so that the data is presented in a different order every epoch." -8632,get_zeros_dtype,tensorflow/tensorflow/python/ops/default_gradient.py,26,function,Return the dtype for the default gradient for a Tensor. -8633,shape_and_dtype,tensorflow/tensorflow/python/ops/default_gradient.py,38,function,Return the shape and dtype for the default gradient for a Tensor. -8634,zeros_like,tensorflow/tensorflow/python/ops/default_gradient.py,52,function,"Like array_ops.zeros_like, but respects resource handles." -8635,ones_like,tensorflow/tensorflow/python/ops/default_gradient.py,60,function,"Like array_ops.ones_like, but respects resource handles." -8636,supports_default_grad,tensorflow/tensorflow/python/ops/default_gradient.py,68,function,"Whether tensor `t` supports creating a default gradient. +8452,get_yield_op,tensorflow/tensorflow/python/ops/data_flow_ops.py,2491,method,"Adds a node that yields a group of records every time it is executed. +If RecordInput `batches` parameter is not None, it yields a list of +record batches with the specified `batch_size`." +8453,get_zeros_dtype,tensorflow/tensorflow/python/ops/default_gradient.py,26,function,Return the dtype for the default gradient for a Tensor. +8454,shape_and_dtype,tensorflow/tensorflow/python/ops/default_gradient.py,38,function,Return the shape and dtype for the default gradient for a Tensor. +8455,zeros_like,tensorflow/tensorflow/python/ops/default_gradient.py,52,function,"Like array_ops.zeros_like, but respects resource handles." +8456,ones_like,tensorflow/tensorflow/python/ops/default_gradient.py,60,function,"Like array_ops.ones_like, but respects resource handles." +8457,supports_default_grad,tensorflow/tensorflow/python/ops/default_gradient.py,68,function,"Whether tensor `t` supports creating a default gradient. This function assumes that `t` is of a trainable type. @@ -66121,46 +73987,7 @@ Args: Returns: Bool" -8637,DequantizeOpTest,tensorflow/tensorflow/python/ops/dequantize_op_test.py,29,class, -8638,_clip,tensorflow/tensorflow/python/ops/embedding_ops.py,43,function,"Helper function for _embedding_lookup_and_transform. - -This function optionally clips embeddings to an l2-norm of max_norm. - -Args: - params: A `Tensor` of embeddings retrieved by `gather`. - ids: The `ids` argument that was passed to `gather`. - max_norm: If not `None`, each embedding is clipped if its l2-norm is larger - than this value. - -Returns: - A `Tensor` with the same type as `params`." -8639,_embedding_lookup_and_transform,tensorflow/tensorflow/python/ops/embedding_ops.py,86,function,"Helper function for embedding_lookup and _compute_sampled_logits. - -This function is a generalization of embedding_lookup that optionally -applies a caller-specified transformation to each embedding. This is -done through the `transform_fn` argument. If provided, the function is -applied to each partitioned tensor of retrieved embeddings, colocated -with the embeddings. This function will be called with a single `Tensor` -argument of the same type as the `params` tensor and should return a -`Tensor`. The shape of the argument will be the same as `params` except -for the size of the first dimension. The first dimension of the result's -shape must be the same size as the argument's. - -Args: - params: See embedding_lookup. - ids: See embedding_lookup. - partition_strategy: See embedding_lookup. - name: See embedding_lookup. - max_norm: See embedding_lookup. - transform_fn: An optional function to apply to each retrieved embedding. If - max_norm is provided, transform_fn is applied to the norm-limited - embeddings. - -Returns: - See embedding_lookup for details. -Raises: - ValueError: If `params` is empty." -8640,embedding_lookup,tensorflow/tensorflow/python/ops/embedding_ops.py,255,function,"Looks up embeddings for the given `ids` from a list of tensors. +8458,embedding_lookup,tensorflow/tensorflow/python/ops/embedding_ops.py,255,function,"Looks up embeddings for the given `ids` from a list of tensors. This function is used to perform parallel lookups on the list of tensors in `params`. It is a generalization of `tf.gather`, where `params` is @@ -66213,7 +74040,7 @@ Returns: Raises: ValueError: If `params` is empty." -8641,embedding_lookup_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,333,function,"Looks up embeddings for the given `ids` from a list of tensors. +8459,embedding_lookup_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,333,function,"Looks up embeddings for the given `ids` from a list of tensors. This function is used to perform parallel lookups on the list of tensors in `params`. It is a generalization of `tf.gather`, where `params` is @@ -66272,7 +74099,7 @@ Returns: Raises: ValueError: If `params` is empty." -8642,embedding_lookup_sparse,tensorflow/tensorflow/python/ops/embedding_ops.py,399,function,"Looks up embeddings for the given ids and weights from a list of tensors. +8460,embedding_lookup_sparse,tensorflow/tensorflow/python/ops/embedding_ops.py,399,function,"Looks up embeddings for the given ids and weights from a list of tensors. This op assumes that there is at least one id for each row in the dense tensor represented by sp_ids (i.e. there are no rows with empty features), and that @@ -66346,7 +74173,7 @@ Raises: TypeError: If `sp_ids` is not a `SparseTensor`, or if `sp_weights` is neither `None` nor `SparseTensor`. ValueError: If `combiner` is not one of {""mean"", ""sqrtn"", ""sum""}." -8643,embedding_lookup_sparse_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,582,function,"Looks up embeddings for the given ids and weights from a list of tensors. +8461,embedding_lookup_sparse_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,582,function,"Looks up embeddings for the given ids and weights from a list of tensors. This op assumes that there is at least one id for each row in the dense tensor represented by sp_ids (i.e. there are no rows with empty features), and that @@ -66424,7 +74251,7 @@ Raises: TypeError: If `sp_ids` is not a `SparseTensor`, or if `sp_weights` is neither `None` nor `SparseTensor`. ValueError: If `combiner` is not one of {""mean"", ""sqrtn"", ""sum""}." -8644,safe_embedding_lookup_sparse_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,673,function,"Lookup embedding results, accounting for invalid IDs and empty features. +8462,safe_embedding_lookup_sparse_v2,tensorflow/tensorflow/python/ops/embedding_ops.py,673,function,"Lookup embedding results, accounting for invalid IDs and empty features. The partitioned embedding in `embedding_weights` must all be the same shape except for the first dimension. The first dimension is allowed to vary as the @@ -66505,7 +74332,7 @@ Returns: Raises: ValueError: if `embedding_weights` is empty." -8645,safe_embedding_lookup_sparse,tensorflow/tensorflow/python/ops/embedding_ops.py,775,function,"Lookup embedding results, accounting for invalid IDs and empty features. +8463,safe_embedding_lookup_sparse,tensorflow/tensorflow/python/ops/embedding_ops.py,775,function,"Lookup embedding results, accounting for invalid IDs and empty features. The partitioned embedding in `embedding_weights` must all be the same shape except for the first dimension. The first dimension is allowed to vary as the @@ -66581,7 +74408,7 @@ Returns: Raises: ValueError: if `embedding_weights` is empty." -8646,embedding_lookup_ragged,tensorflow/tensorflow/python/ops/embedding_ops.py,943,function,"Look up the ragged ids in a list of embedding tensors. +8464,embedding_lookup_ragged,tensorflow/tensorflow/python/ops/embedding_ops.py,943,function,"Look up the ragged ids in a list of embedding tensors. Args: embedding_weights: A tensor representing the complete embedding tensor @@ -66600,9 +74427,7 @@ Returns: Raises: ValueError: whether the embedding_weights is empty or the ragged_ids is not a RaggedTensor." -8647,_prune_invalid_ids,tensorflow/tensorflow/python/ops/embedding_ops.py,989,function,Prune invalid IDs (< 0) from the input ids and weights. -8648,_prune_invalid_weights,tensorflow/tensorflow/python/ops/embedding_ops.py,1002,function,Prune invalid weights (< 0) from the input ids and weights. -8649,foldl,tensorflow/tensorflow/python/ops/functional_ops.py,50,function,"foldl on the list of tensors unpacked from `elems` on dimension 0. +8465,foldl,tensorflow/tensorflow/python/ops/functional_ops.py,50,function,"foldl on the list of tensors unpacked from `elems` on dimension 0. This foldl operator repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the tensors @@ -66649,7 +74474,7 @@ Example: sum = foldl(lambda a, x: a + x, elems) # sum == 21 ```" -8650,foldl_v2,tensorflow/tensorflow/python/ops/functional_ops.py,177,function,"foldl on the list of tensors unpacked from `elems` on dimension 0. +8466,foldl_v2,tensorflow/tensorflow/python/ops/functional_ops.py,177,function,"foldl on the list of tensors unpacked from `elems` on dimension 0. This foldl operator repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the tensors @@ -66697,7 +74522,7 @@ Example: sum = foldl(lambda a, x: a + x, elems) # sum == 21 ```" -8651,foldr,tensorflow/tensorflow/python/ops/functional_ops.py,245,function,"foldr on the list of tensors unpacked from `elems` on dimension 0. +8467,foldr,tensorflow/tensorflow/python/ops/functional_ops.py,245,function,"foldr on the list of tensors unpacked from `elems` on dimension 0. This foldr operator repeatedly applies the callable `fn` to a sequence of elements from last to first. The elements are made of the tensors @@ -66744,7 +74569,7 @@ Example: sum = foldr(lambda a, x: a + x, elems) # sum == 21 ```" -8652,foldr_v2,tensorflow/tensorflow/python/ops/functional_ops.py,373,function,"foldr on the list of tensors unpacked from `elems` on dimension 0. +8468,foldr_v2,tensorflow/tensorflow/python/ops/functional_ops.py,373,function,"foldr on the list of tensors unpacked from `elems` on dimension 0. This foldr operator repeatedly applies the callable `fn` to a sequence of elements from last to first. The elements are made of the tensors @@ -66792,7 +74617,7 @@ Example: sum = foldr(lambda a, x: a + x, elems) # sum == 21 ```" -8653,scan,tensorflow/tensorflow/python/ops/functional_ops.py,441,function,"scan on the list of tensors unpacked from `elems` on dimension 0. +8469,scan,tensorflow/tensorflow/python/ops/functional_ops.py,441,function,"scan on the list of tensors unpacked from `elems` on dimension 0. See also `tf.map_fn`. @@ -66884,7 +74709,7 @@ Examples: fibonaccis = scan(lambda a, _: (a[1], a[0] + a[1]), elems, initializer) # fibonaccis == ([1, 1, 2, 3, 5, 8], [1, 2, 3, 5, 8, 13]) ```" -8654,scan_v2,tensorflow/tensorflow/python/ops/functional_ops.py,705,function,"scan on the list of tensors unpacked from `elems` on dimension 0. +8470,scan_v2,tensorflow/tensorflow/python/ops/functional_ops.py,705,function,"scan on the list of tensors unpacked from `elems` on dimension 0. The simplest version of `scan` repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the tensors @@ -66975,7 +74800,7 @@ Examples: fibonaccis = scan(lambda a, _: (a[1], a[0] + a[1]), elems, initializer) # fibonaccis == ([1, 1, 2, 3, 5, 8], [1, 2, 3, 5, 8, 13]) ```" -8655,If,tensorflow/tensorflow/python/ops/functional_ops.py,819,function,"output = Cond(inputs) ? +8471,If,tensorflow/tensorflow/python/ops/functional_ops.py,819,function,"output = Cond(inputs) ? then_branch(inputs) : else_branch(inputs). @@ -66994,7 +74819,7 @@ Args: Returns: A list of tensors returned by either then_branch(inputs) or else_branch(inputs)." -8656,Gradient,tensorflow/tensorflow/python/ops/functional_ops.py,850,function,"Computes the gradient function for function f via backpropagation. +8472,Gradient,tensorflow/tensorflow/python/ops/functional_ops.py,850,function,"Computes the gradient function for function f via backpropagation. Args: inputs: A list of tensors of size N + M. @@ -67010,9 +74835,7 @@ Args: Returns: A list of tensors of size N." -8657,_GetInputDtypes,tensorflow/tensorflow/python/ops/functional_ops.py,874,function,"Returns the input dtypes of func, excluding dtypes for captured inputs." -8658,_LoopBodyCaptureWrapper,tensorflow/tensorflow/python/ops/functional_ops.py,888,function,Returns a wrapper for `func` that handles loop-carried captured inputs. -8659,While,tensorflow/tensorflow/python/ops/functional_ops.py,911,function,"output = input; While (Cond(output)) { output = Body(output) }. +8473,While,tensorflow/tensorflow/python/ops/functional_ops.py,911,function,"output = input; While (Cond(output)) { output = Body(output) }. Args: input_: A list of `Tensor` objects. A list of input tensors whose types are @@ -67036,8 +74859,7 @@ Raises: Returns: A list of `Tensor` objects. Has the same type as `input`. A list of output tensors whose types are T." -8660,_ForUsingWhile,tensorflow/tensorflow/python/ops/functional_ops.py,992,function,Helper to implement a For loop using a While. -8661,For,tensorflow/tensorflow/python/ops/functional_ops.py,1054,function,"out = input; for i in range(start, limit, delta) out = body(i, out). +8474,For,tensorflow/tensorflow/python/ops/functional_ops.py,1054,function,"out = input; for i in range(start, limit, delta) out = body(i, out). Args: start: A `Tensor` of type `int32`. @@ -67056,7 +74878,7 @@ Args: Returns: A list of `Tensor` objects. Has the same type as `input`. A list of output tensors whose types are T." -8662,partitioned_call,tensorflow/tensorflow/python/ops/functional_ops.py,1112,function,"Executes a function while respecting device annotations. +8475,partitioned_call,tensorflow/tensorflow/python/ops/functional_ops.py,1112,function,"Executes a function while respecting device annotations. Currently, only those functions that execute within the same address space can be executed. @@ -67080,61 +74902,7 @@ Returns: The list of `Tensor`s returned by invoking `f(args)`. If the function does not return anything, then returns `None` if eager execution is enabled, or the `Operation` if not." -8663,_set_read_only_resource_inputs_attr,tensorflow/tensorflow/python/ops/functional_ops.py,1217,function,"Sets the list of resource inputs which are read-only. - -This is used by AutomaticControlDependencies. - -Args: - op: PartitionedCall Operation. - func_graph: FuncGraph." -8664,FunctionalOpsTest,tensorflow/tensorflow/python/ops/functional_ops_test.py,30,class, -8665,_product,tensorflow/tensorflow/python/ops/gradient_checker.py,38,function, -8666,_extra_feeds,tensorflow/tensorflow/python/ops/gradient_checker.py,48,function, -8667,_compute_theoretical_jacobian,tensorflow/tensorflow/python/ops/gradient_checker.py,57,function,"Computes the theoretical Jacobian for dy/dx. - -Computes the theoretical Jacobian using the ops generated by -compute_gradient(). - -Args: - x: the tensor ""x"". - x_shape: the dimensions of x as a tuple or an array of ints. - x_data: a numpy parray as the input data for x - dy: the tensor ""dy"". - dy_shape: the dimensions of dy as a tuple or an array of ints. - dx: Tensor or IndexedSlices representing dx - extra_feed_dict: dict that allows fixing specified tensor values - during the jacobian calculation. - -Returns: - A 2-d numpy array representing the Jacobian for dy/dx. It has ""x_size"" rows - and ""dy_size"" columns where ""x_size"" is the number of elements in x and - ""dy_size"" is the number of elements in dy. - -Raises: - ValueError: If `dy` is empty but the gradient is nonzero." -8668,_compute_numeric_jacobian,tensorflow/tensorflow/python/ops/gradient_checker.py,135,function,"Computes the numeric Jacobian for dy/dx. - -Computes the numeric Jacobian by slightly perturbing the inputs and -measuring the differences on the output. - -Args: - x: the tensor ""x"". - x_shape: the dimensions of x as a tuple or an array of ints. - x_data: a numpy array as the input data for x - y: the tensor ""y"". - y_shape: the dimensions of y as a tuple or an array of ints. - delta: the amount of perturbation we give to the input - extra_feed_dict: dict that allows fixing specified tensor values - during the jacobian calculation. - -Returns: - A 2-d numpy array representing the Jacobian for dy/dx. It has ""x_size"" rows - and ""y_size"" columns where ""x_size"" is the number of elements in x and - ""y_size"" is the number of elements in y." -8669,_compute_dx_and_dy,tensorflow/tensorflow/python/ops/gradient_checker.py,196,function,Returns a node to compute gradient of y wrt x. -8670,_compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker.py,211,function,Computes the theoretical and numerical jacobian. -8671,_compute_gradient_list,tensorflow/tensorflow/python/ops/gradient_checker.py,245,function,Compute gradients for a list of x values. -8672,compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker.py,277,function,"Computes and returns the theoretical and numerical Jacobian. +8476,compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker.py,277,function,"Computes and returns the theoretical and numerical Jacobian. If `x` or `y` is complex, the Jacobian will still be real but the corresponding Jacobian dimension(s) will be twice as large. This is required @@ -67168,8 +74936,7 @@ Returns: Jacobian for dy/dx. Each has ""x_size"" rows and ""y_size"" columns where ""x_size"" is the number of elements in x and ""y_size"" is the number of elements in y. If x is a list, returns a list of two numpy arrays." -8673,_compute_error,tensorflow/tensorflow/python/ops/gradient_checker.py,338,function, -8674,compute_gradient_error,tensorflow/tensorflow/python/ops/gradient_checker.py,354,function,"Computes the gradient error. +8477,compute_gradient_error,tensorflow/tensorflow/python/ops/gradient_checker.py,354,function,"Computes the gradient error. Computes the maximum error for dy/dx between the computed Jacobian and the numerically estimated Jacobian. @@ -67199,80 +74966,7 @@ Args: Returns: The maximum error in between the two Jacobians." -8675,_bad_grad,tensorflow/tensorflow/python/ops/gradient_checker_test.py,37,function,A gradient that returns the wrong shape. -8676,_nan_grad,tensorflow/tensorflow/python/ops/gradient_checker_test.py,43,function,A gradient that returns NaN. -8677,GradientCheckerTest,tensorflow/tensorflow/python/ops/gradient_checker_test.py,48,class, -8678,MiniMNISTTest,tensorflow/tensorflow/python/ops/gradient_checker_test.py,203,class, -8679,_product,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,35,function, -8680,_eval_indexed_slices,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,45,function,"Converts IndexedSlices to IndexedSlicesValue with numpy indices/values. - -When eager execution is enabled, converts IndexedSlices -to IndexedSlicesValue with numpy indices/values. - -Args: - a: any value. - -Returns: - If a is IndexedSlices and eager execution is enabled, calls numpy() on a's - fields. Otherwise returns a unchanged." -8681,_to_numpy,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,66,function,"Converts Tensors, EagerTensors, and IndexedSlicesValue to numpy arrays. - -Args: - a: any value. - -Returns: - If a is EagerTensor or Tensor, returns the evaluation of a by calling - numpy() or run(). If a is IndexedSlicesValue, constructs the corresponding - dense numpy array. Otherwise returns a unchanged." -8682,_prepare,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,95,function,"Return a function that executes 'f'. - - In TF 2.x, this is the same as `f`. - In TF 1.x, returns a Python function that executes the graph defined by `f` - in a Session. - -Args: - f: the function. - xs_dtypes: dtypes of f's arguments. - xs_shapes: shapes of f's arguments. - -Returns:" -8683,_compute_theoretical_jacobian,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,129,function,"Computes the theoretical Jacobian for f regarding xs[param]. - -One can think of the relation among f, xs and y as y = f(xs). - -Args: - f: the function. - y_shape: the shape of the result. - y_dtype: the dtype of the result. - xs: a list of tensors. - param: the index of the target parameter. - -Returns: - A 2-d numpy array representing the Jacobian. It has ""y_size"" rows - and ""x_size"" columns where ""x_size"" is the number of elements in xs[param] - and ""y_size"" is the number of elements in the result. - -Raises: - ValueError: If result is empty but the gradient is nonzero." -8684,_compute_numeric_jacobian,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,201,function,"Computes the numeric Jacobian for f regarding xs[param]. - -One can think of the relation among f, xs and y as y = f(xs). - -Args: - f: the function. - y_size: the number of elements of the result. - y_dtype: the dtype of the result. - xs: a list of tensors. - param: the index of the target parameter. - delta: the amount of perturbation we give to the input. - -Returns: - A 2-d numpy array representing the Jacobian. It has ""y_size"" rows - and ""x_size"" columns where ""x_size"" is the number of elements in xs[param] - and ""y_size"" is the number of elements in the result." -8685,_compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,259,function,Computes the theoretical and numerical jacobian. -8686,_compute_gradient_list,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,279,function,Compute gradients for a list of x values. -8687,compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,295,function,"Computes the theoretical and numeric Jacobian of `f`. +8478,compute_gradient,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,295,function,"Computes the theoretical and numeric Jacobian of `f`. With y = f(x), computes the theoretical and numeric Jacobian dy/dx. @@ -67303,7 +74997,7 @@ theoretical, numerical = tf.test.compute_gradient(test_func, [1.0]) theoretical, numerical # ((array([[2.]], dtype=float32),), (array([[2.000004]], dtype=float32),)) ```" -8688,max_error,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,335,function,"Computes maximum elementwise gap. +8479,max_error,tensorflow/tensorflow/python/ops/gradient_checker_v2.py,335,function,"Computes maximum elementwise gap. Computes the maximum elementwise gap between two lists of tensors of the same shape. @@ -67314,10 +75008,7 @@ Args: Returns: The maximum elementwise gap between the two." -8689,_random_complex,tensorflow/tensorflow/python/ops/gradient_checker_v2_test.py,41,function, -8690,GradientCheckerTest,tensorflow/tensorflow/python/ops/gradient_checker_v2_test.py,49,class, -8691,MiniMNISTTest,tensorflow/tensorflow/python/ops/gradient_checker_v2_test.py,280,class, -8692,gradients,tensorflow/tensorflow/python/ops/gradients_impl.py,44,function,"Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. +8480,gradients,tensorflow/tensorflow/python/ops/gradients_impl.py,44,function,"Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. `ys` and `xs` are each a `Tensor` or a list of tensors. `grad_ys` is a list of `Tensor`, holding the gradients received by the @@ -67426,7 +75117,7 @@ Raises: have a registered gradient function. ValueError: if the arguments are invalid. RuntimeError: if called in Eager mode." -8693,gradients_v2,tensorflow/tensorflow/python/ops/gradients_impl.py,177,function,"Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. +8481,gradients_v2,tensorflow/tensorflow/python/ops/gradients_impl.py,177,function,"Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. `tf.gradients` is only valid in a graph context. In particular, it is valid in the context of a `tf.function` wrapper, where code @@ -67549,37 +75240,7 @@ Raises: have a registered gradient function. ValueError: if the arguments are invalid. RuntimeError: if called in Eager mode." -8694,_hessian_vector_product,tensorflow/tensorflow/python/ops/gradients_impl.py,323,function,"Multiply the Hessian of `ys` wrt `xs` by `v`. - -This is an efficient construction that uses a backprop-like approach -to compute the product between the Hessian and another vector. The -Hessian is usually too large to be explicitly computed or even -represented, but this method allows us to at least multiply by it -for the same big-O cost as backprop. - -Implicit Hessian-vector products are the main practical, scalable way -of using second derivatives with neural networks. They allow us to -do things like construct Krylov subspaces and approximate conjugate -gradient descent. - -Example: if `y` = 1/2 `x`^T A `x`, then `hessian_vector_product(y, -x, v)` will return an expression that evaluates to the same values -as (A + A.T) `v`. - -Args: - ys: A scalar value, or a tensor or list of tensors to be summed to - yield a scalar. - xs: A list of tensors that we should construct the Hessian over. - v: A list of tensors, with the same shapes as xs, that we want to - multiply by the Hessian. - -Returns: - A list of tensors (or if the list would be length 1, a single tensor) - containing the product between the Hessian and `v`. - -Raises: - ValueError: `xs` and `v` have different length." -8695,hessians,tensorflow/tensorflow/python/ops/gradients_impl.py,377,function,"Constructs the Hessian of sum of `ys` with respect to `x` in `xs`. +8482,hessians,tensorflow/tensorflow/python/ops/gradients_impl.py,377,function,"Constructs the Hessian of sum of `ys` with respect to `x` in `xs`. `hessians()` adds ops to the graph to output the Hessian matrix of `ys` with respect to `xs`. It returns a list of `Tensor` of length `len(xs)` @@ -67603,7 +75264,7 @@ Returns: Raises: LookupError: if one of the operations between `xs` and `ys` does not have a registered gradient function." -8696,HessiansV2,tensorflow/tensorflow/python/ops/gradients_impl.py,444,function,"Constructs the Hessian of sum of `ys` with respect to `x` in `xs`. +8483,HessiansV2,tensorflow/tensorflow/python/ops/gradients_impl.py,444,function,"Constructs the Hessian of sum of `ys` with respect to `x` in `xs`. `hessians()` adds ops to the graph to output the Hessian matrix of `ys` with respect to `xs`. It returns a list of `Tensor` of length `len(xs)` @@ -67626,150 +75287,7 @@ Returns: Raises: LookupError: if one of the operations between `xs` and `ys` does not have a registered gradient function." -8697,GradientsTest,tensorflow/tensorflow/python/ops/gradients_test.py,66,class, -8698,FunctionGradientsTest,tensorflow/tensorflow/python/ops/gradients_test.py,492,class, -8699,StopGradientTest,tensorflow/tensorflow/python/ops/gradients_test.py,691,class, -8700,PreventGradientTest,tensorflow/tensorflow/python/ops/gradients_test.py,701,class, -8701,HessianVectorProductTest,tensorflow/tensorflow/python/ops/gradients_test.py,711,class, -8702,HessianTest,tensorflow/tensorflow/python/ops/gradients_test.py,740,class, -8703,IndexedSlicesToTensorTest,tensorflow/tensorflow/python/ops/gradients_test.py,833,class, -8704,OnlyRealGradientsTest,tensorflow/tensorflow/python/ops/gradients_test.py,917,class, -8705,ResourceCondTest,tensorflow/tensorflow/python/ops/gradients_test.py,929,class, -8706,GetDependentVariablesTest,tensorflow/tensorflow/python/ops/gradients_test.py,954,class, -8707,CustomGradientTest,tensorflow/tensorflow/python/ops/gradients_test.py,1075,class, -8708,TensorListGradientsTest,tensorflow/tensorflow/python/ops/gradients_test.py,1427,class, -8709,VariablesGradientTest,tensorflow/tensorflow/python/ops/gradients_test.py,1447,class, -8710,GradPassThroughTest,tensorflow/tensorflow/python/ops/gradients_test.py,1647,class, -8711,_MarkReachedOps,tensorflow/tensorflow/python/ops/gradients_util.py,52,function,"Mark all ops reached from ""from_ops"". - -Args: - from_ops: list of Operations. - reached_ops: set of Operations. - func_graphs: list of FuncGraphs. This method will traverse through - these functions if they capture from_ops or any reachable ops." -8712,_PendingCount,tensorflow/tensorflow/python/ops/gradients_util.py,72,function,"Initialize the pending count for ops between two lists of Operations. - -'pending_count[op]' indicates the number of backprop inputs -to this operation. - -Args: - to_ops: list of Operations. - from_ops: list of Operations. - colocate_gradients_with_ops: Python bool. See docstring of gradients(). - func_graphs: list of FuncGraphs. This method will traverse through - these functions if they capture from_ops or any reachable ops. This is - useful if to_ops occur in a function and from_ops are in an outer function - or graph. - xs_set: ObjectIdentitySet of Tensors. - -Returns: - A tuple containing: (1) the subset of to_ops reachable from from_ops by a - path of zero or more backpropagatable tensors, (2) a mapping from operation - to the number of backprop inputs to that op, and (3) a ControlFlowState - object which is not None if the ops between from_ops and to_ops contain - control flow loops." -8713,_AsList,tensorflow/tensorflow/python/ops/gradients_util.py,136,function, -8714,_DefaultGradYs,tensorflow/tensorflow/python/ops/gradients_util.py,140,function,"Fill in default values for grad_ys. - -Args: - grad_ys: List of gradients, can contain None. - ys: List of tensors. - colocate_gradients_with_ops: If True, try colocating gradients with - the corresponding op. - gradient_uid: A unique identifier within the graph indicating - which invocation of gradients is being executed. Used to cluster - ops for compilation. - -Returns: - A list of gradients to use, without None. - -Raises: - ValueError: If sizes of gradients and inputs don't match - TypeError: If type of any gradient is not valid for its input." -8715,_IsBackpropagatable,tensorflow/tensorflow/python/ops/gradients_util.py,230,function, -8716,_VerifyGeneratedGradients,tensorflow/tensorflow/python/ops/gradients_util.py,237,function,"Verify that gradients are valid in number and type. - -Args: - grads: List of generated gradients. - op: Operation for which the gradients where generated. - -Raises: - ValueError: if sizes of gradients and inputs don't match. - TypeError: if type of any gradient is not valid for its input." -8717,_StopOps,tensorflow/tensorflow/python/ops/gradients_util.py,258,function,"The set of ops that terminate the gradient computation. - -This computes the frontier of the forward graph *before* which backprop -should stop. Operations in the returned set will not be differentiated. -This set is defined as the subset of `from_ops` containing ops that have -no predecessor in `from_ops`. `pending_count` is the result of -`_PendingCount(xs, from_ops)`. An 'op' has predecessors in `from_ops` -iff pending_count[op] > 0. - -In addition, none of `stop_gradient_ops` will be differentiated. - -Args: - from_ops: list of Operations. - stop_gradient_ops: list of Operations never to backprop through. - pending_count: mapping from operation to number of backprop inputs. - xs_set: ObjectIdentitySet of Tensors. - -Returns: - The set of operations." -8718,_maybe_colocate_with,tensorflow/tensorflow/python/ops/gradients_util.py,293,function,Context to colocate with `op` if `colocate_gradients_with_ops`. -8719,_IsPartitionedCall,tensorflow/tensorflow/python/ops/gradients_util.py,302,function, -8720,_SymGrad,tensorflow/tensorflow/python/ops/gradients_util.py,306,function,Backprop through a function call node op given its outputs' gradients. -8721,_MaybeCompile,tensorflow/tensorflow/python/ops/gradients_util.py,321,function,Compile the calculation in grad_fn if op was marked as compiled. -8722,_RaiseNoGradWrtInitialLoopValError,tensorflow/tensorflow/python/ops/gradients_util.py,358,function,Raises an error if we backprop through a loop var. -8723,_IsFunction,tensorflow/tensorflow/python/ops/gradients_util.py,382,function, -8724,_Captures,tensorflow/tensorflow/python/ops/gradients_util.py,387,function, -8725,_MaybeCaptured,tensorflow/tensorflow/python/ops/gradients_util.py,395,function,"If t is a captured value placeholder, returns the original captured value. - -Args: - t: Tensor - -Returns: - A tensor, potentially from a different Graph/FuncGraph." -8726,_NonEagerInputs,tensorflow/tensorflow/python/ops/gradients_util.py,414,function,"Returns the inputs of op, crossing closure boundaries where necessary. - -Does not return any captured EagerTensors, i.e., the number of tensors -returned may be less than than the actual number of inputs. - -Args: - op: Operation - xs_set: ObjectIdentitySet of Tensors we are differentiating w.r.t. - -Returns: - A list of tensors. The tensors may be from multiple Graph/FuncGraphs if op - is in a FuncGraph and has captured inputs." -8727,_Inputs,tensorflow/tensorflow/python/ops/gradients_util.py,433,function,"Returns the inputs of op, crossing closure boundaries where necessary. - -Args: - op: Operation - xs_set: ObjectIdentitySet of Tensors we are differentiating w.r.t. - -Returns: - A list of tensors. The tensors may be from multiple Graph/FuncGraphs if op - is in a FuncGraph and has captured inputs." -8728,_Consumers,tensorflow/tensorflow/python/ops/gradients_util.py,460,function,"Returns the consumers of t, crossing closure boundaries where necessary. - -Args: - t: Tensor - func_graphs: a list of FuncGraphs that may have captured t. - -Returns: - A list of tensors. The tensors will be from the current graph and/or - func_graphs." -8729,_GradientsHelper,tensorflow/tensorflow/python/ops/gradients_util.py,479,function,Implementation of gradients(). -8730,_HasAnyNotNoneGrads,tensorflow/tensorflow/python/ops/gradients_util.py,733,function,Return true iff op has real gradient. -8731,_UpdatePendingAndEnqueueReady,tensorflow/tensorflow/python/ops/gradients_util.py,745,function,Update pending count for the inputs of op and enqueue ready ops. -8732,_SetGrad,tensorflow/tensorflow/python/ops/gradients_util.py,783,function,"Sets gradient ""grad"" in ""grads"" for tensor ""t""." -8733,_ZerosLike,tensorflow/tensorflow/python/ops/gradients_util.py,798,function, -8734,_GetGrad,tensorflow/tensorflow/python/ops/gradients_util.py,807,function,"Gets gradient for tensor ""t""." -8735,_GetGrads,tensorflow/tensorflow/python/ops/gradients_util.py,830,function,Gets all gradients for op. -8736,_AccumulatorShape,tensorflow/tensorflow/python/ops/gradients_util.py,838,function, -8737,_LogOpGradients,tensorflow/tensorflow/python/ops/gradients_util.py,846,function,Log the in and out grads of an op. -8738,_MultiDeviceAddN,tensorflow/tensorflow/python/ops/gradients_util.py,864,function,Adds tensors from potentially multiple devices. -8739,AggregationMethod,tensorflow/tensorflow/python/ops/gradients_util.py,893,class,"A class listing aggregation methods used to combine gradients. +8484,AggregationMethod,tensorflow/tensorflow/python/ops/gradients_util.py,893,class,"A class listing aggregation methods used to combine gradients. Computing partial derivatives can require aggregating gradient contributions. This class lists the various methods that can @@ -67791,29 +75309,7 @@ be supported in future releases: using the ""AddN"" op. This method of summing gradients may reduce performance, but it can improve memory utilization because the gradients can be released earlier." -8740,_AggregatedGrads,tensorflow/tensorflow/python/ops/gradients_util.py,925,function,"Get the aggregated gradients for op. - -Args: - grads: The map of memoized gradients. - op: The op to get gradients for. - gradient_uid: A unique identifier within the graph indicating - which invocation of gradients is being executed. Used to cluster - ops for compilation. - loop_state: An object for maintaining the state of the while loops in the - graph. It is of type ControlFlowState. None if the graph - contains no while loops. - aggregation_method: Specifies the method used to combine gradient terms. - Accepted values are constants defined in the class `AggregationMethod`. - -Returns: - A list of gradients, one per each output of `op`. If the gradients - for a particular output is a list, this function aggregates it - before returning. - -Raises: - TypeError: if the incoming grads are not Tensors or IndexedSlices. - ValueError: if the arguments are invalid." -8741,histogram_fixed_width_bins,tensorflow/tensorflow/python/ops/histogram_ops.py,35,function,"Bins the given values for use in a histogram. +8485,histogram_fixed_width_bins,tensorflow/tensorflow/python/ops/histogram_ops.py,35,function,"Bins the given values for use in a histogram. Given the tensor `values`, this operation returns a rank 1 `Tensor` representing the indices of a histogram into which each element @@ -67848,7 +75344,7 @@ Examples: >>> indices = tf.histogram_fixed_width_bins(new_values, value_range, nbins=5) >>> indices.numpy() array([0, 0, 1, 2, 4, 4], dtype=int32)" -8742,histogram_fixed_width,tensorflow/tensorflow/python/ops/histogram_ops.py,104,function,"Return histogram of values. +8486,histogram_fixed_width,tensorflow/tensorflow/python/ops/histogram_ops.py,104,function,"Return histogram of values. Given the tensor `values`, this operation returns a rank 1 histogram counting the number of entries in `values` that fell into every bin. The bins are @@ -67881,79 +75377,8 @@ Examples: >>> hist = tf.histogram_fixed_width(new_values, value_range, nbins=5) >>> hist.numpy() array([2, 1, 1, 0, 2], dtype=int32)" -8743,BinValuesFixedWidth,tensorflow/tensorflow/python/ops/histogram_ops_test.py,31,class, -8744,HistogramFixedWidthTest,tensorflow/tensorflow/python/ops/histogram_ops_test.py,83,class, -8745,_ResizeNearestNeighborGrad,tensorflow/tensorflow/python/ops/image_grad.py,29,function,"The derivatives for nearest neighbor resizing. - -Args: - op: The ResizeNearestNeighbor op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input and the output." -8746,_ResizeBilinearGrad,tensorflow/tensorflow/python/ops/image_grad.py,54,function,"The derivatives for bilinear resizing. - -Args: - op: The ResizeBilinear op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input." -8747,_ScaleAndTranslateGrad,tensorflow/tensorflow/python/ops/image_grad.py,73,function,"The derivatives for ScaleAndTranslate transformation op. - -Args: - op: The ScaleAndTranslate op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input." -8748,_ResizeBicubicGrad,tensorflow/tensorflow/python/ops/image_grad.py,95,function,"The derivatives for bicubic resizing. - -Args: - op: The ResizeBicubic op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input." -8749,_CropAndResizeGrad,tensorflow/tensorflow/python/ops/image_grad.py,117,function,"The derivatives for crop_and_resize. - -We back-propagate to the image only when the input image tensor has floating -point dtype but we always back-propagate to the input boxes tensor. - -Args: - op: The CropAndResize op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input image, boxes, as well as the always-None - gradients w.r.t. box_ind and crop_size." -8750,_CustomReciprocal,tensorflow/tensorflow/python/ops/image_grad.py,159,function,"Wrapper function around `math_ops.div_no_nan()` to perform a ""safe"" reciprocal incase the input is zero. Avoids divide by zero and NaNs. - -Input: - x -> input tensor to be reciprocat-ed. -Returns: - x_reciprocal -> reciprocal of x without NaNs." -8751,_RGBToHSVGrad,tensorflow/tensorflow/python/ops/image_grad.py,171,function,"The gradients for `rgb_to_hsv` operation. - -This function is a piecewise continuous function as defined here: -https://en.wikipedia.org/wiki/HSL_and_HSV#From_RGB -We perform the multivariate derivative and compute all partial derivatives -separately before adding them in the end. Formulas are given before each -partial derivative calculation. - -Args: - op: The `rgb_to_hsv` `Operation` that we are differentiating. - grad: Gradient with respect to the output of the `rgb_to_hsv` op. - -Returns: - Gradients with respect to the input of `rgb_to_hsv`." -8752,ResizeNearestNeighborOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,38,class, -8753,ResizeBilinearOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,113,class, -8754,ResizeBicubicOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,202,class, -8755,ScaleAndTranslateOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,265,class, -8756,CropAndResizeOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,329,class, -8757,RGBToHSVOpTest,tensorflow/tensorflow/python/ops/image_grad_test.py,458,class, -8758,flat_transforms_to_matrices,tensorflow/tensorflow/python/ops/image_ops.py,177,function,"Converts `tf.contrib.image` projective transforms to affine matrices. +8487,BinValuesFixedWidth,tensorflow/tensorflow/python/ops/histogram_ops_test.py,31,class, +8488,flat_transforms_to_matrices,tensorflow/tensorflow/python/ops/image_ops.py,177,function,"Converts `tf.contrib.image` projective transforms to affine matrices. Note that the output matrices map output coordinates to input coordinates. For the forward transformation matrix, call `tf.linalg.inv` on the result. @@ -67969,7 +75394,7 @@ Returns: Raises: ValueError: If `transforms` have an invalid shape." -8759,matrices_to_flat_transforms,tensorflow/tensorflow/python/ops/image_ops.py,209,function,"Converts affine matrices to `tf.contrib.image` projective transforms. +8489,matrices_to_flat_transforms,tensorflow/tensorflow/python/ops/image_ops.py,209,function,"Converts affine matrices to `tf.contrib.image` projective transforms. Note that we expect matrices that map output coordinates to input coordinates. To convert forward transformation matrices, call `tf.linalg.inv` on the @@ -67986,126 +75411,7 @@ Returns: Raises: ValueError: If `transform_matrices` have an invalid shape." -8760,_image_projective_transform_grad,tensorflow/tensorflow/python/ops/image_ops.py,243,function,Computes the gradient for ImageProjectiveTransform. -8761,_assert,tensorflow/tensorflow/python/ops/image_ops_impl.py,64,function,"A polymorphic assert, works with tensors and boolean expressions. - -If `cond` is not a tensor, behave like an ordinary assert statement, except -that a empty list is returned. If `cond` is a tensor, return a list -containing a single TensorFlow assert op. - -Args: - cond: Something evaluates to a boolean value. May be a tensor. - ex_type: The exception class to use. - msg: The error message. - -Returns: - A list, containing at most one assert op." -8762,_is_tensor,tensorflow/tensorflow/python/ops/image_ops_impl.py,88,function,"Returns `True` if `x` is a symbolic tensor-like object. - -Args: - x: A python object to check. - -Returns: - `True` if `x` is a `tf.Tensor` or `tf.Variable`, otherwise `False`." -8763,_ImageDimensions,tensorflow/tensorflow/python/ops/image_ops_impl.py,100,function,"Returns the dimensions of an image tensor. - -Args: - image: A rank-D Tensor. For 3-D of shape: `[height, width, channels]`. - rank: The expected rank of the image - -Returns: - A list of corresponding to the dimensions of the - input image. Dimensions that are statically known are python integers, - otherwise, they are integer scalar tensors." -8764,_Check3DImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,122,function,"Assert that we are working with a properly shaped image. - -Args: - image: 3-D Tensor of shape [height, width, channels] - require_static: If `True`, requires that all dimensions of `image` are known - and non-zero. - -Raises: - ValueError: if `image.shape` is not a 3-vector. - -Returns: - An empty list, if `image` has fully defined dimensions. Otherwise, a list - containing an assert op is returned." -8765,_Assert3DImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,157,function,"Assert that we are working with a properly shaped image. - -Performs the check statically if possible (i.e. if the shape -is statically known). Otherwise adds a control dependency -to an assert op that checks the dynamic shape. - -Args: - image: 3-D Tensor of shape [height, width, channels] - -Raises: - ValueError: if `image.shape` is not a 3-vector. - -Returns: - If the shape of `image` could be verified statically, `image` is - returned unchanged, otherwise there will be a control dependency - added that asserts the correct dynamic shape." -8766,_AssertAtLeast3DImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,179,function,"Assert that we are working with a properly shaped image. - -Performs the check statically if possible (i.e. if the shape -is statically known). Otherwise adds a control dependency -to an assert op that checks the dynamic shape. - -Args: - image: >= 3-D Tensor of size [*, height, width, depth] - -Raises: - ValueError: if image.shape is not a [>= 3] vector. - -Returns: - If the shape of `image` could be verified statically, `image` is - returned unchanged, otherwise there will be a control dependency - added that asserts the correct dynamic shape." -8767,_CheckAtLeast3DImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,201,function,"Assert that we are working with a properly shaped image. - -Args: - image: >= 3-D Tensor of size [*, height, width, depth] - require_static: If `True`, requires that all dimensions of `image` are known - and non-zero. - -Raises: - ValueError: if image.shape is not a [>= 3] vector. - -Returns: - An empty list, if `image` has fully defined dimensions. Otherwise, a list - containing an assert op is returned." -8768,_AssertGrayscaleImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,244,function,"Assert that we are working with a properly shaped grayscale image. - -Performs the check statically if possible (i.e. if the shape -is statically known). Otherwise adds a control dependency -to an assert op that checks the dynamic shape. - -Args: - image: >= 2-D Tensor of size [*, 1] - -Raises: - ValueError: if image.shape is not a [>= 2] vector or if - last dimension is not size 1. - -Returns: - If the shape of `image` could be verified statically, `image` is - returned unchanged, otherwise there will be a control dependency - added that asserts the correct dynamic shape." -8769,_CheckGrayscaleImage,tensorflow/tensorflow/python/ops/image_ops_impl.py,267,function,"Assert that we are working with properly shaped grayscale image. - -Args: - image: >= 2-D Tensor of size [*, 1] - require_static: Boolean, whether static shape is required. - -Raises: - ValueError: if image.shape is not a [>= 2] vector or if - last dimension is not size 1. - -Returns: - An empty list, if `image` has fully defined dimensions. Otherwise, a list - containing an assert op is returned." -8770,fix_image_flip_shape,tensorflow/tensorflow/python/ops/image_ops_impl.py,310,function,"Set the shape to 3 dimensional if we don't know anything else. +8490,fix_image_flip_shape,tensorflow/tensorflow/python/ops/image_ops_impl.py,310,function,"Set the shape to 3 dimensional if we don't know anything else. Args: image: original image size @@ -68113,7 +75419,7 @@ Args: Returns: An image whose shape is at least (None, None, None)." -8771,random_flip_up_down,tensorflow/tensorflow/python/ops/image_ops_impl.py,331,function,"Randomly flips an image vertically (upside down). +8491,random_flip_up_down,tensorflow/tensorflow/python/ops/image_ops_impl.py,331,function,"Randomly flips an image vertically (upside down). With a 1 in 2 chance, outputs the contents of `image` flipped along the first dimension, which is `height`. Otherwise, output the image as-is. @@ -68147,7 +75453,7 @@ Returns: A tensor of the same type and shape as `image`. Raises: ValueError: if the shape of `image` not supported." -8772,random_flip_left_right,tensorflow/tensorflow/python/ops/image_ops_impl.py,372,function,"Randomly flip an image horizontally (left to right). +8492,random_flip_left_right,tensorflow/tensorflow/python/ops/image_ops_impl.py,372,function,"Randomly flip an image horizontally (left to right). With a 1 in 2 chance, outputs the contents of `image` flipped along the second dimension, which is `width`. Otherwise output the image as-is. @@ -68183,23 +75489,7 @@ Returns: Raises: ValueError: if the shape of `image` not supported." -8773,_random_flip,tensorflow/tensorflow/python/ops/image_ops_impl.py,413,function,"Randomly (50% chance) flip an image along axis `flip_index`. - -Args: - image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor - of shape `[height, width, channels]`. - flip_index: Dimension along which to flip the image. - Vertical: 0, Horizontal: 1 - seed: A Python integer. Used to create a random seed. See - `tf.compat.v1.set_random_seed` for behavior. - scope_name: Name of the scope in which the ops are added. - -Returns: - A tensor of the same type and shape as `image`. - -Raises: - ValueError: if the shape of `image` not supported." -8774,flip_left_right,tensorflow/tensorflow/python/ops/image_ops_impl.py,472,function,"Flip an image horizontally (left to right). +8493,flip_left_right,tensorflow/tensorflow/python/ops/image_ops_impl.py,472,function,"Flip an image horizontally (left to right). Outputs the contents of `image` flipped along the width dimension. @@ -68227,7 +75517,7 @@ Returns: Raises: ValueError: if the shape of `image` not supported." -8775,flip_up_down,tensorflow/tensorflow/python/ops/image_ops_impl.py,507,function,"Flip an image vertically (upside down). +8494,flip_up_down,tensorflow/tensorflow/python/ops/image_ops_impl.py,507,function,"Flip an image vertically (upside down). Outputs the contents of `image` flipped along the height dimension. @@ -68255,24 +75545,7 @@ Returns: Raises: ValueError: if the shape of `image` not supported." -8776,_flip,tensorflow/tensorflow/python/ops/image_ops_impl.py,540,function,"Flip an image either horizontally or vertically. - -Outputs the contents of `image` flipped along the dimension `flip_index`. - -See also `reverse()`. - -Args: - image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor - of shape `[height, width, channels]`. - flip_index: 0 For vertical, 1 for horizontal. - scope_name: string, scope name. - -Returns: - A `Tensor` of the same type and shape as `image`. - -Raises: - ValueError: if the shape of `image` not supported." -8777,rot90,tensorflow/tensorflow/python/ops/image_ops_impl.py,584,function,"Rotate image(s) counter-clockwise by 90 degrees. +8495,rot90,tensorflow/tensorflow/python/ops/image_ops_impl.py,584,function,"Rotate image(s) counter-clockwise by 90 degrees. For example: @@ -68301,26 +75574,7 @@ Returns: Raises: ValueError: if the shape of `image` not supported." -8778,_rot90_3D,tensorflow/tensorflow/python/ops/image_ops_impl.py,642,function,"Rotate image counter-clockwise by 90 degrees `k` times. - -Args: - image: 3-D Tensor of shape `[height, width, channels]`. - k: A scalar integer. The number of times the image is rotated by 90 degrees. - name_scope: A valid TensorFlow name scope. - -Returns: - A 3-D tensor of the same type and shape as `image`." -8779,_rot90_4D,tensorflow/tensorflow/python/ops/image_ops_impl.py,673,function,"Rotate batch of images counter-clockwise by 90 degrees `k` times. - -Args: - images: 4-D Tensor of shape `[height, width, channels]`. - k: A scalar integer. The number of times the images are rotated by 90 - degrees. - name_scope: A valid TensorFlow name scope. - -Returns: - A 4-D `Tensor` of the same type and shape as `images`." -8780,transpose,tensorflow/tensorflow/python/ops/image_ops_impl.py,707,function,"Transpose image(s) by swapping the height and width dimension. +8496,transpose,tensorflow/tensorflow/python/ops/image_ops_impl.py,707,function,"Transpose image(s) by swapping the height and width dimension. Usage Example: @@ -68363,7 +75617,7 @@ array([[[ 1, 2], [[ 3, 4], [ 7, 8], [11, 12]]], dtype=int32)>" -8781,central_crop,tensorflow/tensorflow/python/ops/image_ops_impl.py,777,function,"Crop the central region of the image(s). +8497,central_crop,tensorflow/tensorflow/python/ops/image_ops_impl.py,777,function,"Crop the central region of the image(s). Remove the outer parts of an image but retain the central region of the image along each dimension. If we specify central_fraction = 0.5, this function @@ -68414,7 +75668,7 @@ Raises: Returns: 3-D / 4-D float Tensor, as per the input." -8782,pad_to_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,910,function,"Pad `image` with zeros to the specified `height` and `width`. +8498,pad_to_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,910,function,"Pad `image` with zeros to the specified `height` and `width`. Adds `offset_height` rows of zeros on top, `offset_width` columns of zeros on the left, and then pads the image on the bottom and right @@ -68467,7 +75721,7 @@ Raises: ValueError: If the shape of `image` is incompatible with the `offset_*` or `target_*` arguments, or either `offset_height` or `offset_width` is negative." -8783,crop_to_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,1022,function,"Crops an image to a specified bounding box. +8499,crop_to_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,1022,function,"Crops an image to a specified bounding box. This op cuts a rectangular part out of `image`. The top-left corner of the returned image is at `offset_height, offset_width` in `image`, and its @@ -68494,7 +75748,7 @@ Raises: ValueError: If the shape of `image` is incompatible with the `offset_*` or `target_*` arguments, or either `offset_height` or `offset_width` is negative, or either `target_height` or `target_width` is not positive." -8784,resize_image_with_crop_or_pad,tensorflow/tensorflow/python/ops/image_ops_impl.py,1107,function,"Crops and/or pads an image to a target width and height. +8500,resize_image_with_crop_or_pad,tensorflow/tensorflow/python/ops/image_ops_impl.py,1107,function,"Crops and/or pads an image to a target width and height. Resizes an image to a target width and height by either centrally cropping the image or padding it evenly with zeros. @@ -68520,10 +75774,9 @@ Returns: `[batch, new_height, new_width, channels]`. If `images` was 3-D, a 3-D float Tensor of shape `[new_height, new_width, channels]`." -8785,ResizeMethodV1,tensorflow/tensorflow/python/ops/image_ops_impl.py,1226,class,See `v1.image.resize` for details. -8786,ResizeMethod,tensorflow/tensorflow/python/ops/image_ops_impl.py,1235,class,See `tf.image.resize` for details. -8787,_resize_images_common,tensorflow/tensorflow/python/ops/image_ops_impl.py,1247,function,Core functionality for v1 and v2 resize functions. -8788,resize_images,tensorflow/tensorflow/python/ops/image_ops_impl.py,1327,function,"Resize `images` to `size` using the specified `method`. +8501,ResizeMethodV1,tensorflow/tensorflow/python/ops/image_ops_impl.py,1226,class,See `v1.image.resize` for details. +8502,ResizeMethod,tensorflow/tensorflow/python/ops/image_ops_impl.py,1235,class,See `tf.image.resize` for details. +8503,resize_images,tensorflow/tensorflow/python/ops/image_ops_impl.py,1327,function,"Resize `images` to `size` using the specified `method`. Resized images will be distorted if their original aspect ratio is not the same as `size`. To avoid distortions see @@ -68572,7 +75825,7 @@ Returns: `[batch, new_height, new_width, channels]`. If `images` was 3-D, a 3-D float Tensor of shape `[new_height, new_width, channels]`." -8789,resize_images_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,1413,function,"Resize `images` to `size` using the specified `method`. +8504,resize_images_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,1413,function,"Resize `images` to `size` using the specified `method`. Resized images will be distorted if their original aspect ratio is not the same as `size`. To avoid distortions see @@ -68691,8 +75944,7 @@ Returns: `[batch, new_height, new_width, channels]`. If `images` was 3-D, a 3-D float Tensor of shape `[new_height, new_width, channels]`." -8790,_resize_image_with_pad_common,tensorflow/tensorflow/python/ops/image_ops_impl.py,1590,function,Core functionality for v1 and v2 resize_image_with_pad functions. -8791,resize_image_with_pad_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,1667,function,"Resizes and pads an image to a target width and height. +8505,resize_image_with_pad_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,1667,function,"Resizes and pads an image to a target width and height. Resizes an image to a target width and height by keeping the aspect ratio the same without distortion. If the target @@ -68719,7 +75971,7 @@ Returns: `[batch, new_height, new_width, channels]`. If `images` was 3-D, a 3-D float Tensor of shape `[new_height, new_width, channels]`." -8792,resize_image_with_pad_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,1710,function,"Resizes and pads an image to a target width and height. +8506,resize_image_with_pad_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,1710,function,"Resizes and pads an image to a target width and height. Resizes an image to a target width and height by keeping the aspect ratio the same without distortion. If the target @@ -68744,7 +75996,7 @@ Returns: `[batch, new_height, new_width, channels]`. If `images` was 3-D, a 3-D float Tensor of shape `[new_height, new_width, channels]`." -8793,per_image_standardization,tensorflow/tensorflow/python/ops/image_ops_impl.py,1751,function,"Linearly scales each image in `image` to have mean 0 and variance 1. +8507,per_image_standardization,tensorflow/tensorflow/python/ops/image_ops_impl.py,1751,function,"Linearly scales each image in `image` to have mean 0 and variance 1. For each 3-D image `x` in `image`, computes `(x - mean) / adjusted_stddev`, where @@ -68764,7 +76016,7 @@ Returns: Raises: ValueError: if the shape of 'image' is incompatible with this function." -8794,random_brightness,tensorflow/tensorflow/python/ops/image_ops_impl.py,1797,function,"Adjust the brightness of images by a random factor. +8508,random_brightness,tensorflow/tensorflow/python/ops/image_ops_impl.py,1797,function,"Adjust the brightness of images by a random factor. Equivalent to `adjust_brightness()` using a `delta` randomly picked in the interval `[-max_delta, max_delta)`. @@ -68789,7 +76041,7 @@ Returns: Raises: ValueError: if `max_delta` is negative." -8795,random_contrast,tensorflow/tensorflow/python/ops/image_ops_impl.py,1833,function,"Adjust the contrast of an image or images by a random factor. +8509,random_contrast,tensorflow/tensorflow/python/ops/image_ops_impl.py,1833,function,"Adjust the contrast of an image or images by a random factor. Equivalent to `adjust_contrast()` but uses a `contrast_factor` randomly picked in the interval `[lower, upper)`. @@ -68815,7 +76067,7 @@ Returns: Raises: ValueError: if `upper <= lower` or if `lower < 0`." -8796,adjust_brightness,tensorflow/tensorflow/python/ops/image_ops_impl.py,1873,function,"Adjust the brightness of RGB or Grayscale images. +8510,adjust_brightness,tensorflow/tensorflow/python/ops/image_ops_impl.py,1873,function,"Adjust the brightness of RGB or Grayscale images. This is a convenience method that converts RGB images to float representation, adjusts their brightness, and then converts them back to the @@ -68847,7 +76099,7 @@ Args: Returns: A brightness-adjusted tensor of the same shape and type as `image`." -8797,adjust_contrast,tensorflow/tensorflow/python/ops/image_ops_impl.py,1925,function,"Adjust contrast of RGB or grayscale images. +8511,adjust_contrast,tensorflow/tensorflow/python/ops/image_ops_impl.py,1925,function,"Adjust contrast of RGB or grayscale images. This is a convenience method that converts RGB images to float representation, adjusts their contrast, and then converts them back to the @@ -68883,7 +76135,7 @@ Args: Returns: The contrast-adjusted image or images." -8798,adjust_gamma,tensorflow/tensorflow/python/ops/image_ops_impl.py,1982,function,"Performs [Gamma Correction](http://en.wikipedia.org/wiki/Gamma_correction). +8512,adjust_gamma,tensorflow/tensorflow/python/ops/image_ops_impl.py,1982,function,"Performs [Gamma Correction](http://en.wikipedia.org/wiki/Gamma_correction). on the input image. @@ -68922,7 +76174,7 @@ Notes: the output image will be brighter than the input image. References: [Wikipedia](http://en.wikipedia.org/wiki/Gamma_correction)" -8799,convert_image_dtype,tensorflow/tensorflow/python/ops/image_ops_impl.py,2047,function,"Convert `image` to `dtype`, scaling its values if needed. +8513,convert_image_dtype,tensorflow/tensorflow/python/ops/image_ops_impl.py,2047,function,"Convert `image` to `dtype`, scaling its values if needed. Images that are represented using floating point values are expected to have values in the range [0,1). Image data stored in integer data types are @@ -68965,7 +76217,7 @@ Returns: Raises: AttributeError: Raises an attribute error when dtype is neither float nor integer" -8800,rgb_to_grayscale,tensorflow/tensorflow/python/ops/image_ops_impl.py,2147,function,"Converts one or more images from RGB to Grayscale. +8514,rgb_to_grayscale,tensorflow/tensorflow/python/ops/image_ops_impl.py,2147,function,"Converts one or more images from RGB to Grayscale. Outputs a tensor of the same `DType` and rank as `images`. The size of the last dimension of the output is 1, containing the Grayscale value of the @@ -68983,7 +76235,7 @@ Args: Returns: The converted grayscale image(s)." -8801,grayscale_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,2183,function,"Converts one or more images from Grayscale to RGB. +8515,grayscale_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,2183,function,"Converts one or more images from Grayscale to RGB. Outputs a tensor of the same `DType` and rank as `images`. The size of the last dimension of the output is 3, containing the RGB value of the pixels. @@ -69002,7 +76254,7 @@ Args: Returns: The converted grayscale image(s)." -8802,random_hue,tensorflow/tensorflow/python/ops/image_ops_impl.py,2220,function,"Adjust the hue of RGB images by a random factor. +8516,random_hue,tensorflow/tensorflow/python/ops/image_ops_impl.py,2220,function,"Adjust the hue of RGB images by a random factor. Equivalent to `adjust_hue()` but uses a `delta` randomly picked in the interval `[-max_delta, max_delta)`. @@ -69031,7 +76283,7 @@ Returns: Raises: ValueError: if `max_delta` is invalid." -8803,adjust_hue,tensorflow/tensorflow/python/ops/image_ops_impl.py,2263,function,"Adjust hue of RGB images. +8517,adjust_hue,tensorflow/tensorflow/python/ops/image_ops_impl.py,2263,function,"Adjust hue of RGB images. This is a convenience method that converts an RGB image to float representation, converts it to HSV, adds an offset to the @@ -69080,7 +76332,7 @@ array([[[ 2, 1, 3], [11, 10, 12]], [[14, 13, 15], [17, 16, 18]]], dtype=int32)>" -8804,random_jpeg_quality,tensorflow/tensorflow/python/ops/image_ops_impl.py,2331,function,"Randomly changes jpeg encoding quality for inducing jpeg noise. +8518,random_jpeg_quality,tensorflow/tensorflow/python/ops/image_ops_impl.py,2331,function,"Randomly changes jpeg encoding quality for inducing jpeg noise. `min_jpeg_quality` must be in the interval `[0, 100]` and less than `max_jpeg_quality`. @@ -69109,7 +76361,7 @@ Returns: Raises: ValueError: if `min_jpeg_quality` or `max_jpeg_quality` is invalid." -8805,adjust_jpeg_quality,tensorflow/tensorflow/python/ops/image_ops_impl.py,2379,function,"Adjust jpeg encoding quality of an image. +8519,adjust_jpeg_quality,tensorflow/tensorflow/python/ops/image_ops_impl.py,2379,function,"Adjust jpeg encoding quality of an image. This is a convenience method that converts an image to uint8 representation, encodes it to jpeg with `jpeg_quality`, decodes it, and then converts back @@ -69141,7 +76393,7 @@ Returns: Raises: InvalidArgumentError: quality must be in [0,100] InvalidArgumentError: image must have 1 or 3 channels" -8806,random_saturation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2430,function,"Adjust the saturation of RGB images by a random factor. +8520,random_saturation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2430,function,"Adjust the saturation of RGB images by a random factor. Equivalent to `adjust_saturation()` but uses a `saturation_factor` randomly picked in the interval `[lower, upper)`. @@ -69173,7 +76425,7 @@ Returns: Raises: ValueError: if `upper <= lower` or if `lower < 0`." -8807,adjust_saturation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2476,function,"Adjust saturation of RGB images. +8521,adjust_saturation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2476,function,"Adjust saturation of RGB images. This is a convenience method that converts RGB images to float representation, converts them to HSV, adds an offset to the @@ -69208,7 +76460,7 @@ Returns: Raises: InvalidArgumentError: input must have 3 channels" -8808,is_jpeg,tensorflow/tensorflow/python/ops/image_ops_impl.py,2528,function,"Convenience function to check if the 'contents' encodes a JPEG image. +8522,is_jpeg,tensorflow/tensorflow/python/ops/image_ops_impl.py,2528,function,"Convenience function to check if the 'contents' encodes a JPEG image. Args: contents: 0-D `string`. The encoded image bytes. @@ -69217,16 +76469,7 @@ Args: Returns: A scalar boolean tensor indicating if 'contents' may be a JPEG image. is_jpeg is susceptible to false positives." -8809,_is_png,tensorflow/tensorflow/python/ops/image_ops_impl.py,2547,function,"Convenience function to check if the 'contents' encodes a PNG image. - -Args: - contents: 0-D `string`. The encoded image bytes. - name: A name for the operation (optional) - -Returns: - A scalar boolean tensor indicating if 'contents' may be a PNG image. - is_png is susceptible to false positives." -8810,encode_png,tensorflow/tensorflow/python/ops/image_ops_impl.py,2604,function,"PNG-encode an image. +8523,encode_png,tensorflow/tensorflow/python/ops/image_ops_impl.py,2604,function,"PNG-encode an image. `image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]` where `channels` is: @@ -69248,7 +76491,7 @@ Args: Returns: A `Tensor` of type `string`." -8811,decode_image,tensorflow/tensorflow/python/ops/image_ops_impl.py,2637,function,"Function for `decode_bmp`, `decode_gif`, `decode_jpeg`, and `decode_png`. +8524,decode_image,tensorflow/tensorflow/python/ops/image_ops_impl.py,2637,function,"Function for `decode_bmp`, `decode_gif`, `decode_jpeg`, and `decode_png`. Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the appropriate operation to convert the input bytes `string` into a `Tensor` @@ -69280,7 +76523,7 @@ Returns: Raises: ValueError: On incorrect number of channels." -8812,total_variation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2770,function,"Calculate and return the total variation for one or more images. +8525,total_variation,tensorflow/tensorflow/python/ops/image_ops_impl.py,2770,function,"Calculate and return the total variation for one or more images. The total variation is the sum of the absolute differences for neighboring pixel-values in the input images. This measures how much noise is in the @@ -69310,7 +76553,7 @@ Returns: total variation for each image in the batch. If `images` was 3-D, return a scalar float with the total variation for that image." -8813,sample_distorted_bounding_box_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,2842,function,"Generate a single randomly distorted bounding box for an image. +8526,sample_distorted_bounding_box_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,2842,function,"Generate a single randomly distorted bounding box for an image. Bounding box annotations are often supplied in addition to ground-truth labels in image recognition or object localization tasks. A common technique for @@ -69391,7 +76634,7 @@ Returns: bboxes: A `Tensor` of type `float32`. 3-D with shape `[1, 1, 4]` containing the distorted bounding box. Provide as input to `tf.image.draw_bounding_boxes`." -8814,sample_distorted_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,2946,function,"Generate a single randomly distorted bounding box for an image. +8527,sample_distorted_bounding_box,tensorflow/tensorflow/python/ops/image_ops_impl.py,2946,function,"Generate a single randomly distorted bounding box for an image. Bounding box annotations are often supplied in addition to ground-truth labels in image recognition or object localization tasks. A common technique for @@ -69475,7 +76718,7 @@ Returns: bboxes: A `Tensor` of type `float32`. 3-D with shape `[1, 1, 4]` containing the distorted bounding box. Provide as input to `tf.image.draw_bounding_boxes`." -8815,non_max_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,3057,function,"Greedily selects a subset of bounding boxes in descending order of score. +8528,non_max_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,3057,function,"Greedily selects a subset of bounding boxes in descending order of score. Prunes away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as @@ -69511,7 +76754,7 @@ Args: Returns: selected_indices: A 1-D integer `Tensor` of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`." -8816,non_max_suppression_with_scores,tensorflow/tensorflow/python/ops/image_ops_impl.py,3110,function,"Greedily selects a subset of bounding boxes in descending order of score. +8529,non_max_suppression_with_scores,tensorflow/tensorflow/python/ops/image_ops_impl.py,3110,function,"Greedily selects a subset of bounding boxes in descending order of score. Prunes away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as @@ -69570,7 +76813,7 @@ Returns: corresponding scores for each selected box, where `M <= max_output_size`. Scores only differ from corresponding input scores when using Soft NMS (i.e. when `soft_nms_sigma>0`)" -8817,non_max_suppression_with_overlaps,tensorflow/tensorflow/python/ops/image_ops_impl.py,3197,function,"Greedily selects a subset of bounding boxes in descending order of score. +8530,non_max_suppression_with_overlaps,tensorflow/tensorflow/python/ops/image_ops_impl.py,3197,function,"Greedily selects a subset of bounding boxes in descending order of score. Prunes away boxes that have high overlap with previously selected boxes. N-by-n overlap values are supplied as square matrix. @@ -69599,7 +76842,7 @@ Args: Returns: selected_indices: A 1-D integer `Tensor` of shape `[M]` representing the selected indices from the overlaps tensor, where `M <= max_output_size`." -8818,rgb_to_yiq,tensorflow/tensorflow/python/ops/image_ops_impl.py,3249,function,"Converts one or more images from RGB to YIQ. +8531,rgb_to_yiq,tensorflow/tensorflow/python/ops/image_ops_impl.py,3249,function,"Converts one or more images from RGB to YIQ. Outputs a tensor of the same shape as the `images` tensor, containing the YIQ value of the pixels. @@ -69618,7 +76861,7 @@ Args: Returns: images: tensor with the same shape as `images`." -8819,yiq_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,3283,function,"Converts one or more images from YIQ to RGB. +8532,yiq_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,3283,function,"Converts one or more images from YIQ to RGB. Outputs a tensor of the same shape as the `images` tensor, containing the RGB value of the pixels. @@ -69631,7 +76874,7 @@ Args: Returns: images: tensor with the same shape as `images`." -8820,rgb_to_yuv,tensorflow/tensorflow/python/ops/image_ops_impl.py,3312,function,"Converts one or more images from RGB to YUV. +8533,rgb_to_yuv,tensorflow/tensorflow/python/ops/image_ops_impl.py,3312,function,"Converts one or more images from RGB to YUV. Outputs a tensor of the same shape as the `images` tensor, containing the YUV value of the pixels. @@ -69643,7 +76886,7 @@ Args: Returns: images: tensor with the same shape as `images`." -8821,yuv_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,3339,function,"Converts one or more images from YUV to RGB. +8534,yuv_to_rgb,tensorflow/tensorflow/python/ops/image_ops_impl.py,3339,function,"Converts one or more images from YUV to RGB. Outputs a tensor of the same shape as the `images` tensor, containing the RGB value of the pixels. @@ -69681,22 +76924,7 @@ Args: Returns: images: tensor with the same shape as `images`." -8822,_verify_compatible_image_shapes,tensorflow/tensorflow/python/ops/image_ops_impl.py,3386,function,"Checks if two image tensors are compatible for applying SSIM or PSNR. - -This function checks if two sets of images have ranks at least 3, and if the -last three dimensions match. - -Args: - img1: Tensor containing the first image batch. - img2: Tensor containing the second image batch. - -Returns: - A tuple containing: the first tensor shape, the second tensor shape, and a - list of control_flow_ops.Assert() ops implementing the checks. - -Raises: - ValueError: When static shape check fails." -8823,psnr,tensorflow/tensorflow/python/ops/image_ops_impl.py,3433,function,"Returns the Peak Signal-to-Noise Ratio between a and b. +8535,psnr,tensorflow/tensorflow/python/ops/image_ops_impl.py,3433,function,"Returns the Peak Signal-to-Noise Ratio between a and b. This is intended to be used on signals (or images). Produces a PSNR value for each image in batch. @@ -69729,63 +76957,7 @@ Arguments: Returns: The scalar PSNR between a and b. The returned tensor has type `tf.float32` and shape [batch_size, 1]." -8824,_ssim_helper,tensorflow/tensorflow/python/ops/image_ops_impl.py,3486,function,"Helper function for computing SSIM. - -SSIM estimates covariances with weighted sums. The default parameters -use a biased estimate of the covariance: -Suppose `reducer` is a weighted sum, then the mean estimators are - \mu_x = \sum_i w_i x_i, - \mu_y = \sum_i w_i y_i, -where w_i's are the weighted-sum weights, and covariance estimator is - cov_{xy} = \sum_i w_i (x_i - \mu_x) (y_i - \mu_y) -with assumption \sum_i w_i = 1. This covariance estimator is biased, since - E[cov_{xy}] = (1 - \sum_i w_i ^ 2) Cov(X, Y). -For SSIM measure with unbiased covariance estimators, pass as `compensation` -argument (1 - \sum_i w_i ^ 2). - -Arguments: - x: First set of images. - y: Second set of images. - reducer: Function that computes 'local' averages from the set of images. For - non-convolutional version, this is usually tf.reduce_mean(x, [1, 2]), and - for convolutional version, this is usually tf.nn.avg_pool2d or - tf.nn.conv2d with weighted-sum kernel. - max_val: The dynamic range (i.e., the difference between the maximum - possible allowed value and the minimum allowed value). - compensation: Compensation factor. See above. - k1: Default value 0.01 - k2: Default value 0.03 (SSIM is less sensitivity to K2 for lower values, so - it would be better if we took the values in the range of 0 < K2 < 0.4). - -Returns: - A pair containing the luminance measure, and the contrast-structure measure." -8825,_fspecial_gauss,tensorflow/tensorflow/python/ops/image_ops_impl.py,3544,function,Function to mimic the 'fspecial' gaussian MATLAB function. -8826,_ssim_per_channel,tensorflow/tensorflow/python/ops/image_ops_impl.py,3561,function,"Computes SSIM index between img1 and img2 per color channel. - -This function matches the standard SSIM implementation from: -Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004). Image -quality assessment: from error visibility to structural similarity. IEEE -transactions on image processing. - -Details: - - 11x11 Gaussian filter of width 1.5 is used. - - k1 = 0.01, k2 = 0.03 as in the original paper. - -Args: - img1: First image batch. - img2: Second image batch. - max_val: The dynamic range of the images (i.e., the difference between the - maximum the and minimum allowed values). - filter_size: Default value 11 (size of gaussian filter). - filter_sigma: Default value 1.5 (width of gaussian filter). - k1: Default value 0.01 - k2: Default value 0.03 (SSIM is less sensitivity to K2 for lower values, so - it would be better if we took the values in the range of 0 < K2 < 0.4). - -Returns: - A pair of tensors containing and channel-wise SSIM and contrast-structure - values. The shape is [..., channels]." -8827,ssim,tensorflow/tensorflow/python/ops/image_ops_impl.py,3645,function,"Computes SSIM index between img1 and img2. +8536,ssim,tensorflow/tensorflow/python/ops/image_ops_impl.py,3645,function,"Computes SSIM index between img1 and img2. This function is based on the standard SSIM implementation from: Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004). Image @@ -69835,7 +77007,7 @@ Returns: A tensor containing an SSIM value for each image in batch. Returned SSIM values are in range (-1, 1], when pixel values are non-negative. Returns a tensor with shape: broadcast(img1.shape[:-3], img2.shape[:-3])." -8828,ssim_multiscale,tensorflow/tensorflow/python/ops/image_ops_impl.py,3730,function,"Computes the MS-SSIM between img1 and img2. +8537,ssim_multiscale,tensorflow/tensorflow/python/ops/image_ops_impl.py,3730,function,"Computes the MS-SSIM between img1 and img2. This function assumes that `img1` and `img2` are image batches, i.e. the last three dimensions are [height, width, channels]. @@ -69868,7 +77040,7 @@ Returns: A tensor containing an MS-SSIM value for each image in batch. The values are in range [0, 1]. Returns a tensor with shape: broadcast(img1.shape[:-3], img2.shape[:-3])." -8829,image_gradients,tensorflow/tensorflow/python/ops/image_ops_impl.py,3858,function,"Returns image gradients (dy, dx) for each color channel. +8538,image_gradients,tensorflow/tensorflow/python/ops/image_ops_impl.py,3858,function,"Returns image gradients (dy, dx) for each color channel. Both output tensors have the same shape as the input: [batch_size, h, w, d]. The gradient values are organized so that [I(x+1, y) - I(x, y)] is in @@ -69917,7 +77089,7 @@ Returns: Raises: ValueError: If `image` is not a 4D tensor." -8830,sobel_edges,tensorflow/tensorflow/python/ops/image_ops_impl.py,3932,function,"Returns a tensor holding Sobel edge maps. +8539,sobel_edges,tensorflow/tensorflow/python/ops/image_ops_impl.py,3932,function,"Returns a tensor holding Sobel edge maps. Arguments: image: Image tensor with shape [batch_size, h, w, d] and type float32 or @@ -69927,10 +77099,10 @@ Returns: Tensor holding edge maps for each channel. Returns a tensor with shape [batch_size, h, w, d, 2] where the last two dimensions hold [[dy[0], dx[0]], [dy[1], dx[1]], ..., [dy[d-1], dx[d-1]]] calculated using the Sobel filter." -8831,resize_bicubic,tensorflow/tensorflow/python/ops/image_ops_impl.py,3972,function, -8832,resize_bilinear,tensorflow/tensorflow/python/ops/image_ops_impl.py,3985,function, -8833,resize_nearest_neighbor,tensorflow/tensorflow/python/ops/image_ops_impl.py,3998,function, -8834,crop_and_resize_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4045,function,"Extracts crops from the input image tensor and resizes them. +8540,resize_bicubic,tensorflow/tensorflow/python/ops/image_ops_impl.py,3972,function, +8541,resize_bilinear,tensorflow/tensorflow/python/ops/image_ops_impl.py,3985,function, +8542,resize_nearest_neighbor,tensorflow/tensorflow/python/ops/image_ops_impl.py,3998,function, +8543,crop_and_resize_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4045,function,"Extracts crops from the input image tensor and resizes them. Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a @@ -70000,8 +77172,8 @@ maxval=BATCH_SIZE, dtype=tf.int32) output = tf.image.crop_and_resize(image, boxes, box_indices, CROP_SIZE) output.shape #=> (5, 24, 24, 3) ```" -8835,crop_and_resize_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,4132,function, -8836,extract_glimpse,tensorflow/tensorflow/python/ops/image_ops_impl.py,4152,function,"Extracts a glimpse from the input tensor. +8544,crop_and_resize_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,4132,function, +8545,extract_glimpse,tensorflow/tensorflow/python/ops/image_ops_impl.py,4152,function,"Extracts a glimpse from the input tensor. Returns a set of windows called glimpses extracted at location `offsets` from the input tensor. If the windows only partially @@ -70066,7 +77238,7 @@ Args: Returns: A `Tensor` of type `float32`." -8837,extract_glimpse_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4238,function,"Extracts a glimpse from the input tensor. +8546,extract_glimpse_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4238,function,"Extracts a glimpse from the input tensor. Returns a set of windows called glimpses extracted at location `offsets` from the input tensor. If the windows only partially @@ -70131,7 +77303,7 @@ Args: Returns: A `Tensor` of type `float32`." -8838,combined_non_max_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,4325,function,"Greedily selects a subset of bounding boxes in descending order of score. +8547,combined_non_max_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,4325,function,"Greedily selects a subset of bounding boxes in descending order of score. This operation performs non_max_suppression on the inputs per batch, across all classes. @@ -70182,68 +77354,7 @@ Returns: valid detections per batch item. Only the top valid_detections[i] entries in nms_boxes[i], nms_scores[i] and nms_class[i] are valid. The rest of the entries are zero paddings." -8839,_bbox_overlap,tensorflow/tensorflow/python/ops/image_ops_impl.py,4396,function,"Calculates the overlap (iou - intersection over union) between boxes_a and boxes_b. - -Args: - boxes_a: a tensor with a shape of [batch_size, N, 4]. N is the number of - boxes per image. The last dimension is the pixel coordinates in - [ymin, xmin, ymax, xmax] form. - boxes_b: a tensor with a shape of [batch_size, M, 4]. M is the number of - boxes. The last dimension is the pixel coordinates in - [ymin, xmin, ymax, xmax] form. -Returns: - intersection_over_union: a tensor with as a shape of [batch_size, N, M], - representing the ratio of intersection area over union area (IoU) between - two boxes" -8840,_self_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,4442,function,"Suppress boxes in the same tile. - - Compute boxes that cannot be suppressed by others (i.e., - can_suppress_others), and then use them to suppress boxes in the same tile. - -Args: - iou: a tensor of shape [batch_size, num_boxes_with_padding] representing - intersection over union. - iou_sum: a scalar tensor. - iou_threshold: a scalar tensor. - -Returns: - iou_suppressed: a tensor of shape [batch_size, num_boxes_with_padding]. - iou_diff: a scalar tensor representing whether any box is supressed in - this step. - iou_sum_new: a scalar tensor of shape [batch_size] that represents - the iou sum after suppression. - iou_threshold: a scalar tensor." -8841,_cross_suppression,tensorflow/tensorflow/python/ops/image_ops_impl.py,4480,function,"Suppress boxes between different tiles. - -Args: - boxes: a tensor of shape [batch_size, num_boxes_with_padding, 4] - box_slice: a tensor of shape [batch_size, tile_size, 4] - iou_threshold: a scalar tensor - inner_idx: a scalar tensor representing the tile index of the tile - that is used to supress box_slice - tile_size: an integer representing the number of boxes in a tile - -Returns: - boxes: unchanged boxes as input - box_slice_after_suppression: box_slice after suppression - iou_threshold: unchanged" -8842,_suppression_loop_body,tensorflow/tensorflow/python/ops/image_ops_impl.py,4508,function,"Process boxes in the range [idx*tile_size, (idx+1)*tile_size). - -Args: - boxes: a tensor with a shape of [batch_size, anchors, 4]. - iou_threshold: a float representing the threshold for deciding whether boxes - overlap too much with respect to IOU. - output_size: an int32 tensor of size [batch_size]. Representing the number - of selected boxes for each batch. - idx: an integer scalar representing induction variable. - tile_size: an integer representing the number of boxes in a tile - -Returns: - boxes: updated boxes. - iou_threshold: pass down iou_threshold to the next iteration. - output_size: the updated output_size. - idx: the updated induction variable." -8843,non_max_suppression_padded,tensorflow/tensorflow/python/ops/image_ops_impl.py,4578,function,"Greedily selects a subset of bounding boxes in descending order of score. +8548,non_max_suppression_padded,tensorflow/tensorflow/python/ops/image_ops_impl.py,4578,function,"Greedily selects a subset of bounding boxes in descending order of score. Performs algorithmically equivalent operation to tf.image.non_max_suppression, with the addition of an optional parameter which zero-pads the output to @@ -70294,7 +77405,7 @@ Returns: batch dimensions of the input boxes. Raises: ValueError: When set pad_to_max_output_size to False for batched input." -8844,non_max_suppression_padded_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4680,function,"Non-maximum suppression. +8549,non_max_suppression_padded_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4680,function,"Non-maximum suppression. Prunes away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as @@ -70394,7 +77505,7 @@ Returns: batch dimensions of the input boxes. Raises: ValueError: When set pad_to_max_output_size to False for batched input." -8845,non_max_suppression_padded_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,4917,function,"Greedily selects a subset of bounding boxes in descending order of score. +8550,non_max_suppression_padded_v1,tensorflow/tensorflow/python/ops/image_ops_impl.py,4917,function,"Greedily selects a subset of bounding boxes in descending order of score. Performs algorithmically equivalent operation to tf.image.non_max_suppression, with the addition of an optional parameter which zero-pads the output to @@ -70432,7 +77543,7 @@ Returns: selected indices from the boxes tensor, where `M <= max_output_size`. valid_outputs: A scalar integer `Tensor` denoting how many elements in `selected_indices` are valid. Valid elements occur first, then padding." -8846,draw_bounding_boxes_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4974,function,"Draw bounding boxes on a batch of images. +8551,draw_bounding_boxes_v2,tensorflow/tensorflow/python/ops/image_ops_impl.py,4974,function,"Draw bounding boxes on a batch of images. Outputs a copy of `images` but draws on top of the pixels zero or more bounding boxes specified by the locations in `boxes`. The coordinates of the @@ -70478,7 +77589,7 @@ array([[[[1., 0., 0.], [[1., 0., 0.], [1., 0., 0.], [1., 0., 0.]]]], dtype=float32)>" -8847,draw_bounding_boxes,tensorflow/tensorflow/python/ops/image_ops_impl.py,5029,function,"Draw bounding boxes on a batch of images. +8552,draw_bounding_boxes,tensorflow/tensorflow/python/ops/image_ops_impl.py,5029,function,"Draw bounding boxes on a batch of images. Outputs a copy of `images` but draws on top of the pixels zero or more bounding boxes specified by the locations in `boxes`. The coordinates of the @@ -70524,65 +77635,81 @@ array([[[[1., 0., 0.], [[1., 0., 0.], [1., 0., 0.], [1., 0., 0.]]]], dtype=float32)>" -8848,generate_bounding_box_proposals,tensorflow/tensorflow/python/ops/image_ops_impl.py,5082,function,"Generate bounding box proposals from encoded bounding boxes. +8553,generate_bounding_box_proposals,tensorflow/tensorflow/python/ops/image_ops_impl.py,5082,function,"Generate bounding box proposals from encoded bounding boxes. Returns: rois: Region of interest boxes sorted by their scores. roi_probabilities: scores of the ROI boxes in the ROIs' tensor." -8849,RGBToHSVTest,tensorflow/tensorflow/python/ops/image_ops_test.py,56,class, -8850,RGBToYIQTest,tensorflow/tensorflow/python/ops/image_ops_test.py,96,class, -8851,RGBToYUVTest,tensorflow/tensorflow/python/ops/image_ops_test.py,126,class, -8852,GrayscaleToRGBTest,tensorflow/tensorflow/python/ops/image_ops_test.py,156,class, -8853,AdjustGamma,tensorflow/tensorflow/python/ops/image_ops_test.py,277,class, -8854,AdjustHueTest,tensorflow/tensorflow/python/ops/image_ops_test.py,414,class, -8855,FlipImageBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,539,class, -8856,AdjustHueBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,660,class, -8857,AdjustSaturationBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,703,class, -8858,ResizeBilinearBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,747,class, -8859,ResizeBicubicBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,795,class, -8860,ResizeAreaBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,853,class, -8861,AdjustSaturationTest,tensorflow/tensorflow/python/ops/image_ops_test.py,900,class, -8862,FlipTransposeRotateTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1004,class, -8863,AdjustContrastTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1390,class, -8864,AdjustBrightnessTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1479,class, -8865,PerImageWhiteningTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1529,class, -8866,CropToBoundingBoxTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1585,class, -8867,CentralCropTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1768,class, -8868,PadToBoundingBoxTest,tensorflow/tensorflow/python/ops/image_ops_test.py,1910,class, -8869,SelectDistortedCropBoxTest,tensorflow/tensorflow/python/ops/image_ops_test.py,2106,class, -8870,ResizeImagesV2Test,tensorflow/tensorflow/python/ops/image_ops_test.py,2316,class, -8871,ResizeImagesTest,tensorflow/tensorflow/python/ops/image_ops_test.py,2856,class, -8872,ResizeImageWithPadV1Test,tensorflow/tensorflow/python/ops/image_ops_test.py,3367,class, -8873,ResizeImageWithPadV2Test,tensorflow/tensorflow/python/ops/image_ops_test.py,3467,class, -8874,ResizeImageWithCropOrPadTest,tensorflow/tensorflow/python/ops/image_ops_test.py,3566,class, -8875,simple_color_ramp,tensorflow/tensorflow/python/ops/image_ops_test.py,3815,function,Build a simple color ramp RGB image. -8876,JpegTest,tensorflow/tensorflow/python/ops/image_ops_test.py,3827,class, -8877,PngTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4046,class, -8878,GifTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4137,class, -8879,ConvertImageTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4180,class, -8880,TotalVariationTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4250,class,"Tests the function total_variation() in image_ops. +8554,AdjustGamma,tensorflow/tensorflow/python/ops/image_ops_test.py,277,class, +8555,FlipImageBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,539,class, +8556,benchmarkFlipLeftRightCpu1,tensorflow/tensorflow/python/ops/image_ops_test.py,632,method, +8557,benchmarkFlipLeftRightCpuAll,tensorflow/tensorflow/python/ops/image_ops_test.py,635,method, +8558,benchmarkFlipLeftRightGpu,tensorflow/tensorflow/python/ops/image_ops_test.py,638,method, +8559,benchmarkRandomFlipLeftRightCpu1,tensorflow/tensorflow/python/ops/image_ops_test.py,641,method, +8560,benchmarkRandomFlipLeftRightCpuAll,tensorflow/tensorflow/python/ops/image_ops_test.py,644,method, +8561,benchmarkRandomFlipLeftRightGpu,tensorflow/tensorflow/python/ops/image_ops_test.py,647,method, +8562,benchmarkBatchedRandomFlipLeftRightCpu1,tensorflow/tensorflow/python/ops/image_ops_test.py,650,method, +8563,benchmarkBatchedRandomFlipLeftRightCpuAll,tensorflow/tensorflow/python/ops/image_ops_test.py,653,method, +8564,benchmarkBatchedRandomFlipLeftRightGpu,tensorflow/tensorflow/python/ops/image_ops_test.py,656,method, +8565,AdjustHueBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,660,class, +8566,benchmarkAdjustHueCpu1,tensorflow/tensorflow/python/ops/image_ops_test.py,693,method, +8567,benchmarkAdjustHueCpuAll,tensorflow/tensorflow/python/ops/image_ops_test.py,696,method, +8568,benchmarkAdjustHueGpu,tensorflow/tensorflow/python/ops/image_ops_test.py,699,method, +8569,AdjustSaturationBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,703,class, +8570,benchmarkAdjustSaturationCpu1,tensorflow/tensorflow/python/ops/image_ops_test.py,737,method, +8571,benchmarkAdjustSaturationCpuAll,tensorflow/tensorflow/python/ops/image_ops_test.py,740,method, +8572,benchmarkAdjustSaturationGpu,tensorflow/tensorflow/python/ops/image_ops_test.py,743,method, +8573,ResizeBilinearBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,747,class, +8574,benchmarkSimilar3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,776,method, +8575,benchmarkScaleUp3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,779,method, +8576,benchmarkScaleDown3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,782,method, +8577,benchmarkSimilar1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,785,method, +8578,benchmarkScaleUp1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,788,method, +8579,benchmarkScaleDown1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,791,method, +8580,ResizeBicubicBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,795,class, +8581,benchmarkSimilar3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,825,method, +8582,benchmarkScaleUp3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,828,method, +8583,benchmarkScaleDown3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,831,method, +8584,benchmarkSimilar1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,834,method, +8585,benchmarkScaleUp1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,837,method, +8586,benchmarkScaleDown1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,840,method, +8587,benchmarkSimilar4Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,843,method, +8588,benchmarkScaleUp4Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,846,method, +8589,benchmarkScaleDown4Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,849,method, +8590,ResizeAreaBenchmark,tensorflow/tensorflow/python/ops/image_ops_test.py,853,class, +8591,benchmarkSimilar3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,881,method, +8592,benchmarkScaleUp3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,884,method, +8593,benchmarkScaleDown3Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,887,method, +8594,benchmarkSimilar1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,890,method, +8595,benchmarkScaleUp1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,893,method, +8596,benchmarkScaleDown1Channel,tensorflow/tensorflow/python/ops/image_ops_test.py,896,method, +8597,simple_color_ramp,tensorflow/tensorflow/python/ops/image_ops_test.py,3815,function,Build a simple color ramp RGB image. +8598,Initializer,tensorflow/tensorflow/python/ops/init_ops.py,55,class,Initializer base class: all initializers inherit from this class. +8599,get_config,tensorflow/tensorflow/python/ops/init_ops.py,70,method,"Returns the configuration of the initializer as a JSON-serializable dict. -We test a few small handmade examples, as well as -some larger examples using an equivalent numpy -implementation of the total_variation() function. +Returns: + A JSON-serializable Python dict." +8600,from_config,tensorflow/tensorflow/python/ops/init_ops.py,79,method,"Instantiates an initializer from a configuration dictionary. -We do NOT test for overflows and invalid / edge-case arguments." -8881,FormatTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4428,class, -8882,NonMaxSuppressionTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4461,class, -8883,NonMaxSuppressionWithScoresTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4585,class, -8884,NonMaxSuppressionPaddedTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4620,class, -8885,NonMaxSuppressionWithOverlapsTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4686,class, -8886,VerifyCompatibleImageShapesTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4711,class,Tests utility function used by ssim() and psnr(). -8887,PSNRTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4738,class,Tests for PSNR. -8888,SSIMTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4842,class,Tests for SSIM. -8889,MultiscaleSSIMTest,tensorflow/tensorflow/python/ops/image_ops_test.py,4976,class,Tests for MS-SSIM. -8890,ImageGradientsTest,tensorflow/tensorflow/python/ops/image_ops_test.py,5123,class, -8891,SobelEdgesTest,tensorflow/tensorflow/python/ops/image_ops_test.py,5172,class, -8892,DecodeImageTest,tensorflow/tensorflow/python/ops/image_ops_test.py,5208,class, -8893,Initializer,tensorflow/tensorflow/python/ops/init_ops.py,55,class,Initializer base class: all initializers inherit from this class. -8894,Zeros,tensorflow/tensorflow/python/ops/init_ops.py,102,class,Initializer that generates tensors initialized to 0. -8895,Ones,tensorflow/tensorflow/python/ops/init_ops.py,122,class,Initializer that generates tensors initialized to 1. -8896,Constant,tensorflow/tensorflow/python/ops/init_ops.py,142,class,"Initializer that generates tensors with constant values. +Example: + +```python +initializer = RandomUniform(-1, 1) +config = initializer.get_config() +initializer = RandomUniform.from_config(config) +``` + +Args: + config: A Python dictionary. It will typically be the output of + `get_config`. + +Returns: + An Initializer instance." +8601,Zeros,tensorflow/tensorflow/python/ops/init_ops.py,102,class,Initializer that generates tensors initialized to 0. +8602,get_config,tensorflow/tensorflow/python/ops/init_ops.py,116,method, +8603,Ones,tensorflow/tensorflow/python/ops/init_ops.py,122,class,Initializer that generates tensors initialized to 1. +8604,get_config,tensorflow/tensorflow/python/ops/init_ops.py,136,method, +8605,Constant,tensorflow/tensorflow/python/ops/init_ops.py,142,class,"Initializer that generates tensors with constant values. The resulting tensor is populated with values of type `dtype`, as specified by arguments `value` following the desired `shape` of the @@ -70646,7 +77773,8 @@ ValueError: Too many elements provided. Needed at most 6, but received 8 Traceback (most recent call last): ... TypeError: Expected Tensor's shape: (3, 4), got (8,)." -8897,RandomUniform,tensorflow/tensorflow/python/ops/init_ops.py,242,class,"Initializer that generates tensors with a uniform distribution. +8606,get_config,tensorflow/tensorflow/python/ops/init_ops.py,232,method, +8607,RandomUniform,tensorflow/tensorflow/python/ops/init_ops.py,242,class,"Initializer that generates tensors with a uniform distribution. Args: minval: A python scalar or a scalar tensor. Lower bound of the range of @@ -70657,7 +77785,8 @@ Args: `tf.compat.v1.set_random_seed` for behavior. dtype: Default data type, used if no `dtype` argument is provided when calling the initializer." -8898,RandomNormal,tensorflow/tensorflow/python/ops/init_ops.py,282,class,"Initializer that generates tensors with a normal distribution. +8608,get_config,tensorflow/tensorflow/python/ops/init_ops.py,271,method, +8609,RandomNormal,tensorflow/tensorflow/python/ops/init_ops.py,282,class,"Initializer that generates tensors with a normal distribution. Args: mean: a python scalar or a scalar tensor. Mean of the random values to @@ -70668,7 +77797,8 @@ Args: `tf.compat.v1.set_random_seed` for behavior. dtype: Default data type, used if no `dtype` argument is provided when calling the initializer. Only floating point types are supported." -8899,TruncatedNormal,tensorflow/tensorflow/python/ops/init_ops.py,323,class,"Initializer that generates a truncated normal distribution. +8610,get_config,tensorflow/tensorflow/python/ops/init_ops.py,311,method, +8611,TruncatedNormal,tensorflow/tensorflow/python/ops/init_ops.py,323,class,"Initializer that generates a truncated normal distribution. These values are similar to values from a `random_normal_initializer` except that values more than two standard deviations from the mean @@ -70684,7 +77814,8 @@ Args: `tf.compat.v1.set_random_seed` for behavior. dtype: Default data type, used if no `dtype` argument is provided when calling the initializer. Only floating point types are supported." -8900,UniformUnitScaling,tensorflow/tensorflow/python/ops/init_ops.py,371,class,"Initializer that generates tensors without scaling variance. +8612,get_config,tensorflow/tensorflow/python/ops/init_ops.py,357,method, +8613,UniformUnitScaling,tensorflow/tensorflow/python/ops/init_ops.py,371,class,"Initializer that generates tensors without scaling variance. When initializing a deep network, it is in principle advantageous to keep the scale of the input variance constant, so it does not explode or diminish @@ -70710,7 +77841,8 @@ Args: References: [Sussillo et al., 2014](https://arxiv.org/abs/1412.6558) ([pdf](http://arxiv.org/pdf/1412.6558.pdf))" -8901,VarianceScaling,tensorflow/tensorflow/python/ops/init_ops.py,437,class,"Initializer capable of adapting its scale to the shape of weights tensors. +8614,get_config,tensorflow/tensorflow/python/ops/init_ops.py,430,method, +8615,VarianceScaling,tensorflow/tensorflow/python/ops/init_ops.py,437,class,"Initializer capable of adapting its scale to the shape of weights tensors. With `distribution=""truncated_normal"" or ""untruncated_normal""`, samples are drawn from a truncated/untruncated normal @@ -70736,7 +77868,8 @@ Args: Raises: ValueError: In case of an invalid value for the ""scale"", mode"" or ""distribution"" arguments." -8902,Orthogonal,tensorflow/tensorflow/python/ops/init_ops.py,534,class,"Initializer that generates an orthogonal matrix. +8616,get_config,tensorflow/tensorflow/python/ops/init_ops.py,521,method, +8617,Orthogonal,tensorflow/tensorflow/python/ops/init_ops.py,534,class,"Initializer that generates an orthogonal matrix. If the shape of the tensor to initialize is two-dimensional, it is initialized with an orthogonal matrix obtained from the QR decomposition of a matrix of @@ -70758,7 +77891,8 @@ Args: References: [Saxe et al., 2014](https://openreview.net/forum?id=_wzZwKpTDF_9C) ([pdf](https://arxiv.org/pdf/1312.6120.pdf))" -8903,ConvolutionDeltaOrthogonal,tensorflow/tensorflow/python/ops/init_ops.py,603,class,"Initializer that generates a delta orthogonal kernel for ConvNets. +8618,get_config,tensorflow/tensorflow/python/ops/init_ops.py,597,method, +8619,ConvolutionDeltaOrthogonal,tensorflow/tensorflow/python/ops/init_ops.py,603,class,"Initializer that generates a delta orthogonal kernel for ConvNets. The shape of the tensor must have length 3, 4 or 5. The number of input filters must not exceed the number of output filters. The center pixels of the @@ -70777,7 +77911,8 @@ Args: References: [Xiao et al., 2018](http://proceedings.mlr.press/v80/xiao18a.html) ([pdf](http://proceedings.mlr.press/v80/xiao18a/xiao18a.pdf))" -8904,ConvolutionOrthogonal,tensorflow/tensorflow/python/ops/init_ops.py,669,class,"Initializer that generates orthogonal kernel for ConvNets. +8620,get_config,tensorflow/tensorflow/python/ops/init_ops.py,665,method, +8621,ConvolutionOrthogonal,tensorflow/tensorflow/python/ops/init_ops.py,669,class,"Initializer that generates orthogonal kernel for ConvNets. Base class used to construct 1D, 2D and 3D orthogonal kernels for convolution. @@ -70792,7 +77927,8 @@ Args: References: [Xiao et al., 2018](http://proceedings.mlr.press/v80/xiao18a.html) ([pdf](http://proceedings.mlr.press/v80/xiao18a/xiao18a.pdf))" -8905,ConvolutionOrthogonal2D,tensorflow/tensorflow/python/ops/init_ops.py,736,class,"Initializer that generates a 2D orthogonal kernel for ConvNets. +8622,get_config,tensorflow/tensorflow/python/ops/init_ops.py,695,method, +8623,ConvolutionOrthogonal2D,tensorflow/tensorflow/python/ops/init_ops.py,736,class,"Initializer that generates a 2D orthogonal kernel for ConvNets. The shape of the tensor must have length 4. The number of input filters must not exceed the number of output filters. @@ -70810,7 +77946,7 @@ Args: References: [Xiao et al., 2018](http://proceedings.mlr.press/v80/xiao18a.html) ([pdf](http://proceedings.mlr.press/v80/xiao18a/xiao18a.pdf))" -8906,ConvolutionOrthogonal1D,tensorflow/tensorflow/python/ops/init_ops.py,880,class,"Initializer that generates a 1D orthogonal kernel for ConvNets. +8624,ConvolutionOrthogonal1D,tensorflow/tensorflow/python/ops/init_ops.py,880,class,"Initializer that generates a 1D orthogonal kernel for ConvNets. The shape of the tensor must have length 3. The number of input filters must not exceed the number of output filters. @@ -70829,7 +77965,7 @@ Args: References: [Xiao et al., 2018](http://proceedings.mlr.press/v80/xiao18a.html) ([pdf](http://proceedings.mlr.press/v80/xiao18a/xiao18a.pdf))" -8907,ConvolutionOrthogonal3D,tensorflow/tensorflow/python/ops/init_ops.py,1005,class,"Initializer that generates a 3D orthogonal kernel for ConvNets. +8625,ConvolutionOrthogonal3D,tensorflow/tensorflow/python/ops/init_ops.py,1005,class,"Initializer that generates a 3D orthogonal kernel for ConvNets. The shape of the tensor must have length 5. The number of input filters must not exceed the number of output filters. @@ -70848,7 +77984,9 @@ Args: References: [Xiao et al., 2018](http://proceedings.mlr.press/v80/xiao18a.html) ([pdf](http://proceedings.mlr.press/v80/xiao18a/xiao18a.pdf))" -8908,Identity,tensorflow/tensorflow/python/ops/init_ops.py,1170,class,"Initializer that generates the identity matrix. +8626,matmul,tensorflow/tensorflow/python/ops/init_ops.py,1082,method, +8627,cast,tensorflow/tensorflow/python/ops/init_ops.py,1085,method,Return p or (1-p). +8628,Identity,tensorflow/tensorflow/python/ops/init_ops.py,1170,class,"Initializer that generates the identity matrix. Only use for 2D matrices. @@ -70856,7 +77994,8 @@ Args: gain: Multiplicative factor to apply to the identity matrix. dtype: Default data type, used if no `dtype` argument is provided when calling the initializer. Only floating point types are supported." -8909,GlorotUniform,tensorflow/tensorflow/python/ops/init_ops.py,1210,class,"The Glorot uniform initializer, also called Xavier uniform initializer. +8629,get_config,tensorflow/tensorflow/python/ops/init_ops.py,1203,method, +8630,GlorotUniform,tensorflow/tensorflow/python/ops/init_ops.py,1210,class,"The Glorot uniform initializer, also called Xavier uniform initializer. It draws samples from a uniform distribution within [-limit, limit] where `limit` is `sqrt(6 / (fan_in + fan_out))` @@ -70871,7 +78010,8 @@ Args: References: [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) ([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))" -8910,GlorotNormal,tensorflow/tensorflow/python/ops/init_ops.py,1242,class,"The Glorot normal initializer, also called Xavier normal initializer. +8631,get_config,tensorflow/tensorflow/python/ops/init_ops.py,1235,method, +8632,GlorotNormal,tensorflow/tensorflow/python/ops/init_ops.py,1242,class,"The Glorot normal initializer, also called Xavier normal initializer. It draws samples from a truncated normal distribution centered on 0 with standard deviation (after truncation) given by @@ -70887,7 +78027,8 @@ Args: References: [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) ([pdf](http://jmlr.org/proceedings/papers/v9/glorot10a/glorot10a.pdf))" -8911,lecun_normal,tensorflow/tensorflow/python/ops/init_ops.py,1295,function,"LeCun normal initializer. +8633,get_config,tensorflow/tensorflow/python/ops/init_ops.py,1268,method, +8634,lecun_normal,tensorflow/tensorflow/python/ops/init_ops.py,1295,function,"LeCun normal initializer. It draws samples from a truncated normal distribution centered on 0 with standard deviation (after truncation) given by @@ -70908,7 +78049,7 @@ References: ([pdf](https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf)) - Efficient Backprop, [Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)" -8912,lecun_uniform,tensorflow/tensorflow/python/ops/init_ops.py,1323,function,"LeCun uniform initializer. +8635,lecun_uniform,tensorflow/tensorflow/python/ops/init_ops.py,1323,function,"LeCun uniform initializer. It draws samples from a uniform distribution within [-limit, limit] where `limit` is `sqrt(3 / fan_in)` @@ -70928,7 +78069,7 @@ References: ([pdf](https://papers.nips.cc/paper/6698-self-normalizing-neural-networks.pdf)) - Efficient Backprop, [Lecun et al., 1998](http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf)" -8913,he_normal,tensorflow/tensorflow/python/ops/init_ops.py,1350,function,"He normal initializer. +8636,he_normal,tensorflow/tensorflow/python/ops/init_ops.py,1350,function,"He normal initializer. It draws samples from a truncated normal distribution centered on 0 with standard deviation (after truncation) given by @@ -70946,7 +78087,7 @@ References: (https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long ([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))" -8914,he_uniform,tensorflow/tensorflow/python/ops/init_ops.py,1375,function,"He uniform variance scaling initializer. +8637,he_uniform,tensorflow/tensorflow/python/ops/init_ops.py,1375,function,"He uniform variance scaling initializer. It draws samples from a uniform distribution within [-limit, limit] where `limit` is `sqrt(6 / fan_in)` @@ -70963,29 +78104,29 @@ References: (https://www.cv-foundation.org/openaccess/content_iccv_2015/html/He_Delving_Deep_into_ICCV_2015_paper.html) # pylint: disable=line-too-long ([pdf](https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf))" -8915,_compute_fans,tensorflow/tensorflow/python/ops/init_ops.py,1401,function,"Computes the number of input and output units for a weight shape. - -Args: - shape: Integer shape tuple or TF tensor shape. - -Returns: - A tuple of integer scalars (fan_in, fan_out)." -8916,_assert_float_dtype,tensorflow/tensorflow/python/ops/init_ops.py,1428,function,"Validate and return floating point type based on `dtype`. - -`dtype` must be a floating point type. - -Args: - dtype: The data type to validate. - -Returns: - Validated type. - -Raises: - ValueError: if `dtype` is not a floating point type." -8917,InitializersTest,tensorflow/tensorflow/python/ops/init_ops_test.py,36,class, -8918,Initializer,tensorflow/tensorflow/python/ops/init_ops_v2.py,48,class,"Initializer base class: all initializers inherit from this class. +8638,Initializer,tensorflow/tensorflow/python/ops/init_ops_v2.py,48,class,"Initializer base class: all initializers inherit from this class. " -8919,Zeros,tensorflow/tensorflow/python/ops/init_ops_v2.py,94,class,"Initializer that generates tensors initialized to 0. +8639,get_config,tensorflow/tensorflow/python/ops/init_ops_v2.py,62,method,"Returns the configuration of the initializer as a JSON-serializable dict. + +Returns: + A JSON-serializable Python dict." +8640,from_config,tensorflow/tensorflow/python/ops/init_ops_v2.py,71,method,"Instantiates an initializer from a configuration dictionary. + +Example: + +```python +initializer = RandomUniform(-1, 1) +config = initializer.get_config() +initializer = RandomUniform.from_config(config) +``` + +Args: + config: A Python dictionary. + It will typically be the output of `get_config`. + +Returns: + An Initializer instance." +8641,Zeros,tensorflow/tensorflow/python/ops/init_ops_v2.py,94,class,"Initializer that generates tensors initialized to 0. Initializers allow you to pre-specify an initialization strategy, encoded in the Initializer object, without knowing the shape and dtype of the variable @@ -71006,7 +78147,7 @@ array([[0., 0., 0.], [0., 0., 0.]], dtype=float32)> >>> make_variables(4, tf.random_uniform_initializer(minval=-1., maxval=1.)) (, >>> make_variables(4, tf.random_uniform_initializer(minval=-1., maxval=1.)) (, 0) and @@ -72178,7 +79258,7 @@ Other differences: b) Explicitly supports 'euclidean' norm as the default, including for higher order tensors. @end_compatibility" -8995,norm,tensorflow/tensorflow/python/ops/linalg_ops.py,632,function,"Computes the norm of vectors, matrices, and tensors. +8699,norm,tensorflow/tensorflow/python/ops/linalg_ops.py,632,function,"Computes the norm of vectors, matrices, and tensors. This function can compute several different vector norms (the 1-norm, the Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) and @@ -72235,53 +79315,21 @@ Other differences: b) Explicitly supports 'euclidean' norm as the default, including for higher order tensors. @end_compatibility" -8996,eye,tensorflow/tensorflow/python/ops/linalg_ops_impl.py,33,function,"Construct an identity matrix, or a batch of matrices. +8700,eye,tensorflow/tensorflow/python/ops/linalg_ops_impl.py,33,function,"Construct an identity matrix, or a batch of matrices. See `linalg_ops.eye`." -8997,empty_tensor_list,tensorflow/tensorflow/python/ops/list_ops.py,45,function, -8998,tensor_list_reserve,tensorflow/tensorflow/python/ops/list_ops.py,59,function, -8999,tensor_list_from_tensor,tensorflow/tensorflow/python/ops/list_ops.py,67,function, -9000,tensor_list_get_item,tensorflow/tensorflow/python/ops/list_ops.py,74,function, -9001,tensor_list_pop_back,tensorflow/tensorflow/python/ops/list_ops.py,84,function, -9002,tensor_list_gather,tensorflow/tensorflow/python/ops/list_ops.py,92,function, -9003,tensor_list_scatter,tensorflow/tensorflow/python/ops/list_ops.py,105,function, -9004,tensor_list_stack,tensorflow/tensorflow/python/ops/list_ops.py,122,function, -9005,tensor_list_concat,tensorflow/tensorflow/python/ops/list_ops.py,135,function, -9006,tensor_list_split,tensorflow/tensorflow/python/ops/list_ops.py,147,function, -9007,tensor_list_set_item,tensorflow/tensorflow/python/ops/list_ops.py,155,function,Sets `item` at `index` in input list. -9008,_PushBackGrad,tensorflow/tensorflow/python/ops/list_ops.py,175,function, -9009,_PopBackGrad,tensorflow/tensorflow/python/ops/list_ops.py,183,function, -9010,_TensorListStackGrad,tensorflow/tensorflow/python/ops/list_ops.py,195,function, -9011,_TensorListConcatGrad,tensorflow/tensorflow/python/ops/list_ops.py,201,function,Gradient function for TensorListConcat. -9012,_TensorListSplitGrad,tensorflow/tensorflow/python/ops/list_ops.py,215,function, -9013,_TensorListFromTensorGrad,tensorflow/tensorflow/python/ops/list_ops.py,227,function,Gradient for TensorListFromTensor. -9014,_TensorListGetItemGrad,tensorflow/tensorflow/python/ops/list_ops.py,249,function,Gradient for TensorListGetItem. -9015,_TensorListSetItemGrad,tensorflow/tensorflow/python/ops/list_ops.py,265,function,Gradient function for TensorListSetItem. -9016,_TensorListResizeGrad,tensorflow/tensorflow/python/ops/list_ops.py,280,function, -9017,_TensorListGatherGrad,tensorflow/tensorflow/python/ops/list_ops.py,287,function,Gradient function for TensorListGather. -9018,_TensorListScatterGrad,tensorflow/tensorflow/python/ops/list_ops.py,301,function,Gradient function for TensorListScatter. -9019,_TensorListScatterIntoExistingListGrad,tensorflow/tensorflow/python/ops/list_ops.py,317,function,Gradient function for TensorListScatterIntoExistingList. -9020,_build_element_shape,tensorflow/tensorflow/python/ops/list_ops.py,330,function,"Converts shape to a format understood by list_ops for element_shape. - -If `shape` is already a `Tensor` it is returned as-is. We do not perform a -type check here. - -If shape is None or a TensorShape with unknown rank, -1 is returned. - -If shape is a scalar, an int32 tensor with empty list is returned. Note we -do directly return an empty list since ops.convert_to_tensor would conver it -to a float32 which is not a valid type for element_shape. - -If shape is a sequence of dims, None's in the list are replaced with -1. We -do not check the dtype of the other dims. - -Args: - shape: Could be None, Tensor, TensorShape or a list of dims (each dim could - be a None, scalar or Tensor). - -Returns: - A None-free shape that can be converted to a tensor." -9021,Print,tensorflow/tensorflow/python/ops/logging_ops.py,74,function,"Prints a list of tensors. +8701,empty_tensor_list,tensorflow/tensorflow/python/ops/list_ops.py,45,function, +8702,tensor_list_reserve,tensorflow/tensorflow/python/ops/list_ops.py,59,function, +8703,tensor_list_from_tensor,tensorflow/tensorflow/python/ops/list_ops.py,67,function, +8704,tensor_list_get_item,tensorflow/tensorflow/python/ops/list_ops.py,74,function, +8705,tensor_list_pop_back,tensorflow/tensorflow/python/ops/list_ops.py,84,function, +8706,tensor_list_gather,tensorflow/tensorflow/python/ops/list_ops.py,92,function, +8707,tensor_list_scatter,tensorflow/tensorflow/python/ops/list_ops.py,105,function, +8708,tensor_list_stack,tensorflow/tensorflow/python/ops/list_ops.py,122,function, +8709,tensor_list_concat,tensorflow/tensorflow/python/ops/list_ops.py,135,function, +8710,tensor_list_split,tensorflow/tensorflow/python/ops/list_ops.py,147,function, +8711,tensor_list_set_item,tensorflow/tensorflow/python/ops/list_ops.py,155,function,Sets `item` at `index` in input list. +8712,Print,tensorflow/tensorflow/python/ops/logging_ops.py,74,function,"Prints a list of tensors. This is an identity op (behaves like `tf.identity`) with the side effect of printing `data` when evaluating. @@ -72312,9 +79360,7 @@ Returns: out = tf.add(tensor, tensor) sess.run(out) ```" -9022,_generate_placeholder_string,tensorflow/tensorflow/python/ops/logging_ops.py,113,function,Generate and return a string that does not appear in `x`. -9023,_is_filepath,tensorflow/tensorflow/python/ops/logging_ops.py,122,function,Returns True if output_stream is a file path. -9024,print_v2,tensorflow/tensorflow/python/ops/logging_ops.py,135,function,"Print the specified inputs. +8713,print_v2,tensorflow/tensorflow/python/ops/logging_ops.py,135,function,"Print the specified inputs. A TensorFlow operator that prints the specified inputs to a desired output stream or logging level. The inputs may be dense or sparse Tensors, @@ -72422,9 +79468,7 @@ Returns: Raises: ValueError: If an unsupported output stream is specified." -9025,_PrintGrad,tensorflow/tensorflow/python/ops/logging_ops.py,373,function, -9026,_Collect,tensorflow/tensorflow/python/ops/logging_ops.py,377,function, -9027,histogram_summary,tensorflow/tensorflow/python/ops/logging_ops.py,389,function,"Outputs a `Summary` protocol buffer with a histogram. +8714,histogram_summary,tensorflow/tensorflow/python/ops/logging_ops.py,389,function,"Outputs a `Summary` protocol buffer with a histogram. This ops is deprecated. Please switch to tf.summary.histogram. @@ -72449,7 +79493,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -9028,image_summary,tensorflow/tensorflow/python/ops/logging_ops.py,429,function,"Outputs a `Summary` protocol buffer with images. +8715,image_summary,tensorflow/tensorflow/python/ops/logging_ops.py,429,function,"Outputs a `Summary` protocol buffer with images. For an explanation of why this op was deprecated, and information on how to migrate, look @@ -72495,7 +79539,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -9029,audio_summary,tensorflow/tensorflow/python/ops/logging_ops.py,490,function,"Outputs a `Summary` protocol buffer with audio. +8716,audio_summary,tensorflow/tensorflow/python/ops/logging_ops.py,490,function,"Outputs a `Summary` protocol buffer with audio. This op is deprecated. Please switch to tf.summary.audio. For an explanation of why this op was deprecated, and information on how to @@ -72530,7 +79574,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -9030,merge_summary,tensorflow/tensorflow/python/ops/logging_ops.py,547,function,"Merges summaries. +8717,merge_summary,tensorflow/tensorflow/python/ops/logging_ops.py,547,function,"Merges summaries. This op is deprecated. Please switch to tf.compat.v1.summary.merge, which has identical @@ -72554,7 +79598,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer resulting from the merging." -9031,merge_all_summaries,tensorflow/tensorflow/python/ops/logging_ops.py,581,function,"Merges all summaries collected in the default graph. +8718,merge_all_summaries,tensorflow/tensorflow/python/ops/logging_ops.py,581,function,"Merges all summaries collected in the default graph. This op is deprecated. Please switch to tf.compat.v1.summary.merge_all, which has @@ -72568,7 +79612,7 @@ Returns: If no summaries were collected, returns None. Otherwise returns a scalar `Tensor` of type `string` containing the serialized `Summary` protocol buffer resulting from the merging." -9032,get_summary_op,tensorflow/tensorflow/python/ops/logging_ops.py,604,function,"Returns a single Summary op that would run all summaries. +8719,get_summary_op,tensorflow/tensorflow/python/ops/logging_ops.py,604,function,"Returns a single Summary op that would run all summaries. Either existing one from `SUMMARY_OP` collection or merges all existing summaries. @@ -72577,7 +79621,7 @@ Returns: If no summaries were collected, returns None. Otherwise returns a scalar `Tensor` of type `string` containing the serialized `Summary` protocol buffer resulting from the merging." -9033,scalar_summary,tensorflow/tensorflow/python/ops/logging_ops.py,635,function,"Outputs a `Summary` protocol buffer with scalar values. +8720,scalar_summary,tensorflow/tensorflow/python/ops/logging_ops.py,635,function,"Outputs a `Summary` protocol buffer with scalar values. This ops is deprecated. Please switch to tf.summary.scalar. For an explanation of why this op was deprecated, and information on how to @@ -72597,7 +79641,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -9034,initialize_all_tables,tensorflow/tensorflow/python/ops/lookup_ops.py,54,function,"Returns an Op that initializes all tables of the default graph. +8721,initialize_all_tables,tensorflow/tensorflow/python/ops/lookup_ops.py,54,function,"Returns an Op that initializes all tables of the default graph. Args: name: Optional name for the initialization op. @@ -72605,7 +79649,7 @@ Args: Returns: An Op that initializes all tables. Note that if there are not tables the returned Op is a NoOp." -9035,tables_initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,68,function,"Returns an Op that initializes all tables of the default graph. +8722,tables_initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,68,function,"Returns an Op that initializes all tables of the default graph. See the [Low Level Intro](https://www.tensorflow.org/guide/low_level_intro#feature_columns) @@ -72617,22 +79661,40 @@ Args: Returns: An Op that initializes all tables. Note that if there are not tables the returned Op is a NoOp." -9036,_check_table_dtypes,tensorflow/tensorflow/python/ops/lookup_ops.py,88,function,"Check that the given key_dtype and value_dtype matches the table dtypes. - -Args: - table: The table to check types against to. - key_dtype: The key data type to check. - value_dtype: The value data type to check. - -Raises: - TypeError: when 'key_dtype' or 'value_dtype' doesn't match the table data - types." -9037,LookupInterface,tensorflow/tensorflow/python/ops/lookup_ops.py,108,class,Represent a lookup table that persists across different steps. -9038,InitializableLookupTableBase,tensorflow/tensorflow/python/ops/lookup_ops.py,149,class,"Initializable lookup table interface. +8723,LookupInterface,tensorflow/tensorflow/python/ops/lookup_ops.py,108,class,Represent a lookup table that persists across different steps. +8724,key_dtype,tensorflow/tensorflow/python/ops/lookup_ops.py,126,method,The table key dtype. +8725,value_dtype,tensorflow/tensorflow/python/ops/lookup_ops.py,131,method,The table value dtype. +8726,name,tensorflow/tensorflow/python/ops/lookup_ops.py,136,method,The name of the table. +8727,size,tensorflow/tensorflow/python/ops/lookup_ops.py,140,method,Compute the number of elements in this table. +8728,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,144,method,"Looks up `keys` in a table, outputs the corresponding values." +8729,InitializableLookupTableBase,tensorflow/tensorflow/python/ops/lookup_ops.py,149,class,"Initializable lookup table interface. An initializable lookup tables persist across different steps." -9039,InitializableLookupTableBaseV1,tensorflow/tensorflow/python/ops/lookup_ops.py,240,class, -9040,StaticHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,248,class,"A generic hash table that is immutable once initialized. +8730,default_value,tensorflow/tensorflow/python/ops/lookup_ops.py,186,method,The default value of the table. +8731,size,tensorflow/tensorflow/python/ops/lookup_ops.py,190,method,"Compute the number of elements in this table. + +Args: + name: A name for the operation (optional). + +Returns: + A scalar tensor containing the number of elements in this table." +8732,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,202,method,"Looks up `keys` in a table, outputs the corresponding values. + +The `default_value` is used for keys not present in the table. + +Args: + keys: Keys to look up. May be either a `SparseTensor` or dense `Tensor`. + name: A name for the operation (optional). + +Returns: + A `SparseTensor` if keys are sparse, otherwise a dense `Tensor`. + +Raises: + TypeError: when `keys` or `default_value` doesn't match the table data + types." +8733,InitializableLookupTableBaseV1,tensorflow/tensorflow/python/ops/lookup_ops.py,240,class, +8734,initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,243,method, +8735,StaticHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,248,class,"A generic hash table that is immutable once initialized. Example usage: @@ -72644,7 +79706,16 @@ table = tf.lookup.StaticHashTable( tf.lookup.KeyValueTensorInitializer(keys_tensor, vals_tensor), -1) print(table.lookup(input_tensor)) ```" -9041,StaticHashTableV1,tensorflow/tensorflow/python/ops/lookup_ops.py,330,class,"A generic hash table that is immutable once initialized. +8736,name,tensorflow/tensorflow/python/ops/lookup_ops.py,307,method, +8737,export,tensorflow/tensorflow/python/ops/lookup_ops.py,310,method,"Returns tensors of all keys and values in the table. + +Args: + name: A name for the operation (optional). + +Returns: + A pair of tensors with the first tensor containing all keys and the + second tensors containing all values in the table." +8738,StaticHashTableV1,tensorflow/tensorflow/python/ops/lookup_ops.py,330,class,"A generic hash table that is immutable once initialized. When running in graph mode, you must evaluate the tensor returned by `tf.tables_initializer()` before evaluating the tensor returned by @@ -72674,9 +79745,14 @@ table = tf.lookup.StaticHashTable( tf.lookup.KeyValueTensorInitializer(keys_tensor, vals_tensor), -1) print(table.lookup(input_tensor)) ```" -9042,HashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,369,class, -9043,TableInitializerBase,tensorflow/tensorflow/python/ops/lookup_ops.py,376,class,Base class for lookup table initializers. -9044,DatasetInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,416,class,"Creates a table initializer from a `tf.data.Dataset`. +8739,initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,364,method, +8740,HashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,369,class, +8741,init,tensorflow/tensorflow/python/ops/lookup_ops.py,372,method, +8742,TableInitializerBase,tensorflow/tensorflow/python/ops/lookup_ops.py,376,class,Base class for lookup table initializers. +8743,key_dtype,tensorflow/tensorflow/python/ops/lookup_ops.py,390,method,The expected table key dtype. +8744,value_dtype,tensorflow/tensorflow/python/ops/lookup_ops.py,395,method,The expected table value dtype. +8745,initialize,tensorflow/tensorflow/python/ops/lookup_ops.py,399,method,Returns the table initialization op. +8746,DatasetInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,416,class,"Creates a table initializer from a `tf.data.Dataset`. Sample usage: ```python @@ -72695,8 +79771,20 @@ Attributes: first scalar is treated as a key and the second as value. Raises: ValueError if `dataset` doesn't conform to specifications." -9045,KeyValueTensorInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,476,class,Table initializers given `keys` and `values` tensors. -9046,TextFileIndex,tensorflow/tensorflow/python/ops/lookup_ops.py,532,class,"The key and value content to get from each line. +8747,initialize,tensorflow/tensorflow/python/ops/lookup_ops.py,467,method, +8748,KeyValueTensorInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,476,class,Table initializers given `keys` and `values` tensors. +8749,initialize,tensorflow/tensorflow/python/ops/lookup_ops.py,509,method,"Initializes the given `table` with `keys` and `values` tensors. + +Args: + table: The table to initialize. + +Returns: + The operation that initializes the table. + +Raises: + TypeError: when the keys and values data types do not match the table + key and value data types." +8750,TextFileIndex,tensorflow/tensorflow/python/ops/lookup_ops.py,532,class,"The key and value content to get from each line. This class defines the key and value used for tf.lookup.TextFileInitializer. @@ -72709,7 +79797,7 @@ by the following, or a value `>=0`. A value `>=0` means use the index (starting at zero) of the split line based on `delimiter`." -9047,TextFileInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,552,class,"Table initializers from a text file. +8751,TextFileInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,552,class,"Table initializers from a text file. This initializer assigns one entry in the table for each line in the file. @@ -72761,9 +79849,20 @@ table = tf.lookup.StaticHashTable(tf.lookup.TextFileInitializer( ... table.init.run() ```" -9048,TextFileStringTableInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,733,class,Table initializer for `int64` IDs to string tables from a text file. -9049,TextFileIdTableInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,784,class,Table initializer for string to `int64` IDs tables from a text file. -9050,HasherSpec,tensorflow/tensorflow/python/ops/lookup_ops.py,837,class,"A structure for the spec of the hashing function to use for hash buckets. +8752,initialize,tensorflow/tensorflow/python/ops/lookup_ops.py,689,method,"Initializes the table from a text file. + +Args: + table: The table to be initialized. + +Returns: + The operation that initializes the table. + +Raises: + TypeError: when the keys and values data types do not match the table + key and value data types." +8753,TextFileStringTableInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,733,class,Table initializer for `int64` IDs to string tables from a text file. +8754,TextFileIdTableInitializer,tensorflow/tensorflow/python/ops/lookup_ops.py,784,class,Table initializer for string to `int64` IDs tables from a text file. +8755,HasherSpec,tensorflow/tensorflow/python/ops/lookup_ops.py,837,class,"A structure for the spec of the hashing function to use for hash buckets. `hasher` is the name of the hashing function to use (eg. ""fasthash"", ""stronghash""). @@ -72773,7 +79872,7 @@ supported, currently only used by a strong hash. Fields: hasher: The hasher name to use. key: The key to be used by the hashing function, if required." -9051,StrongHashSpec,tensorflow/tensorflow/python/ops/lookup_ops.py,855,class,"A structure to specify a key of the strong keyed hash spec. +8756,StrongHashSpec,tensorflow/tensorflow/python/ops/lookup_ops.py,855,class,"A structure to specify a key of the strong keyed hash spec. The strong hash requires a `key`, which is a list of 2 unsigned integer numbers. These should be non-zero; random numbers generated from random.org @@ -72781,8 +79880,7 @@ would be a fine choice. Fields: key: The key to be used by the keyed hashing function." -9052,_as_string,tensorflow/tensorflow/python/ops/lookup_ops.py,878,function, -9053,IdTableWithHashBuckets,tensorflow/tensorflow/python/ops/lookup_ops.py,884,class,"String to Id table wrapper that assigns out-of-vocabulary keys to buckets. +8757,IdTableWithHashBuckets,tensorflow/tensorflow/python/ops/lookup_ops.py,884,class,"String to Id table wrapper that assigns out-of-vocabulary keys to buckets. For example, if an instance of `IdTableWithHashBuckets` is initialized with a string-to-id table that maps: @@ -72828,7 +79926,25 @@ print(out.eval()) The hash function used for generating out-of-vocabulary buckets ID is handled by `hasher_spec`." -9054,StaticVocabularyTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1099,class,"String to Id table wrapper that assigns out-of-vocabulary keys to buckets. +8758,initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,1008,method, +8759,init,tensorflow/tensorflow/python/ops/lookup_ops.py,1016,method, +8760,resource_handle,tensorflow/tensorflow/python/ops/lookup_ops.py,1020,method, +8761,name,tensorflow/tensorflow/python/ops/lookup_ops.py,1026,method, +8762,size,tensorflow/tensorflow/python/ops/lookup_ops.py,1029,method,Compute the number of elements in this table. +8763,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,1051,method,"Looks up `keys` in the table, outputs the corresponding values. + +It assigns out-of-vocabulary keys to buckets based in their hashes. + +Args: + keys: Keys to look up. May be either a `SparseTensor` or dense `Tensor`. + name: Optional name for the op. + +Returns: + A `SparseTensor` if keys are sparse, otherwise a dense `Tensor`. + +Raises: + TypeError: when `keys` doesn't match the table key data type." +8764,StaticVocabularyTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1099,class,"String to Id table wrapper that assigns out-of-vocabulary keys to buckets. For example, if an instance of `StaticVocabularyTable` is initialized with a string-to-id initializer that maps: @@ -72870,8 +79986,25 @@ print(out.eval()) The hash function used for generating out-of-vocabulary buckets ID is Fingerprint64." -9055,StaticVocabularyTableV1,tensorflow/tensorflow/python/ops/lookup_ops.py,1280,class, -9056,index_table_from_file,tensorflow/tensorflow/python/ops/lookup_ops.py,1290,function,"Returns a lookup table that converts a string tensor into int64 IDs. +8765,resource_handle,tensorflow/tensorflow/python/ops/lookup_ops.py,1219,method, +8766,name,tensorflow/tensorflow/python/ops/lookup_ops.py,1225,method, +8767,size,tensorflow/tensorflow/python/ops/lookup_ops.py,1228,method,Compute the number of elements in this table. +8768,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,1237,method,"Looks up `keys` in the table, outputs the corresponding values. + +It assigns out-of-vocabulary keys to buckets based in their hashes. + +Args: + keys: Keys to look up. May be either a `SparseTensor` or dense `Tensor`. + name: Optional name for the op. + +Returns: + A `SparseTensor` if keys are sparse, otherwise a dense `Tensor`. + +Raises: + TypeError: when `keys` doesn't match the table key data type." +8769,StaticVocabularyTableV1,tensorflow/tensorflow/python/ops/lookup_ops.py,1280,class, +8770,initializer,tensorflow/tensorflow/python/ops/lookup_ops.py,1283,method, +8771,index_table_from_file,tensorflow/tensorflow/python/ops/lookup_ops.py,1290,function,"Returns a lookup table that converts a string tensor into int64 IDs. This operation constructs a lookup table to convert tensor of strings into int64 IDs. The mapping can be initialized from a vocabulary file specified in @@ -72942,7 +80075,7 @@ Raises: ValueError: If `vocabulary_file` is not set. ValueError: If `num_oov_buckets` is negative or `vocab_size` is not greater than zero." -9057,index_table_from_tensor,tensorflow/tensorflow/python/ops/lookup_ops.py,1411,function,"Returns a lookup table that converts a string tensor into int64 IDs. +8772,index_table_from_tensor,tensorflow/tensorflow/python/ops/lookup_ops.py,1411,function,"Returns a lookup table that converts a string tensor into int64 IDs. This operation constructs a lookup table to convert tensor of strings into int64 IDs. The mapping can be initialized from a string `vocabulary_list` 1-D @@ -72993,7 +80126,7 @@ Returns: Raises: ValueError: If `vocabulary_list` is invalid. ValueError: If `num_oov_buckets` is negative." -9058,index_to_string_table_from_file,tensorflow/tensorflow/python/ops/lookup_ops.py,1510,function,"Returns a lookup table that maps a `Tensor` of indices into strings. +8773,index_to_string_table_from_file,tensorflow/tensorflow/python/ops/lookup_ops.py,1510,function,"Returns a lookup table that maps a `Tensor` of indices into strings. This operation constructs a lookup table to map int64 indices into string values. The table is initialized from a vocabulary file specified in @@ -73056,7 +80189,7 @@ Returns: Raises: ValueError: when `vocabulary_file` is empty. ValueError: when `vocab_size` is invalid." -9059,index_to_string_table_from_tensor,tensorflow/tensorflow/python/ops/lookup_ops.py,1601,function,"Returns a lookup table that maps a `Tensor` of indices into strings. +8774,index_to_string_table_from_tensor,tensorflow/tensorflow/python/ops/lookup_ops.py,1601,function,"Returns a lookup table that maps a `Tensor` of indices into strings. This operation constructs a lookup table to map int64 indices into string values. The mapping is initialized from a string `vocabulary_list` 1-D @@ -73099,7 +80232,7 @@ Returns: Raises: ValueError: when `vocabulary_list` is not set." -9060,MutableHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1663,class,"A generic mutable hash table implementation. +8775,MutableHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1663,class,"A generic mutable hash table implementation. Data can be inserted by calling the insert method and removed by calling the remove method. It does not support initialization via the init method. @@ -73113,7 +80246,68 @@ sess.run(table.insert(keys, values)) out = table.lookup(query_keys) print(out.eval()) ```" -9061,DenseHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1902,class,"A generic mutable hash table implementation using tensors as backing store. +8776,name,tensorflow/tensorflow/python/ops/lookup_ops.py,1758,method, +8777,size,tensorflow/tensorflow/python/ops/lookup_ops.py,1761,method,"Compute the number of elements in this table. + +Args: + name: A name for the operation (optional). + +Returns: + A scalar tensor containing the number of elements in this table." +8778,remove,tensorflow/tensorflow/python/ops/lookup_ops.py,1774,method,"Removes `keys` and its associated values from the table. + +If a key is not present in the table, it is silently ignored. + +Args: + keys: Keys to remove. Can be a tensor of any shape. Must match the table's + key type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` do not match the table data types." +8779,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,1800,method,"Looks up `keys` in a table, outputs the corresponding values. + +The `default_value` is used for keys not present in the table. + +Args: + keys: Keys to look up. Can be a tensor of any shape. Must match the + table's key_dtype. + name: A name for the operation (optional). + +Returns: + A tensor containing the values in the same shape as `keys` using the + table's value type. + +Raises: + TypeError: when `keys` do not match the table data types." +8780,insert,tensorflow/tensorflow/python/ops/lookup_ops.py,1825,method,"Associates `keys` with `values`. + +Args: + keys: Keys to insert. Can be a tensor of any shape. Must match the table's + key type. + values: Values to be associated with keys. Must be a tensor of the same + shape as `keys` and match the table's value type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` or `values` doesn't match the table data + types." +8781,export,tensorflow/tensorflow/python/ops/lookup_ops.py,1852,method,"Returns tensors of all keys and values in the table. + +Args: + name: A name for the operation (optional). + +Returns: + A pair of tensors with the first tensor containing all keys and the + second tensors containing all values in the table." +8782,restore,tensorflow/tensorflow/python/ops/lookup_ops.py,1891,method, +8783,DenseHashTable,tensorflow/tensorflow/python/ops/lookup_ops.py,1902,class,"A generic mutable hash table implementation using tensors as backing store. Data can be inserted by calling the insert method and removed by calling the remove method. It does not support initialization via the init method. @@ -73137,9 +80331,98 @@ sess.run(table.insert(keys, values)) out = table.lookup(query_keys) print(out.eval()) ```" -9062,_RollGrad,tensorflow/tensorflow/python/ops/manip_grad.py,26,function, -9063,roll,tensorflow/tensorflow/python/ops/manip_ops.py,31,function, -9064,map_fn,tensorflow/tensorflow/python/ops/map_fn.py,47,function,"Transforms `elems` by applying `fn` to each element unstacked on axis 0. +8784,name,tensorflow/tensorflow/python/ops/lookup_ops.py,2016,method, +8785,size,tensorflow/tensorflow/python/ops/lookup_ops.py,2019,method,"Compute the number of elements in this table. + +Args: + name: A name for the operation (optional). + +Returns: + A scalar tensor containing the number of elements in this table." +8786,lookup,tensorflow/tensorflow/python/ops/lookup_ops.py,2032,method,"Looks up `keys` in a table, outputs the corresponding values. + +The `default_value` is used for keys not present in the table. + +Args: + keys: Keys to look up. Can be a tensor of any shape. Must match the + table's key_dtype. + name: A name for the operation (optional). + +Returns: + A tensor containing the values in the same shape as `keys` using the + table's value type. + +Raises: + TypeError: when `keys` do not match the table data types." +8787,insert_or_assign,tensorflow/tensorflow/python/ops/lookup_ops.py,2058,method,"Associates `keys` with `values`. + +Args: + keys: Keys to insert. Can be a tensor of any shape. Must match the table's + key type. + values: Values to be associated with keys. Must be a tensor of the same + shape as `keys` and match the table's value type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` or `values` doesn't match the table data + types." +8788,insert,tensorflow/tensorflow/python/ops/lookup_ops.py,2085,method,"Associates `keys` with `values`. + +Args: + keys: Keys to insert. Can be a tensor of any shape. Must match the table's + key type. + values: Values to be associated with keys. Must be a tensor of the same + shape as `keys` and match the table's value type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` or `values` doesn't match the table data + types." +8789,erase,tensorflow/tensorflow/python/ops/lookup_ops.py,2104,method,"Removes `keys` and its associated values from the table. + +If a key is not present in the table, it is silently ignored. + +Args: + keys: Keys to remove. Can be a tensor of any shape. Must match the table's + key type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` do not match the table data types." +8790,remove,tensorflow/tensorflow/python/ops/lookup_ops.py,2131,method,"Removes `keys` and its associated values from the table. + +If a key is not present in the table, it is silently ignored. + +Args: + keys: Keys to remove. Can be a tensor of any shape. Must match the table's + key type. + name: A name for the operation (optional). + +Returns: + The created Operation. + +Raises: + TypeError: when `keys` do not match the table data types." +8791,export,tensorflow/tensorflow/python/ops/lookup_ops.py,2149,method,"Returns tensors of all keys and values in the table. + +Args: + name: A name for the operation (optional). + +Returns: + A pair of tensors with the first tensor containing all keys and the + second tensors containing all values in the table." +8792,restore,tensorflow/tensorflow/python/ops/lookup_ops.py,2189,method, +8793,roll,tensorflow/tensorflow/python/ops/manip_ops.py,31,function, +8794,map_fn,tensorflow/tensorflow/python/ops/map_fn.py,47,function,"Transforms `elems` by applying `fn` to each element unstacked on axis 0. See also `tf.scan`. @@ -73399,19 +80682,8 @@ Examples: ... fn_output_signature=(tf.int64, tf.int64)) (, )" -9065,_dtype_to_spec,tensorflow/tensorflow/python/ops/map_fn.py,525,function, -9066,_most_general_compatible_type,tensorflow/tensorflow/python/ops/map_fn.py,531,function,Returns the most general TypeSpec compatible with `spec`. -9067,_result_flat_signature_to_batchable_tensor_spec,tensorflow/tensorflow/python/ops/map_fn.py,547,function,Converts result_flat_signature -> result_batchable_tensor_specs. -9068,_elems_flat_to_batchable,tensorflow/tensorflow/python/ops/map_fn.py,557,function,Converts elems_flat -> elems_batchable. -9069,_elems_value_batchable_to_flat,tensorflow/tensorflow/python/ops/map_fn.py,570,function,Converts elems_value_batchable -> elems_value_flat. -9070,_result_value_flat_to_batchable,tensorflow/tensorflow/python/ops/map_fn.py,584,function,Converts result_value_flat -> result_value_batchable. -9071,_result_batchable_to_flat,tensorflow/tensorflow/python/ops/map_fn.py,602,function,Converts result_batchable -> result_flat. -9072,map_fn_v2,tensorflow/tensorflow/python/ops/map_fn.py,628,function,Transform `elems` by applying `fn` to each element unstacked on axis 0. -9073,_safe_shape_div,tensorflow/tensorflow/python/ops/math_grad.py,35,function,"Divides `x / y` assuming `x, y >= 0`, treating `0 / 0 = 0`." -9074,_ArgMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,41,function, -9075,_ArgMinGrad,tensorflow/tensorflow/python/ops/math_grad.py,47,function, -9076,_EuclideanNormGrad,tensorflow/tensorflow/python/ops/math_grad.py,53,function,Gradient for EuclideanNorm. -9077,SmartBroadcastGradientArgs,tensorflow/tensorflow/python/ops/math_grad.py,67,function,"Optimized version of `broadcast_gradient_args` that caches results. +8795,map_fn_v2,tensorflow/tensorflow/python/ops/map_fn.py,628,function,Transform `elems` by applying `fn` to each element unstacked on axis 0. +8796,SmartBroadcastGradientArgs,tensorflow/tensorflow/python/ops/math_grad.py,67,function,"Optimized version of `broadcast_gradient_args` that caches results. This implementation avoids creating `broadcast_gradient_args` ops in the case that the input shapes are fully defined, and provides hints to the calling @@ -73431,170 +80703,7 @@ Returns: shape (and so x's gradient must be reduced and/or reshaped). * A 3-tuple of broadcast information for y, containing the respective details for y." -9078,_IsScalar,tensorflow/tensorflow/python/ops/math_grad.py,143,function, -9079,_SumGrad,tensorflow/tensorflow/python/ops/math_grad.py,148,function,Gradient for Sum. -9080,_MinOrMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,220,function,Gradient for Min or Max. Amazingly it's precisely the same code. -9081,_MaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,242,function,Gradient for Max. -9082,_MinGrad,tensorflow/tensorflow/python/ops/math_grad.py,248,function, -9083,_MeanGrad,tensorflow/tensorflow/python/ops/math_grad.py,253,function,Gradient for Mean. -9084,_ProdGrad,tensorflow/tensorflow/python/ops/math_grad.py,273,function,Gradient for Prod. -9085,_SegmentSumGrad,tensorflow/tensorflow/python/ops/math_grad.py,322,function,Gradient for SegmentSum. -9086,_SegmentMeanGrad,tensorflow/tensorflow/python/ops/math_grad.py,328,function,Gradient for SegmentMean. -9087,_SparseSegmentSumGrad,tensorflow/tensorflow/python/ops/math_grad.py,341,function,Gradient for SparseSegmentSum. -9088,_SparseSegmentSumWithNumSegmentsGrad,tensorflow/tensorflow/python/ops/math_grad.py,350,function,Gradient for SparseSegmentSumWithNumSegments. -9089,_SparseSegmentMeanGrad,tensorflow/tensorflow/python/ops/math_grad.py,359,function,Gradient for SparseSegmentMean. -9090,_SparseSegmentMeanWithNumSegmentsGrad,tensorflow/tensorflow/python/ops/math_grad.py,367,function,Gradient for SparseSegmentMeanWithNumSegments. -9091,_SparseSegmentSqrtNGrad,tensorflow/tensorflow/python/ops/math_grad.py,375,function,Gradient for SparseSegmentSqrtN. -9092,_SparseSegmentSqrtNWithNumSegmentsGrad,tensorflow/tensorflow/python/ops/math_grad.py,383,function,Gradient for SparseSegmentSqrtNWithNumSegments. -9093,_SegmentMinOrMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,390,function,Gradient for SegmentMin and SegmentMax. -9094,_SegmentMinGrad,tensorflow/tensorflow/python/ops/math_grad.py,406,function,Gradient for SegmentMin. -9095,_SegmentMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,412,function,Gradient for SegmentMax. -9096,_GatherDropNegatives,tensorflow/tensorflow/python/ops/math_grad.py,417,function,"Helper function for unsorted segment ops. - -Gathers params for - positive segment ids and gathers 0 for inputs with negative segment id. - Also returns the clipped indices and a boolean mask with the same shape - as ids where a positive id is masked as true. With this, the latter two - can be passed as arguments to this function to reuse them." -9097,_UnsortedSegmentMinOrMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,452,function,Gradient for UnsortedSegmentMin and UnsortedSegmentMax. -9098,_UnsortedSegmentSumGrad,tensorflow/tensorflow/python/ops/math_grad.py,471,function,Gradient for UnsortedSegmentSum. -9099,_UnsortedSegmentMaxGrad,tensorflow/tensorflow/python/ops/math_grad.py,477,function,Gradient for UnsortedSegmentMax. -9100,_UnsortedSegmentMinGrad,tensorflow/tensorflow/python/ops/math_grad.py,483,function,Gradient for UnsortedSegmentMin. -9101,_UnsortedSegmentProdGrad,tensorflow/tensorflow/python/ops/math_grad.py,489,function,"Gradient for UnsortedSegmentProd. - -The gradient can be expressed for each segment by dividing the segment's -product by each element of the segment input tensor, but this approach can't -deal with zeros in the input. -Unlike reduce_prod we can't use cumsum here as individual segments may have -a different number of elements. Therefore we consider three cases: -1) A segment input contains no zeros and we can safely divide by the input - tensor. -2) A segment contains exactly one zero. Then the gradient of each input of - the segment is zero except for the 0-input, there the gradient is - the product of the remaining segment entries. -3) A segment contains at least two zeros. The gradient is zero for all - segment inputs." -9102,_AbsGrad,tensorflow/tensorflow/python/ops/math_grad.py,537,function, -9103,_NegGrad,tensorflow/tensorflow/python/ops/math_grad.py,543,function,Returns -grad. -9104,_InvGrad,tensorflow/tensorflow/python/ops/math_grad.py,549,function,Returns -grad * (1 / x^2). -9105,_ReciprocalGrad,tensorflow/tensorflow/python/ops/math_grad.py,556,function,Returns -grad * (1 / x^2). -9106,_InvGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,563,function, -9107,_ReciprocalGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,573,function, -9108,_SquareGrad,tensorflow/tensorflow/python/ops/math_grad.py,583,function, -9109,_SqrtGrad,tensorflow/tensorflow/python/ops/math_grad.py,593,function, -9110,_SqrtGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,599,function, -9111,_RsqrtGrad,tensorflow/tensorflow/python/ops/math_grad.py,608,function,Returns -0.5 * grad * conj(y)^3. -9112,_RsqrtGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,615,function,"Returns backprop gradient for f(a,b) = -0.5 * b * conj(a)^3." -9113,_ExpGrad,tensorflow/tensorflow/python/ops/math_grad.py,628,function,Returns grad * exp(x). -9114,_Expm1Grad,tensorflow/tensorflow/python/ops/math_grad.py,637,function,Returns grad * exp(x). -9115,_LogGrad,tensorflow/tensorflow/python/ops/math_grad.py,647,function,Returns grad * (1/x). -9116,_Log1pGrad,tensorflow/tensorflow/python/ops/math_grad.py,656,function,Returns grad * (1/(1 + x)). -9117,_XLogyGrad,tensorflow/tensorflow/python/ops/math_grad.py,665,function,"Returns gradient of xlogy(x, y) with respect to x and y." -9118,_XLog1pyGrad,tensorflow/tensorflow/python/ops/math_grad.py,682,function,"Returns gradient of xlog1py(x, y) with respect to x and y." -9119,_XDivyGrad,tensorflow/tensorflow/python/ops/math_grad.py,699,function,"Returns gradient of xdivy(x, y) with respect to x and y." -9120,_SinhGrad,tensorflow/tensorflow/python/ops/math_grad.py,716,function,Returns grad * cosh(x). -9121,_CoshGrad,tensorflow/tensorflow/python/ops/math_grad.py,725,function,Returns grad * sinh(x). -9122,_TanhGrad,tensorflow/tensorflow/python/ops/math_grad.py,734,function,Returns grad * (1 - tanh(x) * tanh(x)). -9123,_AsinhGrad,tensorflow/tensorflow/python/ops/math_grad.py,743,function,Returns grad * 1/cosh(y). -9124,_AcoshGrad,tensorflow/tensorflow/python/ops/math_grad.py,752,function,Returns grad * 1/sinh(y). -9125,_AtanhGrad,tensorflow/tensorflow/python/ops/math_grad.py,761,function,Returns grad * 1/ (1 - x^2). -9126,_TanhGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,773,function, -9127,_ErfGrad,tensorflow/tensorflow/python/ops/math_grad.py,781,function,Returns grad * 2/sqrt(pi) * exp(-x**2). -9128,_ErfcGrad,tensorflow/tensorflow/python/ops/math_grad.py,791,function,Returns -grad * 2/sqrt(pi) * exp(-x**2). -9129,_ErfinvGrad,tensorflow/tensorflow/python/ops/math_grad.py,802,function,Returns grad * sqrt(pi) / 2 * exp(erfinv(x)**2). -9130,_NdtriGrad,tensorflow/tensorflow/python/ops/math_grad.py,811,function,Returns grad * sqrt(2 * pi) * exp(ndtri(x)**2 / 2). -9131,_LgammaGrad,tensorflow/tensorflow/python/ops/math_grad.py,820,function,Returns grad * digamma(x). -9132,_DigammaGrad,tensorflow/tensorflow/python/ops/math_grad.py,829,function,Compute gradient of the digamma function with respect to its argument. -9133,_DawsnGrad,tensorflow/tensorflow/python/ops/math_grad.py,839,function,Compute gradient of dawsn(x) with respect to its argument. -9134,_ExpintGrad,tensorflow/tensorflow/python/ops/math_grad.py,848,function,Compute gradient of expint(x) with respect to its argument. -9135,_FresnelCosGrad,tensorflow/tensorflow/python/ops/math_grad.py,856,function,Compute gradient of fresnel_cos(x) with respect to its argument. -9136,_FresnelSinGrad,tensorflow/tensorflow/python/ops/math_grad.py,864,function,Compute gradient of fresnel_sin(x) with respect to its argument. -9137,_SpenceGrad,tensorflow/tensorflow/python/ops/math_grad.py,872,function,Compute gradient of spence(x) with respect to its argument. -9138,_BesselI0Grad,tensorflow/tensorflow/python/ops/math_grad.py,883,function,Compute gradient of bessel_i0(x) with respect to its argument. -9139,_BesselI0eGrad,tensorflow/tensorflow/python/ops/math_grad.py,892,function,Compute gradient of bessel_i0e(x) with respect to its argument. -9140,_BesselI1Grad,tensorflow/tensorflow/python/ops/math_grad.py,902,function,Compute gradient of bessel_i1(x) with respect to its argument. -9141,_BesselI1eGrad,tensorflow/tensorflow/python/ops/math_grad.py,919,function,Compute gradient of bessel_i1e(x) with respect to its argument. -9142,_BesselK0Grad,tensorflow/tensorflow/python/ops/math_grad.py,937,function,Compute gradient of bessel_k0(x) with respect to its argument. -9143,_BesselK0eGrad,tensorflow/tensorflow/python/ops/math_grad.py,946,function,Compute gradient of bessel_k0e(x) with respect to its argument. -9144,_BesselK1Grad,tensorflow/tensorflow/python/ops/math_grad.py,956,function,Compute gradient of bessel_k1(x) with respect to its argument. -9145,_BesselK1eGrad,tensorflow/tensorflow/python/ops/math_grad.py,968,function,Compute gradient of bessel_k1e(x) with respect to its argument. -9146,_BesselJ0Grad,tensorflow/tensorflow/python/ops/math_grad.py,981,function,Compute gradient of bessel_j0(x) with respect to its argument. -9147,_BesselJ1Grad,tensorflow/tensorflow/python/ops/math_grad.py,990,function,Compute gradient of bessel_j1(x) with respect to its argument. -9148,_BesselY0Grad,tensorflow/tensorflow/python/ops/math_grad.py,1007,function,Compute gradient of bessel_y0(x) with respect to its argument. -9149,_BesselY1Grad,tensorflow/tensorflow/python/ops/math_grad.py,1016,function,Compute gradient of bessel_y1(x) with respect to its argument. -9150,_IgammaGrad,tensorflow/tensorflow/python/ops/math_grad.py,1028,function,"Returns gradient of igamma(a, x) with respect to a and x." -9151,_IgammacGrad,tensorflow/tensorflow/python/ops/math_grad.py,1047,function,"Returns gradient of igammac(a, x) = 1 - igamma(a, x) w.r.t. a and x." -9152,_BetaincGrad,tensorflow/tensorflow/python/ops/math_grad.py,1054,function,"Returns gradient of betainc(a, b, x) with respect to x." -9153,_ZetaGrad,tensorflow/tensorflow/python/ops/math_grad.py,1082,function,"Returns gradient of zeta(x, q) with respect to x and q." -9154,_PolygammaGrad,tensorflow/tensorflow/python/ops/math_grad.py,1101,function,"Returns gradient of psi(n, x) with respect to n and x." -9155,_SigmoidGrad,tensorflow/tensorflow/python/ops/math_grad.py,1120,function,Returns grad * sigmoid(x) * (1 - sigmoid(x)). -9156,_SigmoidGradGrad,tensorflow/tensorflow/python/ops/math_grad.py,1129,function, -9157,_SignGrad,tensorflow/tensorflow/python/ops/math_grad.py,1138,function,Returns 0. -9158,_SinGrad,tensorflow/tensorflow/python/ops/math_grad.py,1145,function,Returns grad * cos(x). -9159,_CosGrad,tensorflow/tensorflow/python/ops/math_grad.py,1154,function,Returns grad * -sin(x). -9160,_TanGrad,tensorflow/tensorflow/python/ops/math_grad.py,1163,function,Returns grad * 1/sec^2(x). -9161,_AsinGrad,tensorflow/tensorflow/python/ops/math_grad.py,1174,function,Returns grad * 1/sqrt(1-x^2). -9162,_AcosGrad,tensorflow/tensorflow/python/ops/math_grad.py,1187,function,Returns grad * -1/sqrt(1-x^2). -9163,_AtanGrad,tensorflow/tensorflow/python/ops/math_grad.py,1200,function,Returns grad * 1/ (1 + x^2). -9164,_Atan2Grad,tensorflow/tensorflow/python/ops/math_grad.py,1212,function,"Returns grad * x / (x^2 + y^2), grad * -y / (x^2 + y^2)." -9165,_AddNGrad,tensorflow/tensorflow/python/ops/math_grad.py,1222,function,Copies the gradient to all inputs. -9166,_ShapesFullySpecifiedAndEqual,tensorflow/tensorflow/python/ops/math_grad.py,1228,function, -9167,_AddGrad,tensorflow/tensorflow/python/ops/math_grad.py,1240,function,Gradient for Add. -9168,_SubGrad,tensorflow/tensorflow/python/ops/math_grad.py,1274,function,Gradient for Sub. -9169,_MulGrad,tensorflow/tensorflow/python/ops/math_grad.py,1308,function,The gradient of scalar multiplication. -9170,_MulNoNanGrad,tensorflow/tensorflow/python/ops/math_grad.py,1349,function,The gradient of scalar multiplication with NaN-suppression. -9171,_DivGrad,tensorflow/tensorflow/python/ops/math_grad.py,1367,function,The gradient for the Div operator. -9172,_FloorDivGrad,tensorflow/tensorflow/python/ops/math_grad.py,1384,function,The gradient for the FloorDiv operator. -9173,_FloorModGrad,tensorflow/tensorflow/python/ops/math_grad.py,1390,function,"Returns grad * (1, -floor(x/y))." -9174,_TruncateDivGrad,tensorflow/tensorflow/python/ops/math_grad.py,1406,function, -9175,_RealDivGrad,tensorflow/tensorflow/python/ops/math_grad.py,1411,function,RealDiv op gradient. -9176,_DivNoNanGrad,tensorflow/tensorflow/python/ops/math_grad.py,1428,function,DivNoNan op gradient. -9177,_PowGrad,tensorflow/tensorflow/python/ops/math_grad.py,1446,function,"Returns grad * (y*x^(y-1), z*log(x))." -9178,_MaximumMinimumGradInputOnly,tensorflow/tensorflow/python/ops/math_grad.py,1498,function, -9179,_MaximumMinimumGrad,tensorflow/tensorflow/python/ops/math_grad.py,1508,function,Factor out the code for the gradient of Maximum or Minimum. -9180,_MaximumGrad,tensorflow/tensorflow/python/ops/math_grad.py,1546,function,"Returns grad*(x > y, x <= y) with type of grad." -9181,_MinimumGrad,tensorflow/tensorflow/python/ops/math_grad.py,1552,function,"Returns grad*(x < y, x >= y) with type of grad." -9182,_SquaredDifferenceGrad,tensorflow/tensorflow/python/ops/math_grad.py,1558,function,Returns the gradient for (x-y)^2. -9183,_SelectGrad,tensorflow/tensorflow/python/ops/math_grad.py,1611,function, -9184,_SelectGradV2,tensorflow/tensorflow/python/ops/math_grad.py,1620,function, -9185,_MatMulGradAgainstFirstOnly,tensorflow/tensorflow/python/ops/math_grad.py,1643,function,"Gradient for MatMul, only for the first input." -9186,_MatMulGradAgainstSecondOnly,tensorflow/tensorflow/python/ops/math_grad.py,1659,function,"Gradient for MatMul, only for the second input." -9187,_MatMulGrad,tensorflow/tensorflow/python/ops/math_grad.py,1676,function,Gradient for MatMul. -9188,_SparseMatMulGrad,tensorflow/tensorflow/python/ops/math_grad.py,1709,function,Gradient for SparseMatMul. -9189,_FloorGrad,tensorflow/tensorflow/python/ops/math_grad.py,1761,function, -9190,_CeilGrad,tensorflow/tensorflow/python/ops/math_grad.py,1766,function, -9191,_RoundGrad,tensorflow/tensorflow/python/ops/math_grad.py,1771,function, -9192,_RintGrad,tensorflow/tensorflow/python/ops/math_grad.py,1776,function, -9193,_BatchMatMul,tensorflow/tensorflow/python/ops/math_grad.py,1782,function,Returns the gradient of x and y given the gradient of x * y. -9194,_BatchMatMulV2,tensorflow/tensorflow/python/ops/math_grad.py,1808,function,Returns the gradient of x and y given the gradient of x * y. -9195,_ComplexGrad,tensorflow/tensorflow/python/ops/math_grad.py,1850,function,"Returns the real and imaginary components of 'grad', respectively." -9196,_RealGrad,tensorflow/tensorflow/python/ops/math_grad.py,1862,function,Returns 'grad' as the real part and set the imaginary part 0. -9197,_ImagGrad,tensorflow/tensorflow/python/ops/math_grad.py,1869,function,Returns 'grad' as the imaginary part and set the real part 0. -9198,_AngleGrad,tensorflow/tensorflow/python/ops/math_grad.py,1876,function,Returns -grad / (Im(x) + iRe(x)) -9199,_ConjGrad,tensorflow/tensorflow/python/ops/math_grad.py,1889,function,Returns the complex conjugate of grad. -9200,_ComplexAbsGrad,tensorflow/tensorflow/python/ops/math_grad.py,1895,function,Returns the gradient of ComplexAbs. -9201,_CastGrad,tensorflow/tensorflow/python/ops/math_grad.py,1905,function, -9202,_CrossGrad,tensorflow/tensorflow/python/ops/math_grad.py,1919,function, -9203,_CumsumGrad,tensorflow/tensorflow/python/ops/math_grad.py,1926,function, -9204,_CumprodGrad,tensorflow/tensorflow/python/ops/math_grad.py,1937,function, -9205,_CumulativeLogsumexpGrad,tensorflow/tensorflow/python/ops/math_grad.py,1951,function, -9206,_NextAfterGrad,tensorflow/tensorflow/python/ops/math_grad.py,1985,function,"Returns gradient of nextafter(x1, x2) with respect to x1 and x2." -9207,SquaredDifferenceOpTest,tensorflow/tensorflow/python/ops/math_grad_test.py,38,class, -9208,AbsOpTest,tensorflow/tensorflow/python/ops/math_grad_test.py,66,class, -9209,MinOrMaxGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,107,class, -9210,MaximumOrMinimumGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,126,class, -9211,ProdGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,145,class, -9212,EuclideanNormGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,195,class, -9213,SegmentMinOrMaxGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,332,class, -9214,FloorModGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,377,class, -9215,DivNoNanGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,392,class, -9216,MulNoNanGradientTest,tensorflow/tensorflow/python/ops/math_grad_test.py,419,class, -9217,XlogyTest,tensorflow/tensorflow/python/ops/math_grad_test.py,444,class, -9218,Xlog1pyTest,tensorflow/tensorflow/python/ops/math_grad_test.py,492,class, -9219,XdivyTest,tensorflow/tensorflow/python/ops/math_grad_test.py,542,class, -9220,PowGradTest,tensorflow/tensorflow/python/ops/math_grad_test.py,591,class, -9221,NextAfterTest,tensorflow/tensorflow/python/ops/math_grad_test.py,615,class, -9222,linspace_nd,tensorflow/tensorflow/python/ops/math_ops.py,112,function,"Generates evenly-spaced values in an interval along a given axis. +8797,linspace_nd,tensorflow/tensorflow/python/ops/math_ops.py,112,function,"Generates evenly-spaced values in an interval along a given axis. A sequence of `num` evenly-spaced values are generated beginning at `start` along a given `axis`. @@ -73645,9 +80754,8 @@ Args: Returns: A `Tensor`. Has the same type as `start`." -9223,_set_doc,tensorflow/tensorflow/python/ops/math_ops.py,234,function, -9224,argmax,tensorflow/tensorflow/python/ops/math_ops.py,251,function, -9225,argmax_v2,tensorflow/tensorflow/python/ops/math_ops.py,263,function,"Returns the index with the largest value across axes of a tensor. +8798,argmax,tensorflow/tensorflow/python/ops/math_ops.py,251,function, +8799,argmax_v2,tensorflow/tensorflow/python/ops/math_ops.py,263,function,"Returns the index with the largest value across axes of a tensor. In case of identity returns the smallest index. @@ -73675,8 +80783,8 @@ Args: Returns: A `Tensor` of type `output_type`." -9226,argmin,tensorflow/tensorflow/python/ops/math_ops.py,305,function, -9227,argmin_v2,tensorflow/tensorflow/python/ops/math_ops.py,317,function,"Returns the index with the smallest value across axes of a tensor. +8800,argmin,tensorflow/tensorflow/python/ops/math_ops.py,305,function, +8801,argmin_v2,tensorflow/tensorflow/python/ops/math_ops.py,317,function,"Returns the index with the smallest value across axes of a tensor. Returns the smallest index in case of ties. @@ -73705,7 +80813,7 @@ c = tf.keras.backend.eval(b) # c = 0 # here a[0] = 1 which is the smallest element of a across axis 0 ```" -9228,abs,tensorflow/tensorflow/python/ops/math_ops.py,360,function,"Computes the absolute value of a tensor. +8802,abs,tensorflow/tensorflow/python/ops/math_ops.py,360,function,"Computes the absolute value of a tensor. Given a tensor of integer or floating-point values, this operation returns a tensor of the same type, where each element contains the absolute value of the @@ -73731,9 +80839,8 @@ Returns: A `Tensor` or `SparseTensor` of the same size, type and sparsity as `x`, with absolute values. Note, for `complex64` or `complex128` input, the returned `Tensor` will be of type `float32` or `float64`, respectively." -9229,_bucketize,tensorflow/tensorflow/python/ops/math_ops.py,399,function, -9230,DivideDelegateWithName,tensorflow/tensorflow/python/ops/math_ops.py,406,class,Use Python2/Python3 division delegation to implement divide for tensors. -9231,divide,tensorflow/tensorflow/python/ops/math_ops.py,431,function,"Computes Python style division of `x` by `y`. +8803,DivideDelegateWithName,tensorflow/tensorflow/python/ops/math_ops.py,406,class,Use Python2/Python3 division delegation to implement divide for tensors. +8804,divide,tensorflow/tensorflow/python/ops/math_ops.py,431,function,"Computes Python style division of `x` by `y`. For example: @@ -73750,7 +80857,7 @@ Args: Returns: A `Tensor` with same shape as input" -9232,multiply,tensorflow/tensorflow/python/ops/math_ops.py,465,function,"Returns an element-wise x * y. +8805,multiply,tensorflow/tensorflow/python/ops/math_ops.py,465,function,"Returns an element-wise x * y. For example: @@ -73791,21 +80898,8 @@ A `Tensor`. Has the same type as `x`. Raises: * InvalidArgumentError: When `x` and `y` have incomptatible shapes or types." -9233,_mul,tensorflow/tensorflow/python/ops/math_ops.py,516,function, -9234,subtract,tensorflow/tensorflow/python/ops/math_ops.py,526,function, -9235,_sub,tensorflow/tensorflow/python/ops/math_ops.py,537,function, -9236,_neg,tensorflow/tensorflow/python/ops/math_ops.py,551,function,"Computes numerical negative value element-wise. - -I.e., \(y = -x\). - -Args: - x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`, - `float32`, `float64`, `int32`, `int64`, `complex64`, `complex128`. - name: A name for the operation (optional). - -Returns: - A `Tensor` or `SparseTensor`, respectively. Has the same type as `x`." -9237,scalar_mul,tensorflow/tensorflow/python/ops/math_ops.py,572,function,"Multiplies a scalar times a `Tensor` or `IndexedSlices` object. +8806,subtract,tensorflow/tensorflow/python/ops/math_ops.py,526,function, +8807,scalar_mul,tensorflow/tensorflow/python/ops/math_ops.py,572,function,"Multiplies a scalar times a `Tensor` or `IndexedSlices` object. Intended for use in gradient code which might deal with `IndexedSlices` objects, which are easy to multiply by a scalar but more expensive to @@ -73821,8 +80915,8 @@ Returns: Raises: ValueError: if scalar is not a 0-D `scalar`." -9238,scalar_mul_v2,tensorflow/tensorflow/python/ops/math_ops.py,606,function, -9239,pow,tensorflow/tensorflow/python/ops/math_ops.py,613,function,"Computes the power of one value to another. +8808,scalar_mul_v2,tensorflow/tensorflow/python/ops/math_ops.py,606,function, +8809,pow,tensorflow/tensorflow/python/ops/math_ops.py,613,function,"Computes the power of one value to another. Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for corresponding elements in `x` and `y`. For example: @@ -73842,7 +80936,7 @@ Args: Returns: A `Tensor`." -9240,complex,tensorflow/tensorflow/python/ops/math_ops.py,642,function,"Converts two real numbers to a complex number. +8810,complex,tensorflow/tensorflow/python/ops/math_ops.py,642,function,"Converts two real numbers to a complex number. Given a tensor `real` representing the real part of a complex number, and a tensor `imag` representing the imaginary part of a complex number, this @@ -73869,7 +80963,7 @@ Returns: Raises: TypeError: Real and imag must be correct types" -9241,sign,tensorflow/tensorflow/python/ops/math_ops.py,687,function,"Returns an element-wise indication of the sign of a number. +8811,sign,tensorflow/tensorflow/python/ops/math_ops.py,687,function,"Returns an element-wise indication of the sign of a number. y = sign(x) = -1 if x < 0; 0 if x == 0; 1 if x > 0. @@ -73890,7 +80984,7 @@ Returns: If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.sign(x.values, ...), x.dense_shape)." -9242,real,tensorflow/tensorflow/python/ops/math_ops.py,728,function,"Returns the real part of a complex (or real) tensor. +8812,real,tensorflow/tensorflow/python/ops/math_ops.py,728,function,"Returns the real part of a complex (or real) tensor. Given a tensor `input`, this operation returns a tensor of type `float` that is the real part of each element in `input` considered as a complex number. @@ -73910,7 +81004,7 @@ Args: Returns: A `Tensor` of type `float32` or `float64`." -9243,imag,tensorflow/tensorflow/python/ops/math_ops.py,763,function,"Returns the imaginary part of a complex (or real) tensor. +8813,imag,tensorflow/tensorflow/python/ops/math_ops.py,763,function,"Returns the imaginary part of a complex (or real) tensor. Given a tensor `input`, this operation returns a tensor of type `float` that is the imaginary part of each element in `input` considered as a complex @@ -73930,7 +81024,7 @@ Args: Returns: A `Tensor` of type `float32` or `float64`." -9244,angle,tensorflow/tensorflow/python/ops/math_ops.py,797,function,"Returns the element-wise argument of a complex (or real) tensor. +8814,angle,tensorflow/tensorflow/python/ops/math_ops.py,797,function,"Returns the element-wise argument of a complex (or real) tensor. Given a tensor `input`, this operation returns a tensor of type `float` that is the argument of each element in `input` considered as a complex number. @@ -73957,7 +81051,7 @@ Args: Returns: A `Tensor` of type `float32` or `float64`." -9245,round,tensorflow/tensorflow/python/ops/math_ops.py,840,function,"Rounds the values of a tensor to the nearest integer, element-wise. +8815,round,tensorflow/tensorflow/python/ops/math_ops.py,840,function,"Rounds the values of a tensor to the nearest integer, element-wise. Rounds half to even. Also known as bankers rounding. If you want to round according to the current system rounding mode use tf::cint. @@ -73974,7 +81068,7 @@ Args: Returns: A `Tensor` of same shape and type as `x`." -9246,cast,tensorflow/tensorflow/python/ops/math_ops.py,868,function,"Casts a tensor to a new type. +8816,cast,tensorflow/tensorflow/python/ops/math_ops.py,868,function,"Casts a tensor to a new type. The operation casts `x` (in case of `Tensor`) or `x.values` (in case of `SparseTensor` or `IndexedSlices`) to `dtype`. @@ -74011,7 +81105,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `dtype`." -9247,saturate_cast,tensorflow/tensorflow/python/ops/math_ops.py,933,function,"Performs a safe saturating cast of `value` to `dtype`. +8817,saturate_cast,tensorflow/tensorflow/python/ops/math_ops.py,933,function,"Performs a safe saturating cast of `value` to `dtype`. This function casts the input to `dtype` without applying any scaling. If there is a danger that values would over or underflow in the cast, this op @@ -74024,7 +81118,7 @@ Args: Returns: `value` safely cast to `dtype`." -9248,to_float,tensorflow/tensorflow/python/ops/math_ops.py,967,function,"Casts a tensor to type `float32`. +8818,to_float,tensorflow/tensorflow/python/ops/math_ops.py,967,function,"Casts a tensor to type `float32`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74036,7 +81130,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `float32`." -9249,to_double,tensorflow/tensorflow/python/ops/math_ops.py,987,function,"Casts a tensor to type `float64`. +8819,to_double,tensorflow/tensorflow/python/ops/math_ops.py,987,function,"Casts a tensor to type `float64`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74048,7 +81142,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `float64`." -9250,to_int32,tensorflow/tensorflow/python/ops/math_ops.py,1007,function,"Casts a tensor to type `int32`. +8820,to_int32,tensorflow/tensorflow/python/ops/math_ops.py,1007,function,"Casts a tensor to type `int32`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74060,7 +81154,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `int32`." -9251,to_int64,tensorflow/tensorflow/python/ops/math_ops.py,1027,function,"Casts a tensor to type `int64`. +8821,to_int64,tensorflow/tensorflow/python/ops/math_ops.py,1027,function,"Casts a tensor to type `int64`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74072,7 +81166,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `int64`." -9252,to_bfloat16,tensorflow/tensorflow/python/ops/math_ops.py,1047,function,"Casts a tensor to type `bfloat16`. +8822,to_bfloat16,tensorflow/tensorflow/python/ops/math_ops.py,1047,function,"Casts a tensor to type `bfloat16`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74084,7 +81178,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `bfloat16`." -9253,to_complex64,tensorflow/tensorflow/python/ops/math_ops.py,1067,function,"Casts a tensor to type `complex64`. +8823,to_complex64,tensorflow/tensorflow/python/ops/math_ops.py,1067,function,"Casts a tensor to type `complex64`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74096,7 +81190,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `complex64`." -9254,to_complex128,tensorflow/tensorflow/python/ops/math_ops.py,1087,function,"Casts a tensor to type `complex128`. +8824,to_complex128,tensorflow/tensorflow/python/ops/math_ops.py,1087,function,"Casts a tensor to type `complex128`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. @@ -74108,29 +81202,7 @@ Returns: Raises: TypeError: If `x` cannot be cast to the `complex128`." -9255,_OverrideBinaryOperatorHelper,tensorflow/tensorflow/python/ops/math_ops.py,1108,function,"Register operators with different tensor and scalar versions. - -If `clazz_object` is `SparseTensor`, assumes `func` takes `(sp_indices, -sp_values, sp_shape, dense)` and outputs `(new_sp_values)`. - -Args: - func: the operator - op_name: name of the operator being overridden - clazz_object: class to override for. Either `Tensor` or `SparseTensor`." -9256,_sparse_dense_truediv,tensorflow/tensorflow/python/ops/math_ops.py,1196,function,Internal helper function for 'sp_t / dense_t'. -9257,_truediv_python3,tensorflow/tensorflow/python/ops/math_ops.py,1218,function, -9258,_div_python2,tensorflow/tensorflow/python/ops/math_ops.py,1237,function,"Divide two values using Python 2 semantics. - -Used for Tensor.__div__. - -Args: - x: `Tensor` numerator of real numeric type. - y: `Tensor` denominator of real numeric type. - name: A name for the operation (optional). - -Returns: - `x / y` returns the quotient of x and y." -9259,truediv,tensorflow/tensorflow/python/ops/math_ops.py,1267,function,"Divides x / y elementwise (using Python 3 division operator semantics). +8825,truediv,tensorflow/tensorflow/python/ops/math_ops.py,1267,function,"Divides x / y elementwise (using Python 3 division operator semantics). NOTE: Prefer using the Tensor operator or tf.divide which obey Python division operator semantics. @@ -74156,7 +81228,7 @@ Returns: Raises: TypeError: If `x` and `y` have different dtypes." -9260,div,tensorflow/tensorflow/python/ops/math_ops.py,1303,function,"Divides x / y elementwise (using Python 2 division operator semantics). +8826,div,tensorflow/tensorflow/python/ops/math_ops.py,1303,function,"Divides x / y elementwise (using Python 2 division operator semantics). NOTE: Prefer using the Tensor division operator or tf.divide which obey Python 3 division operator semantics. @@ -74173,7 +81245,7 @@ Args: Returns: `x / y` returns the quotient of x and y." -9261,div_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,1329,function,"Computes a safe divide which returns 0 if the y is zero. +8827,div_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,1329,function,"Computes a safe divide which returns 0 if the y is zero. Args: x: A `Tensor`. Must be one of the following types: `float32`, `float64`. @@ -74182,7 +81254,7 @@ Args: Returns: The element-wise value of the x divided by y." -9262,multiply_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,1349,function,"Computes the product of x and y and returns 0 if the y is zero, even if x is NaN or infinite. +8828,multiply_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,1349,function,"Computes the product of x and y and returns 0 if the y is zero, even if x is NaN or infinite. Args: x: A `Tensor`. Must be one of the following types: `float32`, `float64`. @@ -74191,7 +81263,7 @@ Args: Returns: The element-wise value of the x times y." -9263,floordiv,tensorflow/tensorflow/python/ops/math_ops.py,1381,function,"Divides `x / y` elementwise, rounding toward the most negative integer. +8829,floordiv,tensorflow/tensorflow/python/ops/math_ops.py,1381,function,"Divides `x / y` elementwise, rounding toward the most negative integer. The same as `tf.compat.v1.div(x,y)` for integers, but uses `tf.floor(tf.compat.v1.div(x,y))` for @@ -74213,26 +81285,7 @@ Returns: Raises: TypeError: If the inputs are complex." -9264,_add_dispatch,tensorflow/tensorflow/python/ops/math_ops.py,1419,function,"The operation invoked by the `Tensor.__add__` operator. - - Purpose in the API: - - This method is exposed in TensorFlow's API so that library developers - can register dispatching for `Tensor.__add__` to allow it to handle - custom composite tensors & other custom objects. - - The API symbol is not intended to be called by users directly and does - appear in TensorFlow's generated documentation. - -Args: - x: The left-hand side of the `+` operator. - y: The right-hand side of the `+` operator. - name: an optional name for the operation. - -Returns: - The result of the elementwise `+` operation." -9265,_mul_dispatch,tensorflow/tensorflow/python/ops/math_ops.py,1448,function,"Dispatches cwise mul for ""Dense*Dense"" and ""Dense*Sparse""." -9266,logical_xor,tensorflow/tensorflow/python/ops/math_ops.py,1481,function,"Logical XOR function. +8830,logical_xor,tensorflow/tensorflow/python/ops/math_ops.py,1481,function,"Logical XOR function. x ^ y = (x | y) & ~(x & y) @@ -74269,7 +81322,7 @@ Args: Returns: A `tf.Tensor` of type bool with the same size as that of x or y." -9267,logical_and,tensorflow/tensorflow/python/ops/math_ops.py,1529,function,"Logical AND function. +8831,logical_and,tensorflow/tensorflow/python/ops/math_ops.py,1529,function,"Logical AND function. The operation works for the following input types: @@ -74304,11 +81357,11 @@ Args: Returns: A `tf.Tensor` of type bool with the same size as that of x or y." -9268,and_,tensorflow/tensorflow/python/ops/math_ops.py,1569,function, -9269,or_,tensorflow/tensorflow/python/ops/math_ops.py,1575,function, -9270,xor_,tensorflow/tensorflow/python/ops/math_ops.py,1581,function, -9271,invert_,tensorflow/tensorflow/python/ops/math_ops.py,1587,function, -9272,equal,tensorflow/tensorflow/python/ops/math_ops.py,1607,function,"Returns the truth value of (x == y) element-wise. +8832,and_,tensorflow/tensorflow/python/ops/math_ops.py,1569,function, +8833,or_,tensorflow/tensorflow/python/ops/math_ops.py,1575,function, +8834,xor_,tensorflow/tensorflow/python/ops/math_ops.py,1581,function, +8835,invert_,tensorflow/tensorflow/python/ops/math_ops.py,1587,function, +8836,equal,tensorflow/tensorflow/python/ops/math_ops.py,1607,function,"Returns the truth value of (x == y) element-wise. Performs a [broadcast]( https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) with the @@ -74337,7 +81390,7 @@ Returns: Raises: `tf.errors.InvalidArgumentError`: If shapes of arguments are incompatible" -9273,not_equal,tensorflow/tensorflow/python/ops/math_ops.py,1643,function,"Returns the truth value of (x != y) element-wise. +8837,not_equal,tensorflow/tensorflow/python/ops/math_ops.py,1643,function,"Returns the truth value of (x != y) element-wise. Performs a [broadcast]( https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) with the @@ -74366,7 +81419,7 @@ Returns: Raises: `tf.errors.InvalidArgumentError`: If shapes of arguments are incompatible" -9274,tensor_equals,tensorflow/tensorflow/python/ops/math_ops.py,1679,function,"The operation invoked by the `Tensor.__eq__` operator. +8838,tensor_equals,tensorflow/tensorflow/python/ops/math_ops.py,1679,function,"The operation invoked by the `Tensor.__eq__` operator. Compares two tensors element-wise for equality if they are broadcast-compatible; or returns False if they are not broadcast-compatible. @@ -74389,7 +81442,7 @@ Args: Returns: The result of the elementwise `==` operation, or `False` if the arguments are not broadcast-compatible." -9275,tensor_not_equals,tensorflow/tensorflow/python/ops/math_ops.py,1717,function,"The operation invoked by the `Tensor.__ne__` operator. +8839,tensor_not_equals,tensorflow/tensorflow/python/ops/math_ops.py,1717,function,"The operation invoked by the `Tensor.__ne__` operator. Compares two tensors element-wise for inequality if they are broadcast-compatible; or returns True if they are not broadcast-compatible. @@ -74412,7 +81465,7 @@ Args: Returns: The result of the elementwise `!=` operation, or `True` if the arguments are not broadcast-compatible." -9276,range,tensorflow/tensorflow/python/ops/math_ops.py,1757,function,"Creates a sequence of numbers. +8840,range,tensorflow/tensorflow/python/ops/math_ops.py,1757,function,"Creates a sequence of numbers. Creates a sequence of numbers that begins at `start` and extends by increments of `delta` up to but not including `limit`. @@ -74461,11 +81514,7 @@ Returns: @compatibility(numpy) Equivalent to np.arange @end_compatibility" -9277,_range_tensor_conversion_function,tensorflow/tensorflow/python/ops/math_ops.py,1839,function, -9278,_ReductionDims,tensorflow/tensorflow/python/ops/math_ops.py,1850,function,"Returns range(0, rank(x)) if axis is None." -9279,_has_fully_defined_shape,tensorflow/tensorflow/python/ops/math_ops.py,1869,function,Returns true if tensor has a fully defined shape. -9280,_may_reduce_to_scalar,tensorflow/tensorflow/python/ops/math_ops.py,1874,function,Set a reduction's output shape to be a scalar if we are certain. -9281,reduce_sum_v1,tensorflow/tensorflow/python/ops/math_ops.py,1887,function,"Computes the sum of elements across dimensions of a tensor. +8841,reduce_sum_v1,tensorflow/tensorflow/python/ops/math_ops.py,1887,function,"Computes the sum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74503,7 +81552,7 @@ Returns: Equivalent to np.sum apart the fact that numpy upcast uint8 and int32 to int64 while tensorflow returns the same dtype as the input. @end_compatibility" -9282,reduce_sum,tensorflow/tensorflow/python/ops/math_ops.py,1942,function,"Computes the sum of elements across dimensions of a tensor. +8842,reduce_sum,tensorflow/tensorflow/python/ops/math_ops.py,1942,function,"Computes the sum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74560,8 +81609,8 @@ Returns: Equivalent to np.sum apart the fact that numpy upcast uint8 and int32 to int64 while tensorflow returns the same dtype as the input. @end_compatibility" -9283,reduce_sum_with_dims,tensorflow/tensorflow/python/ops/math_ops.py,2006,function, -9284,reduce_euclidean_norm,tensorflow/tensorflow/python/ops/math_ops.py,2019,function,"Computes the Euclidean norm of elements across dimensions of a tensor. +8843,reduce_sum_with_dims,tensorflow/tensorflow/python/ops/math_ops.py,2006,function, +8844,reduce_euclidean_norm,tensorflow/tensorflow/python/ops/math_ops.py,2019,function,"Computes the Euclidean norm of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74594,7 +81643,7 @@ Args: Returns: The reduced tensor, of the same dtype as the input_tensor." -9285,count_nonzero,tensorflow/tensorflow/python/ops/math_ops.py,2069,function,"Computes number of nonzero elements across dimensions of a tensor. +8845,count_nonzero,tensorflow/tensorflow/python/ops/math_ops.py,2069,function,"Computes number of nonzero elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74643,7 +81692,7 @@ Args: Returns: The reduced tensor (number of nonzero values)." -9286,count_nonzero_v2,tensorflow/tensorflow/python/ops/math_ops.py,2141,function,"Computes number of nonzero elements across dimensions of a tensor. +8846,count_nonzero_v2,tensorflow/tensorflow/python/ops/math_ops.py,2141,function,"Computes number of nonzero elements across dimensions of a tensor. Reduces `input` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74687,7 +81736,7 @@ Args: Returns: The reduced tensor (number of nonzero values)." -9287,reduce_mean_v1,tensorflow/tensorflow/python/ops/math_ops.py,2209,function,"Computes the mean of elements across dimensions of a tensor. +8847,reduce_mean_v1,tensorflow/tensorflow/python/ops/math_ops.py,2209,function,"Computes the mean of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis` by computing the mean of elements across the dimensions in `axis`. @@ -74737,7 +81786,7 @@ for example: @end_compatibility" -9288,reduce_mean,tensorflow/tensorflow/python/ops/math_ops.py,2276,function,"Computes the mean of elements across dimensions of a tensor. +8848,reduce_mean,tensorflow/tensorflow/python/ops/math_ops.py,2276,function,"Computes the mean of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis` by computing the mean of elements across the dimensions in `axis`. @@ -74785,7 +81834,7 @@ for example: @end_compatibility" -9289,reduce_variance,tensorflow/tensorflow/python/ops/math_ops.py,2336,function,"Computes the variance of elements across dimensions of a tensor. +8849,reduce_variance,tensorflow/tensorflow/python/ops/math_ops.py,2336,function,"Computes the variance of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74825,7 +81874,7 @@ Please note `np.var` has a `dtype` parameter that could be used to specify the output type. By default this is `dtype=float64`. On the other hand, `tf.math.reduce_variance` has aggressive type inference from `input_tensor`. @end_compatibility" -9290,reduce_std,tensorflow/tensorflow/python/ops/math_ops.py,2397,function,"Computes the standard deviation of elements across dimensions of a tensor. +8850,reduce_std,tensorflow/tensorflow/python/ops/math_ops.py,2397,function,"Computes the standard deviation of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74865,7 +81914,7 @@ Please note `np.std` has a `dtype` parameter that could be used to specify the output type. By default this is `dtype=float64`. On the other hand, `tf.math.reduce_std` has aggressive type inference from `input_tensor`. @end_compatibility" -9291,reduce_prod,tensorflow/tensorflow/python/ops/math_ops.py,2447,function,"Computes the product of elements across dimensions of a tensor. +8851,reduce_prod,tensorflow/tensorflow/python/ops/math_ops.py,2447,function,"Computes the product of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74889,7 +81938,7 @@ Returns: @compatibility(numpy) Equivalent to np.prod @end_compatibility" -9292,reduce_prod_v1,tensorflow/tensorflow/python/ops/math_ops.py,2486,function,"Computes the product of elements across dimensions of a tensor. +8852,reduce_prod_v1,tensorflow/tensorflow/python/ops/math_ops.py,2486,function,"Computes the product of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74915,7 +81964,7 @@ Returns: @compatibility(numpy) Equivalent to np.prod @end_compatibility" -9293,reduce_min_v1,tensorflow/tensorflow/python/ops/math_ops.py,2532,function,"Computes the minimum of elements across dimensions of a tensor. +8853,reduce_min_v1,tensorflow/tensorflow/python/ops/math_ops.py,2532,function,"Computes the minimum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74941,7 +81990,7 @@ Returns: @compatibility(numpy) Equivalent to np.min @end_compatibility" -9294,reduce_min,tensorflow/tensorflow/python/ops/math_ops.py,2575,function,"Computes the minimum of elements across dimensions of a tensor. +8854,reduce_min,tensorflow/tensorflow/python/ops/math_ops.py,2575,function,"Computes the minimum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74970,7 +82019,7 @@ For example: @compatibility(numpy) Equivalent to np.min @end_compatibility" -9295,reduce_max_v1,tensorflow/tensorflow/python/ops/math_ops.py,2619,function,"Computes the maximum of elements across dimensions of a tensor. +8855,reduce_max_v1,tensorflow/tensorflow/python/ops/math_ops.py,2619,function,"Computes the maximum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -74996,7 +82045,7 @@ Returns: @compatibility(numpy) Equivalent to np.max @end_compatibility" -9296,reduce_max,tensorflow/tensorflow/python/ops/math_ops.py,2662,function,"Computes the maximum of elements across dimensions of a tensor. +8856,reduce_max,tensorflow/tensorflow/python/ops/math_ops.py,2662,function,"Computes the maximum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75036,8 +82085,8 @@ Args: Returns: The reduced tensor." -9297,reduce_max_with_dims,tensorflow/tensorflow/python/ops/math_ops.py,2708,function, -9298,reduce_all_v1,tensorflow/tensorflow/python/ops/math_ops.py,2724,function,"Computes the ""logical and"" of elements across dimensions of a tensor. +8857,reduce_max_with_dims,tensorflow/tensorflow/python/ops/math_ops.py,2708,function, +8858,reduce_all_v1,tensorflow/tensorflow/python/ops/math_ops.py,2724,function,"Computes the ""logical and"" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75072,7 +82121,7 @@ Returns: @compatibility(numpy) Equivalent to np.all @end_compatibility" -9299,reduce_all,tensorflow/tensorflow/python/ops/math_ops.py,2776,function,"Computes the ""logical and"" of elements across dimensions of a tensor. +8859,reduce_all,tensorflow/tensorflow/python/ops/math_ops.py,2776,function,"Computes the ""logical and"" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75105,7 +82154,7 @@ Returns: @compatibility(numpy) Equivalent to np.all @end_compatibility" -9300,reduce_any_v1,tensorflow/tensorflow/python/ops/math_ops.py,2824,function,"Computes the ""logical or"" of elements across dimensions of a tensor. +8860,reduce_any_v1,tensorflow/tensorflow/python/ops/math_ops.py,2824,function,"Computes the ""logical or"" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75140,7 +82189,7 @@ Returns: @compatibility(numpy) Equivalent to np.any @end_compatibility" -9301,reduce_any,tensorflow/tensorflow/python/ops/math_ops.py,2876,function,"Computes the ""logical or"" of elements across dimensions of a tensor. +8861,reduce_any,tensorflow/tensorflow/python/ops/math_ops.py,2876,function,"Computes the ""logical or"" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75173,7 +82222,7 @@ Returns: @compatibility(numpy) Equivalent to np.any @end_compatibility" -9302,reduce_logsumexp_v1,tensorflow/tensorflow/python/ops/math_ops.py,2924,function,"Computes log(sum(exp(elements across dimensions of a tensor))). +8862,reduce_logsumexp_v1,tensorflow/tensorflow/python/ops/math_ops.py,2924,function,"Computes log(sum(exp(elements across dimensions of a tensor))). Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75210,7 +82259,7 @@ Args: Returns: The reduced tensor." -9303,reduce_logsumexp,tensorflow/tensorflow/python/ops/math_ops.py,2978,function,"Computes log(sum(exp(elements across dimensions of a tensor))). +8863,reduce_logsumexp,tensorflow/tensorflow/python/ops/math_ops.py,2978,function,"Computes log(sum(exp(elements across dimensions of a tensor))). Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each @@ -75245,7 +82294,7 @@ Args: Returns: The reduced tensor." -9304,trace,tensorflow/tensorflow/python/ops/math_ops.py,3041,function,"Compute the trace of a tensor `x`. +8864,trace,tensorflow/tensorflow/python/ops/math_ops.py,3041,function,"Compute the trace of a tensor `x`. `trace(x)` returns the sum along the main diagonal of each inner-most matrix in x. If x is of rank `k` with shape `[I, J, K, ..., L, M, N]`, then output @@ -75279,7 +82328,7 @@ Args: Returns: The trace of input tensor." -9305,matmul,tensorflow/tensorflow/python/ops/math_ops.py,3084,function,"Multiplies matrix `a` by matrix `b`, producing `a` * `b`. +8865,matmul,tensorflow/tensorflow/python/ops/math_ops.py,3084,function,"Multiplies matrix `a` by matrix `b`, producing `a` * `b`. The inputs must, following any transpositions, be tensors of rank >= 2 where the inner 2 dimensions specify valid matrix multiplication dimensions, @@ -75387,7 +82436,7 @@ Returns: Raises: ValueError: If `transpose_a` and `adjoint_a`, or `transpose_b` and `adjoint_b` are both set to `True`." -9306,matvec,tensorflow/tensorflow/python/ops/math_ops.py,3279,function,"Multiplies matrix `a` by vector `b`, producing `a` * `b`. +8866,matvec,tensorflow/tensorflow/python/ops/math_ops.py,3279,function,"Multiplies matrix `a` by vector `b`, producing `a` * `b`. The matrix `a` must, following any transpositions, be a tensor of rank >= 2, with `shape(a)[-1] == shape(b)[-1]`, and `shape(a)[:-2]` able to broadcast @@ -75466,36 +82515,7 @@ Returns: Raises: ValueError: If transpose_a and adjoint_a are both set to True." -9307,_calc_mat_mul_flops,tensorflow/tensorflow/python/ops/math_ops.py,3386,function,Calculates the compute resources needed for MatMul. -9308,_calc_batch_mat_mul_flops,tensorflow/tensorflow/python/ops/math_ops.py,3403,function,Calculates the compute resources needed for BatchMatMul. -9309,_as_indexed_slices,tensorflow/tensorflow/python/ops/math_ops.py,3418,function,"Convert 'x' to IndexedSlices. - -Convert a dense Tensor to a block-sparse IndexedSlices. - -Args: - x: Either a Tensor object, or an IndexedSlices object. - optimize: if true, attempt to optimize the conversion of 'x'. - -Returns: - An IndexedSlices object. - -Raises: - TypeError: If 'x' is not a Tensor or an IndexedSlices object." -9310,_as_indexed_slices_list,tensorflow/tensorflow/python/ops/math_ops.py,3442,function,"Convert all elements of 'inputs' to IndexedSlices. - -Additionally, homogenize the types of all the indices to -either int32 or int64. - -Args: - inputs: List containing either Tensor or IndexedSlices objects. - optimize: if true, attempt to optimize the conversion of each input. - -Returns: - A list of IndexedSlices objects. - -Raises: - TypeError: If 'inputs' is not a list or a tuple." -9311,add_n,tensorflow/tensorflow/python/ops/math_ops.py,3479,function,"Adds all input tensors element-wise. +8867,add_n,tensorflow/tensorflow/python/ops/math_ops.py,3479,function,"Adds all input tensors element-wise. `tf.math.add_n` performs the same operation as `tf.math.accumulate_n`, but it waits for all of its inputs to be ready before beginning to sum. @@ -75529,7 +82549,7 @@ Returns: Raises: ValueError: If `inputs` don't all have same shape and dtype or the shape cannot be inferred." -9312,accumulate_n,tensorflow/tensorflow/python/ops/math_ops.py,3537,function,"Returns the element-wise sum of a list of tensors. +8868,accumulate_n,tensorflow/tensorflow/python/ops/math_ops.py,3537,function,"Returns the element-wise sum of a list of tensors. Optionally, pass `shape` and `tensor_dtype` for shape and type checking, otherwise, these are inferred. @@ -75564,8 +82584,7 @@ Returns: Raises: ValueError: If `inputs` don't all have same shape and dtype or the shape cannot be inferred." -9313,_accumulate_n_grad,tensorflow/tensorflow/python/ops/math_ops.py,3607,function,Same as gradient for AddN. Copies the gradient to all inputs. -9314,sigmoid,tensorflow/tensorflow/python/ops/math_ops.py,3615,function,"Computes sigmoid of `x` element-wise. +8869,sigmoid,tensorflow/tensorflow/python/ops/math_ops.py,3615,function,"Computes sigmoid of `x` element-wise. Formula for calculating sigmoid(x): `y = 1 / (1 + exp(-x))`. @@ -75608,7 +82627,7 @@ numpy=array([0. , 0.5, 1. ], dtype=float32)> @compatibility(scipy) Equivalent to scipy.special.expit @end_compatibility" -9315,log_sigmoid,tensorflow/tensorflow/python/ops/math_ops.py,3668,function,"Computes log sigmoid of `x` element-wise. +8870,log_sigmoid,tensorflow/tensorflow/python/ops/math_ops.py,3668,function,"Computes log sigmoid of `x` element-wise. Specifically, `y = log(1 / (1 + exp(-x)))`. For numerical stability, we use `y = -tf.nn.softplus(-x)`. @@ -75619,7 +82638,7 @@ Args: Returns: A Tensor with the same type as `x`." -9316,cumsum,tensorflow/tensorflow/python/ops/math_ops.py,3688,function,"Compute the cumulative sum of the tensor `x` along `axis`. +8871,cumsum,tensorflow/tensorflow/python/ops/math_ops.py,3688,function,"Compute the cumulative sum of the tensor `x` along `axis`. By default, this op performs an inclusive cumsum, which means that the first element of the input is identical to the first element of the output: @@ -75681,7 +82700,7 @@ Args: Returns: A `Tensor`. Has the same type as `x`." -9317,cumprod,tensorflow/tensorflow/python/ops/math_ops.py,3761,function,"Compute the cumulative product of the tensor `x` along `axis`. +8872,cumprod,tensorflow/tensorflow/python/ops/math_ops.py,3761,function,"Compute the cumulative product of the tensor `x` along `axis`. By default, this op performs an inclusive cumprod, which means that the first element of the input is identical to the first element of the output: @@ -75724,7 +82743,7 @@ Args: Returns: A `Tensor`. Has the same type as `x`." -9318,cumulative_logsumexp,tensorflow/tensorflow/python/ops/math_ops.py,3814,function,"Compute the cumulative log-sum-exp of the tensor `x` along `axis`. +8873,cumulative_logsumexp,tensorflow/tensorflow/python/ops/math_ops.py,3814,function,"Compute the cumulative log-sum-exp of the tensor `x` along `axis`. By default, this op performs an inclusive cumulative log-sum-exp, which means that the first element of the input is identical to the first element of @@ -75770,7 +82789,7 @@ Args: Returns: A `Tensor`. Has the same shape and type as `x`." -9319,conj,tensorflow/tensorflow/python/ops/math_ops.py,3871,function,"Returns the complex conjugate of a complex number. +8874,conj,tensorflow/tensorflow/python/ops/math_ops.py,3871,function,"Returns the complex conjugate of a complex number. Given a tensor `input` of complex numbers, this operation returns a tensor of complex numbers that are the complex conjugate of each element in `input`. The @@ -75795,7 +82814,7 @@ Returns: Raises: TypeError: If `x` is not a numeric tensor." -9320,reduced_shape,tensorflow/tensorflow/python/ops/math_ops.py,3913,function,"Helper function for reduction ops. +8875,reduced_shape,tensorflow/tensorflow/python/ops/math_ops.py,3913,function,"Helper function for reduction ops. Args: input_shape: 1-D Tensor, the shape of the Tensor being reduced. @@ -75803,11 +82822,7 @@ Args: Returns: A 1-D Tensor, the output shape as if keepdims were set to True." -9321,_unsorted_segment_N,tensorflow/tensorflow/python/ops/math_ops.py,3955,function,"Helper function for unsorted_segment_mean/_sqrtN. - -Computes the number - of segment entries with 0-entries set to 1 to allow division by N." -9322,unsorted_segment_mean,tensorflow/tensorflow/python/ops/math_ops.py,3983,function,"Computes the mean along segments of a tensor. +8876,unsorted_segment_mean,tensorflow/tensorflow/python/ops/math_ops.py,3983,function,"Computes the mean along segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -75838,7 +82853,7 @@ Returns: A `Tensor`. Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`." -9323,unsorted_segment_sqrt_n,tensorflow/tensorflow/python/ops/math_ops.py,4030,function,"Computes the sum along segments of a tensor divided by the sqrt(N). +8877,unsorted_segment_sqrt_n,tensorflow/tensorflow/python/ops/math_ops.py,4030,function,"Computes the sum along segments of a tensor divided by the sqrt(N). Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -75872,7 +82887,7 @@ Returns: A `Tensor`. Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`." -9324,sparse_segment_sum,tensorflow/tensorflow/python/ops/math_ops.py,4076,function,"Computes the sum along sparse segments of a tensor. +8878,sparse_segment_sum,tensorflow/tensorflow/python/ops/math_ops.py,4076,function,"Computes the sum along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -75929,7 +82944,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9325,sparse_segment_sum_v2,tensorflow/tensorflow/python/ops/math_ops.py,4152,function,"Computes the sum along sparse segments of a tensor. +8879,sparse_segment_sum_v2,tensorflow/tensorflow/python/ops/math_ops.py,4152,function,"Computes the sum along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -75986,7 +83001,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9326,sparse_segment_mean,tensorflow/tensorflow/python/ops/math_ops.py,4221,function,"Computes the mean along sparse segments of a tensor. +8880,sparse_segment_mean,tensorflow/tensorflow/python/ops/math_ops.py,4221,function,"Computes the mean along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -76013,7 +83028,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9327,sparse_segment_mean_v2,tensorflow/tensorflow/python/ops/math_ops.py,4267,function,"Computes the mean along sparse segments of a tensor. +8881,sparse_segment_mean_v2,tensorflow/tensorflow/python/ops/math_ops.py,4267,function,"Computes the mean along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -76040,7 +83055,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9328,sparse_segment_sqrt_n,tensorflow/tensorflow/python/ops/math_ops.py,4306,function,"Computes the sum along sparse segments of a tensor divided by the sqrt(N). +8882,sparse_segment_sqrt_n,tensorflow/tensorflow/python/ops/math_ops.py,4306,function,"Computes the sum along sparse segments of a tensor divided by the sqrt(N). `N` is the size of the segment being reduced. @@ -76058,7 +83073,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9329,sparse_segment_sqrt_n_v2,tensorflow/tensorflow/python/ops/math_ops.py,4343,function,"Computes the sum along sparse segments of a tensor divided by the sqrt(N). +8883,sparse_segment_sqrt_n_v2,tensorflow/tensorflow/python/ops/math_ops.py,4343,function,"Computes the sum along sparse segments of a tensor divided by the sqrt(N). Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) @@ -76081,7 +83096,7 @@ Returns: A `tensor` of the shape as data, except for dimension 0 which has size `k`, the number of segments specified via `num_segments` or inferred for the last element in `segments_ids`." -9330,tensordot,tensorflow/tensorflow/python/ops/math_ops.py,4378,function,"Tensor contraction of a and b along specified axes and outer product. +8884,tensordot,tensorflow/tensorflow/python/ops/math_ops.py,4378,function,"Tensor contraction of a and b along specified axes and outer product. Tensordot (also known as tensor contraction) sums the product of elements from `a` and `b` over the indices specified by `a_axes` and `b_axes`. @@ -76131,7 +83146,7 @@ Raises: ValueError: If the shapes of `a`, `b`, and `axes` are incompatible. IndexError: If the values in axes exceed the rank of the corresponding tensor." -9331,polyval,tensorflow/tensorflow/python/ops/math_ops.py,4565,function,"Computes the elementwise value of a polynomial. +8885,polyval,tensorflow/tensorflow/python/ops/math_ops.py,4565,function,"Computes the elementwise value of a polynomial. If `x` is a tensor and `coeffs` is a list n + 1 tensors, this function returns the value of the n-th order polynomial @@ -76180,7 +83195,7 @@ Returns: @compatibility(numpy) Equivalent to numpy.polyval. @end_compatibility" -9332,reciprocal_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,4636,function,"Performs a safe reciprocal operation, element wise. +8886,reciprocal_no_nan,tensorflow/tensorflow/python/ops/math_ops.py,4636,function,"Performs a safe reciprocal operation, element wise. If a particular element is zero, the reciprocal for that element is also set to zero. @@ -76201,7 +83216,7 @@ Returns: Raises: TypeError: x must be of a valid dtype." -9333,xlog1py,tensorflow/tensorflow/python/ops/math_ops.py,4669,function,"Compute x * log1p(y). +8887,xlog1py,tensorflow/tensorflow/python/ops/math_ops.py,4669,function,"Compute x * log1p(y). Given `x` and `y`, compute `x * log1p(y)`. This function safely returns zero when `x = 0`, no matter what the value of `y` is. @@ -76230,7 +83245,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.xlog1py @end_compatibility" -9334,erfinv,tensorflow/tensorflow/python/ops/math_ops.py,4706,function,"Compute inverse error function. +8888,erfinv,tensorflow/tensorflow/python/ops/math_ops.py,4706,function,"Compute inverse error function. Given `x`, compute the inverse error function of `x`. This function is the inverse of `tf.math.erf`. @@ -76240,14 +83255,14 @@ Args: name: A name for the operation (optional). Returns: Inverse error function of `x`." -9335,ndtri,tensorflow/tensorflow/python/ops/math_ops.py,4724,function,"Compute quantile of Standard Normal. +8889,ndtri,tensorflow/tensorflow/python/ops/math_ops.py,4724,function,"Compute quantile of Standard Normal. Args: x: `Tensor` with type `float` or `double`. name: A name for the operation (optional). Returns: Inverse error function of `x`." -9336,ceil,tensorflow/tensorflow/python/ops/math_ops.py,4741,function,"Return the ceiling of the input, element-wise. +8890,ceil,tensorflow/tensorflow/python/ops/math_ops.py,4741,function,"Return the ceiling of the input, element-wise. For example: @@ -76266,7 +83281,7 @@ Returns: @compatibility(numpy) Equivalent to np.ceil @end_compatibility" -9337,sqrt,tensorflow/tensorflow/python/ops/math_ops.py,4767,function,"Computes element-wise square root of the input tensor. +8891,sqrt,tensorflow/tensorflow/python/ops/math_ops.py,4767,function,"Computes element-wise square root of the input tensor. Note: This operation does not support integer types. @@ -76296,7 +83311,7 @@ Args: Returns: A `tf.Tensor` of same size, type and sparsity as `x`." -9338,exp,tensorflow/tensorflow/python/ops/math_ops.py,4805,function,"Computes exponential of x element-wise. \\(y = e^x\\). +8892,exp,tensorflow/tensorflow/python/ops/math_ops.py,4805,function,"Computes exponential of x element-wise. \\(y = e^x\\). This function computes the exponential of the input tensor element-wise. i.e. `math.exp(x)` or \\(e^x\\), where `x` is the input tensor. @@ -76334,7 +83349,7 @@ Returns: @compatibility(numpy) Equivalent to np.exp @end_compatibility" -9339,sobol_sample,tensorflow/tensorflow/python/ops/math_ops.py,4853,function,"Generates points from the Sobol sequence. +8893,sobol_sample,tensorflow/tensorflow/python/ops/math_ops.py,4853,function,"Generates points from the Sobol sequence. Creates a Sobol sequence with `num_results` samples. Each sample has dimension `dim`. Skips the first `skip` samples. @@ -76351,7 +83366,7 @@ Args: Returns: `Tensor` of samples from Sobol sequence with `shape` [num_results, dim]." -9340,rsqrt,tensorflow/tensorflow/python/ops/math_ops.py,4880,function,"Computes reciprocal of square root of x element-wise. +8894,rsqrt,tensorflow/tensorflow/python/ops/math_ops.py,4880,function,"Computes reciprocal of square root of x element-wise. For example: @@ -76367,28 +83382,7 @@ Args: Returns: A `tf.Tensor`. Has the same type as `x`." -9341,LinspaceTest,tensorflow/tensorflow/python/ops/math_ops_linspace_test.py,34,class, -9342,ReduceTest,tensorflow/tensorflow/python/ops/math_ops_test.py,39,class, -9343,LogSumExpTest,tensorflow/tensorflow/python/ops/math_ops_test.py,136,class, -9344,RoundTest,tensorflow/tensorflow/python/ops/math_ops_test.py,216,class, -9345,ModTest,tensorflow/tensorflow/python/ops/math_ops_test.py,231,class, -9346,SquaredDifferenceTest,tensorflow/tensorflow/python/ops/math_ops_test.py,261,class, -9347,ApproximateEqualTest,tensorflow/tensorflow/python/ops/math_ops_test.py,284,class, -9348,ScalarMulTest,tensorflow/tensorflow/python/ops/math_ops_test.py,325,class, -9349,AddNTest,tensorflow/tensorflow/python/ops/math_ops_test.py,363,class, -9350,DivAndModTest,tensorflow/tensorflow/python/ops/math_ops_test.py,445,class, -9351,DivNoNanTest,tensorflow/tensorflow/python/ops/math_ops_test.py,584,class, -9352,MultiplyNoNanTest,tensorflow/tensorflow/python/ops/math_ops_test.py,600,class, -9353,XlogyTest,tensorflow/tensorflow/python/ops/math_ops_test.py,616,class, -9354,Xlog1pyTest,tensorflow/tensorflow/python/ops/math_ops_test.py,649,class, -9355,XdivyTest,tensorflow/tensorflow/python/ops/math_ops_test.py,683,class, -9356,NextAfterTest,tensorflow/tensorflow/python/ops/math_ops_test.py,716,class, -9357,BinaryOpsTest,tensorflow/tensorflow/python/ops/math_ops_test.py,752,class, -9358,SignTest,tensorflow/tensorflow/python/ops/math_ops_test.py,812,class, -9359,ReciprocalNoNanTest,tensorflow/tensorflow/python/ops/math_ops_test.py,825,class, -9360,EqualityTest,tensorflow/tensorflow/python/ops/math_ops_test.py,855,class, -9361,RangeTest,tensorflow/tensorflow/python/ops/math_ops_test.py,866,class, -9362,build_graph,tensorflow/tensorflow/python/ops/matmul_benchmark.py,35,function,"Build a graph containing a sequence of matmul operations. +8895,build_graph,tensorflow/tensorflow/python/ops/matmul_benchmark.py,35,function,"Build a graph containing a sequence of matmul operations. Args: device: String, the device to run on. @@ -76401,8 +83395,23 @@ Args: Returns: A matmul operation to run()" -9363,MatmulBenchmark,tensorflow/tensorflow/python/ops/matmul_benchmark.py,68,class,Benchmark matmul! -9364,metric_variable,tensorflow/tensorflow/python/ops/metrics_impl.py,41,function,"Create variable in `GraphKeys.(LOCAL|METRIC_VARIABLES)` collections. +8896,MatmulBenchmark,tensorflow/tensorflow/python/ops/matmul_benchmark.py,68,class,Benchmark matmul! +8897,run_graph,tensorflow/tensorflow/python/ops/matmul_benchmark.py,71,method,"Run the graph and print its execution time. + +Args: + device: String, the device to run on. + n: tensor A's first dimension size. + m: tensor A's second dimension size. + k: tensor B's second dimension size. + transpose_a: boolean value to show if tensor A is transposed. + transpose_b: boolean value to show if tensor B is transposed. + num_iters: number of iterations to run the benchmark. + dtype: numpy data type of the input tensor. + +Returns: + The duration of the run in seconds." +8898,benchmark_matmul,tensorflow/tensorflow/python/ops/matmul_benchmark.py,141,method, +8899,metric_variable,tensorflow/tensorflow/python/ops/metrics_impl.py,41,function,"Create variable in `GraphKeys.(LOCAL|METRIC_VARIABLES)` collections. If running in a `DistributionStrategy` context, the variable will be ""sync on read"". This means: @@ -76434,73 +83443,7 @@ Args: Returns: A (non-trainable) variable initialized to zero, or if inside a `DistributionStrategy` scope a sync on read variable container." -9365,_remove_squeezable_dimensions,tensorflow/tensorflow/python/ops/metrics_impl.py,88,function,"Squeeze or expand last dim if needed. - -Squeezes last dim of `predictions` or `labels` if their rank differs by 1 -(using confusion_matrix.remove_squeezable_dimensions). -Squeezes or expands last dim of `weights` if its rank differs by 1 from the -new rank of `predictions`. - -If `weights` is scalar, it is kept scalar. - -This will use static shape if available. Otherwise, it will add graph -operations, which could result in a performance hit. - -Args: - predictions: Predicted values, a `Tensor` of arbitrary dimensions. - labels: Optional label `Tensor` whose dimensions match `predictions`. - weights: Optional weight scalar or `Tensor` whose dimensions match - `predictions`. - -Returns: - Tuple of `predictions`, `labels` and `weights`. Each of them possibly has - the last dimension squeezed, `weights` could be extended by one dimension." -9366,_maybe_expand_labels,tensorflow/tensorflow/python/ops/metrics_impl.py,164,function,"If necessary, expand `labels` along last dimension to match `predictions`. - -Args: - labels: `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels] or [D1, ... DN]. The latter implies - num_labels=1, in which case the result is an expanded `labels` with shape - [D1, ... DN, 1]. - predictions: `Tensor` with shape [D1, ... DN, num_classes]. - -Returns: - `labels` with the same rank as `predictions`. - -Raises: - ValueError: if `labels` has invalid shape." -9367,_safe_scalar_div,tensorflow/tensorflow/python/ops/metrics_impl.py,215,function,"Divides two values, returning 0 if the denominator is 0. - -Args: - numerator: A scalar `float64` `Tensor`. - denominator: A scalar `float64` `Tensor`. - name: Name for the returned op. - -Returns: - 0 if `denominator` == 0, else `numerator` / `denominator`" -9368,_streaming_confusion_matrix,tensorflow/tensorflow/python/ops/metrics_impl.py,231,function,"Calculate a streaming confusion matrix. - -Calculates a confusion matrix. For estimation over a stream of data, -the function creates an `update_op` operation. - -Args: - labels: A `Tensor` of ground truth labels with shape [batch size] and of - type `int32` or `int64`. The tensor will be flattened if its rank > 1. - predictions: A `Tensor` of prediction results for semantic labels, whose - shape is [batch size] and type `int32` or `int64`. The tensor will be - flattened if its rank > 1. - num_classes: The possible number of labels the prediction task can - have. This value must be provided, since a confusion matrix of - dimension = [num_classes, num_classes] will be allocated. - weights: Optional `Tensor` whose rank is either 0, or the same rank as - `labels`, and must be broadcastable to `labels` (i.e., all dimensions must - be either `1`, or the same as the corresponding `labels` dimension). - -Returns: - total_cm: A `Tensor` representing the confusion matrix. - update_op: An operation that increments the confusion matrix." -9369,_aggregate_across_replicas,tensorflow/tensorflow/python/ops/metrics_impl.py,280,function,Aggregate metric value across replicas. -9370,mean,tensorflow/tensorflow/python/ops/metrics_impl.py,316,function,"Computes the (weighted) mean of the given values. +8900,mean,tensorflow/tensorflow/python/ops/metrics_impl.py,316,function,"Computes the (weighted) mean of the given values. The `mean` function creates two local variables, `total` and `count` that are used to compute the average of `values`. This average is ultimately @@ -76536,7 +83479,7 @@ Raises: or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9371,accuracy,tensorflow/tensorflow/python/ops/metrics_impl.py,397,function,"Calculates how often `predictions` matches `labels`. +8901,accuracy,tensorflow/tensorflow/python/ops/metrics_impl.py,397,function,"Calculates how often `predictions` matches `labels`. The `accuracy` function creates two local variables, `total` and `count` that are used to compute the frequency with which `predictions` @@ -76578,49 +83521,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9372,_confusion_matrix_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,461,function,"Computes true_positives, false_negatives, true_negatives, false_positives. - -This function creates up to four local variables, `true_positives`, -`true_negatives`, `false_positives` and `false_negatives`. -`true_positive[i]` is defined as the total weight of values in `predictions` -above `thresholds[i]` whose corresponding entry in `labels` is `True`. -`false_negatives[i]` is defined as the total weight of values in `predictions` -at most `thresholds[i]` whose corresponding entry in `labels` is `True`. -`true_negatives[i]` is defined as the total weight of values in `predictions` -at most `thresholds[i]` whose corresponding entry in `labels` is `False`. -`false_positives[i]` is defined as the total weight of values in `predictions` -above `thresholds[i]` whose corresponding entry in `labels` is `False`. - -For estimation of these metrics over a stream of data, for each metric the -function respectively creates an `update_op` operation that updates the -variable and returns its value. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - labels: A `Tensor` whose shape matches `predictions`. Will be cast to - `bool`. - predictions: A floating point `Tensor` of arbitrary shape and whose values - are in the range `[0, 1]`. - thresholds: A python list or tuple of float thresholds in `[0, 1]`. - weights: Optional `Tensor` whose rank is either 0, or the same rank as - `labels`, and must be broadcastable to `labels` (i.e., all dimensions must - be either `1`, or the same as the corresponding `labels` dimension). - includes: Tuple of keys to return, from 'tp', 'fn', 'tn', fp'. If `None`, - default to all four. - -Returns: - values: Dict of variables of shape `[len(thresholds)]`. Keys are from - `includes`. - update_ops: Dict of operations that increments the `values`. Keys are from - `includes`. - -Raises: - ValueError: If `predictions` and `labels` have mismatched shapes, or if - `weights` is not `None` and its shape doesn't match `predictions`, or if - `includes` contains invalid keys." -9373,_aggregate_variable,tensorflow/tensorflow/python/ops/metrics_impl.py,624,function, -9374,auc,tensorflow/tensorflow/python/ops/metrics_impl.py,633,function,"Computes the approximate AUC via a Riemann sum. +8902,auc,tensorflow/tensorflow/python/ops/metrics_impl.py,633,function,"Computes the approximate AUC via a Riemann sum. The `auc` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` that are used to @@ -76696,7 +83597,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9375,mean_absolute_error,tensorflow/tensorflow/python/ops/metrics_impl.py,863,function,"Computes the mean absolute error between the labels and predictions. +8903,mean_absolute_error,tensorflow/tensorflow/python/ops/metrics_impl.py,863,function,"Computes the mean absolute error between the labels and predictions. The `mean_absolute_error` function creates two local variables, `total` and `count` that are used to compute the mean absolute error. This @@ -76738,7 +83639,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9376,mean_cosine_distance,tensorflow/tensorflow/python/ops/metrics_impl.py,924,function,"Computes the cosine distance between the labels and predictions. +8904,mean_cosine_distance,tensorflow/tensorflow/python/ops/metrics_impl.py,924,function,"Computes the cosine distance between the labels and predictions. The `mean_cosine_distance` function creates two local variables, `total` and `count` that are used to compute the average cosine distance @@ -76778,7 +83679,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9377,mean_per_class_accuracy,tensorflow/tensorflow/python/ops/metrics_impl.py,998,function,"Calculates the mean of the per-class accuracies. +8905,mean_per_class_accuracy,tensorflow/tensorflow/python/ops/metrics_impl.py,998,function,"Calculates the mean of the per-class accuracies. Calculates the accuracy for each class, then takes the mean of that. @@ -76817,7 +83718,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9378,mean_iou,tensorflow/tensorflow/python/ops/metrics_impl.py,1103,function,"Calculate per-step mean Intersection-Over-Union (mIOU). +8906,mean_iou,tensorflow/tensorflow/python/ops/metrics_impl.py,1103,function,"Calculate per-step mean Intersection-Over-Union (mIOU). Mean Intersection-Over-Union is a common evaluation metric for semantic image segmentation, which first computes the IOU for each @@ -76860,7 +83761,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9379,mean_relative_error,tensorflow/tensorflow/python/ops/metrics_impl.py,1206,function,"Computes the mean relative error by normalizing with the given values. +8907,mean_relative_error,tensorflow/tensorflow/python/ops/metrics_impl.py,1206,function,"Computes the mean relative error by normalizing with the given values. The `mean_relative_error` function creates two local variables, `total` and `count` that are used to compute the mean relative absolute error. @@ -76903,7 +83804,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9380,mean_squared_error,tensorflow/tensorflow/python/ops/metrics_impl.py,1275,function,"Computes the mean squared error between the labels and predictions. +8908,mean_squared_error,tensorflow/tensorflow/python/ops/metrics_impl.py,1275,function,"Computes the mean squared error between the labels and predictions. The `mean_squared_error` function creates two local variables, `total` and `count` that are used to compute the mean squared error. @@ -76945,7 +83846,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9381,mean_tensor,tensorflow/tensorflow/python/ops/metrics_impl.py,1336,function,"Computes the element-wise (weighted) mean of the given tensors. +8909,mean_tensor,tensorflow/tensorflow/python/ops/metrics_impl.py,1336,function,"Computes the element-wise (weighted) mean of the given tensors. In contrast to the `mean` function which returns a scalar with the mean, this function returns an average tensor with the same shape as the @@ -76985,7 +83886,7 @@ Raises: or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9382,percentage_below,tensorflow/tensorflow/python/ops/metrics_impl.py,1421,function,"Computes the percentage of values less than the given threshold. +8910,percentage_below,tensorflow/tensorflow/python/ops/metrics_impl.py,1421,function,"Computes the percentage of values less than the given threshold. The `percentage_below` function creates two local variables, `total` and `count` that are used to compute the percentage of `values` that @@ -77022,29 +83923,7 @@ Raises: or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9383,_count_condition,tensorflow/tensorflow/python/ops/metrics_impl.py,1475,function,"Sums the weights of cases where the given values are True. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - values: A `bool` `Tensor` of arbitrary size. - weights: Optional `Tensor` whose rank is either 0, or the same rank as - `values`, and must be broadcastable to `values` (i.e., all dimensions must - be either `1`, or the same as the corresponding `values` dimension). - metrics_collections: An optional list of collections that the metric - value variable should be added to. - updates_collections: An optional list of collections that the metric update - ops should be added to. - -Returns: - value_tensor: A `Tensor` representing the current value of the metric. - update_op: An operation that accumulates the error from a batch of data. - -Raises: - ValueError: If `weights` is not `None` and its shape doesn't match `values`, - or if either `metrics_collections` or `updates_collections` are not a list - or tuple." -9384,false_negatives,tensorflow/tensorflow/python/ops/metrics_impl.py,1522,function,"Computes the total number of false negatives. +8911,false_negatives,tensorflow/tensorflow/python/ops/metrics_impl.py,1522,function,"Computes the total number of false negatives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77071,7 +83950,7 @@ Raises: or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9385,false_negatives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1574,function,"Computes false negatives at provided threshold values. +8912,false_negatives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1574,function,"Computes false negatives at provided threshold values. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77101,7 +83980,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9386,false_positives,tensorflow/tensorflow/python/ops/metrics_impl.py,1630,function,"Sum the weights of false positives. +8913,false_positives,tensorflow/tensorflow/python/ops/metrics_impl.py,1630,function,"Sum the weights of false positives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77129,7 +84008,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9387,false_positives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1683,function,"Computes false positives at provided threshold values. +8914,false_positives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1683,function,"Computes false positives at provided threshold values. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77159,7 +84038,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9388,true_negatives,tensorflow/tensorflow/python/ops/metrics_impl.py,1739,function,"Sum the weights of true_negatives. +8915,true_negatives,tensorflow/tensorflow/python/ops/metrics_impl.py,1739,function,"Sum the weights of true_negatives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77187,7 +84066,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9389,true_negatives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1792,function,"Computes true negatives at provided threshold values. +8916,true_negatives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1792,function,"Computes true negatives at provided threshold values. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77217,7 +84096,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9390,true_positives,tensorflow/tensorflow/python/ops/metrics_impl.py,1848,function,"Sum the weights of true_positives. +8917,true_positives,tensorflow/tensorflow/python/ops/metrics_impl.py,1848,function,"Sum the weights of true_positives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77245,7 +84124,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9391,true_positives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1901,function,"Computes true positives at provided threshold values. +8918,true_positives_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,1901,function,"Computes true positives at provided threshold values. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. @@ -77275,7 +84154,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9392,precision,tensorflow/tensorflow/python/ops/metrics_impl.py,1957,function,"Computes the precision of the predictions with respect to the labels. +8919,precision,tensorflow/tensorflow/python/ops/metrics_impl.py,1957,function,"Computes the precision of the predictions with respect to the labels. The `precision` function creates two local variables, `true_positives` and `false_positives`, that are used to compute the @@ -77317,7 +84196,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9393,precision_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,2052,function,"Computes precision values for different `thresholds` on `predictions`. +8920,precision_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,2052,function,"Computes precision values for different `thresholds` on `predictions`. The `precision_at_thresholds` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` @@ -77360,7 +84239,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9394,recall,tensorflow/tensorflow/python/ops/metrics_impl.py,2133,function,"Computes the recall of the predictions with respect to the labels. +8921,recall,tensorflow/tensorflow/python/ops/metrics_impl.py,2133,function,"Computes the recall of the predictions with respect to the labels. The `recall` function creates two local variables, `true_positives` and `false_negatives`, that are used to compute the recall. This value is @@ -77400,143 +84279,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9395,_at_k_name,tensorflow/tensorflow/python/ops/metrics_impl.py,2225,function, -9396,_select_class_id,tensorflow/tensorflow/python/ops/metrics_impl.py,2235,function,"Filter all but `selected_id` out of `ids`. - -Args: - ids: `int64` `Tensor` or `SparseTensor` of IDs. - selected_id: Int id to select. - -Returns: - `SparseTensor` of same dimensions as `ids`. This contains only the entries - equal to `selected_id`." -9397,_maybe_select_class_id,tensorflow/tensorflow/python/ops/metrics_impl.py,2269,function,"If class ID is specified, filter all other classes. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: `int64` `Tensor` of class IDs, with shape [D1, ... DN, k] - where N >= 1. Commonly, N=1 and `predictions_idx` has shape - [batch size, k]. - selected_id: Int id to select. - -Returns: - Tuple of `labels` and `predictions_idx`, possibly with classes removed." -9398,_sparse_true_positive_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2292,function,"Calculates true positives for recall@k and precision@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels_sparse`. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - name: Name of operation. - -Returns: - A [D1, ... DN] `Tensor` of true positive counts." -9399,_streaming_sparse_true_positive_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2337,function,"Calculates weighted per step true positives for recall@k and precision@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels`. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - k: Integer, k for @k metric. This is only used for default op name. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - name: Name of new variable, and namespace for other dependent ops. - -Returns: - A tuple of `Variable` and update `Operation`. - -Raises: - ValueError: If `weights` is not `None` and has an incompatible shape." -9400,_sparse_false_negative_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2388,function,"Calculates false negatives for recall@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels_sparse`. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - -Returns: - A [D1, ... DN] `Tensor` of false negative counts." -9401,_streaming_sparse_false_negative_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2432,function,"Calculates weighted per step false negatives for recall@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels`. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - k: Integer, k for @k metric. This is only used for default op name. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - name: Name of new variable, and namespace for other dependent ops. - -Returns: - A tuple of `Variable` and update `Operation`. - -Raises: - ValueError: If `weights` is not `None` and has an incompatible shape." -9402,recall_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2484,function,"Computes recall@k of the predictions with respect to sparse labels. +8922,recall_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2484,function,"Computes recall@k of the predictions with respect to sparse labels. If `class_id` is specified, we calculate recall by considering only the entries in the batch for which `class_id` is in the label, and computing @@ -77601,7 +84344,7 @@ Raises: `predictions`, or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9403,recall_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2577,function,"Computes recall@k of top-k predictions with respect to sparse labels. +8923,recall_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,2577,function,"Computes recall@k of top-k predictions with respect to sparse labels. Differs from `recall_at_k` in that predictions must be in the form of top `k` class indices, whereas `recall_at_k` expects logits. Refer to `recall_at_k` @@ -77645,7 +84388,7 @@ Raises: ValueError: If `weights` is not `None` and its shape doesn't match `predictions`, or if either `metrics_collections` or `updates_collections` are not a list or tuple." -9404,recall_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,2661,function,"Computes various recall values for different `thresholds` on `predictions`. +8924,recall_at_thresholds,tensorflow/tensorflow/python/ops/metrics_impl.py,2661,function,"Computes various recall values for different `thresholds` on `predictions`. The `recall_at_thresholds` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and `false_negatives` @@ -77686,7 +84429,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9405,root_mean_squared_error,tensorflow/tensorflow/python/ops/metrics_impl.py,2739,function,"Computes the root mean squared error between the labels and predictions. +8925,root_mean_squared_error,tensorflow/tensorflow/python/ops/metrics_impl.py,2739,function,"Computes the root mean squared error between the labels and predictions. The `root_mean_squared_error` function creates two local variables, `total` and `count` that are used to compute the root mean squared error. @@ -77728,7 +84471,7 @@ Raises: either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9406,sensitivity_at_specificity,tensorflow/tensorflow/python/ops/metrics_impl.py,2810,function,"Computes the specificity at a given sensitivity. +8926,sensitivity_at_specificity,tensorflow/tensorflow/python/ops/metrics_impl.py,2810,function,"Computes the specificity at a given sensitivity. The `sensitivity_at_specificity` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and @@ -77777,127 +84520,8 @@ Raises: `specificity` is not between 0 and 1, or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9407,_expand_and_tile,tensorflow/tensorflow/python/ops/metrics_impl.py,2911,function,"Slice `tensor` shape in 2, then tile along the sliced dimension. - -A new dimension is inserted in shape of `tensor` before `dim`, then values are -tiled `multiple` times along the new dimension. - -Args: - tensor: Input `Tensor` or `SparseTensor`. - multiple: Integer, number of times to tile. - dim: Integer, dimension along which to tile. - name: Name of operation. - -Returns: - `Tensor` result of expanding and tiling `tensor`. - -Raises: - ValueError: if `multiple` is less than 1, or `dim` is not in - `[-rank(tensor), rank(tensor)]`." -9408,_num_relevant,tensorflow/tensorflow/python/ops/metrics_impl.py,2965,function,"Computes number of relevant values for each row in labels. - -For labels with shape [D1, ... DN, num_labels], this is the minimum of -`num_labels` and `k`. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. - k: Integer, k for @k metric. - -Returns: - Integer `Tensor` of shape [D1, ... DN], where each value is the number of - relevant values for that row. - -Raises: - ValueError: if inputs have invalid dtypes or values." -9409,_sparse_average_precision_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3003,function,"Computes average precision@k of predictions with respect to sparse labels. - -From en.wikipedia.org/wiki/Information_retrieval#Average_precision, formula -for each row is: - - AveP = sum_{i=1...k} P_{i} * rel_{i} / num_relevant_items - -A ""row"" is the elements in dimension [D1, ... DN] of `predictions_idx`, -`labels`, and the result `Tensors`. In the common case, this is [batch_size]. -Each row of the results contains the average precision for that row. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels] or [D1, ... DN], where the latter implies - num_labels=1. N >= 1 and num_labels is the number of target classes for - the associated prediction. Commonly, N=1 and `labels` has shape - [batch_size, num_labels]. [D1, ... DN] must match `predictions_idx`. - Values should be non-negative. Negative values are ignored. - predictions_idx: Integer `Tensor` with shape [D1, ... DN, k] where N >= 1. - Commonly, N=1 and `predictions_idx` has shape [batch size, k]. The final - dimension must be set and contains the top `k` predicted class indices. - [D1, ... DN] must match `labels`. Values should be in range - [0, num_classes). - -Returns: - `float64` `Tensor` of shape [D1, ... DN], where each value is the average - precision for that row. - -Raises: - ValueError: if the last dimension of predictions_idx is not set." -9410,_streaming_sparse_average_precision_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3092,function,"Computes average precision@k of predictions with respect to sparse labels. - -`sparse_average_precision_at_top_k` creates two local variables, -`average_precision_at_/total` and `average_precision_at_/max`, that -are used to compute the frequency. This frequency is ultimately returned as -`average_precision_at_`: an idempotent operation that simply divides -`average_precision_at_/total` by `average_precision_at_/max`. - -For estimation of the metric over a stream of data, the function creates an -`update_op` operation that updates these variables and returns the -`precision_at_`. Set operations applied to `top_k` and `labels` calculate -the true positives and false positives weighted by `weights`. Then `update_op` -increments `true_positive_at_` and `false_positive_at_` using these -values. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels] or [D1, ... DN], where the latter implies - num_labels=1. N >= 1 and num_labels is the number of target classes for - the associated prediction. Commonly, N=1 and `labels` has shape - [batch_size, num_labels]. [D1, ... DN] must match `predictions_idx`. - Values should be non-negative. Negative values are ignored. - predictions_idx: Integer `Tensor` with shape [D1, ... DN, k] where N >= 1. - Commonly, N=1 and `predictions_idx` has shape [batch size, k]. The final - dimension contains the top `k` predicted class indices. [D1, ... DN] must - match `labels`. Values should be in range [0, num_classes). - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - metrics_collections: An optional list of collections that values should - be added to. - updates_collections: An optional list of collections that updates should - be added to. - name: Name of new update operation, and namespace for other dependent ops. - -Returns: - mean_average_precision: Scalar `float64` `Tensor` with the mean average - precision values. - update: `Operation` that increments variables appropriately, and whose - value matches `metric`." -9411,_clean_out_of_range_indices,tensorflow/tensorflow/python/ops/metrics_impl.py,3185,function,"Replaces large out-of-range labels by small out-of-range labels. - -Replaces any value in `labels` that is greater or equal to `num_classes` by --1. Do this conditionally for efficiency in case there are no such values. - -Args: - labels: `int64` `Tensor` or `SparseTensor`. - num_classes: `int64` scalar `Tensor`. -Returns: - An `int64` `Tensor` or `SparseTensor` as `labels` with indices greater - or equal to num_classes replaced by -1." -9412,sparse_average_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3228,function,"Renamed to `average_precision_at_k`, please use that method instead." -9413,average_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3247,function,"Computes average precision@k of predictions with respect to sparse labels. +8927,sparse_average_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3228,function,"Renamed to `average_precision_at_k`, please use that method instead." +8928,average_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3247,function,"Computes average precision@k of predictions with respect to sparse labels. `average_precision_at_k` creates two local variables, `average_precision_at_/total` and `average_precision_at_/max`, that @@ -77948,62 +84572,7 @@ Returns: Raises: ValueError: if k is invalid. RuntimeError: If eager execution is enabled." -9414,_sparse_false_positive_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3331,function,"Calculates false positives for precision@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels_sparse`. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - -Returns: - A [D1, ... DN] `Tensor` of false positive counts." -9415,_streaming_sparse_false_positive_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3375,function,"Calculates weighted per step false positives for precision@k. - -If `class_id` is specified, calculate binary true positives for `class_id` - only. -If `class_id` is not specified, calculate metrics for `k` predicted vs - `n` label classes, where `n` is the 2nd dimension of `labels`. - -If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - -Args: - labels: `int64` `Tensor` or `SparseTensor` with shape - [D1, ... DN, num_labels], where N >= 1 and num_labels is the number of - target classes for the associated prediction. Commonly, N=1 and `labels` - has shape [batch_size, num_labels]. [D1, ... DN] must match - `predictions_idx`. - predictions_idx: 1-D or higher `int64` `Tensor` with last dimension `k`, - top `k` predicted classes. For rank `n`, the first `n-1` dimensions must - match `labels`. - k: Integer, k for @k metric. This is only used for default op name. - class_id: Class for which we want binary metrics. - weights: `Tensor` whose rank is either 0, or n-1, where n is the rank of - `labels`. If the latter, it must be broadcastable to `labels` (i.e., all - dimensions must be either `1`, or the same as the corresponding `labels` - dimension). - name: Name of new variable, and namespace for other dependent ops. - -Returns: - A tuple of `Variable` and update `Operation`. - -Raises: - ValueError: If `weights` is not `None` and has an incompatible shape." -9416,precision_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3427,function,"Computes precision@k of the predictions with respect to sparse labels. +8929,precision_at_top_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3427,function,"Computes precision@k of the predictions with respect to sparse labels. Differs from `sparse_precision_at_k` in that predictions must be in the form of top `k` class indices, whereas `sparse_precision_at_k` expects logits. @@ -78048,8 +84617,8 @@ Raises: `predictions`, or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9417,sparse_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3517,function,"Renamed to `precision_at_k`, please use that method instead." -9418,precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3538,function,"Computes precision@k of the predictions with respect to sparse labels. +8930,sparse_precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3517,function,"Renamed to `precision_at_k`, please use that method instead." +8931,precision_at_k,tensorflow/tensorflow/python/ops/metrics_impl.py,3538,function,"Computes precision@k of the predictions with respect to sparse labels. If `class_id` is specified, we calculate precision by considering only the entries in the batch for which `class_id` is in the top-k highest @@ -78115,7 +84684,7 @@ Raises: `predictions`, or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9419,specificity_at_sensitivity,tensorflow/tensorflow/python/ops/metrics_impl.py,3632,function,"Computes the specificity at a given sensitivity. +8932,specificity_at_sensitivity,tensorflow/tensorflow/python/ops/metrics_impl.py,3632,function,"Computes the specificity at a given sensitivity. The `specificity_at_sensitivity` function creates four local variables, `true_positives`, `true_negatives`, `false_positives` and @@ -78164,7 +84733,7 @@ Raises: `sensitivity` is not between 0 and 1, or if either `metrics_collections` or `updates_collections` are not a list or tuple. RuntimeError: If eager execution is enabled." -9420,all_sum,tensorflow/tensorflow/python/ops/nccl_ops.py,33,function,"Returns a list of tensors with the all-reduce sum across `tensors`. +8933,all_sum,tensorflow/tensorflow/python/ops/nccl_ops.py,33,function,"Returns a list of tensors with the all-reduce sum across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. @@ -78176,18 +84745,7 @@ Args: Returns: List of tensors, each with the sum of the input tensors, where tensor i has the same device as `tensors[i]`." -9421,_all_sum_grad,tensorflow/tensorflow/python/ops/nccl_ops.py,51,function,"The gradients for `all_sum`. - -Args: - op: The `all_sum` `Operation` that we are differentiating. - grad: Gradient with respect to the output of the `all_sum` op. - -Returns: - The gradient with respect to the output of `all_sum`. - -Raises: - LookupError: If `reduction` is not `sum`." -9422,all_prod,tensorflow/tensorflow/python/ops/nccl_ops.py,79,function,"Returns a list of tensors with the all-reduce product across `tensors`. +8934,all_prod,tensorflow/tensorflow/python/ops/nccl_ops.py,79,function,"Returns a list of tensors with the all-reduce product across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. @@ -78199,7 +84757,7 @@ Args: Returns: List of tensors, each with the product of the input tensors, where tensor i has the same device as `tensors[i]`." -9423,all_min,tensorflow/tensorflow/python/ops/nccl_ops.py,96,function,"Returns a list of tensors with the all-reduce min across `tensors`. +8935,all_min,tensorflow/tensorflow/python/ops/nccl_ops.py,96,function,"Returns a list of tensors with the all-reduce min across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. @@ -78211,7 +84769,7 @@ Args: Returns: List of tensors, each with the minimum of the input tensors, where tensor i has the same device as `tensors[i]`." -9424,all_max,tensorflow/tensorflow/python/ops/nccl_ops.py,113,function,"Returns a list of tensors with the all-reduce max across `tensors`. +8936,all_max,tensorflow/tensorflow/python/ops/nccl_ops.py,113,function,"Returns a list of tensors with the all-reduce max across `tensors`. The computation is done with an all-reduce operation, so if only some of the returned tensors are evaluated then the computation will hang. @@ -78223,7 +84781,7 @@ Args: Returns: List of tensors, each with the maximum of the input tensors, where tensor i has the same device as `tensors[i]`." -9425,reduce_sum,tensorflow/tensorflow/python/ops/nccl_ops.py,130,function,"Returns a tensor with the reduce sum across `tensors`. +8937,reduce_sum,tensorflow/tensorflow/python/ops/nccl_ops.py,130,function,"Returns a tensor with the reduce sum across `tensors`. The computation is done with a reduce operation, so only one tensor is returned. @@ -78237,18 +84795,7 @@ Returns: Raises: LookupError: If context is not currently using a GPU device." -9426,_reduce_sum_grad,tensorflow/tensorflow/python/ops/nccl_ops.py,150,function,"The gradients for input `Operation` of `reduce_sum`. - -Args: - op: The `sum send` `Operation` that we are differentiating. - grad: Gradient with respect to the output of the `reduce_sum` op. - -Returns: - The gradient with respect to the input of `reduce_sum` op. - -Raises: - LookupError: If the reduction attribute of op is not `sum`." -9427,broadcast,tensorflow/tensorflow/python/ops/nccl_ops.py,173,function,"Returns a tensor that can be efficiently transferred to other devices. +8938,broadcast,tensorflow/tensorflow/python/ops/nccl_ops.py,173,function,"Returns a tensor that can be efficiently transferred to other devices. Args: tensor: The tensor to send; must be assigned to a GPU device. @@ -78256,318 +84803,7 @@ Args: Returns: A tensor with the value of `src_tensor`, which can be used as input to ops on other GPU devices." -9428,_broadcast_grad,tensorflow/tensorflow/python/ops/nccl_ops.py,190,function,"The gradients for input `Operation` of `broadcast`. - -Args: - op: The `broadcast send` `Operation` that we are differentiating. - accumulated_grad: Accumulated gradients with respect to the output of the - `broadcast` op. - -Returns: - Gradients with respect to the input of `broadcast`." -9429,_apply_all_reduce,tensorflow/tensorflow/python/ops/nccl_ops.py,210,function,Helper function for all_* functions. -9430,_apply_reduce,tensorflow/tensorflow/python/ops/nccl_ops.py,239,function,Helper function for reduce_* functions. -9431,_get_shared_name,tensorflow/tensorflow/python/ops/nccl_ops.py,254,function, -9432,_check_device,tensorflow/tensorflow/python/ops/nccl_ops.py,263,function, -9433,_DeviceTensors,tensorflow/tensorflow/python/ops/nccl_ops_test.py,33,function, -9434,_NcclAllReduce,tensorflow/tensorflow/python/ops/nccl_ops_test.py,41,function, -9435,_NcclReduce,tensorflow/tensorflow/python/ops/nccl_ops_test.py,45,function, -9436,_NcclBroadcast,tensorflow/tensorflow/python/ops/nccl_ops_test.py,51,function, -9437,NcclTestCase,tensorflow/tensorflow/python/ops/nccl_ops_test.py,59,class, -9438,AllReduceTest,tensorflow/tensorflow/python/ops/nccl_ops_test.py,131,class, -9439,SingleReduceTest,tensorflow/tensorflow/python/ops/nccl_ops_test.py,150,class, -9440,BroadcastTest,tensorflow/tensorflow/python/ops/nccl_ops_test.py,160,class, -9441,CombinedTest,tensorflow/tensorflow/python/ops/nccl_ops_test.py,184,class,Test all-reduce vs. single-reduce plus broadcast in one session.run. -9442,BatchNormalizationTest,tensorflow/tensorflow/python/ops/nn_batchnorm_test.py,38,class, -9443,SufficientStatisticsTest,tensorflow/tensorflow/python/ops/nn_batchnorm_test.py,352,class, -9444,NormalizeMomentsTest,tensorflow/tensorflow/python/ops/nn_batchnorm_test.py,412,class, -9445,MomentsTest,tensorflow/tensorflow/python/ops/nn_batchnorm_test.py,455,class, -9446,WeightedMomentsTest,tensorflow/tensorflow/python/ops/nn_batchnorm_test.py,597,class,"Tests for nn.weighted_moments. - -Note that this test inherits from MomentsTest, inheriting all its -test methods! - -It modifies MomentsTest in two ways: - -a) By overriding _unweighted_moments, all the codepaths in - MomentsTest are executed, but with calls to tf.nn.moments() - replaced by calls to tf.nn.weighted_moments() with a constant - weight of 1. - -b) By overriding RunMomentTest and RunMomentTestWithDynamicShape, - this test adds multiple additional calls to - RunWeightedMomentsTest() to exercise correctness with - non-constant weights and varying broadcasting situations. (It - also continues to call MomentsTest.Run(Weighted)?MomentsTest as - well.)" -9447,BatchNormalizationTest,tensorflow/tensorflow/python/ops/nn_fused_batchnorm_test.py,35,class, -9448,_Conv2DBackpropInputGrad,tensorflow/tensorflow/python/ops/nn_grad.py,31,function,"The derivatives for deconvolution. - -Args: - op: the Deconvolution op. - grad: the tensor representing the gradient w.r.t. the output - -Returns: - the gradients w.r.t. the input and the filter" -9449,_Conv2DBackpropFilterGrad,tensorflow/tensorflow/python/ops/nn_grad.py,68,function, -9450,_DepthwiseConv2dNativeBackpropInputGrad,tensorflow/tensorflow/python/ops/nn_grad.py,95,function,"The derivatives for deconvolution. - -Args: - op: the Deconvolution op. - grad: the tensor representing the gradient w.r.t. the output - -Returns: - the gradients w.r.t. the input and the filter" -9451,_DepthwiseConv2dNativeBackpropFilterGrad,tensorflow/tensorflow/python/ops/nn_grad.py,128,function, -9452,_Conv3DGrad,tensorflow/tensorflow/python/ops/nn_grad.py,151,function, -9453,_Conv3DBackpropInputGrad,tensorflow/tensorflow/python/ops/nn_grad.py,174,function, -9454,_Conv3DBackpropFilterGrad,tensorflow/tensorflow/python/ops/nn_grad.py,197,function, -9455,_AvgPool3DGrad,tensorflow/tensorflow/python/ops/nn_grad.py,219,function, -9456,_AvgPool3DGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,230,function, -9457,_MaxPool3DGrad,tensorflow/tensorflow/python/ops/nn_grad.py,241,function, -9458,_MaxPool3DGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,253,function, -9459,_MaxPool3DGradGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,269,function, -9460,_SoftmaxGrad,tensorflow/tensorflow/python/ops/nn_grad.py,285,function,"The derivative of the softmax nonlinearity. - -We assume that probs is of shape [batch_size * dim] -The formula for dsoftmax / dx = (diag(softmax) - softmax * softmax'). -This matrix is diagonal minus a rank one matrix, so it is easy to implement -as follows: - - grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax - -Args: - op: the Softmax op. - grad_softmax: the tensor representing the gradient w.r.t. the softmax - output. - -Returns: - gradient w.r.t the input to the softmax" -9461,_LogSoftmaxGrad,tensorflow/tensorflow/python/ops/nn_grad.py,310,function,"The gradient for log_softmax. - - log_softmax = input - log(sum(exp(input)) - dlog_softmax/dinput = diag - softmax(input) - -Args: - op: The log softmax op. - grad: The tensor representing the gradient w.r.t. the output. - -Returns: - The gradients w.r.t. the input." -9462,_BiasAddGrad,tensorflow/tensorflow/python/ops/nn_grad.py,328,function,"Return the gradients for the 2 inputs of bias_op. - -The first input of unused_bias_op is the tensor t, and its gradient is -just the gradient the unused_bias_op received. - -The second input of unused_bias_op is the bias vector which has one fewer -dimension than ""received_grad"" (the batch dimension.) Its gradient is the -received gradient Summed on the batch dimension, which is the first dimension. - -Args: - op: The BiasOp for which we need to generate gradients. - received_grad: Tensor. The gradients passed to the BiasOp. - -Returns: - Two tensors, the first one for the ""tensor"" input of the BiasOp, - the second one for the ""bias"" input of the BiasOp." -9463,_BiasAddGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,356,function,"Gradient for the BiasAddGrad op. - -Args: - op: BiasAddGrad op for which we are calculating gradients. - received_grad: The gradients passed to the BiasAddGrad op. - -Returns: - A single gradient Tensor for the input to BiasAddGrad (which - is the gradient of the bias term in BiasAdd)" -9464,_BiasAddGradV1,tensorflow/tensorflow/python/ops/nn_grad.py,392,function,"Return the gradients for the 2 inputs of bias_op. - -The first input of unused_bias_op is the tensor t, and its gradient is -just the gradient the unused_bias_op received. - -The second input of unused_bias_op is the bias vector which has one fewer -dimension than ""received_grad"" (the batch dimension.) Its gradient is the -received gradient Summed on the batch dimension, which is the first dimension. - -Args: - unused_bias_op: The BiasOp for which we need to generate gradients. - received_grad: Tensor. The gradients passed to the BiasOp. - -Returns: - Two tensors, the first one for the ""tensor"" input of the BiasOp, - the second one for the ""bias"" input of the BiasOp." -9465,_ReluGrad,tensorflow/tensorflow/python/ops/nn_grad.py,416,function, -9466,_EluGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,421,function, -9467,_SeluGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,429,function, -9468,_Relu6Grad,tensorflow/tensorflow/python/ops/nn_grad.py,437,function, -9469,_Relu6GradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,442,function, -9470,_LeakyReluGrad,tensorflow/tensorflow/python/ops/nn_grad.py,449,function, -9471,_LeakyReluGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,456,function, -9472,_EluGrad,tensorflow/tensorflow/python/ops/nn_grad.py,464,function, -9473,_SeluGrad,tensorflow/tensorflow/python/ops/nn_grad.py,469,function, -9474,_SoftplusGrad,tensorflow/tensorflow/python/ops/nn_grad.py,474,function, -9475,_SoftplusGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,479,function, -9476,_SoftsignGrad,tensorflow/tensorflow/python/ops/nn_grad.py,492,function, -9477,_ReluGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,497,function, -9478,_BroadcastMul,tensorflow/tensorflow/python/ops/nn_grad.py,503,function,"Multiply after broadcasting vec to match dimensions of mat. - -Args: - vec: A 1-D tensor of dimension [D0] - mat: A 2-D tensor of dimension [D0, D1] - -Returns: - A tensor of dimension [D0, D1], the result of vec * mat" -9479,_SoftmaxCrossEntropyWithLogitsGrad,tensorflow/tensorflow/python/ops/nn_grad.py,519,function,Gradient function for SoftmaxCrossEntropyWithLogits. -9480,_SparseSoftmaxCrossEntropyWithLogitsGrad,tensorflow/tensorflow/python/ops/nn_grad.py,544,function,Gradient function for SparseSoftmaxCrossEntropyWithLogits. -9481,_Conv2DGrad,tensorflow/tensorflow/python/ops/nn_grad.py,570,function,Gradient function for Conv2D. -9482,_DepthwiseConv2dNativeGrad,tensorflow/tensorflow/python/ops/nn_grad.py,611,function, -9483,_Dilation2DGrad,tensorflow/tensorflow/python/ops/nn_grad.py,635,function, -9484,_LRNGrad,tensorflow/tensorflow/python/ops/nn_grad.py,649,function, -9485,_AvgPoolGrad,tensorflow/tensorflow/python/ops/nn_grad.py,661,function, -9486,_AvgPoolGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,672,function, -9487,_MaxPoolGrad,tensorflow/tensorflow/python/ops/nn_grad.py,683,function, -9488,_MaxPoolGradV2,tensorflow/tensorflow/python/ops/nn_grad.py,695,function, -9489,_MaxPoolGradWithArgmax,tensorflow/tensorflow/python/ops/nn_grad.py,709,function, -9490,_MaxPoolGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,722,function, -9491,_MaxPoolGradGradV2,tensorflow/tensorflow/python/ops/nn_grad.py,738,function, -9492,_MaxPoolGradGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,756,function, -9493,_FractionalMaxPoolGrad,tensorflow/tensorflow/python/ops/nn_grad.py,772,function,"Returns gradient for FractionalMaxPool. - -Since FractionalMaxPool has three outputs, there are three gradients passed in -for each of the outputs. Only the first one is useful, the other two gradients -are empty. - -Args: - op: The FractionalMaxPoolOp. - grad_0: Gradient with respect to op.outputs[0] - unused_grad_1: Gradient with respect to op.outputs[1]/row_seq. It is empty. - unused_grad_2: Gradient with respect to op.outputs[2]/col_seq. It is empty. - -Returns: - Input backprop for FractionalMaxPool op." -9494,_FractionalAvgPoolGrad,tensorflow/tensorflow/python/ops/nn_grad.py,794,function,"Returns gradient for FractionalAvgPool. - -Since FractionalAvgPool has three outputs, there are three gradients passed in -for each of the outputs. Only the first one is useful, the other two gradients -are empty. - -Args: - op: The FractionalAvgPoolOp. - grad_0: Gradient with respect to op.outputs[0] - unused_grad_1: Gradient with respect to op.outputs[1]/row_seq. It is empty. - unused_grad_2: Gradient with respect to op.outputs[2]/col_seq. It is empty. - -Returns: - Input backprop for FractionalAvgPool op." -9495,_BatchNormWithGlobalNormalizationGrad,tensorflow/tensorflow/python/ops/nn_grad.py,816,function,"Return the gradients for the 5 inputs of BatchNormWithGlobalNormalization. - -We do not backprop anything for the mean and var intentionally as they are -not being trained with backprop in the operation. - -Args: - op: The BatchNormOp for which we need to generate gradients. - grad: Tensor. The gradients passed to the BatchNormOp. - -Returns: - dx: Backprop for input, which is (grad * (g * rsqrt(v + epsilon))) - dm: Backprop for mean, which is - sum_over_rest(grad * g) * (-1 / rsqrt(v + epsilon)) - dv: Backprop for variance, which is - sum_over_rest(grad * g * (x - m)) * (-1/2) * (v + epsilon) ^ (-3/2) - db: Backprop for beta, which is grad reduced in all except the - last dimension. - dg: Backprop for gamma, which is (grad * ((x - m) * rsqrt(v + epsilon)))" -9496,_BaseFusedBatchNormGrad,tensorflow/tensorflow/python/ops/nn_grad.py,842,function,"Return the gradients for the 3 inputs of BatchNorm. - -Args: - op: The BatchNormOp for which we need to compute gradients. - version: Integer indicating which version to use of the fused batch - norm gradient. - *grad: An argument list for tensors of gradients wrt the outputs - with grad[0] as grad_y. - -Returns: - grad_x: gradient for x, which is scale * rsqrt(variance + epsilon) * - [grad_y - mean(grad_y) - (x - mean(x)) * - mean(grad_y * (x - mean(x))) / (variance + epsilon)] - in training mode; grad_y * scale * rsqrt(pop_variance + epsilon) - in freeze mode. - - grad_scale: gradient for scale, which is sum(grad_y * (x - mean(x)) * - rsqrt(variance + epsilon)) in training mode; - sum(grad_y * (x - pop_mean) * rsqrt(pop_variance + epsilon)) - in freeze mode. - - grad_offset: gradient for offset, which is sum(grad_y) in training mode; - sum(grad_y) in freeze mode." -9497,_FusedBatchNormGrad,tensorflow/tensorflow/python/ops/nn_grad.py,918,function, -9498,_FusedBatchNormV2Grad,tensorflow/tensorflow/python/ops/nn_grad.py,923,function, -9499,_FusedBatchNormV3Grad,tensorflow/tensorflow/python/ops/nn_grad.py,928,function, -9500,_BatchNormGrad,tensorflow/tensorflow/python/ops/nn_grad.py,932,function,"Returns the gradients for the 3 inputs of BatchNorm. - -Args: - grad_y: A `Tensor` of 4 dimensions for gradient for y. - x: A `Tensor` of 4 dimensions for x. - scale: A `Tensor` of 1 dimension for scaling. - pop_mean: A `Tensor` of 1 dimension for the population mean. Only used when - is_training=False. - pop_var: A `Tensor` of 1 dimension for the population variance. Only used - when is_training=False. - epsilon: A small float number added to the variance of x. - data_format: The data format for input. Either b""NHWC"" or b""NCHW"". - is_training: A bool value to indicate the operation is for training - (default) or inference. - -Returns: - A tuple (grad_x, grad_scale, grad_offset), where grad_x is the gradient - for x, grad_scale the gradient for scale, and grad_offset the gradient - for offset." -9501,_FusedBatchNormGradGrad,tensorflow/tensorflow/python/ops/nn_grad.py,1012,function,"Returns the gradients for the 3 inputs of FusedBatchNormGrad. - -Args: - op: The FusedBatchNormGradOp for which we need to compute gradients. - *grad: An argument list for tensors of gradients wrt the outputs with - grad[0] as grad_grad_x, grad[1] as grad_grad_scale, grad[2] as - grad_grad_offset. - -Returns: - A tuple (grad_grad_y, grad_x, grad_scale, None, None), where grad_grad_y - is the gradient for grad_y, grad_x the gradient for x, grad_scale the - gradient for scale." -9502,_FusedBatchNormGradGradV2,tensorflow/tensorflow/python/ops/nn_grad.py,1050,function, -9503,_FusedBatchNormGradGradV3,tensorflow/tensorflow/python/ops/nn_grad.py,1055,function, -9504,_L2LossGrad,tensorflow/tensorflow/python/ops/nn_grad.py,1061,function,"Return the gradients for L2Loss. - -Args: - op: The L2LossOp for which we need to generate gradients. - grad: Tensor containing a single number. - -Returns: - The gradient, which is (x * grad)." -9505,_TopKGrad,tensorflow/tensorflow/python/ops/nn_grad.py,1076,function,"Return the gradients for TopK. - -Args: - op: The TopKOp for which we need to generate gradients. - grad: Tensor. The gradients passed to the TopKOp. - -Returns: - A list of two tensors, the first being the gradient w.r.t to the input and - TopK, and the second being the gradient w.r.t. to the indices (all zero)." -9506,_NthElementGrad,tensorflow/tensorflow/python/ops/nn_grad.py,1121,function,"Return the gradients for NthElement. - -Args: - op: The NthElementOp for which we need to generate gradients. - grad: Tensor. The gradients passed to the NthElementOp - -Returns: - A list of two tensors, the first being the gradient w.r.t. the input, - the second being the gradient w.r.t. the N (None)." -9507,SoftmaxOpTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,38,class, -9508,Relu6OpTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,61,class, -9509,Conv2dOpTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,80,class, -9510,DepthwiseConv2dTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,131,class, -9511,EluGradOpTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,186,class, -9512,SeluGradOpTest,tensorflow/tensorflow/python/ops/nn_grad_test.py,223,class, -9513,log_poisson_loss,tensorflow/tensorflow/python/ops/nn_impl.py,49,function,"Computes log Poisson loss given `log_input`. +8939,log_poisson_loss,tensorflow/tensorflow/python/ops/nn_impl.py,49,function,"Computes log Poisson loss given `log_input`. Gives the log-likelihood loss between the prediction and the target under the assumption that the target has a Poisson distribution. @@ -78603,7 +84839,7 @@ Returns: Raises: ValueError: If `log_input` and `targets` do not have the same shape." -9514,sigmoid_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_impl.py,115,function,"Computes sigmoid cross entropy given `logits`. +8940,sigmoid_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_impl.py,115,function,"Computes sigmoid cross entropy given `logits`. Measures the probability error in discrete classification tasks in which each class is independent and not mutually exclusive. For instance, one could @@ -78644,7 +84880,7 @@ Returns: Raises: ValueError: If `logits` and `labels` do not have the same shape." -9515,sigmoid_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_impl.py,198,function,"Computes sigmoid cross entropy given `logits`. +8941,sigmoid_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_impl.py,198,function,"Computes sigmoid cross entropy given `logits`. Measures the probability error in discrete classification tasks in which each class is independent and not mutually exclusive. For instance, one could @@ -78684,7 +84920,7 @@ Returns: Raises: ValueError: If `logits` and `labels` do not have the same shape." -9516,weighted_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_impl.py,249,function,"Computes a weighted cross entropy. +8942,weighted_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_impl.py,249,function,"Computes a weighted cross entropy. This is like `sigmoid_cross_entropy_with_logits()` except that `pos_weight`, allows one to trade off recall and precision by up- or down-weighting the @@ -78735,7 +84971,7 @@ Returns: Raises: ValueError: If `logits` and `labels` do not have the same shape." -9517,weighted_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_impl.py,329,function,"Computes a weighted cross entropy. +8943,weighted_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_impl.py,329,function,"Computes a weighted cross entropy. This is like `sigmoid_cross_entropy_with_logits()` except that `pos_weight`, allows one to trade off recall and precision by up- or down-weighting the @@ -78787,7 +85023,7 @@ Returns: Raises: ValueError: If `logits` and `labels` do not have the same shape." -9518,compute_average_loss,tensorflow/tensorflow/python/ops/nn_impl.py,393,function,"Scales per-example losses with sample_weights and computes their average. +8944,compute_average_loss,tensorflow/tensorflow/python/ops/nn_impl.py,393,function,"Scales per-example losses with sample_weights and computes their average. Usage with distribution strategy and custom training loop: @@ -78815,7 +85051,7 @@ Args: Returns: Scalar loss value." -9519,scale_regularization_loss,tensorflow/tensorflow/python/ops/nn_impl.py,451,function,"Scales the sum of the given regularization losses by number of replicas. +8945,scale_regularization_loss,tensorflow/tensorflow/python/ops/nn_impl.py,451,function,"Scales the sum of the given regularization losses by number of replicas. Usage with distribution strategy and custom training loop: @@ -78841,7 +85077,7 @@ Args: Returns: Scalar loss value." -9520,relu_layer,tensorflow/tensorflow/python/ops/nn_impl.py,490,function,"Computes Relu(x * weight + biases). +8946,relu_layer,tensorflow/tensorflow/python/ops/nn_impl.py,490,function,"Computes Relu(x * weight + biases). Args: x: a 2D tensor. Dimensions typically: batch, in_units @@ -78853,7 +85089,7 @@ Args: Returns: A 2-D Tensor computing relu(matmul(x, weights) + biases). Dimensions typically: batch, out_units." -9521,swish,tensorflow/tensorflow/python/ops/nn_impl.py,515,function,"Computes the SiLU or Swish activation function: `x * sigmoid(x)`. +8947,swish,tensorflow/tensorflow/python/ops/nn_impl.py,515,function,"Computes the SiLU or Swish activation function: `x * sigmoid(x)`. The SiLU activation function was introduced in ""Gaussian Error Linear Units (GELUs)"" [Hendrycks et al. 2016](https://arxiv.org/abs/1606.08415) and @@ -78869,7 +85105,7 @@ Args: Returns: The activation value." -9522,normalize,tensorflow/tensorflow/python/ops/nn_impl.py,557,function,"Normalizes `tensor` along dimension `axis` using specified norm. +8948,normalize,tensorflow/tensorflow/python/ops/nn_impl.py,557,function,"Normalizes `tensor` along dimension `axis` using specified norm. This uses `tf.linalg.norm` to compute the norm along `axis`. @@ -78910,7 +85146,7 @@ Returns: Raises: ValueError: If `ord` or `axis` is invalid." -9523,l2_normalize,tensorflow/tensorflow/python/ops/nn_impl.py,611,function,"Normalizes along dimension `axis` using an L2 norm. +8949,l2_normalize,tensorflow/tensorflow/python/ops/nn_impl.py,611,function,"Normalizes along dimension `axis` using an L2 norm. For a 1-D tensor with `axis = 0`, computes @@ -78930,7 +85166,7 @@ Args: Returns: A `Tensor` with the same shape as `x`." -9524,l2_normalize_v2,tensorflow/tensorflow/python/ops/nn_impl.py,639,function,"Normalizes along dimension `axis` using an L2 norm. +8950,l2_normalize_v2,tensorflow/tensorflow/python/ops/nn_impl.py,639,function,"Normalizes along dimension `axis` using an L2 norm. For a 1-D tensor with `axis = 0`, computes @@ -78949,17 +85185,7 @@ Args: Returns: A `Tensor` with the same shape as `x`." -9525,_count_nonzero,tensorflow/tensorflow/python/ops/nn_impl.py,676,function,"Same as math_ops.count_nonzero. - -The reduction is done in dtype, which can be faster for 32-bit dtypes. - -Args: - input_tensor: numeric tensor - dtype: reduction dtype - -Returns: - number of nonzero values with type dtype" -9526,zero_fraction,tensorflow/tensorflow/python/ops/nn_impl.py,699,function,"Returns the fraction of zeros in `value`. +8951,zero_fraction,tensorflow/tensorflow/python/ops/nn_impl.py,699,function,"Returns the fraction of zeros in `value`. If `value` is empty, the result is `nan`. @@ -78976,7 +85202,7 @@ Args: Returns: The fraction of zeros in `value`, with type `float32`." -9527,depthwise_conv2d,tensorflow/tensorflow/python/ops/nn_impl.py,742,function,"Depthwise 2-D convolution. +8952,depthwise_conv2d,tensorflow/tensorflow/python/ops/nn_impl.py,742,function,"Depthwise 2-D convolution. Given a 4D input tensor ('NHWC' or 'NCHW' data formats) and a filter tensor of shape @@ -79054,7 +85280,7 @@ Returns: A 4-D `Tensor` with shape according to `data_format`. E.g., for ""NHWC"" format, shape is `[batch, out_height, out_width, in_channels * channel_multiplier].`" -9528,depthwise_conv2d_v2,tensorflow/tensorflow/python/ops/nn_impl.py,871,function,"Depthwise 2-D convolution. +8953,depthwise_conv2d_v2,tensorflow/tensorflow/python/ops/nn_impl.py,871,function,"Depthwise 2-D convolution. Given a 4D input tensor ('NHWC' or 'NCHW' data formats) and a filter tensor of shape @@ -79130,7 +85356,7 @@ Returns: A 4-D `Tensor` with shape according to `data_format`. E.g., for ""NHWC"" format, shape is `[batch, out_height, out_width, in_channels * channel_multiplier].`" -9529,separable_conv2d,tensorflow/tensorflow/python/ops/nn_impl.py,969,function,"2-D convolution with separable filters. +8954,separable_conv2d,tensorflow/tensorflow/python/ops/nn_impl.py,969,function,"2-D convolution with separable filters. Performs a depthwise convolution that acts separately on channels followed by a pointwise convolution that mixes channels. Note that this is separability @@ -79181,7 +85407,7 @@ Returns: A 4-D `Tensor` with shape according to 'data_format'. For example, with data_format=""NHWC"", shape is [batch, out_height, out_width, out_channels]." -9530,separable_conv2d_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1077,function,"2-D convolution with separable filters. +8955,separable_conv2d_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1077,function,"2-D convolution with separable filters. Performs a depthwise convolution that acts separately on channels followed by a pointwise convolution that mixes channels. Note that this is separability @@ -79231,7 +85457,7 @@ Returns: A 4-D `Tensor` with shape according to 'data_format'. For example, with data_format=""NHWC"", shape is [batch, out_height, out_width, out_channels]." -9531,sufficient_statistics,tensorflow/tensorflow/python/ops/nn_impl.py,1153,function,"Calculate the sufficient statistics for the mean and variance of `x`. +8956,sufficient_statistics,tensorflow/tensorflow/python/ops/nn_impl.py,1153,function,"Calculate the sufficient statistics for the mean and variance of `x`. These sufficient statistics are computed using the one pass algorithm on an input that's optionally shifted. See: @@ -79268,7 +85494,7 @@ Returns: * the (possibly shifted) sum of the elements in the array. * the (possibly shifted) sum of squares of the elements in the array. * the shift by which the mean must be corrected or None if `shift` is None." -9532,sufficient_statistics_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1228,function,"Calculate the sufficient statistics for the mean and variance of `x`. +8957,sufficient_statistics_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1228,function,"Calculate the sufficient statistics for the mean and variance of `x`. These sufficient statistics are computed using the one pass algorithm on an input that's optionally shifted. See: @@ -79290,7 +85516,7 @@ Returns: * the (possibly shifted) sum of the elements in the array. * the (possibly shifted) sum of squares of the elements in the array. * the shift by which the mean must be corrected or None if `shift` is None." -9533,normalize_moments,tensorflow/tensorflow/python/ops/nn_impl.py,1258,function,"Calculate the mean and variance of based on the sufficient statistics. +8958,normalize_moments,tensorflow/tensorflow/python/ops/nn_impl.py,1258,function,"Calculate the mean and variance of based on the sufficient statistics. Args: counts: A `Tensor` containing the total count of the data (one value). @@ -79304,7 +85530,7 @@ Args: Returns: Two `Tensor` objects: `mean` and `variance`." -9534,moments,tensorflow/tensorflow/python/ops/nn_impl.py,1291,function,"Calculate the mean and variance of `x`. +8959,moments,tensorflow/tensorflow/python/ops/nn_impl.py,1291,function,"Calculate the mean and variance of `x`. The mean and variance are calculated by aggregating the contents of `x` across `axes`. If `x` is 1-D and `axes = [0]` this is just the mean @@ -79330,7 +85556,7 @@ Args: Returns: Two `Tensor` objects: `mean` and `variance`." -9535,moments_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1357,function,"Calculates the mean and variance of `x`. +8960,moments_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1357,function,"Calculates the mean and variance of `x`. The mean and variance are calculated by aggregating the contents of `x` across `axes`. If `x` is 1-D and `axes = [0]` this is just the mean @@ -79355,7 +85581,7 @@ Args: Returns: Two `Tensor` objects: `mean` and `variance`." -9536,weighted_moments,tensorflow/tensorflow/python/ops/nn_impl.py,1394,function,"Returns the frequency-weighted mean and variance of `x`. +8961,weighted_moments,tensorflow/tensorflow/python/ops/nn_impl.py,1394,function,"Returns the frequency-weighted mean and variance of `x`. Args: x: A tensor. @@ -79369,7 +85595,7 @@ Args: Returns: Two tensors: `weighted_mean` and `weighted_variance`." -9537,weighted_moments_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1473,function,"Returns the frequency-weighted mean and variance of `x`. +8962,weighted_moments_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1473,function,"Returns the frequency-weighted mean and variance of `x`. Args: x: A tensor. @@ -79382,7 +85608,7 @@ Args: Returns: Two tensors: `weighted_mean` and `weighted_variance`." -9538,batch_normalization,tensorflow/tensorflow/python/ops/nn_impl.py,1498,function,"Batch normalization. +8963,batch_normalization,tensorflow/tensorflow/python/ops/nn_impl.py,1498,function,"Batch normalization. Normalizes a tensor by `mean` and `variance`, and applies (optionally) a `scale` \\(\gamma\\) to it, as well as an `offset` \\(\beta\\): @@ -79433,7 +85659,7 @@ References: Internal Covariate Shift: [Ioffe et al., 2015](http://arxiv.org/abs/1502.03167) ([pdf](http://proceedings.mlr.press/v37/ioffe15.pdf))" -9539,fused_batch_norm,tensorflow/tensorflow/python/ops/nn_impl.py,1569,function,"Batch normalization. +8964,fused_batch_norm,tensorflow/tensorflow/python/ops/nn_impl.py,1569,function,"Batch normalization. See Source: [Batch Normalization: Accelerating Deep Network Training by @@ -79493,7 +85719,7 @@ References: Internal Covariate Shift: [Ioffe et al., 2015](http://proceedings.mlr.press/v37/ioffe15.html) ([pdf](http://proceedings.mlr.press/v37/ioffe15.pdf))" -9540,batch_norm_with_global_normalization,tensorflow/tensorflow/python/ops/nn_impl.py,1675,function,"Batch normalization. +8965,batch_norm_with_global_normalization,tensorflow/tensorflow/python/ops/nn_impl.py,1675,function,"Batch normalization. This op is deprecated. See `tf.nn.batch_normalization`. @@ -79526,7 +85752,7 @@ References: Internal Covariate Shift: [Ioffe et al., 2015](http://proceedings.mlr.press/v37/ioffe15.html) ([pdf](http://proceedings.mlr.press/v37/ioffe15.pdf))" -9541,batch_norm_with_global_normalization_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1730,function,"Batch normalization. +8966,batch_norm_with_global_normalization_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1730,function,"Batch normalization. This op is deprecated. See `tf.nn.batch_normalization`. @@ -79555,53 +85781,7 @@ References: Batch Normalization - Accelerating Deep Network Training by Reducing Internal Covariate Shift: [Ioffe et al., 2015](http://proceedings.mlr.press/v37/ioffe15.html) ([pdf](http://proceedings.mlr.press/v37/ioffe15.pdf))" -9542,_sum_rows,tensorflow/tensorflow/python/ops/nn_impl.py,1780,function,Returns a vector summing up each row of the matrix x. -9543,_compute_sampled_logits,tensorflow/tensorflow/python/ops/nn_impl.py,1793,function,"Helper function for nce_loss and sampled_softmax_loss functions. - -Computes sampled output training logits and labels suitable for implementing -e.g. noise-contrastive estimation (see nce_loss) or sampled softmax (see -sampled_softmax_loss). - -Note: In the case where num_true > 1, we assign to each target class -the target probability 1 / num_true so that the target probabilities -sum to 1 per-example. - -Args: - weights: A `Tensor` of shape `[num_classes, dim]`, or a list of `Tensor` - objects whose concatenation along dimension 0 has shape - `[num_classes, dim]`. The (possibly-partitioned) class embeddings. - biases: A `Tensor` of shape `[num_classes]`. The (possibly-partitioned) - class biases. - labels: A `Tensor` of type `int64` and shape `[batch_size, - num_true]`. The target classes. Note that this format differs from - the `labels` argument of `nn.softmax_cross_entropy_with_logits`. - inputs: A `Tensor` of shape `[batch_size, dim]`. The forward - activations of the input network. - num_sampled: An `int`. The number of classes to randomly sample per batch. - num_classes: An `int`. The number of possible classes. - num_true: An `int`. The number of target classes per training example. - sampled_values: a tuple of (`sampled_candidates`, `true_expected_count`, - `sampled_expected_count`) returned by a `*_candidate_sampler` function. - (if None, we default to `log_uniform_candidate_sampler`) - subtract_log_q: A `bool`. whether to subtract the log expected count of - the labels in the sample to get the logits of the true labels. - Default is True. Turn off for Negative Sampling. - remove_accidental_hits: A `bool`. whether to remove ""accidental hits"" - where a sampled class equals one of the target classes. Default is - False. - partition_strategy: A string specifying the partitioning strategy, relevant - if `len(weights) > 1`. Currently `""div""` and `""mod""` are supported. - Default is `""mod""`. See `tf.nn.embedding_lookup` for more details. - name: A name for the operation (optional). - seed: random seed for candidate sampling. Default to None, which doesn't set - the op-level random seed for candidate sampling. -Returns: - out_logits: `Tensor` object with shape - `[batch_size, num_true + num_sampled]`, for passing to either - `nn.sigmoid_cross_entropy_with_logits` (NCE) or - `nn.softmax_cross_entropy_with_logits` (sampled softmax). - out_labels: A Tensor object with the same shape as `out_logits`." -9544,nce_loss_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1980,function,"Computes and returns the noise-contrastive estimation training loss. +8967,nce_loss_v2,tensorflow/tensorflow/python/ops/nn_impl.py,1980,function,"Computes and returns the noise-contrastive estimation training loss. See [Noise-contrastive estimation: A new estimation principle for unnormalized statistical @@ -79677,7 +85857,7 @@ Args: Returns: A `batch_size` 1-D tensor of per-example NCE losses." -9545,nce_loss,tensorflow/tensorflow/python/ops/nn_impl.py,2085,function,"Computes and returns the noise-contrastive estimation training loss. +8968,nce_loss,tensorflow/tensorflow/python/ops/nn_impl.py,2085,function,"Computes and returns the noise-contrastive estimation training loss. A common use case is to use this method for training, and calculate the full sigmoid loss for evaluation or inference. In this case, you must set @@ -79755,7 +85935,7 @@ References: statistical models: [Gutmann et al., 2010](http://proceedings.mlr.press/v9/gutmann10a) ([pdf](http://proceedings.mlr.press/v9/gutmann10a/gutmann10a.pdf))" -9546,sampled_softmax_loss_v2,tensorflow/tensorflow/python/ops/nn_impl.py,2197,function,"Computes and returns the sampled softmax training loss. +8969,sampled_softmax_loss_v2,tensorflow/tensorflow/python/ops/nn_impl.py,2197,function,"Computes and returns the sampled softmax training loss. This is a faster way to train a softmax classifier over a huge number of classes. @@ -79817,7 +85997,7 @@ Args: Returns: A `batch_size` 1-D tensor of per-example sampled softmax losses." -9547,sampled_softmax_loss,tensorflow/tensorflow/python/ops/nn_impl.py,2289,function,"Computes and returns the sampled softmax training loss. +8970,sampled_softmax_loss,tensorflow/tensorflow/python/ops/nn_impl.py,2289,function,"Computes and returns the sampled softmax training loss. This is a faster way to train a softmax classifier over a huge number of classes. @@ -79886,61 +86066,7 @@ References: [Jean et al., 2014] (https://aclanthology.coli.uni-saarland.de/papers/P15-1001/p15-1001) ([pdf](http://aclweb.org/anthology/P15-1001))" -9548,LossUtilitiesTest,tensorflow/tensorflow/python/ops/nn_loss_scaling_utilities_test.py,35,class, -9549,_get_sequence,tensorflow/tensorflow/python/ops/nn_ops.py,68,function,Formats a value input for gen_nn_ops. -9550,_non_atrous_convolution,tensorflow/tensorflow/python/ops/nn_ops.py,107,function,"Computes sums of N-D convolutions (actually cross correlation). - -It is required that 1 <= N <= 3. - -This is used to implement the more generic `convolution` function, which -extends the interface of this function with a `dilation_rate` parameter. - -Args: - - input: Rank N+2 tensor of type T of shape - `[batch_size] + input_spatial_shape + [in_channels]` if `data_format` - does not start with `""NC""`, or - `[batch_size, in_channels] + input_spatial_shape` if `data_format` starts - with `""NC""`. - filter: Rank N+2 tensor of type T of shape - `filter_spatial_shape + [in_channels, out_channels]`. Rank of either - `input` or `filter` must be known. - padding: Padding method to use, must be either ""VALID"" or ""SAME"". - data_format: A string or None. Specifies whether the channel dimension of - the `input` and output is the last dimension (default, or if `data_format` - does not start with ""NC""), or the second dimension (if `data_format` - starts with ""NC""). For N=1, the valid values are ""NWC"" (default) and - ""NCW"". For N=2, the valid values are ""NHWC"" (default) and ""NCHW"". - For N=3, the valid values are ""NDHWC"" (default) and ""NCDHW"". - strides: Sequence of N positive integers, defaults to `[1] * N`. - name: Name prefix to use. - -Returns: - Rank N+2 tensor of type T of shape - `[batch_size] + output_spatial_shape + [out_channels]`, where - if padding == ""SAME"": - output_spatial_shape = input_spatial_shape - if padding == ""VALID"": - output_spatial_shape = input_spatial_shape - filter_spatial_shape + 1. - -Raises: - ValueError: if ranks are incompatible." -9551,_NonAtrousConvolution,tensorflow/tensorflow/python/ops/nn_ops.py,168,class,"Helper class for _non_atrous_convolution. - -Note that this class assumes that shapes of input and filter passed to -`__call__` are compatible with `input_shape` and filter_shape passed to the -constructor. - -Arguments: - input_shape: static input shape, i.e. input.shape. - filter_shape: static filter shape, i.e. filter.shape. - padding: see _non_atrous_convolution. - data_format: see _non_atrous_convolution. - strides: see _non_atrous_convolution. - name: see _non_atrous_convolution. - num_batch_dims: (Optional.) The number of batch dimensions in the input; - if not provided, the default of `1` is used." -9552,squeeze_batch_dims,tensorflow/tensorflow/python/ops/nn_ops.py,277,function,"Returns `unsqueeze_batch(op(squeeze_batch(inp)))`. +8971,squeeze_batch_dims,tensorflow/tensorflow/python/ops/nn_ops.py,277,function,"Returns `unsqueeze_batch(op(squeeze_batch(inp)))`. Where `squeeze_batch` reshapes `inp` to shape `[prod(inp.shape[:-inner_rank])] + inp.shape[-inner_rank:]` @@ -79956,7 +86082,7 @@ Args: Returns: `unsqueeze_batch_op(squeeze_batch(inp))`." -9553,dilation2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,328,function,"Computes the grayscale dilation of 4-D `input` and 3-D `filters` tensors. +8972,dilation2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,328,function,"Computes the grayscale dilation of 4-D `input` and 3-D `filters` tensors. The `input` tensor has shape `[batch, in_height, in_width, depth]` and the `filters` tensor has shape `[filter_height, filter_width, depth]`, i.e., each @@ -80002,8 +86128,8 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -9554,dilation2d_v1,tensorflow/tensorflow/python/ops/nn_ops.py,396,function, -9555,with_space_to_batch,tensorflow/tensorflow/python/ops/nn_ops.py,415,function,"Performs `op` on the space-to-batch representation of `input`. +8973,dilation2d_v1,tensorflow/tensorflow/python/ops/nn_ops.py,396,function, +8974,with_space_to_batch,tensorflow/tensorflow/python/ops/nn_ops.py,415,function,"Performs `op` on the space-to-batch representation of `input`. This has the effect of transforming sliding window operations into the corresponding ""atrous"" operation in which the input is sampled at the @@ -80135,64 +86261,7 @@ Returns: Raises: ValueError: if `padding` is invalid or the arguments are incompatible. ValueError: if `spatial_dims` are invalid." -9556,_WithSpaceToBatch,tensorflow/tensorflow/python/ops/nn_ops.py,574,class,"Helper class for with_space_to_batch. - -Note that this class assumes that shapes of input and filter passed to -`__call__` are compatible with `input_shape`, `filter_shape`, and -`spatial_dims` passed to the constructor. - -Arguments - input_shape: static shape of input. i.e. input.shape. - dilation_rate: see `with_space_to_batch`. - padding: see `with_space_to_batch`. - build_op: Function that maps (num_spatial_dims, paddings) -> (function that - maps (input, filter) -> output). - filter_shape: see `with_space_to_batch`. - spatial_dims: `see with_space_to_batch`. - data_format: see `with_space_to_batch`. - num_batch_dims: (Optional). Number of batch dims in `input_shape`." -9557,_with_space_to_batch_base_paddings,tensorflow/tensorflow/python/ops/nn_ops.py,745,function,Helper function to compute base_paddings. -9558,_with_space_to_batch_adjust,tensorflow/tensorflow/python/ops/nn_ops.py,762,function,"Returns an `adjusted` version of `orig` based on `spatial_dims`. - -Tensor of the same type as `orig` and with shape -`[max(spatial_dims), ...]` where: - - adjusted[spatial_dims[i] - 1, ...] = orig[i, ...] - -for 0 <= i < len(spatial_dims), and - - adjusted[j, ...] = fill_value - -for j != spatial_dims[i] - 1 for some i. - -If `orig` is a constant value, then the result will be a constant value. - -Args: - orig: Tensor of rank > max(spatial_dims). - fill_value: Numpy scalar (of same data type as `orig) specifying the fill - value for non-spatial dimensions. - spatial_dims: See with_space_to_batch. - -Returns: - `adjusted` tensor." -9559,_get_strides_and_dilation_rate,tensorflow/tensorflow/python/ops/nn_ops.py,821,function,"Helper function for verifying strides and dilation_rate arguments. - -This is used by `convolution` and `pool`. - -Args: - num_spatial_dims: int - strides: Optional. List of N ints >= 1. Defaults to [1]*N. If any value - of strides is > 1, then all values of dilation_rate must be 1. - dilation_rate: Optional. List of N ints >= 1. Defaults to [1]*N. If any - value of dilation_rate is > 1, then all values of strides must be 1. - -Returns: - Normalized (strides, dilation_rate) as int32 numpy arrays of shape - [num_spatial_dims]. - -Raises: - ValueError: if the parameters are invalid." -9560,convolution,tensorflow/tensorflow/python/ops/nn_ops.py,866,function,"Computes sums of N-D convolutions (actually cross-correlation). +8975,convolution,tensorflow/tensorflow/python/ops/nn_ops.py,866,function,"Computes sums of N-D convolutions (actually cross-correlation). This also supports either output striding via the optional `strides` parameter or atrous convolution (also known as convolution with holes or dilated @@ -80304,8 +86373,8 @@ Returns: Raises: ValueError: If input/output depth does not match `filter` shape, if padding is other than `""VALID""` or `""SAME""`, or if data_format is invalid." -9561,convolution_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1005,function, -9562,convolution_internal,tensorflow/tensorflow/python/ops/nn_ops.py,1029,function,"Internal function which performs rank agnostic convolution. +8976,convolution_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1005,function, +8977,convolution_internal,tensorflow/tensorflow/python/ops/nn_ops.py,1029,function,"Internal function which performs rank agnostic convolution. Args: input: See `convolution`. @@ -80334,7 +86403,7 @@ Raises: ValueError: If input and filter both have unknown shapes, or if `num_spatial_dims` is provided and incompatible with the value estimated from `filters.shape`." -9563,Convolution,tensorflow/tensorflow/python/ops/nn_ops.py,1171,class,"Helper class for convolution. +8978,Convolution,tensorflow/tensorflow/python/ops/nn_ops.py,1171,class,"Helper class for convolution. Note that this class assumes that shapes of input and filter passed to `__call__` are compatible with `input_shape`, `filter_shape`, and @@ -80365,7 +86434,7 @@ Arguments `1` (i.e., the input is expected to be `[batch_size, num_channels] + input_spatial_shape` or `[batch_size] + input_spatial_shape + [num_channels]`." -9564,pool,tensorflow/tensorflow/python/ops/nn_ops.py,1332,function,"Performs an N-D pooling operation. +8979,pool,tensorflow/tensorflow/python/ops/nn_ops.py,1332,function,"Performs an N-D pooling operation. In the case that `data_format` does not start with ""NC"", computes for 0 <= b < batch_size, @@ -80443,7 +86512,7 @@ Returns: Raises: ValueError: if arguments are invalid." -9565,pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1507,function,"Performs an N-D pooling operation. +8980,pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1507,function,"Performs an N-D pooling operation. In the case that `data_format` does not start with ""NC"", computes for 0 <= b < batch_size, @@ -80518,7 +86587,7 @@ Returns: Raises: ValueError: if arguments are invalid." -9566,atrous_conv2d,tensorflow/tensorflow/python/ops/nn_ops.py,1607,function,"Atrous convolution (a.k.a. convolution with holes or dilated convolution). +8981,atrous_conv2d,tensorflow/tensorflow/python/ops/nn_ops.py,1607,function,"Atrous convolution (a.k.a. convolution with holes or dilated convolution). This function is a simpler wrapper around the more general `tf.nn.convolution`, and exists only for backwards compatibility. You can @@ -80656,7 +86725,7 @@ References: [Giusti et al., 2013] (https://ieeexplore.ieee.org/abstract/document/6738831) ([pdf](https://arxiv.org/pdf/1302.1700.pdf))" -9567,convert_padding,tensorflow/tensorflow/python/ops/nn_ops.py,1755,function,"Converts Python padding to C++ padding for ops which take EXPLICIT padding. +8982,convert_padding,tensorflow/tensorflow/python/ops/nn_ops.py,1755,function,"Converts Python padding to C++ padding for ops which take EXPLICIT padding. Args: padding: the `padding` argument for a Python op which supports EXPLICIT @@ -80668,7 +86737,7 @@ Returns: Raises: ValueError: If padding is invalid." -9568,conv1d,tensorflow/tensorflow/python/ops/nn_ops.py,1805,function,"Computes a 1-D convolution of input with rank `>=3` and a `3-D` filter. +8983,conv1d,tensorflow/tensorflow/python/ops/nn_ops.py,1805,function,"Computes a 1-D convolution of input with rank `>=3` and a `3-D` filter. Given an input tensor of shape `batch_shape + [in_width, in_channels]` @@ -80716,7 +86785,7 @@ Returns: Raises: ValueError: if `data_format` is invalid." -9569,conv1d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1911,function,"Computes a 1-D convolution given 3-D input and filter tensors. +8984,conv1d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,1911,function,"Computes a 1-D convolution given 3-D input and filter tensors. Given an input tensor of shape `batch_shape + [in_width, in_channels]` @@ -80762,7 +86831,7 @@ Returns: Raises: ValueError: if `data_format` is invalid." -9570,conv1d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,1979,function,"The transpose of `conv1d`. +8985,conv1d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,1979,function,"The transpose of `conv1d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is actually the transpose (gradient) of `conv1d` @@ -80802,7 +86871,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9571,conv2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,2068,function,"Computes a 2-D convolution given `input` and 4-D `filters` tensors. +8986,conv2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,2068,function,"Computes a 2-D convolution given `input` and 4-D `filters` tensors. The `input` tensor may have rank `4` or higher, where shape dimensions `[:-3]` are considered batch dimensions (`batch_shape`). @@ -80885,7 +86954,7 @@ Args: Returns: A `Tensor`. Has the same type as `input` and the same outer batch shape." -9572,conv2d,tensorflow/tensorflow/python/ops/nn_ops.py,2173,function,"Computes a 2-D convolution given 4-D `input` and `filter` tensors. +8987,conv2d,tensorflow/tensorflow/python/ops/nn_ops.py,2173,function,"Computes a 2-D convolution given 4-D `input` and `filter` tensors. Given an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape @@ -80950,7 +87019,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -9573,conv2d_backprop_filter,tensorflow/tensorflow/python/ops/nn_ops.py,2295,function,"Computes the gradients of convolution with respect to the filter. +8988,conv2d_backprop_filter,tensorflow/tensorflow/python/ops/nn_ops.py,2295,function,"Computes the gradients of convolution with respect to the filter. Args: input: A `Tensor`. Must be one of the following types: @@ -80992,7 +87061,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -9574,conv2d_backprop_input,tensorflow/tensorflow/python/ops/nn_ops.py,2356,function,"Computes the gradients of convolution with respect to the input. +8989,conv2d_backprop_input,tensorflow/tensorflow/python/ops/nn_ops.py,2356,function,"Computes the gradients of convolution with respect to the input. Args: input_sizes: A `Tensor` of type `int32`. @@ -81035,7 +87104,7 @@ Args: Returns: A `Tensor`. Has the same type as `filter`." -9575,conv2d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,2421,function,"The transpose of `conv2d`. +8990,conv2d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,2421,function,"The transpose of `conv2d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of `conv2d` @@ -81083,7 +87152,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9576,conv2d_transpose_v2,tensorflow/tensorflow/python/ops/nn_ops.py,2498,function,"The transpose of `conv2d`. +8991,conv2d_transpose_v2,tensorflow/tensorflow/python/ops/nn_ops.py,2498,function,"The transpose of `conv2d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of @@ -81129,8 +87198,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9577,_conv2d_expanded_batch,tensorflow/tensorflow/python/ops/nn_ops.py,2574,function,Helper function for `convolution_internal`; handles expanded batches. -9578,atrous_conv2d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,2611,function,"The transpose of `atrous_conv2d`. +8992,atrous_conv2d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,2611,function,"The transpose of `atrous_conv2d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of @@ -81171,7 +87239,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9579,depthwise_conv2d_native,tensorflow/tensorflow/python/ops/nn_ops.py,2771,function,"Computes a 2-D depthwise convolution. +8993,depthwise_conv2d_native,tensorflow/tensorflow/python/ops/nn_ops.py,2771,function,"Computes a 2-D depthwise convolution. Given an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape @@ -81222,7 +87290,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -9580,depthwise_conv2d_native_backprop_input,tensorflow/tensorflow/python/ops/nn_ops.py,2851,function,"Computes the gradients of depthwise convolution with respect to the input. +8994,depthwise_conv2d_native_backprop_input,tensorflow/tensorflow/python/ops/nn_ops.py,2851,function,"Computes the gradients of depthwise convolution with respect to the input. Args: input_sizes: A `Tensor` of type `int32`. An integer vector representing the @@ -81261,7 +87329,7 @@ Args: Returns: A `Tensor`. Has the same type as `filter`." -9581,depthwise_conv2d_native_backprop_filter,tensorflow/tensorflow/python/ops/nn_ops.py,2921,function,"Computes the gradients of depthwise convolution with respect to the filter. +8995,depthwise_conv2d_native_backprop_filter,tensorflow/tensorflow/python/ops/nn_ops.py,2921,function,"Computes the gradients of depthwise convolution with respect to the filter. Args: input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, @@ -81301,10 +87369,9 @@ Args: Returns: A `Tensor`. Has the same type as `input`." -9582,_conv3d_expanded_batch,tensorflow/tensorflow/python/ops/nn_ops.py,2984,function,Helper function for `conv3d`; handles expanded batches. -9583,conv3d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3026,function, -9584,conv3d_v1,tensorflow/tensorflow/python/ops/nn_ops.py,3041,function, -9585,conv3d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,3062,function,"The transpose of `conv3d`. +8996,conv3d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3026,function, +8997,conv3d_v1,tensorflow/tensorflow/python/ops/nn_ops.py,3041,function, +8998,conv3d_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,3062,function,"The transpose of `conv3d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of `conv3d` @@ -81349,7 +87416,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9586,conv3d_transpose_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3134,function,"The transpose of `conv3d`. +8999,conv3d_transpose_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3134,function,"The transpose of `conv3d`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of `conv3d` @@ -81391,7 +87458,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9587,conv_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,3214,function,"The transpose of `convolution`. +9000,conv_transpose,tensorflow/tensorflow/python/ops/nn_ops.py,3214,function,"The transpose of `convolution`. This operation is sometimes called ""deconvolution"" after (Zeiler et al., 2010), but is really the transpose (gradient) of `conv3d` @@ -81440,8 +87507,7 @@ References: (https://ieeexplore.ieee.org/abstract/document/5539957) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.232.4023&rep=rep1&type=pdf))" -9588,_tf_deterministic_ops,tensorflow/tensorflow/python/ops/nn_ops.py,3297,function, -9589,bias_add,tensorflow/tensorflow/python/ops/nn_ops.py,3312,function,"Adds `bias` to `value`. +9001,bias_add,tensorflow/tensorflow/python/ops/nn_ops.py,3312,function,"Adds `bias` to `value`. This is (mostly) a special case of `tf.add` where `bias` is restricted to 1-D. Broadcasting is supported, so `value` may have any number of dimensions. @@ -81467,7 +87533,7 @@ Raises: then three dimensions when `data_format` is `NC..`, if `bias` does not have exactly one dimension (is a vector), or if the size of `bias` does not match the size of the channel dimension of `value`." -9590,bias_add_v1,tensorflow/tensorflow/python/ops/nn_ops.py,3373,function,"Adds `bias` to `value`. +9002,bias_add_v1,tensorflow/tensorflow/python/ops/nn_ops.py,3373,function,"Adds `bias` to `value`. This is a deprecated version of bias_add and will soon to be removed. @@ -81486,7 +87552,7 @@ Args: Returns: A `Tensor` with the same type as `value`." -9591,crelu,tensorflow/tensorflow/python/ops/nn_ops.py,3402,function,"Computes Concatenated ReLU. +9003,crelu,tensorflow/tensorflow/python/ops/nn_ops.py,3402,function,"Computes Concatenated ReLU. Concatenates a ReLU which selects only the positive part of the activation with a ReLU which selects only the *negative* part of the activation. @@ -81509,8 +87575,8 @@ References: Rectified Linear Units: [Shang et al., 2016](http://proceedings.mlr.press/v48/shang16) ([pdf](http://proceedings.mlr.press/v48/shang16.pdf))" -9592,crelu_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3435,function, -9593,relu6,tensorflow/tensorflow/python/ops/nn_ops.py,3442,function,"Computes Rectified Linear 6: `min(max(features, 0), 6)`. +9004,crelu_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3435,function, +9005,relu6,tensorflow/tensorflow/python/ops/nn_ops.py,3442,function,"Computes Rectified Linear 6: `min(max(features, 0), 6)`. Args: features: A `Tensor` with type `float`, `double`, `int32`, `int64`, `uint8`, @@ -81524,7 +87590,7 @@ References: Convolutional Deep Belief Networks on CIFAR-10: Krizhevsky et al., 2010 ([pdf](http://www.cs.utoronto.ca/~kriz/conv-cifar10-aug2010.pdf))" -9594,leaky_relu,tensorflow/tensorflow/python/ops/nn_ops.py,3465,function,"Compute the Leaky ReLU activation function. +9006,leaky_relu,tensorflow/tensorflow/python/ops/nn_ops.py,3465,function,"Compute the Leaky ReLU activation function. Source: [Rectifier Nonlinearities Improve Neural Network Acoustic Models. AL Maas, AY Hannun, AY Ng - Proc. ICML, 2013] @@ -81544,27 +87610,7 @@ References: (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.693.1422) ([pdf] (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.693.1422&rep=rep1&type=pdf))" -9595,_flatten_outer_dims,tensorflow/tensorflow/python/ops/nn_ops.py,3496,function,Flattens logits' outer dimensions and keep its last dimension. -9596,_softmax,tensorflow/tensorflow/python/ops/nn_ops.py,3523,function,"Helper function for softmax and log_softmax. - -It reshapes and transposes the input logits into a 2-D Tensor and then invokes -the tf.nn._softmax or tf.nn._log_softmax function. The output would be -transposed and reshaped back. - -Args: - logits: A non-empty `Tensor`. Must be one of the following types: `half`, - `float32`, `float64`. - compute_op: Either gen_nn_ops.softmax or gen_nn_ops.log_softmax - dim: The dimension softmax would be performed on. The default is -1 which - indicates the last dimension. - name: A name for the operation (optional). - -Returns: - A `Tensor`. Has the same type as `logits`. Same shape as `logits`. -Raises: - InvalidArgumentError: if `logits` is empty or `dim` is beyond the last - dimension of `logits`." -9597,softmax,tensorflow/tensorflow/python/ops/nn_ops.py,3605,function,"Computes softmax activations. +9007,softmax,tensorflow/tensorflow/python/ops/nn_ops.py,3605,function,"Computes softmax activations. This function performs the equivalent of @@ -81597,7 +87643,7 @@ Raises: Tensor. RuntimeError: If a registered conversion function returns an invalid value." -9598,softmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3649,function,"Computes softmax activations. +9008,softmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3649,function,"Computes softmax activations. This function performs the equivalent of @@ -81616,7 +87662,7 @@ Returns: Raises: InvalidArgumentError: if `logits` is empty or `axis` is beyond the last dimension of `logits`." -9599,log_softmax,tensorflow/tensorflow/python/ops/nn_ops.py,3678,function,"Computes log softmax activations. +9009,log_softmax,tensorflow/tensorflow/python/ops/nn_ops.py,3678,function,"Computes log softmax activations. For each batch `i` and class `j` we have @@ -81636,7 +87682,7 @@ Returns: Raises: InvalidArgumentError: if `logits` is empty or `axis` is beyond the last dimension of `logits`." -9600,log_softmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3708,function,"Computes log softmax activations. +9010,log_softmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3708,function,"Computes log softmax activations. For each batch `i` and class `j` we have @@ -81655,8 +87701,7 @@ Returns: Raises: InvalidArgumentError: if `logits` is empty or `axis` is beyond the last dimension of `logits`." -9601,_ensure_xent_args,tensorflow/tensorflow/python/ops/nn_ops.py,3734,function, -9602,softmax_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3745,function,"Computes softmax cross entropy between `logits` and `labels`. +9011,softmax_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_ops.py,3745,function,"Computes softmax cross entropy between `logits` and `labels`. Measures the probability error in discrete classification tasks in which the classes are mutually exclusive (each entry is in exactly one class). For @@ -81711,7 +87756,7 @@ Returns: A `Tensor` that contains the softmax cross entropy loss. Its type is the same as `logits` and its shape is the same as `labels` except that it does not have the last dimension of `labels`." -9603,softmax_cross_entropy_with_logits_v2_helper,tensorflow/tensorflow/python/ops/nn_ops.py,3809,function,"Computes softmax cross entropy between `logits` and `labels`. +9012,softmax_cross_entropy_with_logits_v2_helper,tensorflow/tensorflow/python/ops/nn_ops.py,3809,function,"Computes softmax cross entropy between `logits` and `labels`. Measures the probability error in discrete classification tasks in which the classes are mutually exclusive (each entry is in exactly one class). For @@ -81758,7 +87803,7 @@ Returns: A `Tensor` that contains the softmax cross entropy loss. Its type is the same as `logits` and its shape is the same as `labels` except that it does not have the last dimension of `labels`." -9604,softmax_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_ops.py,3937,function,"Computes softmax cross entropy between `logits` and `labels`. +9013,softmax_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_ops.py,3937,function,"Computes softmax cross entropy between `logits` and `labels`. Measures the probability error in discrete classification tasks in which the classes are mutually exclusive (each entry is in exactly one class). For @@ -81804,7 +87849,7 @@ Returns: A `Tensor` that contains the softmax cross entropy loss. Its type is the same as `logits` and its shape is the same as `labels` except that it does not have the last dimension of `labels`." -9605,sparse_softmax_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_ops.py,4005,function,"Computes sparse softmax cross entropy between `logits` and `labels`. +9014,sparse_softmax_cross_entropy_with_logits,tensorflow/tensorflow/python/ops/nn_ops.py,4005,function,"Computes sparse softmax cross entropy between `logits` and `labels`. Measures the probability error in discrete classification tasks in which the classes are mutually exclusive (each entry is in exactly one class). For @@ -81852,7 +87897,7 @@ Returns: Raises: ValueError: If logits are scalars (need to have rank >= 1) or if the rank of the labels is not equal to the rank of the logits minus one." -9606,sparse_softmax_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4131,function,"Computes sparse softmax cross entropy between `logits` and `labels`. +9015,sparse_softmax_cross_entropy_with_logits_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4131,function,"Computes sparse softmax cross entropy between `logits` and `labels`. Measures the probability error in discrete classification tasks in which the classes are mutually exclusive (each entry is in exactly one class). For @@ -81897,7 +87942,7 @@ Returns: Raises: ValueError: If logits are scalars (need to have rank >= 1) or if the rank of the labels is not equal to the rank of the logits minus one." -9607,avg_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4184,function,"Performs the avg pooling on the input. +9016,avg_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4184,function,"Performs the avg pooling on the input. Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. @@ -81921,7 +87966,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The average pooled output tensor." -9608,avg_pool,tensorflow/tensorflow/python/ops/nn_ops.py,4247,function,"Performs the average pooling on the input. +9017,avg_pool,tensorflow/tensorflow/python/ops/nn_ops.py,4247,function,"Performs the average pooling on the input. Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. @@ -81941,7 +87986,7 @@ Args: Returns: A `Tensor` with the same type as `value`. The average pooled output tensor." -9609,avg_pool2d,tensorflow/tensorflow/python/ops/nn_ops.py,4292,function,"Performs the average pooling on the input. +9018,avg_pool2d,tensorflow/tensorflow/python/ops/nn_ops.py,4292,function,"Performs the average pooling on the input. Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. @@ -81960,7 +88005,7 @@ Args: Returns: A `Tensor` with the same type as `value`. The average pooled output tensor." -9610,avg_pool1d,tensorflow/tensorflow/python/ops/nn_ops.py,4332,function,"Performs the average pooling on the input. +9019,avg_pool1d,tensorflow/tensorflow/python/ops/nn_ops.py,4332,function,"Performs the average pooling on the input. Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. @@ -81981,7 +88026,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9611,avg_pool3d,tensorflow/tensorflow/python/ops/nn_ops.py,4378,function,"Performs the average pooling on the input. +9020,avg_pool3d,tensorflow/tensorflow/python/ops/nn_ops.py,4378,function,"Performs the average pooling on the input. Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. @@ -82000,7 +88045,7 @@ Args: Returns: A `Tensor` with the same type as `value`. The average pooled output tensor." -9612,max_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4419,function,"Performs the max pooling on the input. +9021,max_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4419,function,"Performs the max pooling on the input. Args: input: Tensor of rank N+2, of shape `[batch_size] + input_spatial_shape + @@ -82021,7 +88066,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9613,max_pool,tensorflow/tensorflow/python/ops/nn_ops.py,4480,function,"Performs the max pooling on the input. +9022,max_pool,tensorflow/tensorflow/python/ops/nn_ops.py,4480,function,"Performs the max pooling on the input. Args: value: A 4-D `Tensor` of the format specified by `data_format`. @@ -82038,7 +88083,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9614,max_pool1d,tensorflow/tensorflow/python/ops/nn_ops.py,4530,function,"Performs the max pooling on the input. +9023,max_pool1d,tensorflow/tensorflow/python/ops/nn_ops.py,4530,function,"Performs the max pooling on the input. Note internally this op reshapes and uses the underlying 2d operation. @@ -82056,7 +88101,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9615,max_pool2d,tensorflow/tensorflow/python/ops/nn_ops.py,4575,function,"Performs the max pooling on the input. +9024,max_pool2d,tensorflow/tensorflow/python/ops/nn_ops.py,4575,function,"Performs the max pooling on the input. Args: input: A 4-D `Tensor` of the format specified by `data_format`. @@ -82072,7 +88117,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9616,max_pool3d,tensorflow/tensorflow/python/ops/nn_ops.py,4614,function,"Performs the max pooling on the input. +9025,max_pool3d,tensorflow/tensorflow/python/ops/nn_ops.py,4614,function,"Performs the max pooling on the input. Args: input: A 5-D `Tensor` of the format specified by `data_format`. @@ -82093,7 +88138,7 @@ Args: Returns: A `Tensor` of format specified by `data_format`. The max pooled output tensor." -9617,max_pool_with_argmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4657,function,"Performs max pooling on the input and outputs both max values and indices. +9026,max_pool_with_argmax_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4657,function,"Performs max pooling on the input and outputs both max values and indices. The indices in `argmax` are flattened, so that a maximum value at position `[b, y, x, c]` becomes flattened index: `(y * width + x) * channels + c` if @@ -82134,12 +88179,8 @@ Returns: output: A `Tensor`. Has the same type as `input`. argmax: A `Tensor` of type `output_dtype`." -9618,max_pool_with_argmax_v1,tensorflow/tensorflow/python/ops/nn_ops.py,4727,function, -9619,_calc_conv3d_flops,tensorflow/tensorflow/python/ops/nn_ops.py,4758,function,Calculates the compute resources needed for Conv3D. -9620,_calc_conv_flops,tensorflow/tensorflow/python/ops/nn_ops.py,4777,function,Calculates the compute resources needed for Conv2D. -9621,_calc_depthwise_conv_flops,tensorflow/tensorflow/python/ops/nn_ops.py,4796,function,Calculates the compute resources needed for DepthwiseConv2dNative. -9622,_calc_bias_add_flops,tensorflow/tensorflow/python/ops/nn_ops.py,4812,function,Calculates the computing needed for BiasAdd. -9623,xw_plus_b,tensorflow/tensorflow/python/ops/nn_ops.py,4822,function,"Computes matmul(x, weights) + biases. +9027,max_pool_with_argmax_v1,tensorflow/tensorflow/python/ops/nn_ops.py,4727,function, +9028,xw_plus_b,tensorflow/tensorflow/python/ops/nn_ops.py,4822,function,"Computes matmul(x, weights) + biases. Args: x: a 2D tensor. Dimensions typically: batch, in_units @@ -82151,7 +88192,7 @@ Args: Returns: A 2-D Tensor computing matmul(x, weights) + biases. Dimensions typically: batch, out_units." -9624,xw_plus_b_v1,tensorflow/tensorflow/python/ops/nn_ops.py,4844,function,"Computes matmul(x, weights) + biases. +9029,xw_plus_b_v1,tensorflow/tensorflow/python/ops/nn_ops.py,4844,function,"Computes matmul(x, weights) + biases. This is a deprecated version of that will soon be removed. @@ -82165,8 +88206,7 @@ Args: Returns: A 2-D Tensor computing matmul(x, weights) + biases. Dimensions typically: batch, out_units." -9625,_get_noise_shape,tensorflow/tensorflow/python/ops/nn_ops.py,4868,function, -9626,dropout,tensorflow/tensorflow/python/ops/nn_ops.py,4898,function,"Computes dropout. +9030,dropout,tensorflow/tensorflow/python/ops/nn_ops.py,4898,function,"Computes dropout. For each element of `x`, with probability `rate`, outputs `0`, and otherwise scales up the input by `1 / (1-rate)`. The scaling is such that the expected @@ -82197,7 +88237,7 @@ Returns: Raises: ValueError: If `rate` is not in `[0, 1)` or if `x` is not a floating point tensor." -9627,dropout_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4950,function,"Computes dropout: randomly sets elements to zero to prevent overfitting. +9031,dropout_v2,tensorflow/tensorflow/python/ops/nn_ops.py,4950,function,"Computes dropout: randomly sets elements to zero to prevent overfitting. Note: The behavior of dropout has changed between TensorFlow 1.x and 2.x. When converting 1.x code, please use named arguments to ensure behavior stays @@ -82267,7 +88307,7 @@ Raises: ValueError: If `rate` is not in `[0, 1)` or if `x` is not a floating point tensor. `rate=1` is disallowed, because the output would be all zeros, which is likely not what was intended." -9628,top_k,tensorflow/tensorflow/python/ops/nn_ops.py,5072,function,"Finds values and indices of the `k` largest entries for the last dimension. +9032,top_k,tensorflow/tensorflow/python/ops/nn_ops.py,5072,function,"Finds values and indices of the `k` largest entries for the last dimension. If the input is a vector (rank=1), finds the `k` largest entries in the vector and outputs their values and indices as vectors. Thus `values[j]` is the @@ -82291,7 +88331,7 @@ Args: Returns: values: The `k` largest elements along each last dimensional slice. indices: The indices of `values` within the last dimension of `input`." -9629,nth_element,tensorflow/tensorflow/python/ops/nn_ops.py,5101,function,"Finds values of the `n`-th smallest value for the last dimension. +9033,nth_element,tensorflow/tensorflow/python/ops/nn_ops.py,5101,function,"Finds values of the `n`-th smallest value for the last dimension. Note that n is zero-indexed. @@ -82316,7 +88356,7 @@ Args: Returns: A `Tensor`. Has the same type as `input`. The `n`-th order statistic along each last dimensional slice." -9630,fractional_max_pool,tensorflow/tensorflow/python/ops/nn_ops.py,5135,function,"Performs fractional max pooling on the input. +9034,fractional_max_pool,tensorflow/tensorflow/python/ops/nn_ops.py,5135,function,"Performs fractional max pooling on the input. This is a deprecated version of `fractional_max_pool`. @@ -82385,7 +88425,7 @@ References: Fractional Max-Pooling: [Graham, 2015](https://arxiv.org/abs/1412.6071) ([pdf](https://arxiv.org/pdf/1412.6071.pdf))" -9631,fractional_max_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5220,function,"Performs fractional max pooling on the input. +9035,fractional_max_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5220,function,"Performs fractional max pooling on the input. Fractional max pooling is slightly different than regular max pooling. In regular max pooling, you downsize an input set by taking the maximum value of @@ -82449,7 +88489,7 @@ References: Fractional Max-Pooling: [Graham, 2015](https://arxiv.org/abs/1412.6071) ([pdf](https://arxiv.org/pdf/1412.6071.pdf))" -9632,fractional_avg_pool,tensorflow/tensorflow/python/ops/nn_ops.py,5308,function,"Performs fractional average pooling on the input. +9036,fractional_avg_pool,tensorflow/tensorflow/python/ops/nn_ops.py,5308,function,"Performs fractional average pooling on the input. This is a deprecated version of `fractional_avg_pool`. @@ -82497,7 +88537,7 @@ References: Fractional Max-Pooling: [Graham, 2015](https://arxiv.org/abs/1412.6071) ([pdf](https://arxiv.org/pdf/1412.6071.pdf))" -9633,fractional_avg_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5372,function,"Performs fractional average pooling on the input. +9037,fractional_avg_pool_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5372,function,"Performs fractional average pooling on the input. Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are @@ -82540,8 +88580,7 @@ References: Fractional Max-Pooling: [Graham, 2015](https://arxiv.org/abs/1412.6071) ([pdf](https://arxiv.org/pdf/1412.6071.pdf))" -9634,_calc_dilation2d_flops,tensorflow/tensorflow/python/ops/nn_ops.py,5434,function,Calculates the compute resources needed for Dilation2D. -9635,erosion2d,tensorflow/tensorflow/python/ops/nn_ops.py,5451,function,"Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors. +9038,erosion2d,tensorflow/tensorflow/python/ops/nn_ops.py,5451,function,"Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors. The `value` tensor has shape `[batch, in_height, in_width, depth]` and the `kernel` tensor has shape `[kernel_height, kernel_width, depth]`, i.e., @@ -82585,7 +88624,7 @@ Returns: Raises: ValueError: If the `value` depth does not match `kernel`' shape, or if padding is other than `'VALID'` or `'SAME'`." -9636,erosion2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5511,function,"Computes the grayscale erosion of 4-D `value` and 3-D `filters` tensors. +9039,erosion2d_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5511,function,"Computes the grayscale erosion of 4-D `value` and 3-D `filters` tensors. The `value` tensor has shape `[batch, in_height, in_width, depth]` and the `filters` tensor has shape `[filters_height, filters_width, depth]`, i.e., @@ -82630,7 +88669,7 @@ Returns: Raises: ValueError: If the `value` depth does not match `filters`' shape, or if padding is other than `'VALID'` or `'SAME'`." -9637,in_top_k,tensorflow/tensorflow/python/ops/nn_ops.py,5581,function,"Says whether the targets are in the top `K` predictions. +9040,in_top_k,tensorflow/tensorflow/python/ops/nn_ops.py,5581,function,"Says whether the targets are in the top `K` predictions. This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the prediction for the target class is finite (not inf, -inf, or nan) and among @@ -82657,30 +88696,8 @@ Args: Returns: A `Tensor` of type `bool`. Computed Precision at `k` as a `bool Tensor`." -9638,in_top_k_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5616,function, -9639,ZeroFractionTest,tensorflow/tensorflow/python/ops/nn_test.py,48,class, -9640,SoftmaxTest,tensorflow/tensorflow/python/ops/nn_test.py,98,class, -9641,LogPoissonLossTest,tensorflow/tensorflow/python/ops/nn_test.py,158,class, -9642,LogSoftmaxTest,tensorflow/tensorflow/python/ops/nn_test.py,201,class, -9643,L2LossTest,tensorflow/tensorflow/python/ops/nn_test.py,245,class, -9644,L2NormalizeTest,tensorflow/tensorflow/python/ops/nn_test.py,270,class, -9645,DropoutTest,tensorflow/tensorflow/python/ops/nn_test.py,333,class, -9646,ComputeSampledLogitsTest,tensorflow/tensorflow/python/ops/nn_test.py,543,class, -9647,CReluTest,tensorflow/tensorflow/python/ops/nn_test.py,986,class, -9648,ReluTest,tensorflow/tensorflow/python/ops/nn_test.py,997,class, -9649,LeakyReluTest,tensorflow/tensorflow/python/ops/nn_test.py,1019,class, -9650,SwishTest,tensorflow/tensorflow/python/ops/nn_test.py,1062,class, -9651,MomentsTest,tensorflow/tensorflow/python/ops/nn_test.py,1091,class, -9652,DataFormatDimMapTest,tensorflow/tensorflow/python/ops/nn_test.py,1160,class, -9653,DataFormatVectorPermuteTest,tensorflow/tensorflow/python/ops/nn_test.py,1220,class, -9654,AvgPoolTest,tensorflow/tensorflow/python/ops/nn_test.py,1322,class, -9655,MaxPoolTest,tensorflow/tensorflow/python/ops/nn_test.py,1407,class, -9656,ConvolutionTest,tensorflow/tensorflow/python/ops/nn_test.py,1504,class, -9657,ConvTransposeTest,tensorflow/tensorflow/python/ops/nn_test.py,1517,class, -9658,RaggedEmbeddingTest,tensorflow/tensorflow/python/ops/nn_test.py,1598,class, -9659,SigmoidCrossEntropyWithLogitsTest,tensorflow/tensorflow/python/ops/nn_xent_test.py,38,class, -9660,WeightedCrossEntropyTest,tensorflow/tensorflow/python/ops/nn_xent_test.py,114,class, -9661,verify_tensor_all_finite,tensorflow/tensorflow/python/ops/numerics.py,35,function,"Assert that the tensor does not contain any NaN's or Inf's. +9041,in_top_k_v2,tensorflow/tensorflow/python/ops/nn_ops.py,5616,function, +9042,verify_tensor_all_finite,tensorflow/tensorflow/python/ops/numerics.py,35,function,"Assert that the tensor does not contain any NaN's or Inf's. Args: t: Tensor to check. @@ -82691,7 +88708,7 @@ Args: Returns: Same tensor as `t`." -9662,verify_tensor_all_finite_v2,tensorflow/tensorflow/python/ops/numerics.py,56,function,"Assert that the tensor does not contain any NaN's or Inf's. +9043,verify_tensor_all_finite_v2,tensorflow/tensorflow/python/ops/numerics.py,56,function,"Assert that the tensor does not contain any NaN's or Inf's. Args: x: Tensor to check. @@ -82700,7 +88717,7 @@ Args: Returns: Same tensor as `x`." -9663,add_check_numerics_ops,tensorflow/tensorflow/python/ops/numerics.py,76,function,"Connect a `tf.debugging.check_numerics` to every floating point tensor. +9044,add_check_numerics_ops,tensorflow/tensorflow/python/ops/numerics.py,76,function,"Connect a `tf.debugging.check_numerics` to every floating point tensor. `check_numerics` operations themselves are added for each `half`, `float`, or `double` tensor in the current default graph. For all ops in the graph, the @@ -82724,9 +88741,9 @@ Not compatible with eager execution. To check for `Inf`s and `NaN`s under eager execution, call `tf.debugging.enable_check_numerics()` once before executing the checked operations. @end_compatibility" -9664,is_differentiable,tensorflow/tensorflow/python/ops/op_selector.py,25,function, -9665,is_iterable,tensorflow/tensorflow/python/ops/op_selector.py,32,function,Return true if the object is iterable. -9666,concatenate_unique,tensorflow/tensorflow/python/ops/op_selector.py,43,function,"Add all the elements of `lb` to `la` if they are not there already. +9045,is_differentiable,tensorflow/tensorflow/python/ops/op_selector.py,25,function, +9046,is_iterable,tensorflow/tensorflow/python/ops/op_selector.py,32,function,Return true if the object is iterable. +9047,concatenate_unique,tensorflow/tensorflow/python/ops/op_selector.py,43,function,"Add all the elements of `lb` to `la` if they are not there already. The elements added to `la` maintain ordering with respect to `lb`. @@ -82735,7 +88752,7 @@ Args: lb: List of Python objects. Returns: `la`: The list `la` with missing elements from `lb`." -9667,get_tensors,tensorflow/tensorflow/python/ops/op_selector.py,62,function,"get all the tensors which are input or output of an op in the graph. +9048,get_tensors,tensorflow/tensorflow/python/ops/op_selector.py,62,function,"get all the tensors which are input or output of an op in the graph. Args: graph: a `tf.Graph`. @@ -82743,7 +88760,7 @@ Returns: A list of `tf.Tensor`. Raises: TypeError: if graph is not a `tf.Graph`." -9668,get_unique_graph,tensorflow/tensorflow/python/ops/op_selector.py,80,function,"Return the unique graph used by the all the elements in tops. +9049,get_unique_graph,tensorflow/tensorflow/python/ops/op_selector.py,80,function,"Return the unique graph used by the all the elements in tops. Args: tops: list of elements to check (usually a list of tf.Operation and/or @@ -82757,13 +88774,13 @@ Returns: Raises: TypeError: if tops is not a iterable of tf.Operation. ValueError: if the graph is not unique." -9669,check_graphs,tensorflow/tensorflow/python/ops/op_selector.py,118,function,"Check that all the element in args belong to the same graph. +9050,check_graphs,tensorflow/tensorflow/python/ops/op_selector.py,118,function,"Check that all the element in args belong to the same graph. Args: *args: a list of object with a obj.graph property. Raises: ValueError: if all the elements do not belong to the same graph." -9670,make_list_of_t,tensorflow/tensorflow/python/ops/op_selector.py,134,function,"Convert ts to a list of `tf.Tensor`. +9051,make_list_of_t,tensorflow/tensorflow/python/ops/op_selector.py,134,function,"Convert ts to a list of `tf.Tensor`. Args: ts: can be an iterable of `tf.Tensor`, a `tf.Graph` or a single tensor. @@ -82775,7 +88792,7 @@ Returns: Raises: TypeError: if `ts` cannot be converted to a list of `tf.Tensor` or, if `check_graph` is `True`, if all the ops do not belong to the same graph." -9671,get_generating_ops,tensorflow/tensorflow/python/ops/op_selector.py,164,function,"Return all the generating ops of the tensors in `ts`. +9052,get_generating_ops,tensorflow/tensorflow/python/ops/op_selector.py,164,function,"Return all the generating ops of the tensors in `ts`. Args: ts: a list of `tf.Tensor` @@ -82783,7 +88800,7 @@ Returns: A list of all the generating `tf.Operation` of the tensors in `ts`. Raises: TypeError: if `ts` cannot be converted to a list of `tf.Tensor`." -9672,get_consuming_ops,tensorflow/tensorflow/python/ops/op_selector.py,178,function,"Return all the consuming ops of the tensors in ts. +9053,get_consuming_ops,tensorflow/tensorflow/python/ops/op_selector.py,178,function,"Return all the consuming ops of the tensors in ts. Args: ts: a list of `tf.Tensor` @@ -82791,7 +88808,7 @@ Returns: A list of all the consuming `tf.Operation` of the tensors in `ts`. Raises: TypeError: if ts cannot be converted to a list of `tf.Tensor`." -9673,make_list_of_op,tensorflow/tensorflow/python/ops/op_selector.py,197,function,"Convert ops to a list of `tf.Operation`. +9054,make_list_of_op,tensorflow/tensorflow/python/ops/op_selector.py,197,function,"Convert ops to a list of `tf.Operation`. Args: tops: can be an iterable of `tf.Operation`, a `tf.Graph` or a single @@ -82805,8 +88822,7 @@ Raises: TypeError: if tops cannot be converted to a list of `tf.Operation` or, if `check_graph` is `True`, if all the ops do not belong to the same graph." -9674,_get_inputs,tensorflow/tensorflow/python/ops/op_selector.py,229,function, -9675,get_backward_walk_ops,tensorflow/tensorflow/python/ops/op_selector.py,237,function,"Do a backward graph walk and return all the visited ops. +9055,get_backward_walk_ops,tensorflow/tensorflow/python/ops/op_selector.py,237,function,"Do a backward graph walk and return all the visited ops. Args: seed_ops: an iterable of operations from which the backward graph @@ -82828,19 +88844,9 @@ Returns: Raises: TypeError: if `seed_ops` or `within_ops` cannot be converted to a list of `tf.Operation`." -9676,UnliftableError,tensorflow/tensorflow/python/ops/op_selector.py,311,class,Raised if a Tensor cannot be lifted from the graph. -9677,_as_operation,tensorflow/tensorflow/python/ops/op_selector.py,318,function, -9678,graph_inputs,tensorflow/tensorflow/python/ops/op_selector.py,324,function, -9679,_path_from,tensorflow/tensorflow/python/ops/op_selector.py,328,function,"Find one path from `from_op` to `tensor`, ignoring `sources`. - -Args: - from_op: A `tf.Operation`. - tensor: A `tf.Operation` or `tf.Tensor`. - sources: A list of `tf.Tensor`. - -Returns: - A python string containing the path, or ""??"" if none is found." -9680,map_subgraph,tensorflow/tensorflow/python/ops/op_selector.py,368,function,"Walk a Graph and capture the subgraph between init_tensor and sources. +9056,UnliftableError,tensorflow/tensorflow/python/ops/op_selector.py,311,class,Raised if a Tensor cannot be lifted from the graph. +9057,graph_inputs,tensorflow/tensorflow/python/ops/op_selector.py,324,function, +9058,map_subgraph,tensorflow/tensorflow/python/ops/op_selector.py,368,function,"Walk a Graph and capture the subgraph between init_tensor and sources. Note: This function mutates visited_ops and op_outputs. @@ -82862,14 +88868,11 @@ Returns: Raises: UnliftableError: if init_tensor depends on a placeholder which is not in sources and add_sources is False." -9681,SelectTest,tensorflow/tensorflow/python/ops/op_selector_test.py,28,class, -9682,_OptionalFromValueGrad,tensorflow/tensorflow/python/ops/optional_grad.py,26,function, -9683,_OptionalGetValueGrad,tensorflow/tensorflow/python/ops/optional_grad.py,32,function, -9684,VarLenFeature,tensorflow/tensorflow/python/ops/parsing_config.py,48,class,"Configuration for parsing a variable-length input feature. +9059,VarLenFeature,tensorflow/tensorflow/python/ops/parsing_config.py,48,class,"Configuration for parsing a variable-length input feature. Fields: dtype: Data type of input." -9685,RaggedFeature,tensorflow/tensorflow/python/ops/parsing_config.py,58,class,"Configuration for passing a RaggedTensor input feature. +9060,RaggedFeature,tensorflow/tensorflow/python/ops/parsing_config.py,58,class,"Configuration for passing a RaggedTensor input feature. `value_key` specifies the feature key for a variable-length list of values; and `partitions` specifies zero or more feature keys for partitioning those @@ -82985,7 +88988,7 @@ Fields: One of `int32` or `int64`. Defaults to `int32`. validate: (Optional.) Boolean indicating whether or not to validate that the input values form a valid RaggedTensor. Defaults to `False`." -9686,SparseFeature,tensorflow/tensorflow/python/ops/parsing_config.py,224,class,"Configuration for parsing a sparse input feature from an `Example`. +9061,SparseFeature,tensorflow/tensorflow/python/ops/parsing_config.py,224,class,"Configuration for parsing a sparse input feature from an `Example`. Note, preferably use `VarLenFeature` (possibly in combination with a `SequenceExample`) in order to parse out `SparseTensor`s instead of @@ -83048,7 +89051,7 @@ Fields: already_sorted: A Python boolean to specify whether the values in `value_key` are already sorted by their index position. If so skip sorting. False by default (optional)." -9687,FixedLenFeature,tensorflow/tensorflow/python/ops/parsing_config.py,299,class,"Configuration for parsing a fixed-length input feature. +9062,FixedLenFeature,tensorflow/tensorflow/python/ops/parsing_config.py,299,class,"Configuration for parsing a fixed-length input feature. To treat sparse input as dense, provide a `default_value`; otherwise, the parse functions will fail on any examples missing this feature. @@ -83058,7 +89061,7 @@ Fields: dtype: Data type of input. default_value: Value to be used if an example is missing this feature. It must be compatible with `dtype` and of the specified `shape`." -9688,FixedLenSequenceFeature,tensorflow/tensorflow/python/ops/parsing_config.py,320,class,"Configuration for parsing a variable-length input feature into a `Tensor`. +9063,FixedLenSequenceFeature,tensorflow/tensorflow/python/ops/parsing_config.py,320,class,"Configuration for parsing a variable-length input feature into a `Tensor`. The resulting `Tensor` of parsing a single `SequenceExample` or `Example` has a static `shape` of `[None] + shape` and the specified `dtype`. @@ -83081,108 +89084,7 @@ Fields: maximum length. Irrelevant for parsing a single `Example` or `SequenceExample`. Defaults to """" for dtype string and 0 otherwise (optional)." -9689,_ParseOpParams,tensorflow/tensorflow/python/ops/parsing_config.py,353,class,"Raw parameters used by `gen_parsing_ops`. - -Attributes: - sparse_keys: A list of string keys in the examples' features. The results - for these keys will be returned as `SparseTensor` objects. - sparse_types: A list of `DTypes` of the same length as `sparse_keys`. Only - `tf.float32` (`FloatList`), `tf.int64` (`Int64List`), and `tf.string` - (`BytesList`) are supported. - dense_keys: A list of string keys in the examples' features. The results for - these keys will be returned as `Tensor`s - dense_types: A list of DTypes of the same length as `dense_keys`. Only - `tf.float32` (`FloatList`), `tf.int64` (`Int64List`), and `tf.string` - (`BytesList`) are supported. - dense_defaults: A dict mapping string keys to `Tensor`s. The keys of the - dict must match the dense_keys of the feature. - dense_shapes: A list of tuples with the same length as `dense_keys`. The - shape of the data for each dense feature referenced by `dense_keys`. - Required for any input tensors identified by `dense_keys`. Must be either - fully defined, or may contain an unknown first dimension. An unknown first - dimension means the feature is treated as having a variable number of - blocks, and the output shape along this dimension is considered unknown at - graph build time. Padding is applied for minibatch elements smaller than - the maximum number of blocks for the given feature along this dimension. - ragged_keys: A list of string keys in the examples' features. The - results for these keys will be returned as `RaggedTensor` objects. - ragged_value_types: A list of `DTypes` of the same length as `ragged_keys`, - specifying the value type for each ragged feature. Must be one of: - `tf.float32`, `tf.int64`, `tf.string`. - ragged_split_types: A list of `DTypes` of the same length as `ragged_keys`, - specifying the row_splits type for each ragged feature. Must be one of: - `tf.int32`, `tf.int64`. - dense_shapes_as_proto: dense_shapes converted to TensorShapeProto. - dense_defaults_vec: A vector of `Tensor`s containing the default values, - corresponding 1:1 with `dense_keys`. - num_features: The total number of feature keys." -9690,_construct_tensors_for_composite_features,tensorflow/tensorflow/python/ops/parsing_config.py,661,function,"Creates tensors for SparseFeatures and RaggedFeatures. - -Constructs new dict based on `tensor_dict`. - -For each key in `features` whose value is a `SparseFeature`: - - * Looks up that SparseFeature's value_key and index_keys in tensor_dict. - * Uses those tensors to construct a single SparseTensor. - * Stores that SparseTensor in the output dict under the same key. - -For each key in `features` whose value is a `RaggedFeature`: - - * Looks up that RaggedFeature's value_key and partition keys in tensor_dict. - * Uses those tensors to construct a single RaggedTensor. - * Stores that RaggedTensor in the output dict under the same key. - -For any other key in `features`: - - * Copies that key and its value from tensor_dict to the output dictionary. - -Args: - features: A `dict` mapping feature keys to `SparseFeature` or - `RaggedFeature` values. Values of other types will be ignored. - tensor_dict: A `dict` mapping feature keys to `Tensor`, `SparseTensor`, and - `RaggedTensor` values. Expected to contain keys of the `SparseFeature`s' - `index_key`s and `value_key`s and mapping them to `SparseTensor`s. - -Returns: - A `dict` mapping feature keys to `Tensor`, `SparseTensor`, and - `RaggedTensor` values. Similar to `tensor_dict` except each `SparseFeature` - in `features` results in a single `SparseTensor`; and each `RaggedFeature` - in `features` results in a single `RaggedTensor`." -9691,_add_ragged_partition,tensorflow/tensorflow/python/ops/parsing_config.py,752,function,"Creates a RaggedTensor from a values tensor and a partition tensor. - -Args: - values: The values tensor for the new RaggedTensor. - partition: The partition configuration object. Specifies the key that - should be used to look up the partition tensor (unless partition is a - RaggedFeature.UniformRowLength, in which case there is no partition - tensor). - tensor_dict: The dictionary mapping keys to tensors. - row_splits_dtype: The dtype for the partition tensor. - validate: Whether to validate that the values form a valid RaggedTensor. - -Returns: - A new RaggedTensor formed from the values and partition tensors." -9692,_add_batched_ragged_partition,tensorflow/tensorflow/python/ops/parsing_config.py,797,function,"Adds a batched ragged partition tensor to a batched ragged tensor. - -Args: - rt: A RaggedTensor with shape [batch_size, ...]. - partition: The partition configuration object. Specifies the key that - should be used to look up the partition tensor (unless partition is a - RaggedFeature.UniformRowLength, in which case there is no partition - tensor). The specified tensor must have shape [batch_size, ...]. - tensor_dict: The dictionary mapping keys to tensors. - feature_key: The name of the feature being parsed (for error messages). - validate: Whether to validate that the values form a valid RaggedTensor. - outer_splits: If not None, then we have two batch dimensions, and this - is the row-splits for the collapsed batch dimension. Every partition - tensor must have an outer row_splits that matches this value. - -Returns: - A new RaggedTensor where each batch item `rt[i]` has been partitioned - using the `partition_t[i]`." -9693,_build_ragged_tensors,tensorflow/tensorflow/python/ops/parsing_config.py,879,function,Builds RaggedTensors from the outputs of a parse op. -9694,_prepend_none_dimension,tensorflow/tensorflow/python/ops/parsing_ops.py,61,function,Returns a copy of features with adjusted FixedLenSequenceFeature shapes. -9695,parse_example_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,82,function,"Parses `Example` protos into a `dict` of tensors. +9064,parse_example_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,82,function,"Parses `Example` protos into a `dict` of tensors. Parses a number of serialized [`Example`](https://www.tensorflow.org/code/tensorflow/core/example/example.proto) protos given in `serialized`. We refer to `serialized` as a batch with @@ -83403,20 +89305,8 @@ Returns: Raises: ValueError: if any feature is invalid." -9696,parse_example,tensorflow/tensorflow/python/ops/parsing_ops.py,320,function, -9697,_parse_example_raw,tensorflow/tensorflow/python/ops/parsing_ops.py,327,function,"Parses `Example` protos. - -Args: - serialized: A vector (1-D Tensor) of strings, a batch of binary - serialized `Example` protos. - names: A vector (1-D Tensor) of strings (optional), the names of - the serialized protos. - params: A `ParseOpParams` containing the parameters for the parse op. - name: A name for this operation (optional). - -Returns: - A `dict` mapping keys to `Tensor`s and `SparseTensor`s and `RaggedTensor`s." -9698,parse_single_example,tensorflow/tensorflow/python/ops/parsing_ops.py,380,function,"Parses a single `Example` proto. +9065,parse_example,tensorflow/tensorflow/python/ops/parsing_ops.py,320,function, +9066,parse_single_example,tensorflow/tensorflow/python/ops/parsing_ops.py,380,function,"Parses a single `Example` proto. Similar to `parse_example`, except: @@ -83444,7 +89334,7 @@ Returns: Raises: ValueError: if any feature is invalid." -9699,parse_single_example_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,415,function,"Parses a single `Example` proto. +9067,parse_single_example_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,415,function,"Parses a single `Example` proto. Similar to `parse_example`, except: @@ -83472,7 +89362,7 @@ Returns: Raises: ValueError: if any feature is invalid." -9700,parse_sequence_example,tensorflow/tensorflow/python/ops/parsing_ops.py,457,function,"Parses a batch of `SequenceExample` protos. +9068,parse_sequence_example,tensorflow/tensorflow/python/ops/parsing_ops.py,457,function,"Parses a batch of `SequenceExample` protos. Parses a vector of serialized [`SequenceExample`](https://www.tensorflow.org/code/tensorflow/core/example/example.proto) @@ -83559,28 +89449,7 @@ Returns: Raises: ValueError: if any feature is invalid." -9701,_parse_sequence_example_raw,tensorflow/tensorflow/python/ops/parsing_ops.py,576,function,"Parses a vector of `SequenceExample` protos. - -Args: - serialized: A vector (1-D Tensor) of type string, containing binary - serialized `SequenceExample` protos. - debug_name: A vector (1-D Tensor) of strings (optional), the names of the - serialized protos. - context: A `ParseOpParams` containing the parameters for the parse - op for the context features. - feature_list: A `ParseOpParams` containing the parameters for the - parse op for the feature_list features. - name: A name for this operation (optional). - -Returns: - A tuple of three `dict`s, each mapping keys to `Tensor`s, `SparseTensor`s, - and `RaggedTensor`s. The first dict contains the context key/values, the - second dict contains the feature_list key/values, and the final dict - contains the lengths of any dense feature_list features. - -Raises: - TypeError: if feature_list.dense_defaults is not either None or a dict." -9702,parse_single_sequence_example,tensorflow/tensorflow/python/ops/parsing_ops.py,702,function,"Parses a single `SequenceExample` proto. +9069,parse_single_sequence_example,tensorflow/tensorflow/python/ops/parsing_ops.py,702,function,"Parses a single `SequenceExample` proto. Parses a single serialized [`SequenceExample`](https://www.tensorflow.org/code/tensorflow/core/example/example.proto) proto given in `serialized`. @@ -83658,27 +89527,7 @@ Returns: Raises: ValueError: if any feature is invalid." -9703,_parse_single_sequence_example_raw,tensorflow/tensorflow/python/ops/parsing_ops.py,811,function,"Parses a single `SequenceExample` proto. - -Args: - serialized: A scalar (0-D Tensor) of type string, a single binary serialized - `SequenceExample` proto. - context: A `ParseOpParams` containing the parameters for the parse op for - the context features. - feature_list: A `ParseOpParams` containing the parameters for the parse op - for the feature_list features. - debug_name: A scalar (0-D Tensor) of strings (optional), the name of the - serialized proto. - name: A name for this operation (optional). - -Returns: - A tuple of two `dict`s, each mapping keys to `Tensor`s and `SparseTensor`s. - The first dict contains the context key/values. - The second dict contains the feature_list key/values. - -Raises: - TypeError: if feature_list.dense_defaults is not either None or a dict." -9704,decode_raw,tensorflow/tensorflow/python/ops/parsing_ops.py,846,function,"Convert raw byte strings into tensors. +9070,decode_raw,tensorflow/tensorflow/python/ops/parsing_ops.py,846,function,"Convert raw byte strings into tensors. Args: input_bytes: @@ -83700,7 +89549,7 @@ Args: Returns: A `Tensor` object storing the decoded bytes." -9705,decode_raw_v1,tensorflow/tensorflow/python/ops/parsing_ops.py,892,function,"Convert raw byte strings into tensors. +9071,decode_raw_v1,tensorflow/tensorflow/python/ops/parsing_ops.py,892,function,"Convert raw byte strings into tensors. Args: input_bytes: @@ -83716,7 +89565,7 @@ Args: Returns: A `Tensor` object storing the decoded bytes." -9706,decode_csv,tensorflow/tensorflow/python/ops/parsing_ops.py,935,function,"Convert CSV records to tensors. Each column maps to one tensor. +9072,decode_csv,tensorflow/tensorflow/python/ops/parsing_ops.py,935,function,"Convert CSV records to tensors. Each column maps to one tensor. RFC 4180 format is expected for the CSV records. (https://tools.ietf.org/html/rfc4180) @@ -83748,7 +89597,7 @@ Returns: Raises: ValueError: If any of the arguments is malformed." -9707,decode_csv_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,984,function,"Convert CSV records to tensors. Each column maps to one tensor. +9073,decode_csv_v2,tensorflow/tensorflow/python/ops/parsing_ops.py,984,function,"Convert CSV records to tensors. Each column maps to one tensor. RFC 4180 format is expected for the CSV records. (https://tools.ietf.org/html/rfc4180) @@ -83780,8 +89629,7 @@ Returns: Raises: ValueError: If any of the arguments is malformed." -9708,_assert_scalar,tensorflow/tensorflow/python/ops/parsing_ops.py,1042,function,"Asserts that `value` is scalar, and returns `value`." -9709,variable_axis_size_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,72,function,"Get a partitioner for VariableScope to keep shards below `max_shard_bytes`. +9074,variable_axis_size_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,72,function,"Get a partitioner for VariableScope to keep shards below `max_shard_bytes`. This partitioner will shard a Variable along one axis, attempting to keep the maximum shard size below `max_shard_bytes`. In practice, this is not @@ -83810,7 +89658,7 @@ Returns: Raises: ValueError: If any of the byte counts are non-positive." -9710,min_max_variable_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,158,function,"Partitioner to allocate minimum size per slice. +9075,min_max_variable_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,158,function,"Partitioner to allocate minimum size per slice. Returns a partitioner that partitions the variable of given shape and dtype such that each partition has a minimum of `min_slice_size` slice of the @@ -83828,7 +89676,7 @@ Args: Returns: A partition function usable as the `partitioner` argument to `variable_scope` and `get_variable`." -9711,fixed_size_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,222,function,"Partitioner to specify a fixed number of shards along given axis. +9076,fixed_size_partitioner,tensorflow/tensorflow/python/ops/partitioned_variables.py,222,function,"Partitioner to specify a fixed number of shards along given axis. Args: num_shards: `int`, number of shards to partition variable. @@ -83837,7 +89685,7 @@ Args: Returns: A partition function usable as the `partitioner` argument to `variable_scope` and `get_variable`." -9712,create_partitioned_variables,tensorflow/tensorflow/python/ops/partitioned_variables.py,244,function,"Create a list of partitioned variables according to the given `slicing`. +9077,create_partitioned_variables,tensorflow/tensorflow/python/ops/partitioned_variables.py,244,function,"Create a list of partitioned variables according to the given `slicing`. Currently only one dimension of the full variable can be sliced, and the full variable can be reconstructed by the concatenation of the returned @@ -83877,73 +89725,8 @@ Returns: Raises: ValueError: If any of the arguments is malformed." -9713,Conv2DTest,tensorflow/tensorflow/python/ops/quantized_conv_ops_test.py,29,class, -9714,QuantizedOpsTest,tensorflow/tensorflow/python/ops/quantized_ops_test.py,29,class, -9715,add_leading_unit_dimensions,tensorflow/tensorflow/python/ops/random_grad.py,33,function, -9716,_RandomGammaGrad,tensorflow/tensorflow/python/ops/random_grad.py,41,function,"Returns the gradient of a Gamma sample w.r.t. alpha. - -The gradient is computed using implicit differentiation -(Figurnov et al., 2018). - -Args: - op: A `RandomGamma` operation. We assume that the inputs to the operation - are `shape` and `alpha` tensors, and the output is the `sample` tensor. - grad: The incoming gradient `dloss / dsample` of the same shape as - `op.outputs[0]`. - -Returns: - A `Tensor` with derivatives `dloss / dalpha`. - -References: - Implicit Reparameterization Gradients: - [Figurnov et al., 2018] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) - ([pdf] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -9717,_StatelessRandomGammaV2Grad,tensorflow/tensorflow/python/ops/random_grad.py,81,function,"Returns the gradient of a Gamma sample w.r.t. alpha. - -The gradient is computed using implicit differentiation -(Figurnov et al., 2018). - -Args: - op: A `StatelessRandomGamma` operation. We assume that the inputs to the - operation are `shape`, `seed` and `alpha` tensors, and the output is the - `sample` tensor. - grad: The incoming gradient `dloss / dsample` of the same shape as - `op.outputs[0]`. - -Returns: - A `Tensor` with derivatives `dloss / dalpha`. - -References: - Implicit Reparameterization Gradients: - [Figurnov et al., 2018] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) - ([pdf] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -9718,_Ndtr,tensorflow/tensorflow/python/ops/random_grad.py,124,function,Normal distribution function. -9719,_StatelessParameterizedTruncatedNormalGrad,tensorflow/tensorflow/python/ops/random_grad.py,139,function,"Returns the gradient of a TruncatedNormal sample w.r.t. parameters. - -The gradient is computed using implicit differentiation -(Figurnov et al., 2018). - -Args: - op: A `StatelessParameterizedTruncatedNormal` operation. We assume that the - inputs to the operation are `shape`, `seed`, `mean`, `stddev`, `minval`, - and `maxval` tensors, and the output is the `sample` tensor. - grad: The incoming gradient `dloss / dsample` of the same shape as - `op.outputs[0]`. - -Returns: - A list of `Tensor` with derivates with respect to each parameter. - -References: - Implicit Reparameterization Gradients: - [Figurnov et al., 2018] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) - ([pdf] - (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -9720,random_normal,tensorflow/tensorflow/python/ops/random_ops.py,46,function,"Outputs random values from a normal distribution. +9078,add_leading_unit_dimensions,tensorflow/tensorflow/python/ops/random_grad.py,33,function, +9079,random_normal,tensorflow/tensorflow/python/ops/random_ops.py,46,function,"Outputs random values from a normal distribution. Example that generates a new set of random values every time: @@ -83978,7 +89761,7 @@ Args: Returns: A tensor of the specified shape filled with random normal values." -9721,parameterized_truncated_normal,tensorflow/tensorflow/python/ops/random_ops.py,104,function,"Outputs random values from a truncated normal distribution. +9080,parameterized_truncated_normal,tensorflow/tensorflow/python/ops/random_ops.py,104,function,"Outputs random values from a truncated normal distribution. The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard @@ -84003,7 +89786,7 @@ Args: Returns: A tensor of the specified shape filled with random truncated normal values." -9722,truncated_normal,tensorflow/tensorflow/python/ops/random_ops.py,162,function,"Outputs random values from a truncated normal distribution. +9081,truncated_normal,tensorflow/tensorflow/python/ops/random_ops.py,162,function,"Outputs random values from a truncated normal distribution. The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard @@ -84024,7 +89807,7 @@ Args: Returns: A tensor of the specified shape filled with random truncated normal values." -9723,random_uniform,tensorflow/tensorflow/python/ops/random_ops.py,210,function,"Outputs random values from a uniform distribution. +9082,random_uniform,tensorflow/tensorflow/python/ops/random_ops.py,210,function,"Outputs random values from a uniform distribution. The generated values follow a uniform distribution in the range `[minval, maxval)`. The lower bound `minval` is included in the range, while @@ -84086,7 +89869,7 @@ Returns: Raises: ValueError: If `dtype` is integral and `maxval` is not specified." -9724,random_shuffle,tensorflow/tensorflow/python/ops/random_ops.py,322,function,"Randomly shuffles a tensor along its first dimension. +9083,random_shuffle,tensorflow/tensorflow/python/ops/random_ops.py,322,function,"Randomly shuffles a tensor along its first dimension. The tensor is shuffled along dimension 0, such that each `value[j]` is mapped to one and only one `output[i]`. For example, a mapping that might occur for a @@ -84109,7 +89892,7 @@ Args: Returns: A tensor of same shape and type as `value`, shuffled along its first dimension." -9725,random_crop,tensorflow/tensorflow/python/ops/random_ops.py,355,function,"Randomly crops a tensor to a given size. +9084,random_crop,tensorflow/tensorflow/python/ops/random_ops.py,355,function,"Randomly crops a tensor to a given size. Slices a shape `size` portion out of `value` at a uniformly chosen offset. Requires `value.shape >= size`. @@ -84128,7 +89911,7 @@ Args: Returns: A cropped tensor of the same rank as `value` and shape `size`." -9726,multinomial,tensorflow/tensorflow/python/ops/random_ops.py,401,function,"Draws samples from a multinomial distribution. +9085,multinomial,tensorflow/tensorflow/python/ops/random_ops.py,401,function,"Draws samples from a multinomial distribution. Example: @@ -84149,7 +89932,7 @@ Args: Returns: The drawn samples of shape `[batch_size, num_samples]`." -9727,categorical,tensorflow/tensorflow/python/ops/random_ops.py,429,function,"Draws samples from a categorical distribution. +9086,categorical,tensorflow/tensorflow/python/ops/random_ops.py,429,function,"Draws samples from a categorical distribution. Example: @@ -84170,9 +89953,8 @@ Args: Returns: The drawn samples of shape `[batch_size, num_samples]`." -9728,multinomial_categorical_impl,tensorflow/tensorflow/python/ops/random_ops.py,456,function,Implementation for random.categorical (v1) and random.categorical (v2). -9729,_maybe_set_static_shape_helper,tensorflow/tensorflow/python/ops/random_ops.py,467,function, -9730,random_gamma,tensorflow/tensorflow/python/ops/random_ops.py,480,function,"Draws `shape` samples from each of the given Gamma distribution(s). +9087,multinomial_categorical_impl,tensorflow/tensorflow/python/ops/random_ops.py,456,function,Implementation for random.categorical (v1) and random.categorical (v2). +9088,random_gamma,tensorflow/tensorflow/python/ops/random_ops.py,480,function,"Draws `shape` samples from each of the given Gamma distribution(s). `alpha` is the shape parameter describing the distribution(s), and `beta` is the inverse scale parameter(s). @@ -84239,7 +90021,7 @@ References: (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) ([pdf] (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -9731,random_poisson,tensorflow/tensorflow/python/ops/random_ops.py,574,function,"Draws `shape` samples from each of the given Poisson distribution(s). +9089,random_poisson,tensorflow/tensorflow/python/ops/random_ops.py,574,function,"Draws `shape` samples from each of the given Poisson distribution(s). `lam` is the rate parameter describing the distribution(s). @@ -84272,7 +90054,7 @@ Args: Returns: samples: a `Tensor` of shape `tf.concat([shape, tf.shape(lam)], axis=0)` with values of type `dtype`." -9732,random_poisson_v2,tensorflow/tensorflow/python/ops/random_ops.py,614,function,"Draws `shape` samples from each of the given Poisson distribution(s). +9090,random_poisson_v2,tensorflow/tensorflow/python/ops/random_ops.py,614,function,"Draws `shape` samples from each of the given Poisson distribution(s). `lam` is the rate parameter describing the distribution(s). @@ -84305,31 +90087,9 @@ Args: Returns: samples: a `Tensor` of shape `tf.concat([shape, tf.shape(lam)], axis=0)` with values of type `dtype`." -9733,RawOpsTest,tensorflow/tensorflow/python/ops/raw_ops_test.py,30,class, -9734,get_resource_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,66,function, -9735,get_eager_safe_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,76,function,Get the data handle from the Tensor `handle`. -9736,_set_handle_shapes_and_types,tensorflow/tensorflow/python/ops/resource_variable_ops.py,86,function,"Sets the shape inference result HandleData on tensor. - -Args: - tensor: A `Tensor` or `EagerTensor`. - handle_data: A `CppShapeInferenceResult.HandleData`. - graph_mode: A python bool." -9737,_combine_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,112,function,"Concats HandleData from tensors `handle` and `initial_value`. - -Args: - handle: A `Tensor` of dtype `resource`. - initial_value: A `Tensor`. - -Returns: - A `CppShapeInferenceResult.HandleData`. If `initial_value` has dtype - `variant`, the `HandleData` contains the concatenation of the shape_and_type - from both `handle` and `initial_value`. - -Raises: - RuntimeError: If handle, which was returned by VarHandleOp, either has - no handle data, or its len(handle_data.shape_and_type) != 1." -9738,_variable_handle_from_shape_and_dtype,tensorflow/tensorflow/python/ops/resource_variable_ops.py,148,function,"Create a variable handle, copying in handle data from `initial_value`." -9739,eager_safe_variable_handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,200,function,"Creates a variable handle with information to do shape inference. +9091,get_resource_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,66,function, +9092,get_eager_safe_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,76,function,Get the data handle from the Tensor `handle`. +9093,eager_safe_variable_handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,200,function,"Creates a variable handle with information to do shape inference. The dtype is read from `initial_value` and stored in the returned resource tensor's handle data. @@ -84369,19 +90129,441 @@ Args: Returns: The handle, a `Tensor` of type `resource`." -9740,_handle_graph,tensorflow/tensorflow/python/ops/resource_variable_ops.py,249,function, -9741,EagerResourceDeleter,tensorflow/tensorflow/python/ops/resource_variable_ops.py,260,class,"An object which cleans up a resource handle. +9094,EagerResourceDeleter,tensorflow/tensorflow/python/ops/resource_variable_ops.py,260,class,"An object which cleans up a resource handle. An alternative to defining a __del__ method on an object. The intended use is that ResourceVariables or other objects with resource handles will maintain a single reference to this object. When the parent object is collected, this object will be too. Even if the parent object is part of a reference cycle, the cycle will be collectable." -9742,shape_safe_assign_variable_handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,311,function,Helper that checks shape compatibility and assigns variable. -9743,_maybe_set_handle_data,tensorflow/tensorflow/python/ops/resource_variable_ops.py,321,function, -9744,variable_accessed,tensorflow/tensorflow/python/ops/resource_variable_ops.py,333,function,Records that `variable` was accessed for the tape and FuncGraph. -9745,BaseResourceVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,341,class,A python variable from an existing handle. -9746,ResourceVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1392,class,"Variable based on resource handles. +9095,shape_safe_assign_variable_handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,311,function,Helper that checks shape compatibility and assigns variable. +9096,variable_accessed,tensorflow/tensorflow/python/ops/resource_variable_ops.py,333,function,Records that `variable` was accessed for the tape and FuncGraph. +9097,BaseResourceVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,341,class,A python variable from an existing handle. +9098,dtype,tensorflow/tensorflow/python/ops/resource_variable_ops.py,520,method,The dtype of this variable. +9099,device,tensorflow/tensorflow/python/ops/resource_variable_ops.py,525,method,The device this variable is on. +9100,graph,tensorflow/tensorflow/python/ops/resource_variable_ops.py,530,method,The `Graph` of this variable. +9101,name,tensorflow/tensorflow/python/ops/resource_variable_ops.py,535,method,The name of the handle for this variable. +9102,shape,tensorflow/tensorflow/python/ops/resource_variable_ops.py,540,method,The shape of this variable. +9103,set_shape,tensorflow/tensorflow/python/ops/resource_variable_ops.py,544,method, +9104,create,tensorflow/tensorflow/python/ops/resource_variable_ops.py,559,method,The op responsible for initializing this variable. +9105,handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,567,method,The handle by which this variable can be accessed. +9106,value,tensorflow/tensorflow/python/ops/resource_variable_ops.py,571,method,A cached operation which reads the value of this variable. +9107,initializer,tensorflow/tensorflow/python/ops/resource_variable_ops.py,583,method,The op responsible for initializing this variable. +9108,initial_value,tensorflow/tensorflow/python/ops/resource_variable_ops.py,588,method,Returns the Tensor used as the initial value for the variable. +9109,constraint,tensorflow/tensorflow/python/ops/resource_variable_ops.py,595,method,"Returns the constraint function associated with this variable. + +Returns: + The constraint function that was passed to the variable constructor. + Can be `None` if no constraint was passed." +9110,op,tensorflow/tensorflow/python/ops/resource_variable_ops.py,605,method,The op for this variable. +9111,trainable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,610,method, +9112,synchronization,tensorflow/tensorflow/python/ops/resource_variable_ops.py,614,method, +9113,aggregation,tensorflow/tensorflow/python/ops/resource_variable_ops.py,618,method, +9114,eval,tensorflow/tensorflow/python/ops/resource_variable_ops.py,621,method,Evaluates and returns the value of this variable. +9115,numpy,tensorflow/tensorflow/python/ops/resource_variable_ops.py,627,method, +9116,count_up_to,tensorflow/tensorflow/python/ops/resource_variable_ops.py,634,method,"Increments this variable until it reaches `limit`. + +When that Op is run it tries to increment the variable by `1`. If +incrementing the variable would bring it above `limit` then the Op raises +the exception `OutOfRangeError`. + +If no error is raised, the Op outputs the value of the variable before +the increment. + +This is essentially a shortcut for `count_up_to(self, limit)`. + +Args: + limit: value at which incrementing the variable raises an error. + +Returns: + A `Tensor` that will hold the variable value before the increment. If no + other Op modifies this variable, the values produced will all be + distinct." +9117,read_value,tensorflow/tensorflow/python/ops/resource_variable_ops.py,694,method,"Constructs an op which reads the value of this variable. + +Should be used when there are multiple reads, or when it is desirable to +read the value only after some condition is true. + +Returns: + the read operation." +9118,sparse_read,tensorflow/tensorflow/python/ops/resource_variable_ops.py,709,method,"Reads the value of this variable sparsely, using `gather`." +9119,gather_nd,tensorflow/tensorflow/python/ops/resource_variable_ops.py,728,method,"Reads the value of this variable sparsely, using `gather_nd`." +9120,to_proto,tensorflow/tensorflow/python/ops/resource_variable_ops.py,738,method,"Converts a `ResourceVariable` to a `VariableDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Raises: + RuntimeError: If run in EAGER mode. + +Returns: + A `VariableDef` protocol buffer, or `None` if the `Variable` is not + in the specified name scope." +9121,from_proto,tensorflow/tensorflow/python/ops/resource_variable_ops.py,784,method, +9122,is_initialized,tensorflow/tensorflow/python/ops/resource_variable_ops.py,792,method,"Checks whether a resource variable has been initialized. + +Outputs boolean scalar indicating whether the tensor has been initialized. + +Args: + name: A name for the operation (optional). + +Returns: + A `Tensor` of type `bool`." +9123,assign_sub,tensorflow/tensorflow/python/ops/resource_variable_ops.py,805,method,"Subtracts a value from this variable. + +Args: + delta: A `Tensor`. The value to subtract from this variable. + use_locking: If `True`, use locking during the operation. + name: The name to use for the operation. + read_value: A `bool`. Whether to read and return the new value of the + variable or not. + +Returns: + If `read_value` is `True`, this method will return the new value of the + variable after the assignment has completed. Otherwise, when in graph mode + it will return the `Operation` that does the assignment, and when in eager + mode it will return `None`." +9124,assign_add,tensorflow/tensorflow/python/ops/resource_variable_ops.py,832,method,"Adds a value to this variable. + +Args: + delta: A `Tensor`. The value to add to this variable. + use_locking: If `True`, use locking during the operation. + name: The name to use for the operation. + read_value: A `bool`. Whether to read and return the new value of the + variable or not. + +Returns: + If `read_value` is `True`, this method will return the new value of the + variable after the assignment has completed. Otherwise, when in graph mode + it will return the `Operation` that does the assignment, and when in eager + mode it will return `None`." +9125,assign,tensorflow/tensorflow/python/ops/resource_variable_ops.py,864,method,"Assigns a new value to this variable. + +Args: + value: A `Tensor`. The new value for this variable. + use_locking: If `True`, use locking during the assignment. + name: The name to use for the assignment. + read_value: A `bool`. Whether to read and return the new value of the + variable or not. + +Returns: + If `read_value` is `True`, this method will return the new value of the + variable after the assignment has completed. Otherwise, when in graph mode + it will return the `Operation` that does the assignment, and when in eager + mode it will return `None`." +9126,scatter_sub,tensorflow/tensorflow/python/ops/resource_variable_ops.py,902,method,"Subtracts `tf.IndexedSlices` from this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be subtracted from this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9127,scatter_add,tensorflow/tensorflow/python/ops/resource_variable_ops.py,922,method,"Adds `tf.IndexedSlices` to this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be added to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9128,scatter_max,tensorflow/tensorflow/python/ops/resource_variable_ops.py,942,method,"Updates this variable with the max of `tf.IndexedSlices` and itself. + +Args: + sparse_delta: `tf.IndexedSlices` to use as an argument of max + with this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9129,scatter_min,tensorflow/tensorflow/python/ops/resource_variable_ops.py,963,method,"Updates this variable with the min of `tf.IndexedSlices` and itself. + +Args: + sparse_delta: `tf.IndexedSlices` to use as an argument of min + with this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9130,scatter_mul,tensorflow/tensorflow/python/ops/resource_variable_ops.py,984,method,"Multiply this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to multiply this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9131,scatter_div,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1004,method,"Divide this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to divide this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9132,scatter_update,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1024,method,"Assigns `tf.IndexedSlices` to this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9133,batch_scatter_update,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1044,method,"Assigns `tf.IndexedSlices` to this variable batch-wise. + +Analogous to `batch_gather`. This assumes that this variable and the +sparse_delta IndexedSlices have a series of leading dimensions that are the +same for all of them, and the updates are performed on the last dimension of +indices. In other words, the dimensions should be the following: + +`num_prefix_dims = sparse_delta.indices.ndims - 1` +`batch_dim = num_prefix_dims + 1` +`sparse_delta.updates.shape = sparse_delta.indices.shape + var.shape[ + batch_dim:]` + +where + +`sparse_delta.updates.shape[:num_prefix_dims]` +`== sparse_delta.indices.shape[:num_prefix_dims]` +`== var.shape[:num_prefix_dims]` + +And the operation performed can be expressed as: + +`var[i_1, ..., i_n, + sparse_delta.indices[i_1, ..., i_n, j]] = sparse_delta.updates[ + i_1, ..., i_n, j]` + +When sparse_delta.indices is a 1D tensor, this operation is equivalent to +`scatter_update`. + +To avoid this operation one can looping over the first `ndims` of the +variable and using `scatter_update` on the subtensors that result of slicing +the first dimension. This is a valid option for `ndims = 1`, but less +efficient than this implementation. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9134,scatter_nd_sub,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1094,method,"Applies sparse subtraction to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = ref.scatter_nd_sub(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to ref would look like this: + + [1, -9, 3, -6, -6, 6, 7, -4] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9135,scatter_nd_add,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1143,method,"Applies sparse addition to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + add = ref.scatter_nd_add(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(add) +``` + +The resulting update to ref would look like this: + + [1, 13, 3, 14, 14, 6, 7, 20] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9136,scatter_nd_update,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1192,method,"Applies sparse assignment to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = ref.scatter_nd_update(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to ref would look like this: + + [1, 11, 3, 10, 9, 6, 7, 12] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9137,scatter_nd_max,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1241,method,"Updates this variable with the max of `tf.IndexedSlices` and itself. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9138,scatter_nd_min,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1277,method,"Updates this variable with the min of `tf.IndexedSlices` and itself. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9139,read_and_set_handle,tensorflow/tensorflow/python/ops/resource_variable_ops.py,672,method, +9140,ResourceVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1392,class,"Variable based on resource handles. See the [Variables How To](https://tensorflow.org/guide/variables) for a high level overview. @@ -84431,20 +90613,12 @@ with tf.control_dependencies([other_assign]): # `a` was a tf.Variable instead, 2.0 or 3.0 could be printed. tf.compat.v1.Print(b, [b]).eval() ```" -9747,UninitializedVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1844,class,A variable with no initializer. -9748,_dense_var_to_tensor,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1934,function, -9749,_UnreadVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1944,class,"Represents a future for a read of a variable. - -Pretends to be the tensor if anyone looks." -9750,_ReadGrad,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2075,function,Gradient for read op. -9751,variable_shape,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2080,function, -9752,_GatherGrad,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2091,function,Gradient for gather op. -9753,_to_proto_fn,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2104,function,Converts Variable and ResourceVariable to VariableDef for collections. -9754,_from_proto_fn,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2109,function,Creates Variable or ResourceVariable from VariableDef as needed. -9755,is_resource_variable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2153,function,"""Returns True if `var` is to be considered a ResourceVariable." -9756,copy_to_graph_uninitialized,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2159,function,"Copies an existing variable to a new graph, with no initializer." -9757,VariableSpec,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2182,class,Describes a tf.Variable. -9758,register_resource,tensorflow/tensorflow/python/ops/resources.py,38,function,"Registers a resource into the appropriate collections. +9141,UninitializedVariable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,1844,class,A variable with no initializer. +9142,variable_shape,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2080,function, +9143,is_resource_variable,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2153,function,"""Returns True if `var` is to be considered a ResourceVariable." +9144,copy_to_graph_uninitialized,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2159,function,"Copies an existing variable to a new graph, with no initializer." +9145,VariableSpec,tensorflow/tensorflow/python/ops/resource_variable_ops.py,2182,class,Describes a tf.Variable. +9146,register_resource,tensorflow/tensorflow/python/ops/resources.py,38,function,"Registers a resource into the appropriate collections. This makes the resource findable in either the shared or local resources collection. @@ -84456,9 +90630,9 @@ Args: the resource has been initialized. is_shared: if True, the resource gets added to the shared resource collection; otherwise it gets added to the local resource collection." -9759,shared_resources,tensorflow/tensorflow/python/ops/resources.py,60,function,Returns resources visible to all tasks in the cluster. -9760,local_resources,tensorflow/tensorflow/python/ops/resources.py,65,function,Returns resources intended to be local to this session. -9761,report_uninitialized_resources,tensorflow/tensorflow/python/ops/resources.py,70,function,"Returns the names of all uninitialized resources in resource_list. +9147,shared_resources,tensorflow/tensorflow/python/ops/resources.py,60,function,Returns resources visible to all tasks in the cluster. +9148,local_resources,tensorflow/tensorflow/python/ops/resources.py,65,function,Returns resources intended to be local to this session. +9149,report_uninitialized_resources,tensorflow/tensorflow/python/ops/resources.py,70,function,"Returns the names of all uninitialized resources in resource_list. If the returned tensor is empty then all resources have been initialized. @@ -84470,7 +90644,7 @@ Args: Returns: Tensor containing names of the handles of all resources which have not yet been initialized." -9762,initialize_resources,tensorflow/tensorflow/python/ops/resources.py,108,function,"Initializes the resources in the given list. +9150,initialize_resources,tensorflow/tensorflow/python/ops/resources.py,108,function,"Initializes the resources in the given list. Args: resource_list: list of resources to initialize. @@ -84478,101 +90652,7 @@ Args: Returns: op responsible for initializing all resources." -9763,_transpose_batch_time,tensorflow/tensorflow/python/ops/rnn.py,44,function,"Transposes the batch and time dimensions of a Tensor. - -If the input tensor has rank < 2 it returns the original tensor. Retains as -much of the static shape information as possible. - -Args: - x: A Tensor. - -Returns: - x transposed along the first two dimensions." -9764,_best_effort_input_batch_size,tensorflow/tensorflow/python/ops/rnn.py,70,function,"Get static input batch size if available, with fallback to the dynamic one. - -Args: - flat_input: An iterable of time major input Tensors of shape `[max_time, - batch_size, ...]`. All inputs should have compatible batch sizes. - -Returns: - The batch size in Python integer if available, or a scalar Tensor otherwise. - -Raises: - ValueError: if there is any input with an invalid shape." -9765,_infer_state_dtype,tensorflow/tensorflow/python/ops/rnn.py,97,function,"Infer the dtype of an RNN state. - -Args: - explicit_dtype: explicitly declared dtype or None. - state: RNN's hidden state. Must be a Tensor or a nested iterable containing - Tensors. - -Returns: - dtype: inferred dtype of hidden state. - -Raises: - ValueError: if `state` has heterogeneous dtypes or is empty." -9766,_maybe_tensor_shape_from_tensor,tensorflow/tensorflow/python/ops/rnn.py,127,function, -9767,_should_cache,tensorflow/tensorflow/python/ops/rnn.py,134,function,"Returns True if a default caching device should be set, otherwise False." -9768,_rnn_step,tensorflow/tensorflow/python/ops/rnn.py,151,function,"Calculate one step of a dynamic RNN minibatch. - -Returns an (output, state) pair conditioned on `sequence_length`. -When skip_conditionals=False, the pseudocode is something like: - -if t >= max_sequence_length: - return (zero_output, state) -if t < min_sequence_length: - return call_cell() - -# Selectively output zeros or output, old state or new state depending -# on whether we've finished calculating each row. -new_output, new_state = call_cell() -final_output = np.vstack([ - zero_output if time >= sequence_length[r] else new_output_r - for r, new_output_r in enumerate(new_output) -]) -final_state = np.vstack([ - state[r] if time >= sequence_length[r] else new_state_r - for r, new_state_r in enumerate(new_state) -]) -return (final_output, final_state) - -Args: - time: int32 `Tensor` scalar. - sequence_length: int32 `Tensor` vector of size [batch_size]. - min_sequence_length: int32 `Tensor` scalar, min of sequence_length. - max_sequence_length: int32 `Tensor` scalar, max of sequence_length. - zero_output: `Tensor` vector of shape [output_size]. - state: Either a single `Tensor` matrix of shape `[batch_size, state_size]`, - or a list/tuple of such tensors. - call_cell: lambda returning tuple of (new_output, new_state) where - new_output is a `Tensor` matrix of shape `[batch_size, output_size]`. - new_state is a `Tensor` matrix of shape `[batch_size, state_size]`. - state_size: The `cell.state_size` associated with the state. - skip_conditionals: Python bool, whether to skip using the conditional - calculations. This is useful for `dynamic_rnn`, where the input tensor - matches `max_sequence_length`, and using conditionals just slows - everything down. - -Returns: - A tuple of (`final_output`, `final_state`) as given by the pseudocode above: - final_output is a `Tensor` matrix of shape [batch_size, output_size] - final_state is either a single `Tensor` matrix, or a tuple of such - matrices (matching length and shapes of input `state`). - -Raises: - ValueError: If the cell returns a state tuple whose length does not match - that returned by `state_size`." -9769,_reverse_seq,tensorflow/tensorflow/python/ops/rnn.py,300,function,"Reverse a list of Tensors up to specified lengths. - -Args: - input_seq: Sequence of seq_len tensors of dimension (batch_size, n_features) - or nested tuples of tensors. - lengths: A `Tensor` of dimension batch_size, containing lengths for each - sequence in the batch. If ""None"" is specified, simply reverses the list. - -Returns: - time-reversed sequence" -9770,bidirectional_dynamic_rnn,tensorflow/tensorflow/python/ops/rnn.py,347,function,"Creates a dynamic version of bidirectional recurrent neural network. +9151,bidirectional_dynamic_rnn,tensorflow/tensorflow/python/ops/rnn.py,347,function,"Creates a dynamic version of bidirectional recurrent neural network. Takes input and builds independent forward and backward RNNs. The input_size of forward and backward cell must match. The initial state for both directions @@ -84645,7 +90725,7 @@ Returns: Raises: TypeError: If `cell_fw` or `cell_bw` is not an instance of `RNNCell`." -9771,dynamic_rnn,tensorflow/tensorflow/python/ops/rnn.py,505,function,"Creates a recurrent neural network specified by RNNCell `cell`. +9152,dynamic_rnn,tensorflow/tensorflow/python/ops/rnn.py,505,function,"Creates a recurrent neural network specified by RNNCell `cell`. Performs fully dynamic unrolling of `inputs`. @@ -84752,40 +90832,7 @@ Returns: Raises: TypeError: If `cell` is not an instance of RNNCell. ValueError: If inputs is None or an empty list." -9772,_dynamic_rnn_loop,tensorflow/tensorflow/python/ops/rnn.py,703,function,"Internal implementation of Dynamic RNN. - -Args: - cell: An instance of RNNCell. - inputs: A `Tensor` of shape [time, batch_size, input_size], or a nested - tuple of such elements. - initial_state: A `Tensor` of shape `[batch_size, state_size]`, or if - `cell.state_size` is a tuple, then this should be a tuple of tensors - having shapes `[batch_size, s] for s in cell.state_size`. - parallel_iterations: Positive Python int. - swap_memory: A Python boolean - sequence_length: (optional) An `int32` `Tensor` of shape [batch_size]. - dtype: (optional) Expected dtype of output. If not specified, inferred from - initial_state. - -Returns: - Tuple `(final_outputs, final_state)`. - final_outputs: - A `Tensor` of shape `[time, batch_size, cell.output_size]`. If - `cell.output_size` is a (possibly nested) tuple of ints or `TensorShape` - objects, then this returns a (possibly nested) tuple of Tensors matching - the corresponding shapes. - final_state: - A `Tensor`, or possibly nested tuple of Tensors, matching in length - and shapes to `initial_state`. - -Raises: - ValueError: If the input depth cannot be inferred via shape inference - from the inputs. - ValueError: If time_step is not the same for all the elements in the - inputs. - ValueError: If batch_size is not the same for all the elements in the - inputs." -9773,raw_rnn,tensorflow/tensorflow/python/ops/rnn.py,919,function,"Creates an `RNN` specified by RNNCell `cell` and loop function `loop_fn`. +9153,raw_rnn,tensorflow/tensorflow/python/ops/rnn.py,919,function,"Creates an `RNN` specified by RNNCell `cell` and loop function `loop_fn`. **NOTE: This method is still in testing, and the API may change.** @@ -84944,7 +90991,7 @@ Returns: Raises: TypeError: If `cell` is not an instance of RNNCell, or `loop_fn` is not a `callable`." -9774,static_rnn,tensorflow/tensorflow/python/ops/rnn.py,1246,function,"Creates a recurrent neural network specified by RNNCell `cell`. +9154,static_rnn,tensorflow/tensorflow/python/ops/rnn.py,1246,function,"Creates a recurrent neural network specified by RNNCell `cell`. The simplest form of RNN network generated is: @@ -85001,7 +91048,7 @@ Raises: TypeError: If `cell` is not an instance of RNNCell. ValueError: If `inputs` is `None` or an empty list, or if the input depth (column size) cannot be inferred from inputs via shape inference." -9775,static_state_saving_rnn,tensorflow/tensorflow/python/ops/rnn.py,1425,function,"RNN that accepts a state saver for time-truncated RNN calculation. +9155,static_state_saving_rnn,tensorflow/tensorflow/python/ops/rnn.py,1425,function,"RNN that accepts a state saver for time-truncated RNN calculation. Args: cell: An instance of `RNNCell`. @@ -85025,7 +91072,7 @@ Raises: TypeError: If `cell` is not an instance of RNNCell. ValueError: If `inputs` is `None` or an empty list, or if the arity and type of `state_name` does not match that of `cell.state_size`." -9776,static_bidirectional_rnn,tensorflow/tensorflow/python/ops/rnn.py,1520,function,"Creates a bidirectional recurrent neural network. +9156,static_bidirectional_rnn,tensorflow/tensorflow/python/ops/rnn.py,1520,function,"Creates a bidirectional recurrent neural network. Similar to the unidirectional case above (rnn) but takes input and builds independent forward and backward RNNs with the final forward and backward @@ -85065,19 +91112,17 @@ Returns: Raises: TypeError: If `cell_fw` or `cell_bw` is not an instance of `RNNCell`. ValueError: If inputs is None or an empty list." -9777,_block_lstm_grad,tensorflow/tensorflow/python/ops/rnn_grad.py,24,function,Gradient for the BlockLSTM op. -9778,RNNGradTest,tensorflow/tensorflow/python/ops/rnn_grad_test.py,36,class, -9779,deterministic_random_uniform,tensorflow/tensorflow/python/ops/rnn_grad_test.py,139,function, -9780,icfo_to_ifco,tensorflow/tensorflow/python/ops/rnn_grad_test.py,143,function,Convert gates' weights and biases from ICFO to IFCO layout. -9781,_maybe_copy_to_context_device,tensorflow/tensorflow/python/ops/script_ops.py,58,function,Copy an EagerTensor to the current device if it's not on `device_name`. -9782,EagerFunc,tensorflow/tensorflow/python/ops/script_ops.py,71,class,A wrapper for a function owned by an EagerPyFunc. -9783,FuncRegistry,tensorflow/tensorflow/python/ops/script_ops.py,154,class,"A helper class to keep track of registered py functions. +9157,deterministic_random_uniform,tensorflow/tensorflow/python/ops/rnn_grad_test.py,139,function, +9158,icfo_to_ifco,tensorflow/tensorflow/python/ops/rnn_grad_test.py,143,function,Convert gates' weights and biases from ICFO to IFCO layout. +9159,EagerFunc,tensorflow/tensorflow/python/ops/script_ops.py,71,class,A wrapper for a function owned by an EagerPyFunc. +9160,FuncRegistry,tensorflow/tensorflow/python/ops/script_ops.py,154,class,"A helper class to keep track of registered py functions. FuncRegistry keeps a map from unique tokens (string) to python functions, which takes numpy arrays and outputs numpy arrays." -9784,_internal_py_func,tensorflow/tensorflow/python/ops/script_ops.py,274,function,See documentation for py_func and eager_py_func. -9785,_EagerPyFuncGrad,tensorflow/tensorflow/python/ops/script_ops.py,355,function,Computes the gradient of an EagerPyFunc. -9786,eager_py_func,tensorflow/tensorflow/python/ops/script_ops.py,375,function,"Wraps a python function into a TensorFlow op that executes it eagerly. +9161,insert,tensorflow/tensorflow/python/ops/script_ops.py,175,method,Registers `func` and returns a unique token for this entry. +9162,remove,tensorflow/tensorflow/python/ops/script_ops.py,182,method,Removes the registered function corresponding to `token`. +9163,size,tensorflow/tensorflow/python/ops/script_ops.py,256,method,Returns how many functions are currently registered. +9164,eager_py_func,tensorflow/tensorflow/python/ops/script_ops.py,375,function,"Wraps a python function into a TensorFlow op that executes it eagerly. This function allows expressing computations in a TensorFlow graph as Python functions. In particular, it wraps a Python function `func` @@ -85154,7 +91199,7 @@ Args: Returns: A list of `Tensor` or a single `Tensor` which `func` computes; an empty list if `func` returns None." -9787,py_func_common,tensorflow/tensorflow/python/ops/script_ops.py,462,function,"Wraps a python function and uses it as a TensorFlow op. +9165,py_func_common,tensorflow/tensorflow/python/ops/script_ops.py,462,function,"Wraps a python function and uses it as a TensorFlow op. Given a python function `func`, which takes numpy arrays as its arguments and returns numpy arrays as its outputs, wrap this function as an @@ -85208,8 +91253,8 @@ Args: Returns: A list of `Tensor` or a single `Tensor` which `func` computes." -9788,py_func,tensorflow/tensorflow/python/ops/script_ops.py,557,function, -9789,numpy_function,tensorflow/tensorflow/python/ops/script_ops.py,566,function,"Wraps a python function and uses it as a TensorFlow op. +9166,py_func,tensorflow/tensorflow/python/ops/script_ops.py,557,function, +9167,numpy_function,tensorflow/tensorflow/python/ops/script_ops.py,566,function,"Wraps a python function and uses it as a TensorFlow op. Given a python function `func` wrap this function as an operation in a TensorFlow function. `func` must take numpy arrays as its arguments and @@ -85273,10 +91318,22 @@ Args: Returns: Single or list of `tf.Tensor` which `func` computes." -9790,NumpyFunctionTest,tensorflow/tensorflow/python/ops/script_ops_test.py,28,class, -9791,encode_resource_handle,tensorflow/tensorflow/python/ops/session_ops.py,36,function,Encode a ResourceHandle proto as custom numpy struct type. -9792,TensorHandle,tensorflow/tensorflow/python/ops/session_ops.py,42,class,Represents a handle for a live tensor in a session. -9793,get_session_handle,tensorflow/tensorflow/python/ops/session_ops.py,139,function,"Return the handle of `data`. +9168,encode_resource_handle,tensorflow/tensorflow/python/ops/session_ops.py,36,function,Encode a ResourceHandle proto as custom numpy struct type. +9169,TensorHandle,tensorflow/tensorflow/python/ops/session_ops.py,42,class,Represents a handle for a live tensor in a session. +9170,to_numpy_array,tensorflow/tensorflow/python/ops/session_ops.py,78,method,"Convert a TensorHandle object to a feedable numpy value. + +Returns: + A numpy array of a custom struct type that can be used as a feed value + to run()." +9171,handle,tensorflow/tensorflow/python/ops/session_ops.py,88,method,The string representation of this handle. +9172,eval,tensorflow/tensorflow/python/ops/session_ops.py,92,method,Return the value of the tensor represented by this handle. +9173,delete,tensorflow/tensorflow/python/ops/session_ops.py,101,method,Force the deletion of this persistent tensor. +9174,get_raw_handle,tensorflow/tensorflow/python/ops/session_ops.py,110,method,"Return the raw handle of the tensor. + +Note that the method disables the automatic garbage collection of this +persistent tensor. The caller is now responsible for managing the life +time of the tensor." +9175,get_session_handle,tensorflow/tensorflow/python/ops/session_ops.py,139,function,"Return the handle of `data`. This is EXPERIMENTAL and subject to change. @@ -85307,7 +91364,7 @@ p, a = tf.compat.v1.get_session_tensor(h.handle, tf.float32) b = tf.multiply(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```" -9794,get_session_tensor,tensorflow/tensorflow/python/ops/session_ops.py,182,function,"Get the tensor of type `dtype` by feeding a tensor handle. +9176,get_session_tensor,tensorflow/tensorflow/python/ops/session_ops.py,182,function,"Get the tensor of type `dtype` by feeding a tensor handle. This is EXPERIMENTAL and subject to change. @@ -85336,7 +91393,7 @@ p, a = tf.compat.v1.get_session_tensor(h.handle, tf.float32) b = tf.multiply(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```" -9795,delete_session_tensor,tensorflow/tensorflow/python/ops/session_ops.py,223,function,"Delete the tensor for the given tensor handle. +9177,delete_session_tensor,tensorflow/tensorflow/python/ops/session_ops.py,223,function,"Delete the tensor for the given tensor handle. This is EXPERIMENTAL and subject to change. @@ -85350,12 +91407,7 @@ Args: Returns: A pair of graph elements. The first is a placeholder for feeding a tensor handle and the second is a deletion operation." -9796,_register_handle_feeder,tensorflow/tensorflow/python/ops/session_ops.py,246,function, -9797,_get_handle_feeder,tensorflow/tensorflow/python/ops/session_ops.py,250,function, -9798,_get_handle_reader,tensorflow/tensorflow/python/ops/session_ops.py,254,function,Return a read subgraph for this handle. -9799,_get_handle_mover,tensorflow/tensorflow/python/ops/session_ops.py,270,function,Return a move subgraph for this pair of feeder and handle. -9800,_get_handle_deleter,tensorflow/tensorflow/python/ops/session_ops.py,291,function,Return a deletion subgraph for this handle. -9801,set_size,tensorflow/tensorflow/python/ops/sets_impl.py,37,function,"Compute number of unique elements along last dimension of `a`. +9178,set_size,tensorflow/tensorflow/python/ops/sets_impl.py,37,function,"Compute number of unique elements along last dimension of `a`. Args: a: `SparseTensor`, with indices sorted in row-major order. @@ -85369,41 +91421,7 @@ Returns: Raises: TypeError: If `a` is an invalid types." -9802,_convert_to_tensors_or_sparse_tensors,tensorflow/tensorflow/python/ops/sets_impl.py,70,function,"Convert to tensor types, and flip order if necessary. - -Args: - a: `Tensor` or `SparseTensor` of the same type as `b`. - b: `Tensor` or `SparseTensor` of the same type as `a`. - -Returns: - Tuple of `(a, b, flipped)`, where `a` and `b` have been converted to - `Tensor` or `SparseTensor`, and `flipped` indicates whether the order has - been flipped to make it dense,sparse instead of sparse,dense (since the set - ops do not support the latter)." -9803,_set_operation,tensorflow/tensorflow/python/ops/sets_impl.py,95,function,"Compute set operation of elements in last dimension of `a` and `b`. - -All but the last dimension of `a` and `b` must match. - -Args: - a: `Tensor` or `SparseTensor` of the same type as `b`. If sparse, indices - must be sorted in row-major order. - b: `Tensor` or `SparseTensor` of the same type as `a`. Must be - `SparseTensor` if `a` is `SparseTensor`. If sparse, indices must be - sorted in row-major order. - set_operation: String indicating set operation. See - SetOperationOp::SetOperationFromContext for valid values. - validate_indices: Whether to validate the order and range of sparse indices - in `a` and `b`. - -Returns: - A `SparseTensor` with the same rank as `a` and `b`, and all but the last - dimension the same. Elements along the last dimension contain the results - of the set operation. - -Raises: - TypeError: If inputs are invalid types. - ValueError: If `a` is sparse and `b` is dense." -9804,set_intersection,tensorflow/tensorflow/python/ops/sets_impl.py,141,function,"Compute set intersection of elements in last dimension of `a` and `b`. +9179,set_intersection,tensorflow/tensorflow/python/ops/sets_impl.py,141,function,"Compute set intersection of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. @@ -85465,7 +91483,7 @@ Returns: A `SparseTensor` whose shape is the same rank as `a` and `b`, and all but the last dimension the same. Elements along the last dimension contain the intersections." -9805,set_difference,tensorflow/tensorflow/python/ops/sets_impl.py,212,function,"Compute set difference of elements in last dimension of `a` and `b`. +9180,set_difference,tensorflow/tensorflow/python/ops/sets_impl.py,212,function,"Compute set difference of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. @@ -85536,7 +91554,7 @@ Raises: ValueError: If `a` is sparse and `b` is dense. errors_impl.InvalidArgumentError: If the shapes of `a` and `b` do not match in any dimension other than the last dimension." -9806,set_union,tensorflow/tensorflow/python/ops/sets_impl.py,294,function,"Compute set union of elements in last dimension of `a` and `b`. +9181,set_union,tensorflow/tensorflow/python/ops/sets_impl.py,294,function,"Compute set union of elements in last dimension of `a` and `b`. All but the last dimension of `a` and `b` must match. @@ -85607,8 +91625,7 @@ Returns: A `SparseTensor` whose shape is the same rank as `a` and `b`, and all but the last dimension the same. Elements along the last dimension contain the unions." -9807,SobolSampleOpTest,tensorflow/tensorflow/python/ops/sobol_ops_test.py,30,class, -9808,sort,tensorflow/tensorflow/python/ops/sort_ops.py,39,function,"Sorts a tensor. +9182,sort,tensorflow/tensorflow/python/ops/sort_ops.py,39,function,"Sorts a tensor. Usage: @@ -85634,7 +91651,7 @@ Returns: Raises: ValueError: If axis is not a constant scalar, or the direction is invalid." -9809,argsort,tensorflow/tensorflow/python/ops/sort_ops.py,73,function,"Returns the indices of a tensor that give its sorted order along an axis. +9183,argsort,tensorflow/tensorflow/python/ops/sort_ops.py,73,function,"Returns the indices of a tensor that give its sorted order along an axis. For a 1D tensor, `tf.gather(values, tf.argsort(values))` is equivalent to `tf.sort(values)`. For higher dimensions, the output has the same shape as @@ -85669,135 +91686,7 @@ Returns: Raises: ValueError: If axis is not a constant scalar, or the direction is invalid." -9810,_sort_or_argsort,tensorflow/tensorflow/python/ops/sort_ops.py,115,function,"Internal sort/argsort implementation. - -Args: - values: The input values. - axis: The axis along which to sort. - direction: 'ASCENDING' or 'DESCENDING'. - return_argsort: Whether to return the argsort result. - -Returns: - Either the sorted values, or the indices of the sorted values in the - original tensor. See the `sort` and `argsort` docstrings. - -Raises: - ValueError: If axis is not a constant scalar, or the direction is invalid." -9811,_descending_sort,tensorflow/tensorflow/python/ops/sort_ops.py,146,function,"Sorts values in reverse using `top_k`. - -Args: - values: Tensor of numeric values. - axis: Index of the axis which values should be sorted along. - return_argsort: If False, return the sorted values. If True, return the - indices that would sort the values. - -Returns: - The sorted values." -9812,_ascending_sort,tensorflow/tensorflow/python/ops/sort_ops.py,200,function, -9813,SortTest,tensorflow/tensorflow/python/ops/sort_ops_test.py,35,class, -9814,_SparseReorderGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,37,function,"Gradients for the SparseReorder op. - -Args: - op: the SparseReorder op - unused_output_indices_grad: the incoming gradients of the output indices - output_values_grad: the incoming gradients of the output values - -Returns: - Gradient for each of the 3 input tensors: - (input_indices, input_values, input_shape) - The gradients for input_indices and input_shape is None." -9815,_SparseAddGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,66,function,"The backward operator for the SparseAdd op. - -The SparseAdd op calculates A + B, where A, B, and the sum are all represented -as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. -non-empty values of the sum, and outputs the gradients w.r.t. the non-empty -values of A and B. - -Args: - op: the SparseAdd op - *grads: the incoming gradients, one element per output of `op` - -Returns: - Gradient for each of the 6 input tensors of SparseAdd: - (a_indices, a_values, a_shape, b_indices, b_values, b_shape, thresh) - The gradients for the indices, shapes, and the threshold are None." -9816,_SparseTensorDenseAddGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,100,function, -9817,_SparseReduceSumGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,107,function,Similar to gradient for the Sum Op (i.e. tf.reduce_sum()). -9818,_SparseSliceGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,120,function,"The backward operator for the SparseSlice op. - -This op takes in the upstream gradient w.r.t. non-empty values of -the sliced `SparseTensor`, and outputs the gradients w.r.t. -the non-empty values of input `SparseTensor`. - -Args: - op: the SparseSlice op - *grads: the incoming gradients, one element per output of `op` - -Returns: - Gradient for each of the 5 input tensors of SparseSlice: - (indices, values, shape, start, size) - The gradients for the indices, shape, start and the size are None." -9819,_SparseTensorDenseMatMulGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,149,function,"Gradients for the dense tensor in the SparseTensorDenseMatMul op. - -If either input is complex, no gradient is provided. - -Args: - op: the SparseTensorDenseMatMul op - grad: the incoming gradient - -Returns: - Gradient for each of the 4 input tensors: - (sparse_indices, sparse_values, sparse_shape, dense_tensor) - The gradients for indices and shape are None. - -Raises: - TypeError: When the two operands don't have the same type." -9820,_SparseDenseCwiseAddGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,205,function, -9821,_SparseDenseCwiseMulOrDivGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,210,function,"Common code for SparseDenseCwise{Mul,Div} gradients." -9822,_SparseDenseCwiseMulGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,245,function,Gradients for SparseDenseCwiseMul. -9823,_SparseDenseCwiseDivGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,251,function,Gradients for SparseDenseCwiseDiv. -9824,_SparseSoftmaxGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,257,function,"Gradients for SparseSoftmax. - -The calculation is the same as SoftmaxGrad: - - grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax - -where we now only operate on the non-zero values present in the SparseTensors. - -Args: - op: the SparseSoftmax op. - grad: the upstream gradient w.r.t. the non-zero SparseSoftmax output values. - -Returns: - Gradients w.r.t. the input (sp_indices, sp_values, sp_shape)." -9825,_SparseSparseMaximumGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,290,function, -9826,_SparseSparseMinimumGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,296,function, -9827,_SparseFillEmptyRowsGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,302,function,Gradients for SparseFillEmptyRows. -9828,_SparseToDenseGrad,tensorflow/tensorflow/python/ops/sparse_grad.py,316,function, -9829,_convert_to_sparse_tensor,tensorflow/tensorflow/python/ops/sparse_ops.py,57,function,"Convert `sp_input` to `SparseTensor` and return it. - -Args: - sp_input: `SparseTensor` or `SparseTensorValue`. - -Returns: - `sp_input` converted to `SparseTensor`. - -Raises: - ValueError: if `sp_input` is neither `SparseTensor` nor `SparseTensorValue`." -9830,_convert_to_sparse_tensors,tensorflow/tensorflow/python/ops/sparse_ops.py,76,function,"Convert `sp_inputs` to `SparseTensor` objects and return them. - -Args: - sp_inputs: `list` or `tuple` of `SparseTensor` or `SparseTensorValue` - objects. - -Returns: - `sp_inputs` converted to `SparseTensor` objects. - -Raises: - ValueError: if any item in `sp_inputs` is neither `SparseTensor` nor - `SparseTensorValue`." -9831,_make_int64_tensor,tensorflow/tensorflow/python/ops/sparse_ops.py,97,function, -9832,from_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,108,function,"Converts a dense tensor into a sparse tensor. +9184,from_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,108,function,"Converts a dense tensor into a sparse tensor. Only elements not equal to zero will be present in the result. The resulting `SparseTensor` has the same dtype and shape as the input. @@ -85808,7 +91697,7 @@ Args: Returns: The `SparseTensor`." -9833,sparse_expand_dims,tensorflow/tensorflow/python/ops/sparse_ops.py,131,function,"Returns a tensor with an length 1 axis inserted at index `axis`. +9185,sparse_expand_dims,tensorflow/tensorflow/python/ops/sparse_ops.py,131,function,"Returns a tensor with an length 1 axis inserted at index `axis`. Given a tensor `input`, this operation inserts a dimension of length 1 at the dimension index `axis` of `input`'s shape. The dimension index follows python @@ -85875,7 +91764,7 @@ Args: Returns: A `SparseTensor` with the same data as `sp_input`, but its shape has an additional dimension of size 1 added." -9834,sparse_eye,tensorflow/tensorflow/python/ops/sparse_ops.py,237,function,"Creates a two-dimensional sparse tensor with ones along the diagonal. +9186,sparse_eye,tensorflow/tensorflow/python/ops/sparse_ops.py,237,function,"Creates a two-dimensional sparse tensor with ones along the diagonal. Args: num_rows: Non-negative integer or `int32` scalar `tensor` giving the number @@ -85888,7 +91777,7 @@ Args: Returns: A `SparseTensor` of shape [num_rows, num_columns] with ones along the diagonal." -9835,sparse_concat,tensorflow/tensorflow/python/ops/sparse_ops.py,275,function,"Concatenates a list of `SparseTensor` along the specified dimension. +9187,sparse_concat,tensorflow/tensorflow/python/ops/sparse_ops.py,275,function,"Concatenates a list of `SparseTensor` along the specified dimension. Concatenation is with respect to the dense versions of each sparse input. It is assumed that each inputs is a `SparseTensor` whose elements are ordered @@ -85983,8 +91872,8 @@ Returns: Raises: TypeError: If `sp_inputs` is not a list of `SparseTensor`." -9836,sparse_concat_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,388,function, -9837,sparse_add,tensorflow/tensorflow/python/ops/sparse_ops.py,430,function,"Adds two tensors, at least one of each is a `SparseTensor`. +9188,sparse_concat_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,388,function, +9189,sparse_add,tensorflow/tensorflow/python/ops/sparse_ops.py,430,function,"Adds two tensors, at least one of each is a `SparseTensor`. If one `SparseTensor` and one `Tensor` are passed in, returns a `Tensor`. If both arguments are `SparseTensor`s, this returns a `SparseTensor`. The order @@ -86035,7 +91924,7 @@ Returns: Raises: TypeError: If both `a` and `b` are `Tensor`s. Use `tf.add()` instead." -9838,sparse_add_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,491,function,"Adds two tensors, at least one of each is a `SparseTensor`. +9190,sparse_add_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,491,function,"Adds two tensors, at least one of each is a `SparseTensor`. If one `SparseTensor` and one `Tensor` are passed in, returns a `Tensor`. If both arguments are `SparseTensor`s, this returns a `SparseTensor`. The order @@ -86085,7 +91974,7 @@ Returns: Raises: TypeError: If both `a` and `b` are `Tensor`s. Use `tf.add()` instead." -9839,sparse_cross,tensorflow/tensorflow/python/ops/sparse_ops.py,575,function,"Generates sparse cross from a list of sparse and dense tensors. +9191,sparse_cross,tensorflow/tensorflow/python/ops/sparse_ops.py,575,function,"Generates sparse cross from a list of sparse and dense tensors. For example, if the inputs are @@ -86123,7 +92012,7 @@ Args: Returns: A `SparseTensor` of type `string`." -9840,sparse_cross_hashed,tensorflow/tensorflow/python/ops/sparse_ops.py,635,function,"Generates hashed sparse cross from a list of sparse and dense tensors. +9192,sparse_cross_hashed,tensorflow/tensorflow/python/ops/sparse_ops.py,635,function,"Generates hashed sparse cross from a list of sparse and dense tensors. For example, if the inputs are @@ -86159,9 +92048,7 @@ Args: Returns: A `SparseTensor` of type `int64`." -9841,_sparse_cross_internval_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,686,function,See gen_sparse_ops.sparse_cross_v2. -9842,_sparse_cross_internal,tensorflow/tensorflow/python/ops/sparse_ops.py,712,function,See gen_sparse_ops.sparse_cross. -9843,sparse_dense_cwise_add,tensorflow/tensorflow/python/ops/sparse_ops.py,762,function,"Adds up a SparseTensor and a dense Tensor, using these special rules: +9193,sparse_dense_cwise_add,tensorflow/tensorflow/python/ops/sparse_ops.py,762,function,"Adds up a SparseTensor and a dense Tensor, using these special rules: (1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; @@ -86179,7 +92066,7 @@ Args: Returns: output: the SparseTensor output." -9844,sparse_reorder,tensorflow/tensorflow/python/ops/sparse_ops.py,789,function,"Reorders a `SparseTensor` into the canonical, row-major ordering. +9194,sparse_reorder,tensorflow/tensorflow/python/ops/sparse_ops.py,789,function,"Reorders a `SparseTensor` into the canonical, row-major ordering. Note that by convention, all sparse ops preserve the canonical ordering along increasing dimension number. The only time ordering can be violated @@ -86212,7 +92099,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9845,sparse_reshape,tensorflow/tensorflow/python/ops/sparse_ops.py,840,function,"Reshapes a `SparseTensor` to represent values in a new dense shape. +9195,sparse_reshape,tensorflow/tensorflow/python/ops/sparse_ops.py,840,function,"Reshapes a `SparseTensor` to represent values in a new dense shape. This operation has the same semantics as `reshape` on the represented dense tensor. The indices of non-empty values in `sp_input` are recomputed based @@ -86258,8 +92145,8 @@ Raises: ValueError: If argument `shape` requests a `SparseTensor` with a different number of elements than `sp_input`. ValueError: If `shape` has more than one inferred (== -1) dimension." -9846,KeywordRequired,tensorflow/tensorflow/python/ops/sparse_ops.py,945,class, -9847,sparse_split,tensorflow/tensorflow/python/ops/sparse_ops.py,956,function,"Split a `SparseTensor` into `num_split` tensors along `axis`. +9196,KeywordRequired,tensorflow/tensorflow/python/ops/sparse_ops.py,945,class, +9197,sparse_split,tensorflow/tensorflow/python/ops/sparse_ops.py,956,function,"Split a `SparseTensor` into `num_split` tensors along `axis`. If the `sp_input.dense_shape[axis]` is not an integer multiple of `num_split` each slice starting from 0:`shape[axis] % num_split` gets extra one @@ -86296,7 +92183,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`. ValueError: If the deprecated `split_dim` and `axis` are both non None." -9848,sparse_split_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1029,function,"Split a `SparseTensor` into `num_split` tensors along `axis`. +9198,sparse_split_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1029,function,"Split a `SparseTensor` into `num_split` tensors along `axis`. If the `sp_input.dense_shape[axis]` is not an integer multiple of `num_split` each slice starting from 0:`shape[axis] % num_split` gets extra one @@ -86351,7 +92238,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9849,sparse_slice,tensorflow/tensorflow/python/ops/sparse_ops.py,1098,function,"Slice a `SparseTensor` based on the `start` and `size. +9199,sparse_slice,tensorflow/tensorflow/python/ops/sparse_ops.py,1098,function,"Slice a `SparseTensor` based on the `start` and `size. For example, if the input is @@ -86380,7 +92267,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9850,sparse_to_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,1151,function,"Converts a sparse representation into a dense tensor. +9200,sparse_to_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,1151,function,"Converts a sparse representation into a dense tensor. Builds an array `dense` with shape `output_shape` such that @@ -86419,7 +92306,7 @@ Args: Returns: Dense `Tensor` of shape `output_shape`. Has the same type as `sparse_values`." -9851,sparse_reduce_max_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1207,function,"Computes the max of elements across dimensions of a SparseTensor. +9201,sparse_reduce_max_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1207,function,"Computes the max of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In particular, this Op also returns a dense `Tensor` @@ -86473,7 +92360,7 @@ Args: Returns: The reduced Tensor or the reduced SparseTensor if `output_is_sparse` is True." -9852,sparse_reduce_max,tensorflow/tensorflow/python/ops/sparse_ops.py,1295,function,"Computes the max of elements across dimensions of a SparseTensor. +9202,sparse_reduce_max,tensorflow/tensorflow/python/ops/sparse_ops.py,1295,function,"Computes the max of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In particular, this Op also returns a dense `Tensor` @@ -86524,7 +92411,7 @@ Args: Returns: The reduced Tensor." -9853,sparse_reduce_max_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,1365,function,"Computes the max of elements across dimensions of a SparseTensor. +9203,sparse_reduce_max_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,1365,function,"Computes the max of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In contrast to SparseReduceSum, this Op returns a @@ -86552,7 +92439,7 @@ Args: Returns: The reduced SparseTensor." -9854,sparse_reduce_sum_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1415,function,"Computes the sum of elements across dimensions of a SparseTensor. +9204,sparse_reduce_sum_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,1415,function,"Computes the sum of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor` @@ -86595,7 +92482,7 @@ Args: Returns: The reduced Tensor or the reduced SparseTensor if `output_is_sparse` is True." -9855,sparse_reduce_sum,tensorflow/tensorflow/python/ops/sparse_ops.py,1491,function,"Computes the sum of elements across dimensions of a SparseTensor. +9205,sparse_reduce_sum,tensorflow/tensorflow/python/ops/sparse_ops.py,1491,function,"Computes the sum of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor` @@ -86633,7 +92520,7 @@ Args: Returns: The reduced Tensor." -9856,sparse_reduce_sum_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,1548,function,"Computes the sum of elements across dimensions of a SparseTensor. +9206,sparse_reduce_sum_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,1548,function,"Computes the sum of elements across dimensions of a SparseTensor. This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_sum()`. In contrast to SparseReduceSum, this Op returns a @@ -86661,7 +92548,7 @@ Args: Returns: The reduced SparseTensor." -9857,sparse_tensor_to_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,1599,function,"Converts a `SparseTensor` into a dense tensor. +9207,sparse_tensor_to_dense,tensorflow/tensorflow/python/ops/sparse_ops.py,1599,function,"Converts a `SparseTensor` into a dense tensor. This op is a convenience wrapper around `sparse_to_dense` for `SparseTensor`s. @@ -86696,7 +92583,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9858,sparse_to_indicator,tensorflow/tensorflow/python/ops/sparse_ops.py,1655,function,"Converts a `SparseTensor` of ids into a dense bool indicator tensor. +9208,sparse_to_indicator,tensorflow/tensorflow/python/ops/sparse_ops.py,1655,function,"Converts a `SparseTensor` of ids into a dense bool indicator tensor. The last dimension of `sp_input.indices` is discarded and replaced with the values of `sp_input`. If `sp_input.dense_shape = [D0, D1, ..., Dn, K]`, @@ -86740,7 +92627,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9859,sparse_merge,tensorflow/tensorflow/python/ops/sparse_ops.py,1719,function,"Combines a batch of feature ids and values into a single `SparseTensor`. +9209,sparse_merge,tensorflow/tensorflow/python/ops/sparse_ops.py,1719,function,"Combines a batch of feature ids and values into a single `SparseTensor`. The most common use case for this function occurs when feature ids and their corresponding values are stored in `Example` protos on disk. @@ -86830,8 +92717,8 @@ Raises: `Tensor` or a Python int and `sp_ids` is a `SparseTensor`. Or if `vocab_size` is not a or list thereof and `sp_ids` is a list. ValueError: If `sp_ids` and `vocab_size` are lists of different lengths." -9860,sparse_merge_impl,tensorflow/tensorflow/python/ops/sparse_ops.py,1815,function,Internal implementation for sparse_merge to avoid deprecation warnings. -9861,sparse_retain,tensorflow/tensorflow/python/ops/sparse_ops.py,1873,function,"Retains specified non-empty values within a `SparseTensor`. +9210,sparse_merge_impl,tensorflow/tensorflow/python/ops/sparse_ops.py,1815,function,Internal implementation for sparse_merge to avoid deprecation warnings. +9211,sparse_retain,tensorflow/tensorflow/python/ops/sparse_ops.py,1873,function,"Retains specified non-empty values within a `SparseTensor`. For example, if `sp_input` has shape `[4, 5]` and 4 non-empty string values: @@ -86856,7 +92743,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9862,sparse_reset_shape,tensorflow/tensorflow/python/ops/sparse_ops.py,1921,function,"Resets the shape of a `SparseTensor` with indices and values unchanged. +9212,sparse_reset_shape,tensorflow/tensorflow/python/ops/sparse_ops.py,1921,function,"Resets the shape of a `SparseTensor` with indices and values unchanged. If `new_shape` is None, returns a copy of `sp_input` with its shape reset to the tight bounding box of `sp_input`. This will be a shape consisting of @@ -86911,7 +92798,7 @@ Raises: - If `new_shape` has dimension sizes that are too small. - If shapes are not known during graph construction time, and during run time it is found out that the ranks do not match." -9863,sparse_fill_empty_rows,tensorflow/tensorflow/python/ops/sparse_ops.py,2027,function,"Fills empty rows in the input 2-D `SparseTensor` with a default value. +9213,sparse_fill_empty_rows,tensorflow/tensorflow/python/ops/sparse_ops.py,2027,function,"Fills empty rows in the input 2-D `SparseTensor` with a default value. This op adds entries with the specified `default_value` at index `[row, 0]` for any row in the input that does not already have a value. @@ -86956,7 +92843,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9864,serialize_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2093,function,"Serialize a `SparseTensor` into a 3-vector (1-D `Tensor`) object. +9214,serialize_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2093,function,"Serialize a `SparseTensor` into a 3-vector (1-D `Tensor`) object. Args: sp_input: The input `SparseTensor`. @@ -86969,7 +92856,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9865,serialize_sparse_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,2113,function,"Serialize a `SparseTensor` into a 3-vector (1-D `Tensor`) object. +9215,serialize_sparse_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,2113,function,"Serialize a `SparseTensor` into a 3-vector (1-D `Tensor`) object. Args: sp_input: The input `SparseTensor`. @@ -86982,7 +92869,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9866,serialize_many_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2141,function,"Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`. +9216,serialize_many_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2141,function,"Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`. The `SparseTensor` must have rank `R` greater than 1, and the first dimension is treated as the minibatch dimension. Elements of the `SparseTensor` @@ -87004,7 +92891,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9867,serialize_many_sparse_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,2170,function,"Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`. +9217,serialize_many_sparse_v2,tensorflow/tensorflow/python/ops/sparse_ops.py,2170,function,"Serialize `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor`. The `SparseTensor` must have rank `R` greater than 1, and the first dimension is treated as the minibatch dimension. Elements of the `SparseTensor` @@ -87026,7 +92913,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9868,deserialize_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2204,function,"Deserialize `SparseTensor` objects. +9218,deserialize_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2204,function,"Deserialize `SparseTensor` objects. The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where the last dimension stores serialized `SparseTensor` objects and the other N @@ -87079,7 +92966,7 @@ Args: Returns: A `SparseTensor` representing the deserialized `SparseTensor` objects." -9869,deserialize_many_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2275,function,"Deserialize and concatenate `SparseTensors` from a serialized minibatch. +9219,deserialize_many_sparse,tensorflow/tensorflow/python/ops/sparse_ops.py,2275,function,"Deserialize and concatenate `SparseTensors` from a serialized minibatch. The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where `N` is the minibatch size and the rows correspond to packed outputs of @@ -87135,7 +93022,7 @@ Returns: concatenated along the `SparseTensor`s' first dimension. All of the serialized `SparseTensor`s must have had the same rank and type." -9870,sparse_tensor_dense_matmul,tensorflow/tensorflow/python/ops/sparse_ops.py,2348,function,"Multiply SparseTensor (or dense Matrix) (of rank 2) ""A"" by dense matrix +9220,sparse_tensor_dense_matmul,tensorflow/tensorflow/python/ops/sparse_ops.py,2348,function,"Multiply SparseTensor (or dense Matrix) (of rank 2) ""A"" by dense matrix (or SparseTensor) ""B"". Please note that one and only one of the inputs MUST be a SparseTensor and the other MUST be a dense matrix. @@ -87333,7 +93220,7 @@ Returns: `A = A.H if adjoint_a else A` `B = B.H if adjoint_b else B` `return A*B`" -9871,sparse_softmax,tensorflow/tensorflow/python/ops/sparse_ops.py,2584,function,"Applies softmax to a batched N-D `SparseTensor`. +9221,sparse_softmax,tensorflow/tensorflow/python/ops/sparse_ops.py,2584,function,"Applies softmax to a batched N-D `SparseTensor`. The inputs represent an N-D SparseTensor with logical shape `[..., B, C]` (where `N >= 2`), and with indices sorted in the canonical lexicographic @@ -87377,7 +93264,7 @@ Args: name: optional name of the operation. Returns: output: N-D `SparseTensor` representing the results." -9872,sparse_maximum,tensorflow/tensorflow/python/ops/sparse_ops.py,2640,function,"Returns the element-wise max of two SparseTensors. +9222,sparse_maximum,tensorflow/tensorflow/python/ops/sparse_ops.py,2640,function,"Returns the element-wise max of two SparseTensors. Assumes the two SparseTensors have the same shape, i.e., no broadcasting. Example: @@ -87397,7 +93284,7 @@ Args: name: optional name of the operation. Returns: output: the output SparseTensor." -9873,sparse_minimum,tensorflow/tensorflow/python/ops/sparse_ops.py,2678,function,"Returns the element-wise min of two SparseTensors. +9223,sparse_minimum,tensorflow/tensorflow/python/ops/sparse_ops.py,2678,function,"Returns the element-wise min of two SparseTensors. Assumes the two SparseTensors have the same shape, i.e., no broadcasting. Example: @@ -87417,7 +93304,7 @@ Args: name: optional name of the operation. Returns: output: the output SparseTensor." -9874,sparse_transpose,tensorflow/tensorflow/python/ops/sparse_ops.py,2716,function,"Transposes a `SparseTensor` +9224,sparse_transpose,tensorflow/tensorflow/python/ops/sparse_ops.py,2716,function,"Transposes a `SparseTensor` The returned tensor's dimension i will correspond to the input dimension `perm[i]`. If `perm` is not given, it is set to (n-1...0), where n is @@ -87448,7 +93335,7 @@ Returns: Raises: TypeError: If `sp_input` is not a `SparseTensor`." -9875,map_values,tensorflow/tensorflow/python/ops/sparse_ops.py,2778,function,"Applies `op` to the `.values` tensor of one or more `SparseTensor`s. +9225,map_values,tensorflow/tensorflow/python/ops/sparse_ops.py,2778,function,"Applies `op` to the `.values` tensor of one or more `SparseTensor`s. Replaces any `SparseTensor` in `args` or `kwargs` with its `values` tensor (which contains the non-default values for the SparseTensor), @@ -87496,125 +93383,7 @@ Returns: Raises: ValueError: If args contains no `SparseTensor`, or if the `indices` or `dense_shape`s of the input `SparseTensor`s are not equal." -9876,_assert_sparse_compatible,tensorflow/tensorflow/python/ops/sparse_ops.py,2843,function,"Check that all of `sparse_tensors` have same `indices` and `dense_shape`. - -Args: - sparse_tensors: A list of sparse tensors. - -Returns: - An op to be used as a control dependency." -9877,_replace_sparse_with_values,tensorflow/tensorflow/python/ops/sparse_ops.py,2864,function,"Replace `SparseTensor`s with their values in `value` - -Each `SparseTensor` in `value` is replaced by its `values` tensor, and -collects all `SparseTensor`s in `sparse_list`. - -Args: - value: A structure of `Tensor`s and `SparseTensor`s - sparse_list: A list. Output parameter that collects all `SparseTensor`s in - `value`. - -Returns: - `value` with each SparseTensor replaced by its `.value` attribute." -9878,_add_sparse_to_tensors_map,tensorflow/tensorflow/python/ops/sparse_ops.py,2889,function,"Add a `SparseTensor` to a `SparseTensorsMap` and return its handle. - -Args: - sp_input: The input `SparseTensor`. - container: The container for the underlying `SparseTensorsMap` (optional). - shared_name: The shared name for the underlying `SparseTensorsMap` - (optional, defaults to the name of the newly created op). - name: A name prefix for the returned tensors (optional). - -Returns: - A string 1-vector (1D `Tensor`), with the single element representing the - a unique handle to a `SparseTensor` stored by the `SparseTensorMap` - underlying this op. - -Raises: - TypeError: If `sp_input` is not a `SparseTensor`." -9879,_add_many_sparse_to_tensors_map,tensorflow/tensorflow/python/ops/sparse_ops.py,2921,function,"Add a minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. - -The `SparseTensor` must have rank `R` greater than 1, and the first dimension -is treated as the minibatch dimension. Elements of the `SparseTensor` -must be sorted in increasing order of this first dimension. The serialized -`SparseTensor` objects going into each row of the output `Tensor` will have -rank `R-1`. - -The minibatch size `N` is extracted from `sparse_shape[0]`. - -Args: - sp_input: The input rank `R` `SparseTensor`. - container: The container for the underlying `SparseTensorsMap` (optional). - shared_name: The shared name for the underlying `SparseTensorsMap` - (optional, defaults to the name of the newly created op). - name: A name prefix for the returned tensors (optional). - -Returns: - A string matrix (2-D `Tensor`) with `N` rows and `1` column. - Each row represents a unique handle to a `SparseTensor` stored by - the `SparseTensorMap` underlying this op. - -Raises: - TypeError: If `sp_input` is not a `SparseTensor`." -9880,_take_many_sparse_from_tensors_map,tensorflow/tensorflow/python/ops/sparse_ops.py,2961,function,"Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. - -The input `sparse_handles` must be a string matrix of shape `[N, 1]` where -`N` is the minibatch size and the rows correspond to packed outputs of -`add_sparse_to_tensors_map`. The ranks of the original `SparseTensor` objects -must all match. When the final `SparseTensor` is created, it has rank one -higher than the ranks of the incoming `SparseTensor` objects (they have been -concatenated along a new row dimension). - -The output `SparseTensor` object's shape values for all dimensions but the -first are the max across the input `SparseTensor` objects' shape values -for the corresponding dimensions. Its first shape value is `N`, the minibatch -size. - -The input `SparseTensor` objects' indices are assumed ordered in -standard lexicographic order. If this is not the case, after this -step run `sparse.reorder` to restore index ordering. - -For example, if the serialized input is a `[2, 3]` matrix representing two -original `SparseTensor` objects: - - index = [ 0] - [10] - [20] - values = [1, 2, 3] - shape = [50] - -and - - index = [ 2] - [10] - values = [4, 5] - shape = [30] - -then the final deserialized `SparseTensor` will be: - - index = [0 0] - [0 10] - [0 20] - [1 2] - [1 10] - values = [1, 2, 3, 4, 5] - shape = [2 50] - -Args: - sparse_map_op: The `Operation` that created the original handles. - Usually this is, e.g., `add_sparse_to_tensors_map(...).op`. - sparse_handles: 2-D `Tensor` of type `string` of shape `[N, 1]`. - The serialized and packed `SparseTensor` objects. - rank: (optional) Python int, the rank of the `SparseTensor` objects. - name: A name prefix for the returned tensors (optional) - -Returns: - A `SparseTensor` representing the deserialized `SparseTensor`s, - concatenated along the `SparseTensor`s' first dimension. - - All of the serialized `SparseTensor`s must have had the same rank and type." -9881,_UnaryMapValueDispatcher,tensorflow/tensorflow/python/ops/sparse_ops.py,3047,class,OpDispatcher for unary ops that maps base function across sparse values. -9882,SparseOpsTest,tensorflow/tensorflow/python/ops/sparse_ops_test.py,42,class, -9883,lbeta,tensorflow/tensorflow/python/ops/special_math_ops.py,53,function,"Computes \\(ln(|Beta(x)|)\\), reducing along the last dimension. +9226,lbeta,tensorflow/tensorflow/python/ops/special_math_ops.py,53,function,"Computes \\(ln(|Beta(x)|)\\), reducing along the last dimension. Given one-dimensional $z = [z_1,...,z_K]$, we define @@ -87644,7 +93413,7 @@ Args: Returns: The logarithm of \\(|Beta(x)|\\) reducing along the last dimension." -9884,dawsn,tensorflow/tensorflow/python/ops/special_math_ops.py,108,function,"Computes Dawson's integral of `x` element-wise. +9227,dawsn,tensorflow/tensorflow/python/ops/special_math_ops.py,108,function,"Computes Dawson's integral of `x` element-wise. Dawson's integral is defined as `exp(-x**2)` times the integral of `exp(t**2)` from `0` to `x`, with the domain of definition all real numbers. @@ -87666,7 +93435,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.dawsn @end_compatibility" -9885,expint,tensorflow/tensorflow/python/ops/special_math_ops.py,138,function,"Computes the Exponential integral of `x` element-wise. +9228,expint,tensorflow/tensorflow/python/ops/special_math_ops.py,138,function,"Computes the Exponential integral of `x` element-wise. The Exponential integral is defined as the integral of `exp(t) / t` from `-inf` to `x`, with the domain of definition all positive real numbers. @@ -87687,7 +93456,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.expi @end_compatibility" -9886,fresnel_cos,tensorflow/tensorflow/python/ops/special_math_ops.py,167,function,"Computes Fresnel's cosine integral of `x` element-wise. +9229,fresnel_cos,tensorflow/tensorflow/python/ops/special_math_ops.py,167,function,"Computes Fresnel's cosine integral of `x` element-wise. The Fresnel cosine integral is defined as the integral of `cos(t^2)` from `0` to `x`, with the domain of definition all real numbers. @@ -87709,7 +93478,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.fresnel second output. @end_compatibility" -9887,fresnel_sin,tensorflow/tensorflow/python/ops/special_math_ops.py,197,function,"Computes Fresnel's sine integral of `x` element-wise. +9230,fresnel_sin,tensorflow/tensorflow/python/ops/special_math_ops.py,197,function,"Computes Fresnel's sine integral of `x` element-wise. The Fresnel sine integral is defined as the integral of `sin(t^2)` from `0` to `x`, with the domain of definition all real numbers. @@ -87730,7 +93499,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.fresnel first output. @end_compatibility" -9888,spence,tensorflow/tensorflow/python/ops/special_math_ops.py,226,function,"Computes Spence's integral of `x` element-wise. +9231,spence,tensorflow/tensorflow/python/ops/special_math_ops.py,226,function,"Computes Spence's integral of `x` element-wise. Spence's integral is defined as the integral of `log(t) / (1 - t)` from `1` to `x`, with the domain of definition all non-negative real numbers. @@ -87751,7 +93520,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.spence @end_compatibility" -9889,bessel_i0,tensorflow/tensorflow/python/ops/special_math_ops.py,255,function,"Computes the Bessel i0 function of `x` element-wise. +9232,bessel_i0,tensorflow/tensorflow/python/ops/special_math_ops.py,255,function,"Computes the Bessel i0 function of `x` element-wise. Modified Bessel function of order 0. @@ -87771,7 +93540,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.i0 @end_compatibility" -9890,bessel_i0e,tensorflow/tensorflow/python/ops/special_math_ops.py,283,function,"Computes the Bessel i0e function of `x` element-wise. +9233,bessel_i0e,tensorflow/tensorflow/python/ops/special_math_ops.py,283,function,"Computes the Bessel i0e function of `x` element-wise. Modified Bessel function of order 0. @@ -87789,7 +93558,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.i0e @end_compatibility" -9891,bessel_i1,tensorflow/tensorflow/python/ops/special_math_ops.py,309,function,"Computes the Bessel i1 function of `x` element-wise. +9234,bessel_i1,tensorflow/tensorflow/python/ops/special_math_ops.py,309,function,"Computes the Bessel i1 function of `x` element-wise. Modified Bessel function of order 1. @@ -87809,7 +93578,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.i1 @end_compatibility" -9892,bessel_i1e,tensorflow/tensorflow/python/ops/special_math_ops.py,337,function,"Computes the Bessel i1e function of `x` element-wise. +9235,bessel_i1e,tensorflow/tensorflow/python/ops/special_math_ops.py,337,function,"Computes the Bessel i1e function of `x` element-wise. Modified Bessel function of order 1. @@ -87827,7 +93596,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.i1e @end_compatibility" -9893,bessel_k0,tensorflow/tensorflow/python/ops/special_math_ops.py,363,function,"Computes the Bessel k0 function of `x` element-wise. +9236,bessel_k0,tensorflow/tensorflow/python/ops/special_math_ops.py,363,function,"Computes the Bessel k0 function of `x` element-wise. Modified Bessel function of order 0. @@ -87847,7 +93616,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.k0 @end_compatibility" -9894,bessel_k0e,tensorflow/tensorflow/python/ops/special_math_ops.py,391,function,"Computes the Bessel k0e function of `x` element-wise. +9237,bessel_k0e,tensorflow/tensorflow/python/ops/special_math_ops.py,391,function,"Computes the Bessel k0e function of `x` element-wise. Modified Bessel function of order 0. @@ -87865,7 +93634,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.k0e @end_compatibility" -9895,bessel_k1,tensorflow/tensorflow/python/ops/special_math_ops.py,417,function,"Computes the Bessel k1 function of `x` element-wise. +9238,bessel_k1,tensorflow/tensorflow/python/ops/special_math_ops.py,417,function,"Computes the Bessel k1 function of `x` element-wise. Modified Bessel function of order 1. @@ -87885,7 +93654,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.k1 @end_compatibility" -9896,bessel_k1e,tensorflow/tensorflow/python/ops/special_math_ops.py,445,function,"Computes the Bessel k1e function of `x` element-wise. +9239,bessel_k1e,tensorflow/tensorflow/python/ops/special_math_ops.py,445,function,"Computes the Bessel k1e function of `x` element-wise. Modified Bessel function of order 1. @@ -87903,7 +93672,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.k1e @end_compatibility" -9897,bessel_j0,tensorflow/tensorflow/python/ops/special_math_ops.py,471,function,"Computes the Bessel j0 function of `x` element-wise. +9240,bessel_j0,tensorflow/tensorflow/python/ops/special_math_ops.py,471,function,"Computes the Bessel j0 function of `x` element-wise. Modified Bessel function of order 0. @@ -87921,7 +93690,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.j0 @end_compatibility" -9898,bessel_j1,tensorflow/tensorflow/python/ops/special_math_ops.py,497,function,"Computes the Bessel j1 function of `x` element-wise. +9241,bessel_j1,tensorflow/tensorflow/python/ops/special_math_ops.py,497,function,"Computes the Bessel j1 function of `x` element-wise. Modified Bessel function of order 1. @@ -87939,7 +93708,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.j1 @end_compatibility" -9899,bessel_y0,tensorflow/tensorflow/python/ops/special_math_ops.py,523,function,"Computes the Bessel y0 function of `x` element-wise. +9242,bessel_y0,tensorflow/tensorflow/python/ops/special_math_ops.py,523,function,"Computes the Bessel y0 function of `x` element-wise. Modified Bessel function of order 0. @@ -87957,7 +93726,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.y0 @end_compatibility" -9900,bessel_y1,tensorflow/tensorflow/python/ops/special_math_ops.py,549,function,"Computes the Bessel y1 function of `x` element-wise. +9243,bessel_y1,tensorflow/tensorflow/python/ops/special_math_ops.py,549,function,"Computes the Bessel y1 function of `x` element-wise. Modified Bessel function of order 1. @@ -87975,9 +93744,7 @@ Returns: @compatibility(scipy) Equivalent to scipy.special.y1 @end_compatibility" -9901,_einsum_grad,tensorflow/tensorflow/python/ops/special_math_ops.py,574,function, -9902,_enclosing_tpu_context,tensorflow/tensorflow/python/ops/special_math_ops.py,596,function, -9903,einsum,tensorflow/tensorflow/python/ops/special_math_ops.py,608,function,"Tensor contraction over specified indices and outer product. +9244,einsum,tensorflow/tensorflow/python/ops/special_math_ops.py,608,function,"Tensor contraction over specified indices and outer product. Einsum allows defining Tensors by defining their element-wise computation. This computation is defined by `equation`, a shorthand form based on Einstein @@ -88051,71 +93818,9 @@ Raises: ValueError: If - the format of `equation` is incorrect, - number of inputs or their shapes are inconsistent with `equation`." -9904,_einsum_v1,tensorflow/tensorflow/python/ops/special_math_ops.py,687,function,Legacy implementation of einsum without using EinsumOp. -9905,_einsum_v1_parse_and_resolve_equation,tensorflow/tensorflow/python/ops/special_math_ops.py,751,function,"Helper for einsum() that splits/resolves inputs & outputs. - -Args: - equation: Equation string given as argument to einsum(). - input_shapes: List of the shapes of all inputs given to einsum() - -Returns: - input_axis_labels, output_axis_labels where: - input_axis_labels: List of length len(input_shapes) of strings - representing the character label for each dimension of each given input, - resolving any broadcast (...) axes, - output_axis_labels: A string of character labels for each axes of output - tensor, filling in missing output subscripts and broadcast axes. - -Raises: - ValueError: If equation is in the uncorrect format, incorrect number of - inputs given or broadcast axes ""..."" or output axes could not be resolved." -9906,_einsum_v1_reduction,tensorflow/tensorflow/python/ops/special_math_ops.py,834,function,"Helper for einsum() that computes the result of a two-argument einsum(). - -Args: - t0: a `Tensor` - t0_axis_labels: a string of axis labels. This string's length must equal - the rank of t0. - t1: a `Tensor` - t1_axis_labels: a string to axis labels. This string's length must equal - the rank of t1. - axes_to_sum: set of labels of axes to be summed over - -Returns: - A `Tensor` whose elements are obtained by summing, over all axes in - `axes_to_sum`, the corresponding elements of `t0` and `t1`. - - For example, if t0_axis_labels == 'abijk', t1_axis_labels == 'acjkl', and - axes_to_sum == {j,k}, this will return a tensor x where - - out[a,b,c,i,l] = sum_j sum_k t0[a,b,i,j,k] * t1[a,c,j,k,l] - -Raises: - ValueError: if the rank of `t0` does not match the length of - `t0_axis_labels`, or that of `t1` does not match the length of - `t1_axis_labels`." -9907,_transpose_if_necessary,tensorflow/tensorflow/python/ops/special_math_ops.py,962,function,"Like transpose(), but avoids creating a new tensor if possible." -9908,_reshape_if_necessary,tensorflow/tensorflow/python/ops/special_math_ops.py,970,function,"Like reshape(), but avoids creating a new tensor if possible." -9909,_get_shape,tensorflow/tensorflow/python/ops/special_math_ops.py,983,function,"Like get_shape().as_list(), but explicitly queries the shape of a tensor -if necessary to ensure that the returned value contains no unknown value." -9910,_total_size,tensorflow/tensorflow/python/ops/special_math_ops.py,997,function,"Given list of tensor shape values, returns total size. -If shape_values contains tensor values (which are results of -array_ops.shape), then it returns a scalar tensor. -If not, it returns an integer." -9911,_exponential_space_einsum_v1,tensorflow/tensorflow/python/ops/special_math_ops.py,1009,function,Fallback implementation that supports summing an index over > 2 inputs. -9912,_einsum_v2,tensorflow/tensorflow/python/ops/special_math_ops.py,1085,function,Implementation of einsum utilizing opt_einsum and EinsumOp. -9913,_get_opt_einsum_contract_path,tensorflow/tensorflow/python/ops/special_math_ops.py,1136,function,Returns the (memoized) result of opt_einsum.contract_path. -9914,_einsum_v2_parse_and_resolve_equation,tensorflow/tensorflow/python/ops/special_math_ops.py,1159,function,Helper which validates einsum equation and resolves input shapes. -9915,LBetaTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,44,class, -9916,DawsnTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,185,class, -9917,ExpintTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,227,class, -9918,FresnelCosTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,269,class, -9919,FresnelSinTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,314,class, -9920,SpenceTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,359,class, -9921,BesselTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,407,class, -9922,EinsumTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,638,class, -9923,EinsumGradTest,tensorflow/tensorflow/python/ops/special_math_ops_test.py,955,class, -9924,EinsumBenchmark,tensorflow/tensorflow/python/ops/special_math_ops_test.py,1077,class, -9925,build_graph,tensorflow/tensorflow/python/ops/split_benchmark.py,34,function,"Build a graph containing a sequence of split operations. +9245,EinsumBenchmark,tensorflow/tensorflow/python/ops/special_math_ops_test.py,1077,class, +9246,benchmark_einsum,tensorflow/tensorflow/python/ops/special_math_ops_test.py,1106,method, +9247,build_graph,tensorflow/tensorflow/python/ops/split_benchmark.py,34,function,"Build a graph containing a sequence of split operations. Args: device: string, the device to run on. @@ -88125,9 +93830,10 @@ Args: Returns: An array of tensors to run()" -9926,SplitBenchmark,tensorflow/tensorflow/python/ops/split_benchmark.py,55,class,Benchmark split! -9927,variable_op,tensorflow/tensorflow/python/ops/state_ops.py,41,function,Deprecated. Used variable_op_v2 instead. -9928,variable_op_v2,tensorflow/tensorflow/python/ops/state_ops.py,55,function,"Create a variable Operation. +9248,SplitBenchmark,tensorflow/tensorflow/python/ops/split_benchmark.py,55,class,Benchmark split! +9249,benchmark_split,tensorflow/tensorflow/python/ops/split_benchmark.py,109,method, +9250,variable_op,tensorflow/tensorflow/python/ops/state_ops.py,41,function,Deprecated. Used variable_op_v2 instead. +9251,variable_op_v2,tensorflow/tensorflow/python/ops/state_ops.py,55,function,"Create a variable Operation. See also variables.Variable. @@ -88144,7 +93850,7 @@ Args: Returns: A variable tensor." -9929,init_variable,tensorflow/tensorflow/python/ops/state_ops.py,82,function,"Initializes variable with ""init"". +9252,init_variable,tensorflow/tensorflow/python/ops/state_ops.py,82,function,"Initializes variable with ""init"". This op does the following: if init is a Tensor, v = init @@ -88161,7 +93867,7 @@ Args: Returns: The operation that initializes v." -9930,is_variable_initialized,tensorflow/tensorflow/python/ops/state_ops.py,117,function,"Checks whether a tensor has been initialized. +9253,is_variable_initialized,tensorflow/tensorflow/python/ops/state_ops.py,117,function,"Checks whether a tensor has been initialized. Outputs boolean scalar indicating whether the tensor has been initialized. @@ -88172,7 +93878,7 @@ Args: Returns: A `Tensor` of type `bool`." -9931,assign_sub,tensorflow/tensorflow/python/ops/state_ops.py,137,function,"Update `ref` by subtracting `value` from it. +9254,assign_sub,tensorflow/tensorflow/python/ops/state_ops.py,137,function,"Update `ref` by subtracting `value` from it. This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. @@ -88194,7 +93900,7 @@ Args: Returns: Same as ""ref"". Returned as a convenience for operations that want to use the new value after the variable has been updated." -9932,assign_add,tensorflow/tensorflow/python/ops/state_ops.py,168,function,"Update `ref` by adding `value` to it. +9255,assign_add,tensorflow/tensorflow/python/ops/state_ops.py,168,function,"Update `ref` by adding `value` to it. This operation outputs ""ref"" after the update is done. This makes it easier to chain operations that need to use the reset value. @@ -88216,7 +93922,7 @@ Args: Returns: Same as ""ref"". Returned as a convenience for operations that want to use the new value after the variable has been updated." -9933,assign,tensorflow/tensorflow/python/ops/state_ops.py,199,function,"Update `ref` by assigning `value` to it. +9256,assign,tensorflow/tensorflow/python/ops/state_ops.py,199,function,"Update `ref` by assigning `value` to it. This operation outputs a Tensor that holds the new value of `ref` after the value has been assigned. This makes it easier to chain operations that @@ -88239,7 +93945,7 @@ Args: Returns: A `Tensor` that will hold the new value of `ref` after the assignment has completed." -9934,count_up_to,tensorflow/tensorflow/python/ops/state_ops.py,233,function,"Increments 'ref' until it reaches 'limit'. +9257,count_up_to,tensorflow/tensorflow/python/ops/state_ops.py,233,function,"Increments 'ref' until it reaches 'limit'. Args: ref: A Variable. Must be one of the following types: `int32`, `int64`. @@ -88253,7 +93959,7 @@ Returns: A `Tensor`. Has the same type as `ref`. A copy of the input before increment. If nothing else modifies the input, the values produced will all be distinct." -9935,scatter_update,tensorflow/tensorflow/python/ops/state_ops.py,256,function,"Applies sparse updates to a variable reference. +9258,scatter_update,tensorflow/tensorflow/python/ops/state_ops.py,256,function,"Applies sparse updates to a variable reference. This operation computes @@ -88295,7 +94001,7 @@ Args: Returns: Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done." -9936,scatter_nd_update,tensorflow/tensorflow/python/ops/state_ops.py,310,function,"Applies sparse `updates` to individual values or slices in a Variable. +9259,scatter_nd_update,tensorflow/tensorflow/python/ops/state_ops.py,310,function,"Applies sparse `updates` to individual values or slices in a Variable. `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. @@ -88346,7 +94052,7 @@ Args: Returns: The value of the variable after the update." -9937,scatter_add,tensorflow/tensorflow/python/ops/state_ops.py,372,function,"Adds sparse updates to the variable referenced by `resource`. +9260,scatter_add,tensorflow/tensorflow/python/ops/state_ops.py,372,function,"Adds sparse updates to the variable referenced by `resource`. This operation computes @@ -88386,7 +94092,7 @@ Args: Returns: Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done." -9938,scatter_nd_add,tensorflow/tensorflow/python/ops/state_ops.py,424,function,"Applies sparse addition to individual values or slices in a Variable. +9261,scatter_nd_add,tensorflow/tensorflow/python/ops/state_ops.py,424,function,"Applies sparse addition to individual values or slices in a Variable. `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. @@ -88438,7 +94144,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9939,scatter_sub,tensorflow/tensorflow/python/ops/state_ops.py,487,function,"Subtracts sparse updates to a variable reference. +9262,scatter_sub,tensorflow/tensorflow/python/ops/state_ops.py,487,function,"Subtracts sparse updates to a variable reference. ```python # Scalar indices @@ -88481,7 +94187,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9940,scatter_nd_sub,tensorflow/tensorflow/python/ops/state_ops.py,541,function,"Applies sparse subtraction to individual values or slices in a Variable. +9263,scatter_nd_sub,tensorflow/tensorflow/python/ops/state_ops.py,541,function,"Applies sparse subtraction to individual values or slices in a Variable. `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. @@ -88534,7 +94240,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9941,scatter_mul,tensorflow/tensorflow/python/ops/state_ops.py,605,function,"Multiplies sparse updates into a variable reference. +9264,scatter_mul,tensorflow/tensorflow/python/ops/state_ops.py,605,function,"Multiplies sparse updates into a variable reference. This operation computes @@ -88574,7 +94280,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9942,scatter_div,tensorflow/tensorflow/python/ops/state_ops.py,657,function,"Divides a variable reference by sparse updates. +9265,scatter_div,tensorflow/tensorflow/python/ops/state_ops.py,657,function,"Divides a variable reference by sparse updates. This operation computes @@ -88614,7 +94320,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9943,scatter_max,tensorflow/tensorflow/python/ops/state_ops.py,709,function,"Reduces sparse updates into a variable reference using the `max` operation. +9266,scatter_max,tensorflow/tensorflow/python/ops/state_ops.py,709,function,"Reduces sparse updates into a variable reference using the `max` operation. This operation computes @@ -88657,7 +94363,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9944,scatter_min,tensorflow/tensorflow/python/ops/state_ops.py,764,function,"Reduces sparse updates into a variable reference using the `min` operation. +9267,scatter_min,tensorflow/tensorflow/python/ops/state_ops.py,764,function,"Reduces sparse updates into a variable reference using the `min` operation. This operation computes @@ -88700,7 +94406,7 @@ Args: Returns: A mutable `Tensor`. Has the same type as `ref`." -9945,batch_scatter_update,tensorflow/tensorflow/python/ops/state_ops.py,821,function,"Generalization of `tf.compat.v1.scatter_update` to axis different than 0. +9268,batch_scatter_update,tensorflow/tensorflow/python/ops/state_ops.py,821,function,"Generalization of `tf.compat.v1.scatter_update` to axis different than 0. Analogous to `batch_gather`. This assumes that `ref`, `indices` and `updates` have a series of leading dimensions that are the same for all of them, and the @@ -88749,8 +94455,8 @@ Returns: Raises: ValueError: If the initial `ndims` of `ref`, `indices`, and `updates` are not the same." -9946,Algorithm,tensorflow/tensorflow/python/ops/stateful_random_ops.py,67,class, -9947,non_deterministic_ints,tensorflow/tensorflow/python/ops/stateful_random_ops.py,77,function,"Non-deterministically generates some integers. +9269,Algorithm,tensorflow/tensorflow/python/ops/stateful_random_ops.py,67,class, +9270,non_deterministic_ints,tensorflow/tensorflow/python/ops/stateful_random_ops.py,77,function,"Non-deterministically generates some integers. This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results. @@ -88761,27 +94467,7 @@ Args: Returns: a tensor whose element values are non-deterministically chosen." -9948,_uint_to_int,tensorflow/tensorflow/python/ops/stateful_random_ops.py,94,function, -9949,_make_1d_state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,100,function,"Makes a 1-D RNG state. - -Args: - state_size: an integer. - seed: an integer or 1-D tensor. - -Returns: - a 1-D tensor of shape [state_size] and dtype STATE_TYPE." -9950,_get_state_size,tensorflow/tensorflow/python/ops/stateful_random_ops.py,139,function, -9951,_check_state_shape,tensorflow/tensorflow/python/ops/stateful_random_ops.py,148,function, -9952,_make_state_from_seed,tensorflow/tensorflow/python/ops/stateful_random_ops.py,154,function, -9953,_convert_alg_to_int,tensorflow/tensorflow/python/ops/stateful_random_ops.py,158,function,"Converts algorithm to an integer. - -Args: - alg: can be one of these types: integer, Algorithm, Tensor, string. Allowed - strings are ""philox"" and ""threefry"". - -Returns: - An integer, unless the input is a Tensor in which case a Tensor is returned." -9954,create_rng_state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,187,function,"Creates a RNG state from an integer or a vector. +9271,create_rng_state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,187,function,"Creates a RNG state from an integer or a vector. Example: @@ -88798,10 +94484,9 @@ Args: Returns: a 1-D numpy array whose size depends on the algorithm." -9955,_shape_tensor,tensorflow/tensorflow/python/ops/stateful_random_ops.py,210,function,"Convert to an int32 or int64 tensor, defaulting to int64 if empty." -9956,_convert_to_state_tensor,tensorflow/tensorflow/python/ops/stateful_random_ops.py,219,function, -9957,GeneratorSpec,tensorflow/tensorflow/python/ops/stateful_random_ops.py,226,class,TypeSpec for Generator. -9958,Generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,259,class,"Random-number generator. +9272,GeneratorSpec,tensorflow/tensorflow/python/ops/stateful_random_ops.py,226,class,TypeSpec for Generator. +9273,value_type,tensorflow/tensorflow/python/ops/stateful_random_ops.py,251,method, +9274,Generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,259,class,"Random-number generator. Example: @@ -88852,7 +94537,312 @@ There is also a global generator: >>> g = tf.random.get_global_generator() >>> g.normal(shape=(2, 3)) " -9959,get_global_generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,915,function,"Retrieves the global generator. +9275,from_state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,387,method,"Creates a generator from a state. + +See `__init__` for description of `state` and `alg`. + +Args: + state: the new state. + alg: the RNG algorithm. + +Returns: + The new generator. + +Throws: + ValueError: if the generator is created inside a synchronous + `tf.distribute` strategy such as `MirroredStrategy` or `TPUStrategy`, + because there is ambiguity on how to replicate a generator (e.g. should + it be copied so such each replica will get the same random numbers, or + should it be ""split"" into different generators that generate + different random numbers)." +9276,from_seed,tensorflow/tensorflow/python/ops/stateful_random_ops.py,410,method,"Creates a generator from a seed. + +A seed is a 1024-bit unsigned integer represented either as a Python +integer or a vector of integers. Seeds shorter than 1024-bit will be +padded. The padding, the internal structure of a seed and the way a seed +is converted to a state are all opaque (unspecified). The only semantics +specification of seeds is that two different seeds are likely to produce +two independent generators (but no guarantee). + +Args: + seed: the seed for the RNG. + alg: (optional) the RNG algorithm. If None, it will be auto-selected. See + `__init__` for its possible values. + +Returns: + The new generator. + +Throws: + ValueError: if the generator is created inside a synchronous + `tf.distribute` strategy such as `MirroredStrategy` or `TPUStrategy`, + because there is ambiguity on how to replicate a generator (e.g. should + it be copied so such each replica will get the same random numbers, or + should it be ""split"" into different generators that generate + different random numbers)." +9277,from_non_deterministic_state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,444,method,"Creates a generator by non-deterministically initializing its state. + +The source of the non-determinism will be platform- and time-dependent. + +Args: + alg: (optional) the RNG algorithm. If None, it will be auto-selected. See + `__init__` for its possible values. + +Returns: + The new generator. + +Throws: + ValueError: if the generator is created inside a synchronous + `tf.distribute` strategy such as `MirroredStrategy` or `TPUStrategy`, + because there is ambiguity on how to replicate a generator (e.g. should + it be copied so such each replica will get the same random numbers, or + should it be ""split"" into different generators that generate + different random numbers)." +9278,from_key_counter,tensorflow/tensorflow/python/ops/stateful_random_ops.py,473,method,"Creates a generator from a key and a counter. + +This constructor only applies if the algorithm is a counter-based algorithm. +See method `key` for the meaning of ""key"" and ""counter"". + +Args: + key: the key for the RNG, a scalar of type STATE_TYPE. + counter: a vector of dtype STATE_TYPE representing the initial counter for + the RNG, whose length is algorithm-specific., + alg: the RNG algorithm. If None, it will be auto-selected. See + `__init__` for its possible values. + +Returns: + The new generator. + +Throws: + ValueError: if the generator is created inside a synchronous + `tf.distribute` strategy such as `MirroredStrategy` or `TPUStrategy`, + because there is ambiguity on how to replicate a generator (e.g. should + it be copied so such each replica will get the same random numbers, or + should it be ""split"" into different generators that generate + different random numbers)." +9279,reset,tensorflow/tensorflow/python/ops/stateful_random_ops.py,506,method,"Resets the generator by a new state. + +See `__init__` for the meaning of ""state"". + +Args: + state: the new state." +9280,reset_from_seed,tensorflow/tensorflow/python/ops/stateful_random_ops.py,518,method,"Resets the generator by a new seed. + +See `from_seed` for the meaning of ""seed"". + +Args: + seed: the new seed." +9281,reset_from_key_counter,tensorflow/tensorflow/python/ops/stateful_random_ops.py,529,method,"Resets the generator by a new key-counter pair. + +See `from_key_counter` for the meaning of ""key"" and ""counter"". + +Args: + key: the new key. + counter: the new counter." +9282,state,tensorflow/tensorflow/python/ops/stateful_random_ops.py,553,method,The internal state of the RNG. +9283,algorithm,tensorflow/tensorflow/python/ops/stateful_random_ops.py,558,method,The RNG algorithm id (a Python integer or scalar integer Tensor). +9284,key,tensorflow/tensorflow/python/ops/stateful_random_ops.py,567,method,"The 'key' part of the state of a counter-based RNG. + +For a counter-base RNG algorithm such as Philox and ThreeFry (as +described in paper 'Parallel Random Numbers: As Easy as 1, 2, 3' +[https://www.thesalmons.org/john/random123/papers/random123sc11.pdf]), +the RNG state consists of two parts: counter and key. The output is +generated via the formula: output=hash(key, counter), i.e. a hashing of +the counter parametrized by the key. Two RNGs with two different keys can +be thought as generating two independent random-number streams (a stream +is formed by increasing the counter). + +Returns: + A scalar which is the 'key' part of the state, if the RNG algorithm is + counter-based; otherwise it raises a ValueError." +9285,skip,tensorflow/tensorflow/python/ops/stateful_random_ops.py,589,method,"Advance the counter of a counter-based RNG. + +Args: + delta: the amount of advancement. The state of the RNG after + `skip(n)` will be the same as that after `normal([n])` + (or any other distribution). The actual increment added to the + counter is an unspecified implementation detail." +9286,normal,tensorflow/tensorflow/python/ops/stateful_random_ops.py,602,method,"Outputs random values from a normal distribution. + +Args: + shape: A 1-D integer Tensor or Python array. The shape of the output + tensor. + mean: A 0-D Tensor or Python value of type `dtype`. The mean of the normal + distribution. + stddev: A 0-D Tensor or Python value of type `dtype`. The standard + deviation of the normal distribution. + dtype: The type of the output. + name: A name for the operation (optional). + +Returns: + A tensor of the specified shape filled with random normal values." +9287,truncated_normal,tensorflow/tensorflow/python/ops/stateful_random_ops.py,630,method,"Outputs random values from a truncated normal distribution. + +The generated values follow a normal distribution with specified mean and +standard deviation, except that values whose magnitude is more than +2 standard deviations from the mean are dropped and re-picked. + +Args: + shape: A 1-D integer Tensor or Python array. The shape of the output + tensor. + mean: A 0-D Tensor or Python value of type `dtype`. The mean of the + truncated normal distribution. + stddev: A 0-D Tensor or Python value of type `dtype`. The standard + deviation of the normal distribution, before truncation. + dtype: The type of the output. + name: A name for the operation (optional). + +Returns: + A tensor of the specified shape filled with random truncated normal + values." +9288,uniform,tensorflow/tensorflow/python/ops/stateful_random_ops.py,673,method,"Outputs random values from a uniform distribution. + +The generated values follow a uniform distribution in the range +`[minval, maxval)`. The lower bound `minval` is included in the range, while +the upper bound `maxval` is excluded. (For float numbers especially +low-precision types like bfloat16, because of +rounding, the result may sometimes include `maxval`.) + +For floats, the default range is `[0, 1)`. For ints, at least `maxval` must +be specified explicitly. + +In the integer case, the random integers are slightly biased unless +`maxval - minval` is an exact power of two. The bias is small for values of +`maxval - minval` significantly smaller than the range of the output (either +`2**32` or `2**64`). + +For full-range random integers, pass `minval=None` and `maxval=None` with an +integer `dtype` (for integer dtypes, `minval` and `maxval` must be both +`None` or both not `None`). + +Args: + shape: A 1-D integer Tensor or Python array. The shape of the output + tensor. + minval: A Tensor or Python value of type `dtype`, broadcastable with + `shape` (for integer types, broadcasting is not supported, so it needs + to be a scalar). The lower bound (included) on the range of random + values to generate. Pass `None` for full-range integers. Defaults to 0. + maxval: A Tensor or Python value of type `dtype`, broadcastable with + `shape` (for integer types, broadcasting is not supported, so it needs + to be a scalar). The upper bound (excluded) on the range of random + values to generate. Pass `None` for full-range integers. Defaults to 1 + if `dtype` is floating point. + dtype: The type of the output. + name: A name for the operation (optional). + +Returns: + A tensor of the specified shape filled with random uniform values. + +Raises: + ValueError: If `dtype` is integral and `maxval` is not specified." +9289,uniform_full_int,tensorflow/tensorflow/python/ops/stateful_random_ops.py,739,method,"Uniform distribution on an integer type's entire range. + +This method is the same as setting `minval` and `maxval` to `None` in the +`uniform` method. + +Args: + shape: the shape of the output. + dtype: (optional) the integer type, default to uint64. + name: (optional) the name of the node. + +Returns: + A tensor of random numbers of the required shape." +9290,binomial,tensorflow/tensorflow/python/ops/stateful_random_ops.py,759,method,"Outputs random values from a binomial distribution. + +The generated values follow a binomial distribution with specified count and +probability of success parameters. + +Example: + +```python +counts = [10., 20.] +# Probability of success. +probs = [0.8] + +rng = tf.random.Generator.from_seed(seed=234) +binomial_samples = rng.binomial(shape=[2], counts=counts, probs=probs) + + +counts = ... # Shape [3, 1, 2] +probs = ... # Shape [1, 4, 2] +shape = [3, 4, 3, 4, 2] +rng = tf.random.Generator.from_seed(seed=1717) +# Sample shape will be [3, 4, 3, 4, 2] +binomial_samples = rng.binomial(shape=shape, counts=counts, probs=probs) +``` + + +Args: + shape: A 1-D integer Tensor or Python array. The shape of the output + tensor. + counts: Tensor. The counts of the binomial distribution. Must be + broadcastable with `probs`, and broadcastable with the rightmost + dimensions of `shape`. + probs: Tensor. The probability of success for the + binomial distribution. Must be broadcastable with `counts` and + broadcastable with the rightmost dimensions of `shape`. + dtype: The type of the output. Default: tf.int32 + name: A name for the operation (optional). + +Returns: + samples: A Tensor of the specified shape filled with random binomial + values. For each i, each samples[i, ...] is an independent draw from + the binomial distribution on counts[i] trials with probability of + success probs[i]." +9291,make_seeds,tensorflow/tensorflow/python/ops/stateful_random_ops.py,826,method,"Generates seeds for stateless random ops. + +For example: + +```python +seeds = get_global_generator().make_seeds(count=10) +for i in range(10): + seed = seeds[:, i] + numbers = stateless_random_normal(shape=[2, 3], seed=seed) + ... +``` + +Args: + count: the number of seed pairs (note that stateless random ops need a + pair of seeds to invoke). + +Returns: + A tensor of shape [2, count] and dtype int64." +9292,split,tensorflow/tensorflow/python/ops/stateful_random_ops.py,856,method,"Returns a list of independent `Generator` objects. + +Two generators are independent of each other in the sense that the +random-number streams they generate don't have statistically detectable +correlations. The new generators are also independent of the old one. +The old generator's state will be changed (like other random-number +generating methods), so two calls of `split` will return different +new generators. + +For example: + +```python +gens = get_global_generator().split(count=10) +for gen in gens: + numbers = gen.normal(shape=[2, 3]) + # ... +gens2 = get_global_generator().split(count=10) +# gens2 will be different from gens +``` + +The new generators will be put on the current device (possible different +from the old generator's), for example: + +```python +with tf.device(""/device:CPU:0""): + gen = Generator(seed=1234) # gen is on CPU +with tf.device(""/device:GPU:0""): + gens = gen.split(count=10) # gens are on GPU +``` + +Args: + count: the number of generators to return. + +Returns: + A list (length `count`) of `Generator` objects independent of each other. + The new generators have the same RNG algorithm as the old one." +9293,get_global_generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,915,function,"Retrieves the global generator. This function will create the global generator the first time it is called, and the generator will be placed at the default device at that time, so one @@ -88861,7 +94851,7 @@ placed on a less-ideal device will incur performance regression. Returns: The global `tf.random.Generator` object." -9960,set_global_generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,935,function,"Replaces the global generator with another `Generator` object. +9294,set_global_generator,tensorflow/tensorflow/python/ops/stateful_random_ops.py,935,function,"Replaces the global generator with another `Generator` object. This function creates a new Generator object (and the Variable object within), which does not work well with tf.function because (1) tf.function puts @@ -88876,8 +94866,7 @@ random_test.py/RandomTest.testResetGlobalGeneratorBadWithDefun . Args: generator: the new `Generator` object." -9961,StatefulRandomOpsTest,tensorflow/tensorflow/python/ops/stateful_random_ops_test.py,60,class, -9962,split,tensorflow/tensorflow/python/ops/stateless_random_ops.py,45,function,"Splits an RNG seed into `num` new seeds by adding a leading axis. +9295,split,tensorflow/tensorflow/python/ops/stateless_random_ops.py,45,function,"Splits an RNG seed into `num` new seeds by adding a leading axis. Example: @@ -88902,7 +94891,7 @@ Returns: A tensor with shape [num, 2] representing `num` new seeds. It will have the same dtype as `seed` (if `seed` doesn't have an explict dtype, the dtype will be determined by `tf.convert_to_tensor`)." -9963,fold_in,tensorflow/tensorflow/python/ops/stateless_random_ops.py,79,function,"Folds in data to an RNG seed to form a new RNG seed. +9296,fold_in,tensorflow/tensorflow/python/ops/stateless_random_ops.py,79,function,"Folds in data to an RNG seed to form a new RNG seed. For example, in a distributed-training setting, suppose we have a master seed and a replica ID. We want to fold the replica ID into the master seed to @@ -88931,7 +94920,7 @@ Returns: statistically safe for producing a stream of new pseudo-random values. It will have the same dtype as `data` (if `data` doesn't have an explict dtype, the dtype will be determined by `tf.convert_to_tensor`)." -9964,stateless_random_uniform,tensorflow/tensorflow/python/ops/stateless_random_ops.py,118,function,"Outputs deterministic pseudorandom values from a uniform distribution. +9297,stateless_random_uniform,tensorflow/tensorflow/python/ops/stateless_random_ops.py,118,function,"Outputs deterministic pseudorandom values from a uniform distribution. This is a stateless version of `tf.random.uniform`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The @@ -88984,7 +94973,7 @@ Returns: Raises: ValueError: If `dtype` is integral and only one of `minval` or `maxval` is specified." -9965,stateless_random_binomial,tensorflow/tensorflow/python/ops/stateless_random_ops.py,213,function,"Outputs deterministic pseudorandom values from a binomial distribution. +9298,stateless_random_binomial,tensorflow/tensorflow/python/ops/stateless_random_ops.py,213,function,"Outputs deterministic pseudorandom values from a binomial distribution. The generated values follow a binomial distribution with specified count and probability of success parameters. @@ -89031,7 +95020,7 @@ Returns: values. For each i, each samples[..., i] is an independent draw from the binomial distribution on counts[i] trials with probability of success probs[i]." -9966,stateless_random_gamma,tensorflow/tensorflow/python/ops/stateless_random_ops.py,283,function,"Outputs deterministic pseudorandom values from a gamma distribution. +9299,stateless_random_gamma,tensorflow/tensorflow/python/ops/stateless_random_ops.py,283,function,"Outputs deterministic pseudorandom values from a gamma distribution. The generated values follow a gamma distribution with specified concentration (`alpha`) and inverse scale (`beta`) parameters. @@ -89104,7 +95093,7 @@ Returns: samples: A Tensor of the specified shape filled with random gamma values. For each i, each `samples[..., i] is an independent draw from the gamma distribution with concentration alpha[i] and scale beta[i]." -9967,stateless_random_poisson,tensorflow/tensorflow/python/ops/stateless_random_ops.py,383,function,"Outputs deterministic pseudorandom values from a Poisson distribution. +9300,stateless_random_poisson,tensorflow/tensorflow/python/ops/stateless_random_ops.py,383,function,"Outputs deterministic pseudorandom values from a Poisson distribution. The generated values follow a Poisson distribution with specified rate parameter. @@ -89149,7 +95138,7 @@ Returns: samples: A Tensor of the specified shape filled with random Poisson values. For each i, each `samples[..., i]` is an independent draw from the Poisson distribution with rate `lam[i]`." -9968,stateless_random_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,446,function,"Outputs deterministic pseudorandom values from a normal distribution. +9301,stateless_random_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,446,function,"Outputs deterministic pseudorandom values from a normal distribution. This is a stateless version of `tf.random.normal`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The @@ -89170,7 +95159,7 @@ Args: Returns: A tensor of the specified shape filled with random normal values." -9969,stateless_truncated_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,487,function,"Outputs deterministic pseudorandom values, truncated normally distributed. +9302,stateless_truncated_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,487,function,"Outputs deterministic pseudorandom values, truncated normally distributed. This is a stateless version of `tf.random.truncated_normal`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The @@ -89195,7 +95184,7 @@ Args: Returns: A tensor of the specified shape filled with random truncated normal values." -9970,stateless_multinomial,tensorflow/tensorflow/python/ops/stateless_random_ops.py,535,function,"Draws deterministic pseudorandom samples from a multinomial distribution. +9303,stateless_multinomial,tensorflow/tensorflow/python/ops/stateless_random_ops.py,535,function,"Draws deterministic pseudorandom samples from a multinomial distribution. This is a stateless version of `tf.random.categorical`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The @@ -89223,7 +95212,7 @@ Args: Returns: The drawn samples of shape `[batch_size, num_samples]`." -9971,stateless_categorical,tensorflow/tensorflow/python/ops/stateless_random_ops.py,576,function,"Draws deterministic pseudorandom samples from a categorical distribution. +9304,stateless_categorical,tensorflow/tensorflow/python/ops/stateless_random_ops.py,576,function,"Draws deterministic pseudorandom samples from a categorical distribution. This is a stateless version of `tf.categorical`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The @@ -89252,8 +95241,8 @@ Args: Returns: The drawn samples of shape `[batch_size, num_samples]`." -9972,stateless_multinomial_categorical_impl,tensorflow/tensorflow/python/ops/stateless_random_ops.py,616,function,Implementation for stateless multinomial/categorical ops (v1/v2). -9973,stateless_parameterized_truncated_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,625,function,"Outputs random values from a truncated normal distribution. +9305,stateless_multinomial_categorical_impl,tensorflow/tensorflow/python/ops/stateless_random_ops.py,616,function,Implementation for stateless multinomial/categorical ops (v1/v2). +9306,stateless_parameterized_truncated_normal,tensorflow/tensorflow/python/ops/stateless_random_ops.py,625,function,"Outputs random values from a truncated normal distribution. The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard @@ -89299,7 +95288,7 @@ Args: Returns: A tensor of the specified shape filled with random truncated normal values." -9974,regex_full_match,tensorflow/tensorflow/python/ops/string_ops.py,50,function,"Match elements of `input` with regex `pattern`. +9307,regex_full_match,tensorflow/tensorflow/python/ops/string_ops.py,50,function,"Match elements of `input` with regex `pattern`. Args: input: string `Tensor`, the source strings to process. @@ -89309,7 +95298,7 @@ Args: Returns: bool `Tensor` of the same shape as `input` with match results." -9975,regex_replace,tensorflow/tensorflow/python/ops/string_ops.py,79,function,"Replace elements of `input` matching regex `pattern` with `rewrite`. +9308,regex_replace,tensorflow/tensorflow/python/ops/string_ops.py,79,function,"Replace elements of `input` matching regex `pattern` with `rewrite`. >>> tf.strings.regex_replace(""Text with tags.
contains html"", ... ""<[^>]+>"", "" "") @@ -89328,7 +95317,7 @@ Args: Returns: string `Tensor` of the same shape as `input` with specified replacements." -9976,string_format,tensorflow/tensorflow/python/ops/string_ops.py,117,function,"Formats a string template using a list of tensors. +9309,string_format,tensorflow/tensorflow/python/ops/string_ops.py,117,function,"Formats a string template using a list of tensors. Formats a string template using a list of tensors, abbreviating tensors by only printing the first and last `summarize` elements of each dimension @@ -89371,7 +95360,7 @@ Returns: Raises: ValueError: if the number of placeholders does not match the number of inputs." -9977,string_split,tensorflow/tensorflow/python/ops/string_ops.py,180,function,"Split elements of `source` based on `delimiter` into a `SparseTensor`. +9310,string_split,tensorflow/tensorflow/python/ops/string_ops.py,180,function,"Split elements of `source` based on `delimiter` into a `SparseTensor`. Let N be the size of source (typically N will be the batch size). Split each element of `source` based on `delimiter` and return a `SparseTensor` @@ -89408,7 +95397,7 @@ Returns: A `SparseTensor` of rank `2`, the strings split according to the delimiter. The first column of the indices corresponds to the row in `source` and the second column corresponds to the index of the split component in this row." -9978,string_split_v2,tensorflow/tensorflow/python/ops/string_ops.py,237,function,"Split elements of `source` based on `sep` into a `SparseTensor`. +9311,string_split_v2,tensorflow/tensorflow/python/ops/string_ops.py,237,function,"Split elements of `source` based on `sep` into a `SparseTensor`. Let N be the size of source (typically N will be the batch size). Split each element of `source` based on `sep` and return a `SparseTensor` @@ -89446,9 +95435,8 @@ Returns: A `SparseTensor` of rank `2`, the strings split according to the delimiter. The first column of the indices corresponds to the row in `source` and the second column corresponds to the index of the split component in this row." -9979,_reduce_join_reduction_dims,tensorflow/tensorflow/python/ops/string_ops.py,290,function,"Returns range(rank(x) - 1, 0, -1) if axis is None; or axis otherwise." -9980,reduce_join,tensorflow/tensorflow/python/ops/string_ops.py,310,function, -9981,reduce_join_v2,tensorflow/tensorflow/python/ops/string_ops.py,333,function,"Joins all strings into a single string, or joins along an axis. +9312,reduce_join,tensorflow/tensorflow/python/ops/string_ops.py,310,function, +9313,reduce_join_v2,tensorflow/tensorflow/python/ops/string_ops.py,333,function,"Joins all strings into a single string, or joins along an axis. >>> tf.strings.reduce_join([['abc','123'], ... ['def','456']]).numpy() @@ -89472,7 +95460,7 @@ Args: Returns: A `tf.string` tensor." -9982,string_length,tensorflow/tensorflow/python/ops/string_ops.py,381,function,"Computes the length of each string given in the input tensor. +9314,string_length,tensorflow/tensorflow/python/ops/string_ops.py,381,function,"Computes the length of each string given in the input tensor. >>> strings = tf.constant(['Hello','TensorFlow', '🙂']) >>> tf.strings.length(strings).numpy() # default counts bytes @@ -89494,11 +95482,11 @@ Args: Returns: A `Tensor` of type `int32`, containing the length of the input string in the same element of the input tensor." -9983,string_length_v2,tensorflow/tensorflow/python/ops/string_ops.py,410,function, -9984,substr_deprecated,tensorflow/tensorflow/python/ops/string_ops.py,420,function, -9985,substr,tensorflow/tensorflow/python/ops/string_ops.py,428,function, -9986,substr_v2,tensorflow/tensorflow/python/ops/string_ops.py,436,function, -9987,string_to_number,tensorflow/tensorflow/python/ops/string_ops.py,456,function,"Converts each string in the input Tensor to the specified numeric type. +9315,string_length_v2,tensorflow/tensorflow/python/ops/string_ops.py,410,function, +9316,substr_deprecated,tensorflow/tensorflow/python/ops/string_ops.py,420,function, +9317,substr,tensorflow/tensorflow/python/ops/string_ops.py,428,function, +9318,substr_v2,tensorflow/tensorflow/python/ops/string_ops.py,436,function, +9319,string_to_number,tensorflow/tensorflow/python/ops/string_ops.py,456,function,"Converts each string in the input Tensor to the specified numeric type. (Note that int32 overflow results in an error while float overflow results in a rounded value.) @@ -89519,8 +95507,8 @@ Args: Returns: A `Tensor` of type `out_type`." -9988,string_to_number_v1,tensorflow/tensorflow/python/ops/string_ops.py,484,function, -9989,string_to_hash_bucket,tensorflow/tensorflow/python/ops/string_ops.py,498,function,"Converts each string in the input Tensor to its hash mod by a number of buckets. +9320,string_to_number_v1,tensorflow/tensorflow/python/ops/string_ops.py,484,function, +9321,string_to_hash_bucket,tensorflow/tensorflow/python/ops/string_ops.py,498,function,"Converts each string in the input Tensor to its hash mod by a number of buckets. The hash function is deterministic on the content of the string within the process. @@ -89541,8 +95529,8 @@ Args: Returns: A `Tensor` of type `int64`." -9990,string_to_hash_bucket_v1,tensorflow/tensorflow/python/ops/string_ops.py,528,function, -9991,string_join,tensorflow/tensorflow/python/ops/string_ops.py,544,function,"Perform element-wise concatenation of a list of string tensors. +9322,string_to_hash_bucket_v1,tensorflow/tensorflow/python/ops/string_ops.py,528,function, +9323,string_join,tensorflow/tensorflow/python/ops/string_ops.py,544,function,"Perform element-wise concatenation of a list of string tensors. Given a list of string tensors of same shape, performs element-wise concatenation of the strings of the same index in all tensors. @@ -89566,20 +95554,20 @@ Args: Returns: A `tf.string` tensor." -9992,collect,tensorflow/tensorflow/python/ops/summary_op_util.py,28,function,"Adds keys to a collection. +9324,collect,tensorflow/tensorflow/python/ops/summary_op_util.py,28,function,"Adds keys to a collection. Args: val: The value to add per each key. collections: A collection of keys to add. default_collections: Used if collections is None." -9993,clean_tag,tensorflow/tensorflow/python/ops/summary_op_util.py,45,function,"Cleans a tag. Removes illegal characters for instance. +9325,clean_tag,tensorflow/tensorflow/python/ops/summary_op_util.py,45,function,"Cleans a tag. Removes illegal characters for instance. Args: name: The original tag name to be processed. Returns: The cleaned tag name." -9994,summary_scope,tensorflow/tensorflow/python/ops/summary_op_util.py,72,function,"Enters a scope used for the summary and yields both the name and tag. +9326,summary_scope,tensorflow/tensorflow/python/ops/summary_op_util.py,72,function,"Enters a scope used for the summary and yields both the name and tag. To ensure that the summary tag name is always unique, we create a name scope based on `name` and use the full scope name in the tag. @@ -89598,26 +95586,8 @@ Args: Yields: A tuple `(tag, scope)`, both of which are unique and should be used for the tag and the scope for the summary to output." -9995,_SummaryState,tensorflow/tensorflow/python/ops/summary_ops_v2.py,64,class, -9996,_should_record_summaries_internal,tensorflow/tensorflow/python/ops/summary_ops_v2.py,78,function,"Returns boolean Tensor if summaries should/shouldn't be recorded. - -Now the summary condition is decided by logical ""and"" of below conditions: -First, summary writer must be set. Given this constraint is met, -ctx.summary_recording and ctx.summary_recording_distribution_strategy. -The former one is usually set by user, and the latter one is controlled -by DistributionStrategy (tf.distribute.ReplicaContext). - -Args: - default_state: can be True or False. The default summary behavior when - summary writer is set and the user does not specify - ctx.summary_recording and ctx.summary_recording_distribution_strategy - is True." -9997,_should_record_summaries_v2,tensorflow/tensorflow/python/ops/summary_ops_v2.py,109,function,"Returns boolean Tensor which is true if summaries should be recorded. - -If no recording status has been set, this defaults to True, unlike the public -should_record_summaries()." -9998,should_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,119,function,Returns boolean Tensor which is true if summaries should be recorded. -9999,record_if,tensorflow/tensorflow/python/ops/summary_ops_v2.py,126,function,"Sets summary recording on or off per the provided boolean value. +9327,should_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,119,function,Returns boolean Tensor which is true if summaries should be recorded. +9328,record_if,tensorflow/tensorflow/python/ops/summary_ops_v2.py,126,function,"Sets summary recording on or off per the provided boolean value. The provided value can be a python boolean, a scalar boolean Tensor, or or a callable providing such a value; if a callable is passed it will be @@ -89629,15 +95599,15 @@ Args: Yields: Returns a context manager that sets this value on enter and restores the previous value on exit." -10000,record_summaries_every_n_global_steps,tensorflow/tensorflow/python/ops/summary_ops_v2.py,149,function,Sets the should_record_summaries Tensor to true if global_step % n == 0. -10001,always_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,160,function,Sets the should_record_summaries Tensor to always true. -10002,never_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,165,function,Sets the should_record_summaries Tensor to always false. -10003,get_step,tensorflow/tensorflow/python/ops/summary_ops_v2.py,171,function,"Returns the default summary step for the current thread. +9329,record_summaries_every_n_global_steps,tensorflow/tensorflow/python/ops/summary_ops_v2.py,149,function,Sets the should_record_summaries Tensor to true if global_step % n == 0. +9330,always_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,160,function,Sets the should_record_summaries Tensor to always true. +9331,never_record_summaries,tensorflow/tensorflow/python/ops/summary_ops_v2.py,165,function,Sets the should_record_summaries Tensor to always false. +9332,get_step,tensorflow/tensorflow/python/ops/summary_ops_v2.py,171,function,"Returns the default summary step for the current thread. Returns: The step set by `tf.summary.experimental.set_step()` if one has been set, otherwise None." -10004,set_step,tensorflow/tensorflow/python/ops/summary_ops_v2.py,182,function,"Sets the default summary step for the current thread. +9333,set_step,tensorflow/tensorflow/python/ops/summary_ops_v2.py,182,function,"Sets the default summary step for the current thread. For convenience, this function sets a default value for the `step` parameter used in summary-writing functions elsewhere in the API so that it need not @@ -89650,10 +95620,107 @@ will not be reflected inside the function unless using a `tf.Variable` step. Args: step: An `int64`-castable default step value, or None to unset." -10005,SummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,202,class,Interface representing a stateful summary writer object. -10006,ResourceSummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,272,class,Implementation of SummaryWriter using a SummaryWriterInterface resource. -10007,NoopSummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,395,class,"A summary writer that does nothing, for create_noop_writer()." -10008,initialize,tensorflow/tensorflow/python/ops/summary_ops_v2.py,416,function,"Initializes summary writing for graph execution mode. +9334,SummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,202,class,Interface representing a stateful summary writer object. +9335,set_as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,206,method,"Enables this summary writer for the current thread. + +For convenience, if `step` is not None, this function also sets a default +value for the `step` parameter used in summary-writing functions elsewhere +in the API so that it need not be explicitly passed in every such +invocation. The value can be a constant or a variable. + +Note: when setting `step` in a @tf.function, the step value will be +captured at the time the function is traced, so changes to the step outside +the function will not be reflected inside the function unless using +a `tf.Variable` step. + +Args: + step: An `int64`-castable default step value, or `None`. When not `None`, + the current step is modified to the given value. When `None`, the + current step is not modified." +9336,as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,228,method,"Returns a context manager that enables summary writing. + +For convenience, if `step` is not None, this function also sets a default +value for the `step` parameter used in summary-writing functions elsewhere +in the API so that it need not be explicitly passed in every such +invocation. The value can be a constant or a variable. + +Note: when setting `step` in a @tf.function, the step value will be +captured at the time the function is traced, so changes to the step outside +the function will not be reflected inside the function unless using +a `tf.Variable` step. + +For example, `step` can be used as: + +```python +with writer_a.as_default(step=10): + tf.summary.scalar(tag, value) # Logged to writer_a with step 10 + with writer_b.as_default(step=20): + tf.summary.scalar(tag, value) # Logged to writer_b with step 20 + tf.summary.scalar(tag, value) # Logged to writer_a with step 10 +``` + +Args: + step: An `int64`-castable default step value, or `None`. When not `None`, + the current step is captured, replaced by a given one, and the original + one is restored when the context manager exits. When `None`, the current + step is not modified (and not restored when the context manager exits)." +9337,init,tensorflow/tensorflow/python/ops/summary_ops_v2.py,259,method,Initializes the summary writer. +9338,flush,tensorflow/tensorflow/python/ops/summary_ops_v2.py,263,method,Flushes any buffered data. +9339,close,tensorflow/tensorflow/python/ops/summary_ops_v2.py,267,method,Flushes and closes the summary writer. +9340,ResourceSummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,272,class,Implementation of SummaryWriter using a SummaryWriterInterface resource. +9341,set_as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,295,method,"Enables this summary writer for the current thread. + +For convenience, if `step` is not None, this function also sets a default +value for the `step` parameter used in summary-writing functions elsewhere +in the API so that it need not be explicitly passed in every such +invocation. The value can be a constant or a variable. + +Note: when setting `step` in a @tf.function, the step value will be +captured at the time the function is traced, so changes to the step outside +the function will not be reflected inside the function unless using +a `tf.Variable` step. + +Args: + step: An `int64`-castable default step value, or `None`. When not `None`, + the current step is modified to the given value. When `None`, the + current step is not modified." +9342,as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,320,method,"Returns a context manager that enables summary writing. + +For convenience, if `step` is not None, this function also sets a default +value for the `step` parameter used in summary-writing functions elsewhere +in the API so that it need not be explicitly passed in every such +invocation. The value can be a constant or a variable. + +Note: when setting `step` in a @tf.function, the step value will be +captured at the time the function is traced, so changes to the step outside +the function will not be reflected inside the function unless using +a `tf.Variable` step. + +For example, `step` can be used as: + +```python +with writer_a.as_default(step=10): + tf.summary.scalar(tag, value) # Logged to writer_a with step 10 + with writer_b.as_default(step=20): + tf.summary.scalar(tag, value) # Logged to writer_b with step 20 + tf.summary.scalar(tag, value) # Logged to writer_a with step 10 +``` + +Args: + step: An `int64`-castable default step value, or `None`. When not `None`, + the current step is captured, replaced by a given one, and the original + one is restored when the context manager exits. When `None`, the current + step is not modified (and not restored when the context manager exits)." +9343,init,tensorflow/tensorflow/python/ops/summary_ops_v2.py,367,method,Initializes the summary writer. +9344,flush,tensorflow/tensorflow/python/ops/summary_ops_v2.py,376,method,Flushes any buffered data. +9345,close,tensorflow/tensorflow/python/ops/summary_ops_v2.py,382,method,Flushes and closes the summary writer. +9346,NoopSummaryWriter,tensorflow/tensorflow/python/ops/summary_ops_v2.py,395,class,"A summary writer that does nothing, for create_noop_writer()." +9347,set_as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,398,method, +9348,as_default,tensorflow/tensorflow/python/ops/summary_ops_v2.py,402,method, +9349,init,tensorflow/tensorflow/python/ops/summary_ops_v2.py,405,method, +9350,flush,tensorflow/tensorflow/python/ops/summary_ops_v2.py,408,method, +9351,close,tensorflow/tensorflow/python/ops/summary_ops_v2.py,411,method, +9352,initialize,tensorflow/tensorflow/python/ops/summary_ops_v2.py,416,function,"Initializes summary writing for graph execution mode. This operation is a no-op when executing eagerly. @@ -89675,7 +95742,7 @@ Raises: RuntimeError: If the current thread has no default `tf.contrib.summary.SummaryWriter`. ValueError: If session wasn't passed and no default session." -10009,create_file_writer_v2,tensorflow/tensorflow/python/ops/summary_ops_v2.py,458,function,"Creates a summary file writer for the given log directory. +9353,create_file_writer_v2,tensorflow/tensorflow/python/ops/summary_ops_v2.py,458,function,"Creates a summary file writer for the given log directory. Args: logdir: a string specifying the directory in which to write an event file. @@ -89687,7 +95754,7 @@ Args: Returns: A SummaryWriter object." -10010,create_file_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,519,function,"Creates a summary file writer in the current context under the given name. +9354,create_file_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,519,function,"Creates a summary file writer in the current context under the given name. Args: logdir: a string, or None. If a string, creates a summary file writer @@ -89706,7 +95773,7 @@ Args: Returns: Either a summary writer or an empty object which can be used as a summary writer." -10011,create_db_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,566,function,"Creates a summary database writer in the current context. +9355,create_db_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,566,function,"Creates a summary database writer in the current context. This can be used to write tensors from the execution graph directly to a database. Only SQLite is supported right now. This function @@ -89731,12 +95798,10 @@ Args: Returns: A `tf.summary.SummaryWriter` instance." -10012,create_noop_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,619,function,"Returns a summary writer that does nothing. +9356,create_noop_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,619,function,"Returns a summary writer that does nothing. This is useful as a placeholder in code that expects a context manager." -10013,_cleanse_string,tensorflow/tensorflow/python/ops/summary_ops_v2.py,627,function, -10014,_nothing,tensorflow/tensorflow/python/ops/summary_ops_v2.py,633,function,Convenient else branch for when summaries do not record. -10015,all_v2_summary_ops,tensorflow/tensorflow/python/ops/summary_ops_v2.py,639,function,"Returns all V2-style summary ops defined in the current default graph. +9357,all_v2_summary_ops,tensorflow/tensorflow/python/ops/summary_ops_v2.py,639,function,"Returns all V2-style summary ops defined in the current default graph. This includes ops from TF 2.0 tf.summary and TF 1.x tf.contrib.summary (except for `tf.contrib.summary.graph` and `tf.contrib.summary.import_event`), but @@ -89744,14 +95809,14 @@ does *not* include TF 1.x tf.summary ops. Returns: List of summary ops, or None if called under eager execution." -10016,summary_writer_initializer_op,tensorflow/tensorflow/python/ops/summary_ops_v2.py,654,function,"Graph-mode only. Returns the list of ops to create all summary writers. +9358,summary_writer_initializer_op,tensorflow/tensorflow/python/ops/summary_ops_v2.py,654,function,"Graph-mode only. Returns the list of ops to create all summary writers. Returns: The initializer ops. Raises: RuntimeError: If in Eager mode." -10017,summary_scope,tensorflow/tensorflow/python/ops/summary_ops_v2.py,675,function,"Experimental context manager for use when defining a custom summary op. +9359,summary_scope,tensorflow/tensorflow/python/ops/summary_ops_v2.py,675,function,"Experimental context manager for use when defining a custom summary op. This behaves similarly to `tf.name_scope`, except that it returns a generated summary tag in addition to the scope name. The tag is structurally similar to @@ -89778,7 +95843,7 @@ Args: Yields: A tuple `(tag, scope)` as described above." -10018,write,tensorflow/tensorflow/python/ops/summary_ops_v2.py,715,function,"Writes a generic summary to the default SummaryWriter if one exists. +9360,write,tensorflow/tensorflow/python/ops/summary_ops_v2.py,715,function,"Writes a generic summary to the default SummaryWriter if one exists. This exists primarily to support the definition of type-specific summary ops like scalar() and image(), and is not intended for direct use unless defining @@ -89804,7 +95869,7 @@ Returns: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10019,write_raw_pb,tensorflow/tensorflow/python/ops/summary_ops_v2.py,782,function,"Writes a summary using raw `tf.compat.v1.Summary` protocol buffers. +9361,write_raw_pb,tensorflow/tensorflow/python/ops/summary_ops_v2.py,782,function,"Writes a summary using raw `tf.compat.v1.Summary` protocol buffers. Experimental: this exists to support the usage of V1-style manual summary writing (via the construction of a `tf.compat.v1.Summary` protocol buffer) @@ -89824,7 +95889,7 @@ Returns: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10020,summary_writer_function,tensorflow/tensorflow/python/ops/summary_ops_v2.py,833,function,"Helper function to write summaries. +9362,summary_writer_function,tensorflow/tensorflow/python/ops/summary_ops_v2.py,833,function,"Helper function to write summaries. Args: name: name of the summary @@ -89834,8 +95899,8 @@ Args: Returns: The result of writing the summary." -10021,generic,tensorflow/tensorflow/python/ops/summary_ops_v2.py,865,function,Writes a tensor summary if possible. -10022,scalar,tensorflow/tensorflow/python/ops/summary_ops_v2.py,886,function,"Writes a scalar summary if possible. +9363,generic,tensorflow/tensorflow/python/ops/summary_ops_v2.py,865,function,Writes a tensor summary if possible. +9364,scalar,tensorflow/tensorflow/python/ops/summary_ops_v2.py,886,function,"Writes a scalar summary if possible. Unlike `tf.contrib.summary.generic` this op may change the dtype depending on the writer, for both practical and efficiency concerns. @@ -89852,10 +95917,10 @@ Args: Returns: The created `tf.Operation` or a `tf.no_op` if summary writing has not been enabled for this context." -10023,histogram,tensorflow/tensorflow/python/ops/summary_ops_v2.py,918,function,Writes a histogram summary if possible. -10024,image,tensorflow/tensorflow/python/ops/summary_ops_v2.py,933,function,Writes an image summary if possible. -10025,audio,tensorflow/tensorflow/python/ops/summary_ops_v2.py,952,function,Writes an audio summary if possible. -10026,graph,tensorflow/tensorflow/python/ops/summary_ops_v2.py,969,function,"Writes a TensorFlow graph to the summary interface. +9365,histogram,tensorflow/tensorflow/python/ops/summary_ops_v2.py,918,function,Writes a histogram summary if possible. +9366,image,tensorflow/tensorflow/python/ops/summary_ops_v2.py,933,function,Writes an image summary if possible. +9367,audio,tensorflow/tensorflow/python/ops/summary_ops_v2.py,952,function,Writes an audio summary if possible. +9368,graph,tensorflow/tensorflow/python/ops/summary_ops_v2.py,969,function,"Writes a TensorFlow graph to the summary interface. The graph summary is, strictly speaking, not a summary. Conditions like `tf.summary.should_record_summaries` do not apply. Only @@ -89883,7 +95948,7 @@ Returns: Raises: TypeError: If `param` isn't already a `tf.Tensor` in graph mode." -10027,import_event,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1017,function,"Writes a `tf.compat.v1.Event` binary proto. +9369,import_event,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1017,function,"Writes a `tf.compat.v1.Event` binary proto. This can be used to import existing event logs into a new summary writer sink. Please note that this is lower level than the other summary functions and @@ -89896,7 +95961,7 @@ Args: Returns: The created `tf.Operation`." -10028,flush,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1037,function,"Forces summary writer to send any buffered data to storage. +9370,flush,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1037,function,"Forces summary writer to send any buffered data to storage. This operation blocks until that finishes. @@ -89908,19 +95973,9 @@ Args: Returns: The created `tf.Operation`." -10029,eval_dir,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1067,function,Construct a logdir for an eval summary writer. -10030,create_summary_file_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1074,function,Please use `tf.contrib.summary.create_file_writer`. -10031,_serialize_graph,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1081,function, -10032,_choose_step,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1088,function, -10033,_check_create_file_writer_args,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1096,function,"Helper to check the validity of arguments to a create_file_writer() call. - -Args: - inside_function: whether the create_file_writer() call is in a tf.function - **kwargs: the arguments to check, as kwargs to give them names. - -Raises: - ValueError: if the arguments are graph tensors." -10034,run_metadata,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1120,function,"Writes entire RunMetadata summary. +9371,eval_dir,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1067,function,Construct a logdir for an eval summary writer. +9372,create_summary_file_writer,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1074,function,Please use `tf.contrib.summary.create_file_writer`. +9373,run_metadata,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1120,function,"Writes entire RunMetadata summary. A RunMetadata can contain DeviceStats, partition graphs, and function graphs. Please refer to the proto for definition of each field. @@ -89940,7 +95995,7 @@ Returns: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10035,run_metadata_graphs,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1162,function,"Writes graphs from a RunMetadata summary. +9374,run_metadata_graphs,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1162,function,"Writes graphs from a RunMetadata summary. Args: name: A name for this summary. The summary tag used for TensorBoard will be @@ -89957,7 +96012,7 @@ Returns: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10036,keras_model,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1205,function,"Writes a Keras model as JSON to as a Summary. +9375,keras_model,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1205,function,"Writes a Keras model as JSON to as a Summary. Writing the Keras model configuration allows the TensorBoard graph plugin to render a conceptual graph, as opposed to graph of ops. In case the model fails @@ -89978,7 +96033,7 @@ Returns: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10037,trace_on,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1258,function,"Starts a trace to record computation graphs and profiling information. +9376,trace_on,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1258,function,"Starts a trace to record computation graphs and profiling information. Must be invoked in eager mode. @@ -89997,7 +96052,7 @@ Args: profiler: If True, enables the advanced profiler. Enabling profiler implicitly enables the graph collection. The profiler may incur a high memory overhead. The default is False." -10038,trace_export,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1303,function,"Stops and exports the active trace as a Summary and/or profile file. +9377,trace_export,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1303,function,"Stops and exports the active trace as a Summary and/or profile file. Stops the trace and exports all metadata collected during the trace to the default SummaryWriter, if one has been set. @@ -90015,8 +96070,8 @@ Args: Raises: ValueError: if a default writer exists, but no step was provided and `tf.summary.experimental.get_step()` is None." -10039,trace_off,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1359,function,Stops the current trace and discards any collected information. -10040,make_template,tensorflow/tensorflow/python/ops/template.py,40,function,"Given an arbitrary function, wrap it so that it does variable sharing. +9378,trace_off,tensorflow/tensorflow/python/ops/summary_ops_v2.py,1359,function,Stops the current trace and discards any collected information. +9379,make_template,tensorflow/tensorflow/python/ops/template.py,40,function,"Given an arbitrary function, wrap it so that it does variable sharing. This wraps `func_` in a Template and partially evaluates it. Templates are functions that create variables the first time they are called and reuse them @@ -90123,7 +96178,7 @@ Returns: Raises: ValueError: if `name_` is None." -10041,make_template_internal,tensorflow/tensorflow/python/ops/template.py,164,function,"Make a template, optionally compiling func_ into a graph function. +9380,make_template_internal,tensorflow/tensorflow/python/ops/template.py,164,function,"Make a template, optionally compiling func_ into a graph function. See `make_template` for full documentation. @@ -90162,8 +96217,7 @@ Returns: Raises: ValueError: if `name_` is None. ValueError: if `unique_name_` is not None and eager execution is enabled." -10042,_skip_common_stack_elements,tensorflow/tensorflow/python/ops/template.py,234,function,Skips items that the target stacktrace shares with the base stacktrace. -10043,Template,tensorflow/tensorflow/python/ops/template.py,242,class,"Wrap a function to aid in variable sharing. +9381,Template,tensorflow/tensorflow/python/ops/template.py,242,class,"Wrap a function to aid in variable sharing. Templates are functions that create variables the first time they are called and reuse them thereafter. See `make_template` for full documentation. @@ -90172,8 +96226,20 @@ Note: By default, the full variable scope is captured at the time of first call. If `create_scope_now_` is passed as True to the constructor, the full scope will be captured there, but no variables will created until the first call." -10044,_EagerTemplateVariableStore,tensorflow/tensorflow/python/ops/template.py,485,class,Wrapper around EagerVariableStore to support nesting EagerTemplates. -10045,EagerTemplate,tensorflow/tensorflow/python/ops/template.py,539,class,"Wrap a function to aid in variable sharing in Eager mode. +9382,name,tensorflow/tensorflow/python/ops/template.py,396,method,Returns the name given to this Template. +9383,func,tensorflow/tensorflow/python/ops/template.py,401,method,Returns the func given to this Template. +9384,variable_scope,tensorflow/tensorflow/python/ops/template.py,406,method,Returns the variable scope object created by this Template. +9385,variable_scope_name,tensorflow/tensorflow/python/ops/template.py,411,method,Returns the variable scope name created by this Template. +9386,variables,tensorflow/tensorflow/python/ops/template.py,422,method,Returns the list of global and local variables created by the Template. +9387,trainable_variables,tensorflow/tensorflow/python/ops/template.py,427,method,Returns the list of trainable variables created by the Template. +9388,non_trainable_variables,tensorflow/tensorflow/python/ops/template.py,436,method,Returns the list of non-trainable variables created by the Template. +9389,global_variables,tensorflow/tensorflow/python/ops/template.py,444,method,Returns the list of global variables created by the Template. +9390,local_variables,tensorflow/tensorflow/python/ops/template.py,453,method,Returns the list of global variables created by the Template. +9391,weights,tensorflow/tensorflow/python/ops/template.py,462,method,List of weights/variables created by the Template. +9392,trainable_weights,tensorflow/tensorflow/python/ops/template.py,467,method,List of trainable weights/variables created by the Template. +9393,non_trainable_weights,tensorflow/tensorflow/python/ops/template.py,472,method,List of non-trainable weights/variables created by the Template. +9394,var_scope,tensorflow/tensorflow/python/ops/template.py,480,method,Returns the variable scope object created by this Template. +9395,EagerTemplate,tensorflow/tensorflow/python/ops/template.py,539,class,"Wrap a function to aid in variable sharing in Eager mode. Templates are functions that create variables the first time they are called and reuse them thereafter. See `make_template` for full documentation. @@ -90182,94 +96248,12 @@ Note: By default, the full variable scope is captured at the time of first call. If `create_scope_now` is passed as True to the constructor, the full scope will be captured there, but no variables will be created until the first call." -10046,_GetGradSource,tensorflow/tensorflow/python/ops/tensor_array_grad.py,43,function,"Identify which call to tf.gradients created this gradient op or tensor. - -TensorArray gradient calls use an accumulator TensorArray object. If -multiple gradients are calculated and run in the same session, the multiple -gradient nodes may accidentally flow through the same accumulator TensorArray. -This double counting breaks the TensorArray gradient flow. - -The solution is to identify which gradient call this particular -TensorArray*Grad is being called in, by looking at the input gradient -tensor's name, and create or lookup an accumulator gradient TensorArray -associated with this specific call. This solves any confusion and ensures -different gradients from the same forward graph get their own accumulators. - -This function creates the unique label associated with the tf.gradients call -that is used to create the gradient TensorArray. - -Args: - op_or_tensor: `Tensor` or `Operation` which is an input to a - TensorArray*Grad call. - -Returns: - A python string, the unique label associated with this particular - gradients calculation. - -Raises: - ValueError: If not called within a gradients calculation." -10047,_TensorArrayReadGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,87,function,"Gradient for TensorArrayRead. - -Args: - op: Forward TensorArrayRead op. - grad: Gradient `Tensor` to TensorArrayRead. - -Returns: - A flow `Tensor`, which can be used in control dependencies to - force the write of `grad` to the gradient `TensorArray`." -10048,_TensorArrayWriteGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,118,function,"Gradient for TensorArrayWrite. - -Args: - op: Forward TensorArrayWrite op. - flow: Gradient `Tensor` flow to TensorArrayWrite. - -Returns: - A grad `Tensor`, the gradient created in an upstream ReadGrad or PackGrad." -10049,_TensorArrayGatherGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,150,function,"Gradient for TensorArrayGather. - -Args: - op: Forward TensorArrayGather op. - grad: Gradient `Tensor` to TensorArrayGather. - -Returns: - A flow `Tensor`, which can be used in control dependencies to - force the write of `grad` to the gradient `TensorArray`." -10050,_TensorArrayScatterGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,181,function,"Gradient for TensorArrayScatter. - -Args: - op: Forward TensorArrayScatter op. - flow: Gradient `Tensor` flow to TensorArrayScatter. - -Returns: - A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad." -10051,_TensorArrayConcatGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,211,function,"Gradient for TensorArrayConcat. - -Args: - op: Forward TensorArrayConcat op. - grad: Gradient `Tensor` to TensorArrayConcat. - -Returns: - A flow `Tensor`, which can be used in control dependencies to - force the write of `grad` to the gradient `TensorArray`." -10052,_TensorArraySplitGrad,tensorflow/tensorflow/python/ops/tensor_array_grad.py,243,function,"Gradient for TensorArraySplit. - -Args: - op: Forward TensorArraySplit op. - flow: Gradient `Tensor` flow to TensorArraySplit. - -Returns: - A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad." -10053,_GraphTensorArray,tensorflow/tensorflow/python/ops/tensor_array_ops.py,52,class,"Graph-mode implementation of TensorArray. - " -10054,_GraphTensorArrayV2,tensorflow/tensorflow/python/ops/tensor_array_ops.py,388,class,"Graph-mode implementation of TensorArray backed by TensorLists. - -The backing tensor of this TensorArray is a TensorList variant tensor which is -stored in the `flow`. The `handle` is always none here. The reason we use the -`flow` field and not the `handle` field is to ensure backwards compatibility -with legacy control flow." -10055,_EagerTensorArray,tensorflow/tensorflow/python/ops/tensor_array_ops.py,650,class,"Eager-compatible implementation of TensorArray. - " -10056,TensorArray,tensorflow/tensorflow/python/ops/tensor_array_ops.py,947,class,"Class wrapping dynamic-sized, per-time-step, write-once Tensor arrays. +9396,variables,tensorflow/tensorflow/python/ops/template.py,684,method,Returns the list of variables created by the Template. +9397,trainable_variables,tensorflow/tensorflow/python/ops/template.py,692,method,Returns the list of trainable variables created by the Template. +9398,non_trainable_variables,tensorflow/tensorflow/python/ops/template.py,700,method,Returns the list of non-trainable variables created by the Template. +9399,global_variables,tensorflow/tensorflow/python/ops/template.py,708,method,Returns the list of global variables created by the Template. +9400,local_variables,tensorflow/tensorflow/python/ops/template.py,716,method,Returns the list of global variables created by the Template. +9401,TensorArray,tensorflow/tensorflow/python/ops/tensor_array_ops.py,947,class,"Class wrapping dynamic-sized, per-time-step, write-once Tensor arrays. This class is meant to be used with dynamic iteration primitives such as `while_loop` and `map_fn`. It supports gradient back-propagation via special @@ -90324,14 +96308,136 @@ f(5) ```" -10057,build_ta_with_new_flow,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1274,function,Builds a TensorArray with a new `flow` tensor. -10058,_check_dtypes,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1308,function, -10059,TensorArraySpec,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1319,class,Type specification for a `tf.TensorArray`. -10060,TensorArrayOpsTest,tensorflow/tensorflow/python/ops/tensor_array_ops_test.py,30,class, -10061,TreeVariableSaveable,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,26,class,Resource that holds a tree. -10062,tree_variable,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,76,function, -10063,ForestVariables,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,86,class,Resource that holds all trees from a forest. -10064,build_graph,tensorflow/tensorflow/python/ops/transpose_benchmark.py,34,function,"builds a graph containing a sequence of conv2d operations. +9402,flow,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1087,method,The flow `Tensor` forcing ops leading to this TensorArray state. +9403,dtype,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1092,method,The data type of this TensorArray. +9404,handle,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1097,method,The reference to the TensorArray. +9405,element_shape,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1102,method,The `tf.TensorShape` of elements in this TensorArray. +9406,dynamic_size,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1107,method,Python bool; if `True` the TensorArray can grow dynamically. +9407,identity,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1118,method,"Returns a TensorArray with the same content and properties. + +Returns: + A new TensorArray object with flow that ensures the control dependencies + from the contexts will become control dependencies for writes, reads, etc. + Use this object for all subsequent operations." +9408,grad,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1128,method, +9409,read,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1131,method,"Read the value at location `index` in the TensorArray. + +Args: + index: 0-D. int32 tensor with the index to read from. + name: A name for the operation (optional). + +Returns: + The tensor at index `index`." +9410,write,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1144,method,"Write `value` into index `index` of the TensorArray. + +Args: + index: 0-D. int32 scalar with the index to write to. + value: N-D. Tensor of type `dtype`. The Tensor to write to this index. + name: A name for the operation (optional). + +Returns: + A new TensorArray object with flow that ensures the write occurs. + Use this object for all subsequent operations. + +Raises: + ValueError: if there are more writers than specified." +9411,stack,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1161,method,"Return the values in the TensorArray as a stacked `Tensor`. + +All of the values must have been written and their shapes must all match. +If input shapes have rank-`R`, then output shape will have rank-`(R+1)`. + +Args: + name: A name for the operation (optional). + +Returns: + All the tensors in the TensorArray stacked into one tensor." +9412,gather,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1175,method,"Return selected values in the TensorArray as a packed `Tensor`. + +All of selected values must have been written and their shapes +must all match. + +Args: + indices: A `1-D` `Tensor` taking values in `[0, max_value)`. If + the `TensorArray` is not dynamic, `max_value=size()`. + name: A name for the operation (optional). + +Returns: + The tensors in the `TensorArray` selected by `indices`, packed into one + tensor." +9413,concat,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1192,method,"Return the values in the TensorArray as a concatenated `Tensor`. + +All of the values must have been written, their ranks must match, and +and their shapes must all match for all dimensions except the first. + +Args: + name: A name for the operation (optional). + +Returns: + All the tensors in the TensorArray concatenated into one tensor." +9414,unstack,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1207,method,"Unstack the values of a `Tensor` in the TensorArray. + +If input value shapes have rank-`R`, then the output TensorArray will +contain elements whose shapes are rank-`(R-1)`. + +Args: + value: (N+1)-D. Tensor of type `dtype`. The Tensor to unstack. + name: A name for the operation (optional). + +Returns: + A new TensorArray object with flow that ensures the unstack occurs. + Use this object for all subsequent operations. + +Raises: + ValueError: if the shape inference fails." +9415,scatter,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1227,method,"Scatter the values of a `Tensor` in specific indices of a `TensorArray`. + +Args: + indices: A `1-D` `Tensor` taking values in `[0, max_value)`. If + the `TensorArray` is not dynamic, `max_value=size()`. + value: (N+1)-D. Tensor of type `dtype`. The Tensor to unpack. + name: A name for the operation (optional). + +Returns: + A new TensorArray object with flow that ensures the scatter occurs. + Use this object for all subsequent operations. + +Raises: + ValueError: if the shape inference fails." +9416,split,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1246,method,"Split the values of a `Tensor` into the TensorArray. + +Args: + value: (N+1)-D. Tensor of type `dtype`. The Tensor to split. + lengths: 1-D. int32 vector with the lengths to use when splitting + `value` along its first dimension. + name: A name for the operation (optional). + +Returns: + A new TensorArray object with flow that ensures the split occurs. + Use this object for all subsequent operations. + +Raises: + ValueError: if the shape inference fails." +9417,size,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1264,method,Return the size of the TensorArray. +9418,close,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1269,method,Close the current TensorArray. +9419,build_ta_with_new_flow,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1274,function,Builds a TensorArray with a new `flow` tensor. +9420,TensorArraySpec,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1319,class,Type specification for a `tf.TensorArray`. +9421,is_compatible_with,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1341,method, +9422,most_specific_compatible_type,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1352,method, +9423,from_value,tensorflow/tensorflow/python/ops/tensor_array_ops.py,1397,method, +9424,TreeVariableSaveable,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,26,class,Resource that holds a tree. +9425,restore,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,54,method,"Restores the associated tree from 'restored_tensors'. + +Args: + restored_tensors: the tensors that were loaded from a checkpoint. + unused_restored_shapes: the shapes this object should conform to after + restore. Not meaningful for trees. + +Returns: + The operation that restores the state of the tree variable." +9426,resource,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,72,method, +9427,tree_variable,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,76,function, +9428,ForestVariables,tensorflow/tensorflow/python/ops/tensor_forest_ops.py,86,class,Resource that holds all trees from a forest. +9429,build_graph,tensorflow/tensorflow/python/ops/transpose_benchmark.py,34,function,"builds a graph containing a sequence of conv2d operations. Args: device: String, the device to run on. @@ -90342,8 +96448,9 @@ Args: Returns: An array of tensors to run()" -10065,TransposeBenchmark,tensorflow/tensorflow/python/ops/transpose_benchmark.py,62,class,Benchmark transpose! -10066,UnconnectedGradients,tensorflow/tensorflow/python/ops/unconnected_gradients.py,27,class,"Controls how gradient computation behaves when y does not depend on x. +9430,TransposeBenchmark,tensorflow/tensorflow/python/ops/transpose_benchmark.py,62,class,Benchmark transpose! +9431,benchmark_transpose,tensorflow/tensorflow/python/ops/transpose_benchmark.py,110,method, +9432,UnconnectedGradients,tensorflow/tensorflow/python/ops/unconnected_gradients.py,27,class,"Controls how gradient computation behaves when y does not depend on x. The gradient of y with respect to x can be zero in two different ways: there could be no differentiable path in the graph connecting x to y (and so we can @@ -90356,9 +96463,7 @@ there is no path in the graph from x to y: * `NONE`: Indicates that [None] will be returned if there is no path from x to y * `ZERO`: Indicates that a zero tensor will be returned in the shape of x." -10067,_PartitionInfo,tensorflow/tensorflow/python/ops/variable_scope.py,63,class,Holds partition info used by initializer functions. -10068,_ReuseMode,tensorflow/tensorflow/python/ops/variable_scope.py,190,class,Mode for variable access within a variable scope. -10069,enable_resource_variables,tensorflow/tensorflow/python/ops/variable_scope.py,219,function,"Creates resource variables by default. +9433,enable_resource_variables,tensorflow/tensorflow/python/ops/variable_scope.py,219,function,"Creates resource variables by default. Resource variables are improved versions of TensorFlow variables with a well-defined memory model. Accessing a resource variable reads its value, and @@ -90371,7 +96476,7 @@ read/write pairs. Calling tf.enable_resource_variables() lets you opt-in to this TensorFlow 2.0 feature." -10070,resource_variables_enabled,tensorflow/tensorflow/python/ops/variable_scope.py,240,function,"Returns `True` if resource variables are enabled. +9434,resource_variables_enabled,tensorflow/tensorflow/python/ops/variable_scope.py,240,function,"Returns `True` if resource variables are enabled. Resource variables are improved versions of TensorFlow variables with a well-defined memory model. Accessing a resource variable reads its value, and @@ -90384,24 +96489,12 @@ read/write pairs. Calling tf.enable_resource_variables() lets you opt-in to this TensorFlow 2.0 feature." -10071,disable_resource_variables,tensorflow/tensorflow/python/ops/variable_scope.py,262,function,"Opts out of resource variables. +9435,disable_resource_variables,tensorflow/tensorflow/python/ops/variable_scope.py,262,function,"Opts out of resource variables. If your code needs tf.disable_resource_variables() to be called to work properly please file a bug." -10072,_VariableStore,tensorflow/tensorflow/python/ops/variable_scope.py,273,class,"Variable store that carries a number of named Variables. - -New variable names and new variables can be created; all stored -variables are initialized with the initializer passed to __init__. - -Attributes: - vars: a dictionary with string names (same as passed in GetVar) as keys and - the corresponding TensorFlow Variables as values." -10073,_LazyEvalTensor,tensorflow/tensorflow/python/ops/variable_scope.py,1008,class,A Tensor-like object that only evaluates its thunk when used. -10074,_make_master_property,tensorflow/tensorflow/python/ops/variable_scope.py,1028,function, -10075,_make_master_method,tensorflow/tensorflow/python/ops/variable_scope.py,1040,function, -10076,_make_op_method,tensorflow/tensorflow/python/ops/variable_scope.py,1050,function, -10077,no_regularizer,tensorflow/tensorflow/python/ops/variable_scope.py,1080,function,Use this function to prevent regularization of variables. -10078,VariableScope,tensorflow/tensorflow/python/ops/variable_scope.py,1087,class,"Variable scope object to carry defaults to provide to `get_variable`. +9436,no_regularizer,tensorflow/tensorflow/python/ops/variable_scope.py,1080,function,Use this function to prevent regularization of variables. +9437,VariableScope,tensorflow/tensorflow/python/ops/variable_scope.py,1087,class,"Variable scope object to carry defaults to provide to `get_variable`. Many of the arguments we need for `get_variable` in a variable store are most easily handled with a context. This object is used for the defaults. @@ -90430,12 +96523,34 @@ Attributes: variable and return the Tensor for the projected value (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training." -10079,_VariableScopeStore,tensorflow/tensorflow/python/ops/variable_scope.py,1401,class,A thread local store for the current variable scope and scope counts. -10080,get_variable_scope_store,tensorflow/tensorflow/python/ops/variable_scope.py,1424,function,Returns the variable scope store for current thread. -10081,get_variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,1438,function,Returns the current variable scope. -10082,_get_default_variable_store,tensorflow/tensorflow/python/ops/variable_scope.py,1443,function, -10083,with_variable_store,tensorflow/tensorflow/python/ops/variable_scope.py,1453,function, -10084,EagerVariableStore,tensorflow/tensorflow/python/ops/variable_scope.py,1463,class,"Wrapper allowing functional layers to be used with eager execution. +9438,name,tensorflow/tensorflow/python/ops/variable_scope.py,1151,method, +9439,original_name_scope,tensorflow/tensorflow/python/ops/variable_scope.py,1155,method, +9440,reuse,tensorflow/tensorflow/python/ops/variable_scope.py,1159,method, +9441,initializer,tensorflow/tensorflow/python/ops/variable_scope.py,1163,method, +9442,dtype,tensorflow/tensorflow/python/ops/variable_scope.py,1167,method, +9443,use_resource,tensorflow/tensorflow/python/ops/variable_scope.py,1171,method, +9444,regularizer,tensorflow/tensorflow/python/ops/variable_scope.py,1175,method, +9445,caching_device,tensorflow/tensorflow/python/ops/variable_scope.py,1179,method, +9446,partitioner,tensorflow/tensorflow/python/ops/variable_scope.py,1183,method, +9447,custom_getter,tensorflow/tensorflow/python/ops/variable_scope.py,1187,method, +9448,constraint,tensorflow/tensorflow/python/ops/variable_scope.py,1191,method, +9449,reuse_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1194,method,Reuse variables in this scope. +9450,set_initializer,tensorflow/tensorflow/python/ops/variable_scope.py,1198,method,Set initializer for this scope. +9451,set_dtype,tensorflow/tensorflow/python/ops/variable_scope.py,1202,method,Set data type for this scope. +9452,set_use_resource,tensorflow/tensorflow/python/ops/variable_scope.py,1206,method,Sets whether to use ResourceVariables for this scope. +9453,set_regularizer,tensorflow/tensorflow/python/ops/variable_scope.py,1213,method,Set regularizer for this scope. +9454,set_caching_device,tensorflow/tensorflow/python/ops/variable_scope.py,1217,method,Set caching_device for this scope. +9455,set_partitioner,tensorflow/tensorflow/python/ops/variable_scope.py,1224,method,Set partitioner for this scope. +9456,set_custom_getter,tensorflow/tensorflow/python/ops/variable_scope.py,1228,method,Set custom getter for this scope. +9457,get_collection,tensorflow/tensorflow/python/ops/variable_scope.py,1232,method,Get this scope's variables. +9458,trainable_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1237,method,Get this scope's trainable variables. +9459,global_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1241,method,Get this scope's global variables. +9460,local_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1245,method,Get this scope's local variables. +9461,get_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1249,method,Gets an existing variable with this name or create a new one. +9462,get_variable_scope_store,tensorflow/tensorflow/python/ops/variable_scope.py,1424,function,Returns the variable scope store for current thread. +9463,get_variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,1438,function,Returns the current variable scope. +9464,with_variable_store,tensorflow/tensorflow/python/ops/variable_scope.py,1453,function, +9465,EagerVariableStore,tensorflow/tensorflow/python/ops/variable_scope.py,1463,class,"Wrapper allowing functional layers to be used with eager execution. When eager execution is enabled Variables get deleted when they go out of scope, and are not stored in global collections by default. A lot of code @@ -90452,86 +96567,21 @@ eager-friendly. For example, to create a dense layer, use: x = tf.compat.v1.layers.dense(input, name=""l1"") print(container.variables) # Should print the variables used in the layer. ```" -10085,get_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1545,function, -10086,get_local_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1688,function, -10087,_get_partitioned_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1733,function,"Gets or creates a sharded variable list with these parameters. +9466,as_default,tensorflow/tensorflow/python/ops/variable_scope.py,1494,method, +9467,variables,tensorflow/tensorflow/python/ops/variable_scope.py,1497,method, +9468,trainable_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1500,method, +9469,non_trainable_variables,tensorflow/tensorflow/python/ops/variable_scope.py,1506,method, +9470,copy,tensorflow/tensorflow/python/ops/variable_scope.py,1512,method,"Copy this variable store and all of its contents. -The `partitioner` must be a callable that accepts a fully defined -`TensorShape` and returns a sequence of integers (the `partitions`). -These integers describe how to partition the given sharded `Variable` -along the given dimension. That is, `partitions[1] = 3` means split -the `Variable` into 3 shards along dimension 1. Currently, sharding along -only one axis is supported. - -If the list of variables with the given name (prefix) is already stored, -we return the stored variables. Otherwise, we create a new one. - -If initializer is `None` (the default), the default initializer passed in -the constructor is used. If that one is `None` too, we use a new -`glorot_uniform_initializer`. If initializer is a Tensor, we use -it as a value and derive the shape from the initializer. - -If the initializer is a callable, then it will be called for each -shard. Otherwise the initializer should match the shape of the entire -sharded Variable, and it will be sliced accordingly for each shard. - -Some useful partitioners are available. See, e.g., -`variable_axis_size_partitioner` and `min_max_variable_partitioner`. - -Args: - name: The name of the new or existing variable. - shape: Shape of the new or existing variable. - dtype: Type of the new or existing variable (defaults to `DT_FLOAT`). - initializer: Initializer for the variable if one is created. - regularizer: A (Tensor -> Tensor or None) function; the result of applying - it on a newly created variable will be added to the collection - GraphKeys.REGULARIZATION_LOSSES and can be used for regularization. - trainable: If `True` also add the variable to the graph collection - `GraphKeys.TRAINABLE_VARIABLES` (see `tf.Variable`). - collections: List of graph collections keys to add the Variable to. Defaults - to `[GraphKeys.GLOBAL_VARIABLES]` (see `tf.Variable`). - caching_device: Optional device string or function describing where the - Variable should be cached for reading. Defaults to the Variable's device. - If not `None`, caches on another device. Typical use is to cache on the - device where the Ops using the Variable reside, to deduplicate copying - through `Switch` and other conditional statements. - partitioner: Optional callable that accepts a fully defined `TensorShape` - and `dtype` of the Variable to be created, and returns a list of - partitions for each axis (currently only one axis can be partitioned). - validate_shape: If False, allows the variable to be initialized with a value - of unknown shape. If True, the default, the shape of initial_value must be - known. - use_resource: If False, creates a regular Variable. If True, creates an - experimental ResourceVariable instead which has well-defined semantics. - Defaults to False (will later change to True). - constraint: An optional projection function to be applied to the variable - after being updated by an `Optimizer` (e.g. used to implement norm - constraints or value constraints for layer weights). The function must - take as input the unprojected Tensor representing the value of the - variable and return the Tensor for the projected value (which must have - the same shape). Constraints are not safe to use when doing asynchronous - distributed training. - synchronization: Indicates when a distributed a variable will be aggregated. - Accepted values are constants defined in the class - `tf.VariableSynchronization`. By default the synchronization is set to - `AUTO` and the current `DistributionStrategy` chooses when to synchronize. - aggregation: Indicates how a distributed variable will be aggregated. - Accepted values are constants defined in the class - `tf.VariableAggregation`. +Variables contained in this store will be copied over to the new variable +store, meaning that they can be modified without affecting the variables in +this store. Returns: - A tuple `(shards, partitions)` where `shards` is the list of `Variable` - shards and `partitions` is the output of the partitioner on the input - shape. - -Raises: - ValueError: when creating a new variable and shape is not declared, - or when violating reuse during variable creation. Reuse is set inside - `variable_scope`." -10088,_pure_variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,1852,class,"A context for the variable_scope, see `variable_scope` for docs." -10089,_maybe_wrap_custom_getter,tensorflow/tensorflow/python/ops/variable_scope.py,2018,function,Wrap a call to a custom_getter to use the old_getter internally. -10090,_get_unique_variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2037,function,Get a name with the given prefix unique in the current variable scope. -10091,variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2054,class,"A context manager for defining ops that creates variables (layers). + A new EagerVariableStore instance containing copied variables." +9471,get_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1545,function, +9472,get_local_variable,tensorflow/tensorflow/python/ops/variable_scope.py,1688,function, +9473,variable_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2054,class,"A context manager for defining ops that creates variables (layers). This context manager validates that the (optional) `values` are from the same graph, ensures that graph is the default graph, and pushes a name scope and a @@ -90683,25 +96733,10 @@ def thread_target_fn(captured_scope): thread = threading.Thread(target=thread_target_fn, args=(main_thread_scope,)) ```" -10092,variable_op_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2465,function,Deprecated: context manager for defining an op that creates variables. -10093,_call_partitioner,tensorflow/tensorflow/python/ops/variable_scope.py,2496,function,"Call partitioner validating its inputs/output. - -Args: - partitioner: a function mapping `Tensor` shape and dtype to a list of - partitions. - shape: shape of the `Tensor` to partition, must have at least two - dimensions. - dtype: dtype of the elements in the `Tensor`. - -Returns: - A list with elements >=1 and exactly one >1. The index of that - element corresponds to the partitioning axis." -10094,_get_slice_dim_and_num_slices,tensorflow/tensorflow/python/ops/variable_scope.py,2537,function,Get slicing dimension and number of slices from the partitioner output. -10095,_iter_slices,tensorflow/tensorflow/python/ops/variable_scope.py,2549,function,Slices a given a shape along the specified dimension. -10096,default_variable_creator,tensorflow/tensorflow/python/ops/variable_scope.py,2561,function,Default variable creator. -10097,default_variable_creator_v2,tensorflow/tensorflow/python/ops/variable_scope.py,2620,function,Default variable creator. -10098,_make_getter,tensorflow/tensorflow/python/ops/variable_scope.py,2657,function,Gets around capturing loop variables in python being broken. -10099,variable_creator_scope_v1,tensorflow/tensorflow/python/ops/variable_scope.py,2668,function,"Scope which defines a variable creation function to be used by variable(). +9474,variable_op_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2465,function,Deprecated: context manager for defining an op that creates variables. +9475,default_variable_creator,tensorflow/tensorflow/python/ops/variable_scope.py,2561,function,Default variable creator. +9476,default_variable_creator_v2,tensorflow/tensorflow/python/ops/variable_scope.py,2620,function,Default variable creator. +9477,variable_creator_scope_v1,tensorflow/tensorflow/python/ops/variable_scope.py,2668,function,"Scope which defines a variable creation function to be used by variable(). variable_creator is expected to be a function with the following signature: @@ -90768,7 +96803,7 @@ Args: Yields: A scope in which the creator is active" -10100,variable_creator_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2744,function,"Scope which defines a variable creation function to be used by variable(). +9478,variable_creator_scope,tensorflow/tensorflow/python/ops/variable_scope.py,2744,function,"Scope which defines a variable creation function to be used by variable(). variable_creator is expected to be a function with the following signature: @@ -90829,11 +96864,9 @@ Args: Yields: A scope in which the creator is active" -10101,VariableSpecTest,tensorflow/tensorflow/python/ops/variable_spec_test.py,30,class, -10102,default_variable_creator,tensorflow/tensorflow/python/ops/variables.py,53,function, -10103,default_variable_creator_v2,tensorflow/tensorflow/python/ops/variables.py,58,function, -10104,_make_getter,tensorflow/tensorflow/python/ops/variables.py,63,function,To avoid capturing loop variables. -10105,VariableSynchronization,tensorflow/tensorflow/python/ops/variables.py,73,class,"Indicates when a distributed variable will be synced. +9479,default_variable_creator,tensorflow/tensorflow/python/ops/variables.py,53,function, +9480,default_variable_creator_v2,tensorflow/tensorflow/python/ops/variables.py,58,function, +9481,VariableSynchronization,tensorflow/tensorflow/python/ops/variables.py,73,class,"Indicates when a distributed variable will be synced. * `AUTO`: Indicates that the synchronization will be determined by the current `DistributionStrategy` (eg. With `MirroredStrategy` this would be @@ -90845,7 +96878,7 @@ Yields: * `ON_READ`: Indicates that the variable will be aggregated across devices when it is read (eg. when checkpointing or when evaluating an op that uses the variable)." -10106,VariableAggregationV2,tensorflow/tensorflow/python/ops/variables.py,95,class,"Indicates how a distributed variable will be aggregated. +9482,VariableAggregationV2,tensorflow/tensorflow/python/ops/variables.py,95,class,"Indicates how a distributed variable will be aggregated. `tf.distribute.Strategy` distributes a model by making multiple copies (called ""replicas"") acting data-parallel on different elements of the input @@ -90860,10 +96893,10 @@ different values for `x` computed in the different replicas. * `ONLY_FIRST_REPLICA`: This is for when every replica is performing the same update, but we only want to perform the update once. Used, e.g., for the global step counter." -10107,VariableAggregation,tensorflow/tensorflow/python/ops/variables.py,130,class, -10108,validate_synchronization_aggregation_trainable,tensorflow/tensorflow/python/ops/variables.py,151,function,"Given user-provided variable properties, sets defaults and validates." -10109,VariableMetaclass,tensorflow/tensorflow/python/ops/variables.py,179,class,Metaclass to allow construction of tf.Variable to be overridden. -10110,Variable,tensorflow/tensorflow/python/ops/variables.py,269,class,"See the [variable guide](https://tensorflow.org/guide/variable). +9483,VariableAggregation,tensorflow/tensorflow/python/ops/variables.py,130,class, +9484,validate_synchronization_aggregation_trainable,tensorflow/tensorflow/python/ops/variables.py,151,function,"Given user-provided variable properties, sets defaults and validates." +9485,VariableMetaclass,tensorflow/tensorflow/python/ops/variables.py,179,class,Metaclass to allow construction of tf.Variable to be overridden. +9486,Variable,tensorflow/tensorflow/python/ops/variables.py,269,class,"See the [variable guide](https://tensorflow.org/guide/variable). A variable maintains shared, persistent state manipulated by a program. @@ -90954,7 +96987,531 @@ and be created only once: See the `tf.function` documentation for details." -10111,VariableV1,tensorflow/tensorflow/python/ops/variables.py,1346,class,"See the [Variables Guide](https://tensorflow.org/guide/variables). +9487,value,tensorflow/tensorflow/python/ops/variables.py,443,method,"Returns the last snapshot of this variable. + +You usually do not need to call this method as all ops that need the value +of the variable call it automatically through a `convert_to_tensor()` call. + +Returns a `Tensor` which holds the value of the variable. You can not +assign a new value to this tensor as it is not a reference to the variable. + +To avoid copies, if the consumer of the returned value is on the same device +as the variable, this actually returns the live value of the variable, not +a copy. Updates to the variable are seen by the consumer. If the consumer +is on a different device it will get a copy of the variable. + +Returns: + A `Tensor` containing the value of the variable." +9488,read_value,tensorflow/tensorflow/python/ops/variables.py,462,method,"Returns the value of this variable, read in the current context. + +Can be different from value() if it's on another device, with control +dependencies, etc. + +Returns: + A `Tensor` containing the value of the variable." +9489,set_shape,tensorflow/tensorflow/python/ops/variables.py,473,method,"Overrides the shape for this variable. + +Args: + shape: the `TensorShape` representing the overridden shape." +9490,trainable,tensorflow/tensorflow/python/ops/variables.py,482,method, +9491,synchronization,tensorflow/tensorflow/python/ops/variables.py,486,method, +9492,aggregation,tensorflow/tensorflow/python/ops/variables.py,490,method, +9493,eval,tensorflow/tensorflow/python/ops/variables.py,493,method,"In a session, computes and returns the value of this variable. + +This is not a graph construction method, it does not add ops to the graph. + +This convenience method requires a session where the graph +containing this variable has been launched. If no session is +passed, the default session is used. See `tf.compat.v1.Session` for more +information on launching a graph and on sessions. + +```python +v = tf.Variable([1, 2]) +init = tf.compat.v1.global_variables_initializer() + +with tf.compat.v1.Session() as sess: + sess.run(init) + # Usage passing the session explicitly. + print(v.eval(sess)) + # Usage with the default session. The 'with' block + # above makes 'sess' the default session. + print(v.eval()) +``` + +Args: + session: The session to use to evaluate this variable. If none, the + default session is used. + +Returns: + A numpy `ndarray` with a copy of the value of this variable." +9494,initialized_value,tensorflow/tensorflow/python/ops/variables.py,528,method,"Returns the value of the initialized variable. + +You should use this instead of the variable itself to initialize another +variable with a value that depends on the value of this variable. + +```python +# Initialize 'v' with a random tensor. +v = tf.Variable(tf.random.truncated_normal([10, 40])) +# Use `initialized_value` to guarantee that `v` has been +# initialized before its value is used to initialize `w`. +# The random values are picked only once. +w = tf.Variable(v.initialized_value() * 2.0) +``` + +Returns: + A `Tensor` holding the value of this variable after its initializer + has run." +9495,initial_value,tensorflow/tensorflow/python/ops/variables.py,553,method,"Returns the Tensor used as the initial value for the variable. + +Note that this is different from `initialized_value()` which runs +the op that initializes the variable before returning its value. +This method returns the tensor that is used by the op that initializes +the variable. + +Returns: + A `Tensor`." +9496,constraint,tensorflow/tensorflow/python/ops/variables.py,567,method,"Returns the constraint function associated with this variable. + +Returns: + The constraint function that was passed to the variable constructor. + Can be `None` if no constraint was passed." +9497,assign,tensorflow/tensorflow/python/ops/variables.py,576,method,"Assigns a new value to the variable. + +This is essentially a shortcut for `assign(self, value)`. + +Args: + value: A `Tensor`. The new value for this variable. + use_locking: If `True`, use locking during the assignment. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + The updated variable. If `read_value` is false, instead returns None in + Eager mode and the assign op in graph mode." +9498,assign_add,tensorflow/tensorflow/python/ops/variables.py,594,method,"Adds a value to this variable. + + This is essentially a shortcut for `assign_add(self, delta)`. + +Args: + delta: A `Tensor`. The value to add to this variable. + use_locking: If `True`, use locking during the operation. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + The updated variable. If `read_value` is false, instead returns None in + Eager mode and the assign op in graph mode." +9499,assign_sub,tensorflow/tensorflow/python/ops/variables.py,612,method,"Subtracts a value from this variable. + +This is essentially a shortcut for `assign_sub(self, delta)`. + +Args: + delta: A `Tensor`. The value to subtract from this variable. + use_locking: If `True`, use locking during the operation. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + The updated variable. If `read_value` is false, instead returns None in + Eager mode and the assign op in graph mode." +9500,scatter_sub,tensorflow/tensorflow/python/ops/variables.py,630,method,"Subtracts `tf.IndexedSlices` from this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be subtracted from this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9501,scatter_add,tensorflow/tensorflow/python/ops/variables.py,646,method,"Adds `tf.IndexedSlices` to this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be added to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9502,scatter_max,tensorflow/tensorflow/python/ops/variables.py,662,method,"Updates this variable with the max of `tf.IndexedSlices` and itself. + +Args: + sparse_delta: `tf.IndexedSlices` to use as an argument of max with this + variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9503,scatter_min,tensorflow/tensorflow/python/ops/variables.py,679,method,"Updates this variable with the min of `tf.IndexedSlices` and itself. + +Args: + sparse_delta: `tf.IndexedSlices` to use as an argument of min with this + variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9504,scatter_mul,tensorflow/tensorflow/python/ops/variables.py,696,method,"Multiply this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to multiply this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9505,scatter_div,tensorflow/tensorflow/python/ops/variables.py,712,method,"Divide this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to divide this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9506,scatter_update,tensorflow/tensorflow/python/ops/variables.py,728,method,"Assigns `tf.IndexedSlices` to this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9507,batch_scatter_update,tensorflow/tensorflow/python/ops/variables.py,744,method,"Assigns `tf.IndexedSlices` to this variable batch-wise. + +Analogous to `batch_gather`. This assumes that this variable and the +sparse_delta IndexedSlices have a series of leading dimensions that are the +same for all of them, and the updates are performed on the last dimension of +indices. In other words, the dimensions should be the following: + +`num_prefix_dims = sparse_delta.indices.ndims - 1` +`batch_dim = num_prefix_dims + 1` +`sparse_delta.updates.shape = sparse_delta.indices.shape + var.shape[ + batch_dim:]` + +where + +`sparse_delta.updates.shape[:num_prefix_dims]` +`== sparse_delta.indices.shape[:num_prefix_dims]` +`== var.shape[:num_prefix_dims]` + +And the operation performed can be expressed as: + +`var[i_1, ..., i_n, + sparse_delta.indices[i_1, ..., i_n, j]] = sparse_delta.updates[ + i_1, ..., i_n, j]` + +When sparse_delta.indices is a 1D tensor, this operation is equivalent to +`scatter_update`. + +To avoid this operation one can looping over the first `ndims` of the +variable and using `scatter_update` on the subtensors that result of slicing +the first dimension. This is a valid option for `ndims = 1`, but less +efficient than this implementation. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + The updated variable. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9508,scatter_nd_sub,tensorflow/tensorflow/python/ops/variables.py,790,method,"Applies sparse subtraction to individual values or slices in a Variable. + +Assuming the variable has rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into self. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of self. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, self.shape[K], ..., self.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + v = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = v.scatter_nd_sub(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to v would look like this: + + [1, -9, 3, -6, -6, 6, 7, -4] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9509,scatter_nd_add,tensorflow/tensorflow/python/ops/variables.py,837,method,"Applies sparse addition to individual values or slices in a Variable. + +The Variable has rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into self. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of self. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, self.shape[K], ..., self.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + v = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + add = v.scatter_nd_add(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(add) +``` + +The resulting update to v would look like this: + + [1, 13, 3, 14, 14, 6, 7, 20] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9510,scatter_nd_update,tensorflow/tensorflow/python/ops/variables.py,884,method,"Applies sparse assignment to individual values or slices in a Variable. + +The Variable has rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into self. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of self. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, self.shape[K], ..., self.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + v = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = v.scatter_nd_assign(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to v would look like this: + + [1, 11, 3, 10, 9, 6, 7, 12] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + The updated variable." +9511,sparse_read,tensorflow/tensorflow/python/ops/variables.py,931,method,"Gather slices from params axis axis according to indices. + +This function supports a subset of tf.gather, see tf.gather for details on +usage. + +Args: + indices: The index `Tensor`. Must be one of the following types: `int32`, + `int64`. Must be in range `[0, params.shape[axis])`. + name: A name for the operation (optional). + +Returns: + A `Tensor`. Has the same type as `params`." +9512,gather_nd,tensorflow/tensorflow/python/ops/variables.py,947,method,"Gather slices from `params` into a Tensor with shape specified by `indices`. + +See tf.gather_nd for details. + +Args: + indices: A `Tensor`. Must be one of the following types: `int32`, `int64`. + Index tensor. + name: A name for the operation (optional). + +Returns: + A `Tensor`. Has the same type as `params`." +9513,count_up_to,tensorflow/tensorflow/python/ops/variables.py,963,method,"Increments this variable until it reaches `limit`. + +When that Op is run it tries to increment the variable by `1`. If +incrementing the variable would bring it above `limit` then the Op raises +the exception `OutOfRangeError`. + +If no error is raised, the Op outputs the value of the variable before +the increment. + +This is essentially a shortcut for `count_up_to(self, limit)`. + +Args: + limit: value at which incrementing the variable raises an error. + +Returns: + A `Tensor` that will hold the variable value before the increment. If no + other Op modifies this variable, the values produced will all be + distinct." +9514,load,tensorflow/tensorflow/python/ops/variables.py,987,method,"Load new value into this variable. + +Writes new value to variable's memory. Doesn't add ops to the graph. + +This convenience method requires a session where the graph +containing this variable has been launched. If no session is +passed, the default session is used. See `tf.compat.v1.Session` for more +information on launching a graph and on sessions. + +```python +v = tf.Variable([1, 2]) +init = tf.compat.v1.global_variables_initializer() + +with tf.compat.v1.Session() as sess: + sess.run(init) + # Usage passing the session explicitly. + v.load([2, 3], sess) + print(v.eval(sess)) # prints [2 3] + # Usage with the default session. The 'with' block + # above makes 'sess' the default session. + v.load([3, 4], sess) + print(v.eval()) # prints [3 4] +``` + +Args: + value: New variable value + session: The session to use to evaluate this variable. If none, the + default session is used. + +Raises: + ValueError: Session is not passed and no default session" +9515,name,tensorflow/tensorflow/python/ops/variables.py,1128,method,The name of this variable. +9516,initializer,tensorflow/tensorflow/python/ops/variables.py,1145,method,The initializer operation for this variable. +9517,device,tensorflow/tensorflow/python/ops/variables.py,1150,method,The device of this variable. +9518,dtype,tensorflow/tensorflow/python/ops/variables.py,1155,method,The `DType` of this variable. +9519,op,tensorflow/tensorflow/python/ops/variables.py,1160,method,The `Operation` of this variable. +9520,graph,tensorflow/tensorflow/python/ops/variables.py,1165,method,The `Graph` of this variable. +9521,shape,tensorflow/tensorflow/python/ops/variables.py,1170,method,"The `TensorShape` of this variable. + +Returns: + A `TensorShape`." +9522,get_shape,tensorflow/tensorflow/python/ops/variables.py,1178,method,Alias of `Variable.shape`. +9523,to_proto,tensorflow/tensorflow/python/ops/variables.py,1186,method,"Converts a `Variable` to a `VariableDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `VariableDef` protocol buffer, or `None` if the `Variable` is not + in the specified name scope." +9524,from_proto,tensorflow/tensorflow/python/ops/variables.py,1199,method,Returns a `Variable` object created from `variable_def`. +9525,experimental_ref,tensorflow/tensorflow/python/ops/variables.py,1215,method, +9526,ref,tensorflow/tensorflow/python/ops/variables.py,1218,method,"Returns a hashable reference object to this Variable. + +The primary use case for this API is to put variables in a set/dictionary. +We can't put variables in a set/dictionary as `variable.__hash__()` is no +longer available starting Tensorflow 2.0. + +The following will raise an exception starting 2.0 + +>>> x = tf.Variable(5) +>>> y = tf.Variable(10) +>>> z = tf.Variable(10) +>>> variable_set = {x, y, z} +Traceback (most recent call last): + ... +TypeError: Variable is unhashable. Instead, use tensor.ref() as the key. +>>> variable_dict = {x: 'five', y: 'ten'} +Traceback (most recent call last): + ... +TypeError: Variable is unhashable. Instead, use tensor.ref() as the key. + +Instead, we can use `variable.ref()`. + +>>> variable_set = {x.ref(), y.ref(), z.ref()} +>>> x.ref() in variable_set +True +>>> variable_dict = {x.ref(): 'five', y.ref(): 'ten', z.ref(): 'ten'} +>>> variable_dict[y.ref()] +'ten' + +Also, the reference object provides `.deref()` function that returns the +original Variable. + +>>> x = tf.Variable(5) +>>> x.ref().deref() +" +9527,spec,tensorflow/tensorflow/python/ops/variables.py,1309,method,Computes the spec string used for saving. +9528,to_proto,tensorflow/tensorflow/python/ops/variables.py,1316,method,"Returns a SaveSliceInfoDef() proto. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `SaveSliceInfoDef` protocol buffer, or None if the `Variable` is not + in the specified name scope." +9529,VariableV1,tensorflow/tensorflow/python/ops/variables.py,1346,class,"See the [Variables Guide](https://tensorflow.org/guide/variables). A variable maintains state in the graph across calls to `run()`. You add a variable to the graph by constructing an instance of the class `Variable`. @@ -91066,70 +97623,481 @@ not have these issues: * Add `use_resource=True` when constructing `tf.Variable`; * Call `tf.compat.v1.get_variable_scope().set_use_resource(True)` inside a `tf.compat.v1.variable_scope` before the `tf.compat.v1.get_variable()` call." -10112,RefVariable,tensorflow/tensorflow/python/ops/variables.py,1556,class,Ref-based implementation of variables. -10113,_try_guard_against_uninitialized_dependencies,tensorflow/tensorflow/python/ops/variables.py,2729,function,"Attempt to guard against dependencies on uninitialized variables. +9530,RefVariable,tensorflow/tensorflow/python/ops/variables.py,1556,class,Ref-based implementation of variables. +9531,value,tensorflow/tensorflow/python/ops/variables.py,1912,method,"Returns the last snapshot of this variable. -Replace references to variables in `initial_value` with references to the -variable's initialized values. The initialized values are essentially -conditional TensorFlow graphs that return a variable's value if it is -initialized or its `initial_value` if it hasn't been initialized. This -replacement is done on a best effort basis: +You usually do not need to call this method as all ops that need the value +of the variable call it automatically through a `convert_to_tensor()` call. -- If the `initial_value` graph contains cycles, we don't do any - replacements for that graph. -- If the variables that `initial_value` depends on are not present in the - `GLOBAL_VARIABLES` or `LOCAL_VARIABLES` we don't replace them. +Returns a `Tensor` which holds the value of the variable. You can not +assign a new value to this tensor as it is not a reference to the variable. -In these cases, it is up to the caller to ensure that the `initial_value` -graph uses initialized variables or that they guard access to variables -using their `initialized_value` method. - -Args: - name: Variable name. - initial_value: `Tensor`. The initial value. +To avoid copies, if the consumer of the returned value is on the same device +as the variable, this actually returns the live value of the variable, not +a copy. Updates to the variable are seen by the consumer. If the consumer +is on a different device it will get a copy of the variable. Returns: - A `Tensor` suitable to initialize a variable. + A `Tensor` containing the value of the variable." +9532,read_value,tensorflow/tensorflow/python/ops/variables.py,1931,method,"Returns the value of this variable, read in the current context. + +Can be different from value() if it's on another device, with control +dependencies, etc. + +Returns: + A `Tensor` containing the value of the variable." +9533,set_shape,tensorflow/tensorflow/python/ops/variables.py,1958,method,"Overrides the shape for this variable. + +Args: + shape: the `TensorShape` representing the overridden shape." +9534,trainable,tensorflow/tensorflow/python/ops/variables.py,1968,method, +9535,synchronization,tensorflow/tensorflow/python/ops/variables.py,1972,method, +9536,aggregation,tensorflow/tensorflow/python/ops/variables.py,1976,method, +9537,eval,tensorflow/tensorflow/python/ops/variables.py,1979,method,"In a session, computes and returns the value of this variable. + +This is not a graph construction method, it does not add ops to the graph. + +This convenience method requires a session where the graph +containing this variable has been launched. If no session is +passed, the default session is used. See `tf.compat.v1.Session` for more +information on launching a graph and on sessions. + +```python +v = tf.Variable([1, 2]) +init = tf.compat.v1.global_variables_initializer() + +with tf.compat.v1.Session() as sess: + sess.run(init) + # Usage passing the session explicitly. + print(v.eval(sess)) + # Usage with the default session. The 'with' block + # above makes 'sess' the default session. + print(v.eval()) +``` + +Args: + session: The session to use to evaluate this variable. If none, the + default session is used. + +Returns: + A numpy `ndarray` with a copy of the value of this variable." +9538,initial_value,tensorflow/tensorflow/python/ops/variables.py,2012,method,"Returns the Tensor used as the initial value for the variable. + +Note that this is different from `initialized_value()` which runs +the op that initializes the variable before returning its value. +This method returns the tensor that is used by the op that initializes +the variable. + +Returns: + A `Tensor`." +9539,constraint,tensorflow/tensorflow/python/ops/variables.py,2026,method,"Returns the constraint function associated with this variable. + +Returns: + The constraint function that was passed to the variable constructor. + Can be `None` if no constraint was passed." +9540,assign,tensorflow/tensorflow/python/ops/variables.py,2035,method,"Assigns a new value to the variable. + +This is essentially a shortcut for `assign(self, value)`. + +Args: + value: A `Tensor`. The new value for this variable. + use_locking: If `True`, use locking during the assignment. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + A `Tensor` that will hold the new value of this variable after + the assignment has completed." +9541,assign_add,tensorflow/tensorflow/python/ops/variables.py,2057,method,"Adds a value to this variable. + + This is essentially a shortcut for `assign_add(self, delta)`. + +Args: + delta: A `Tensor`. The value to add to this variable. + use_locking: If `True`, use locking during the operation. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + A `Tensor` that will hold the new value of this variable after + the addition has completed." +9542,assign_sub,tensorflow/tensorflow/python/ops/variables.py,2079,method,"Subtracts a value from this variable. + +This is essentially a shortcut for `assign_sub(self, delta)`. + +Args: + delta: A `Tensor`. The value to subtract from this variable. + use_locking: If `True`, use locking during the operation. + name: The name of the operation to be created + read_value: if True, will return something which evaluates to the new + value of the variable; if False will return the assign op. + +Returns: + A `Tensor` that will hold the new value of this variable after + the subtraction has completed." +9543,scatter_sub,tensorflow/tensorflow/python/ops/variables.py,2101,method,"Subtracts `tf.IndexedSlices` from this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be subtracted from this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered subtraction has completed. + Raises: - TypeError: If `initial_value` is not a `Tensor`." -10114,_has_cycle,tensorflow/tensorflow/python/ops/variables.py,2768,function,Detect cycles in the dependencies of `initial_value`. -10115,_safe_initial_value_from_tensor,tensorflow/tensorflow/python/ops/variables.py,2784,function,"Replace dependencies on variables with their initialized values. + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9544,scatter_add,tensorflow/tensorflow/python/ops/variables.py,2125,method,"Adds `tf.IndexedSlices` to this variable. Args: - name: Variable name. - tensor: A `Tensor`. The tensor to replace. - op_cache: A dict mapping operation names to `Operation`s. Used to memoize - the results so as to avoid creating redundant operations. + sparse_delta: `tf.IndexedSlices` to be added to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. Returns: - A `Tensor` compatible with `tensor`. Any inputs that lead to variable - values will be replaced with a corresponding graph that uses the - variable's initialized values. This is done on a best-effort basis. If no - modifications need to be made then `tensor` will be returned unchanged." -10116,_safe_initial_value_from_op,tensorflow/tensorflow/python/ops/variables.py,2807,function,"Replace dependencies on variables with their initialized values. + A `Tensor` that will hold the new value of this variable after + the scattered addition has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9545,scatter_max,tensorflow/tensorflow/python/ops/variables.py,2149,method,"Updates this variable with the max of `tf.IndexedSlices` and itself. Args: - name: Variable name. - op: An `Operation`. The operation to replace. - op_cache: A dict mapping operation names to `Operation`s. Used to memoize - the results so as to avoid creating redundant operations. + sparse_delta: `tf.IndexedSlices` to use as an argument of max with this + variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. Returns: - An `Operation` compatible with `op`. Any inputs that lead to variable - values will be replaced with a corresponding graph that uses the - variable's initialized values. This is done on a best-effort basis. If no - modifications need to be made then `op` will be returned unchanged." -10117,_find_initialized_value_for_variable,tensorflow/tensorflow/python/ops/variables.py,2858,function,"Find the initialized value for a variable op. + A `Tensor` that will hold the new value of this variable after + the scattered maximization has completed. -To do so, lookup the variable op in the variables collection. +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9546,scatter_min,tensorflow/tensorflow/python/ops/variables.py,2174,method,"Updates this variable with the min of `tf.IndexedSlices` and itself. Args: - variable_op: A variable `Operation`. + sparse_delta: `tf.IndexedSlices` to use as an argument of min with this + variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. Returns: - A `Tensor` representing the initialized value for the variable or `None` - if the initialized value could not be found." -10118,PartitionedVariable,tensorflow/tensorflow/python/ops/variables.py,2884,class,"A container for partitioned `Variable` objects. + A `Tensor` that will hold the new value of this variable after + the scattered minimization has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9547,scatter_mul,tensorflow/tensorflow/python/ops/variables.py,2199,method,"Multiply this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to multiply this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered multiplication has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9548,scatter_div,tensorflow/tensorflow/python/ops/variables.py,2223,method,"Divide this variable by `tf.IndexedSlices`. + +Args: + sparse_delta: `tf.IndexedSlices` to divide this variable by. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered division has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9549,scatter_update,tensorflow/tensorflow/python/ops/variables.py,2247,method,"Assigns `tf.IndexedSlices` to this variable. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered assignment has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9550,batch_scatter_update,tensorflow/tensorflow/python/ops/variables.py,2271,method,"Assigns `tf.IndexedSlices` to this variable batch-wise. + +Analogous to `batch_gather`. This assumes that this variable and the +sparse_delta IndexedSlices have a series of leading dimensions that are the +same for all of them, and the updates are performed on the last dimension of +indices. In other words, the dimensions should be the following: + +`num_prefix_dims = sparse_delta.indices.ndims - 1` +`batch_dim = num_prefix_dims + 1` +`sparse_delta.updates.shape = sparse_delta.indices.shape + var.shape[ + batch_dim:]` + +where + +`sparse_delta.updates.shape[:num_prefix_dims]` +`== sparse_delta.indices.shape[:num_prefix_dims]` +`== var.shape[:num_prefix_dims]` + +And the operation performed can be expressed as: + +`var[i_1, ..., i_n, + sparse_delta.indices[i_1, ..., i_n, j]] = sparse_delta.updates[ + i_1, ..., i_n, j]` + +When sparse_delta.indices is a 1D tensor, this operation is equivalent to +`scatter_update`. + +To avoid this operation one can looping over the first `ndims` of the +variable and using `scatter_update` on the subtensors that result of slicing +the first dimension. This is a valid option for `ndims = 1`, but less +efficient than this implementation. + +Args: + sparse_delta: `tf.IndexedSlices` to be assigned to this variable. + use_locking: If `True`, use locking during the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered assignment has completed. + +Raises: + TypeError: if `sparse_delta` is not an `IndexedSlices`." +9551,scatter_nd_sub,tensorflow/tensorflow/python/ops/variables.py,2323,method,"Applies sparse subtraction to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = ref.scatter_nd_sub(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to ref would look like this: + + [1, -9, 3, -6, -6, 6, 7, -4] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered subtraction has completed." +9552,scatter_nd_add,tensorflow/tensorflow/python/ops/variables.py,2372,method,"Applies sparse addition to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + add = ref.scatter_nd_add(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(add) +``` + +The resulting update to ref would look like this: + + [1, 13, 3, 14, 14, 6, 7, 20] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered addition has completed." +9553,scatter_nd_update,tensorflow/tensorflow/python/ops/variables.py,2421,method,"Applies sparse assignment to individual values or slices in a Variable. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +For example, say we want to add 4 scattered elements to a rank-1 tensor to +8 elements. In Python, that update would look like this: + +```python + ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8]) + indices = tf.constant([[4], [3], [1] ,[7]]) + updates = tf.constant([9, 10, 11, 12]) + op = ref.scatter_nd_update(indices, updates) + with tf.compat.v1.Session() as sess: + print sess.run(op) +``` + +The resulting update to ref would look like this: + + [1, 11, 3, 10, 9, 6, 7, 12] + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered assignment has completed." +9554,scatter_nd_max,tensorflow/tensorflow/python/ops/variables.py,2470,method,"Updates this variable with the max of `tf.IndexedSlices` and itself. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered addition has completed." +9555,scatter_nd_min,tensorflow/tensorflow/python/ops/variables.py,2503,method,"Updates this variable with the min of `tf.IndexedSlices` and itself. + +`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. + +`indices` must be integer tensor, containing indices into `ref`. +It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. + +The innermost dimension of `indices` (with length `K`) corresponds to +indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th +dimension of `ref`. + +`updates` is `Tensor` of rank `Q-1+P-K` with shape: + +``` +[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]. +``` + +See `tf.scatter_nd` for more details about how to make updates to +slices. + +Args: + indices: The indices to be used in the operation. + updates: The values to be used in the operation. + name: the name of the operation. + +Returns: + A `Tensor` that will hold the new value of this variable after + the scattered addition has completed." +9556,count_up_to,tensorflow/tensorflow/python/ops/variables.py,2553,method,"Increments this variable until it reaches `limit`. + +When that Op is run it tries to increment the variable by `1`. If +incrementing the variable would bring it above `limit` then the Op raises +the exception `OutOfRangeError`. + +If no error is raised, the Op outputs the value of the variable before +the increment. + +This is essentially a shortcut for `count_up_to(self, limit)`. + +Args: + limit: value at which incrementing the variable raises an error. + +Returns: + A `Tensor` that will hold the variable value before the increment. If no + other Op modifies this variable, the values produced will all be + distinct." +9557,name,tensorflow/tensorflow/python/ops/variables.py,2599,method,The name of this variable. +9558,initializer,tensorflow/tensorflow/python/ops/variables.py,2604,method,The initializer operation for this variable. +9559,device,tensorflow/tensorflow/python/ops/variables.py,2609,method,The device of this variable. +9560,dtype,tensorflow/tensorflow/python/ops/variables.py,2614,method,The `DType` of this variable. +9561,op,tensorflow/tensorflow/python/ops/variables.py,2619,method,The `Operation` of this variable. +9562,graph,tensorflow/tensorflow/python/ops/variables.py,2624,method,The `Graph` of this variable. +9563,shape,tensorflow/tensorflow/python/ops/variables.py,2634,method,"The `TensorShape` of this variable. + +Returns: + A `TensorShape`." +9564,to_proto,tensorflow/tensorflow/python/ops/variables.py,2642,method,"Converts a `Variable` to a `VariableDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `VariableDef` protocol buffer, or `None` if the `Variable` is not + in the specified name scope." +9565,PartitionedVariable,tensorflow/tensorflow/python/ops/variables.py,2884,class,"A container for partitioned `Variable` objects. @compatibility(eager) `tf.PartitionedVariable` is not compatible with eager execution. Use `tf.Variable` instead which is compatible @@ -91138,7 +98106,22 @@ TensorFlow Eager Execution guide](https://www.tensorflow.org/guide/eager#variables_and_optimizers) for details on how variables work in eager execution. @end_compatibility" -10119,global_variables,tensorflow/tensorflow/python/ops/variables.py,3106,function,"Returns global variables. +9566,as_tensor,tensorflow/tensorflow/python/ops/variables.py,2994,method,"Returns the overall concatenated value as a `Tensor`. + +The returned tensor will not inherit the control dependencies from the scope +where the value is used, which is similar to getting the value of +`Variable`. + +Returns: + `Tensor` containing the concatenated value." +9567,name,tensorflow/tensorflow/python/ops/variables.py,3022,method, +9568,dtype,tensorflow/tensorflow/python/ops/variables.py,3026,method, +9569,shape,tensorflow/tensorflow/python/ops/variables.py,3030,method, +9570,get_shape,tensorflow/tensorflow/python/ops/variables.py,3039,method, +9571,assign,tensorflow/tensorflow/python/ops/variables.py,3074,method, +9572,assign_add,tensorflow/tensorflow/python/ops/variables.py,3082,method, +9573,assign_sub,tensorflow/tensorflow/python/ops/variables.py,3090,method, +9574,global_variables,tensorflow/tensorflow/python/ops/variables.py,3106,function,"Returns global variables. Global variables are variables that are shared across machines in a distributed environment. The `Variable()` constructor or `get_variable()` @@ -91158,19 +98141,8 @@ Args: Returns: A list of `Variable` objects." -10120,all_variables,tensorflow/tensorflow/python/ops/variables.py,3133,function,Use `tf.compat.v1.global_variables` instead. -10121,_all_saveable_objects,tensorflow/tensorflow/python/ops/variables.py,3138,function,"Returns all variables and `SaveableObject`s that must be checkpointed. - -Args: - scope: (Optional.) A string. If supplied, the resulting list is filtered to - include only items whose `name` attribute matches `scope` using - `re.match`. Items without a `name` attribute are never returned if a scope - is supplied. The choice of `re.match` means that a `scope` without special - tokens filters by prefix. - -Returns: - A list of `Variable` and `SaveableObject` to be checkpointed" -10122,local_variables,tensorflow/tensorflow/python/ops/variables.py,3157,function,"Returns local variables. +9575,all_variables,tensorflow/tensorflow/python/ops/variables.py,3133,function,Use `tf.compat.v1.global_variables` instead. +9576,local_variables,tensorflow/tensorflow/python/ops/variables.py,3157,function,"Returns local variables. Local variables - per process variables, usually not saved/restored to checkpoint and used for temporary or intermediate values. @@ -91192,7 +98164,7 @@ Args: Returns: A list of local `Variable` objects." -10123,model_variables,tensorflow/tensorflow/python/ops/variables.py,3185,function,"Returns all variables in the MODEL_VARIABLES collection. +9577,model_variables,tensorflow/tensorflow/python/ops/variables.py,3185,function,"Returns all variables in the MODEL_VARIABLES collection. Args: scope: (Optional.) A string. If supplied, the resulting list is filtered to @@ -91203,7 +98175,7 @@ Args: Returns: A list of local Variable objects." -10124,trainable_variables,tensorflow/tensorflow/python/ops/variables.py,3202,function,"Returns all variables created with `trainable=True`. +9578,trainable_variables,tensorflow/tensorflow/python/ops/variables.py,3202,function,"Returns all variables created with `trainable=True`. When passed `trainable=True`, the `Variable()` constructor automatically adds new variables to the graph collection @@ -91219,7 +98191,7 @@ Args: Returns: A list of Variable objects." -10125,moving_average_variables,tensorflow/tensorflow/python/ops/variables.py,3224,function,"Returns all variables that maintain their moving averages. +9579,moving_average_variables,tensorflow/tensorflow/python/ops/variables.py,3224,function,"Returns all variables that maintain their moving averages. If an `ExponentialMovingAverage` object is created and the `apply()` method is called on a list of variables, these variables will @@ -91235,7 +98207,7 @@ Args: Returns: A list of Variable objects." -10126,variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3246,function,"Returns an Op that initializes a list of variables. +9580,variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3246,function,"Returns an Op that initializes a list of variables. After you launch the graph in a session, you can run the returned Op to initialize all the variables in `var_list`. This Op runs all the @@ -91253,22 +98225,22 @@ Args: Returns: An Op that run the initializers of all the specified variables." -10127,initialize_variables,tensorflow/tensorflow/python/ops/variables.py,3274,function,See `tf.compat.v1.variables_initializer`. -10128,global_variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3280,function,"Returns an Op that initializes global variables. +9581,initialize_variables,tensorflow/tensorflow/python/ops/variables.py,3274,function,See `tf.compat.v1.variables_initializer`. +9582,global_variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3280,function,"Returns an Op that initializes global variables. This is just a shortcut for `variables_initializer(global_variables())` Returns: An Op that initializes global variables in the graph." -10129,initialize_all_variables,tensorflow/tensorflow/python/ops/variables.py,3296,function,See `tf.compat.v1.global_variables_initializer`. -10130,local_variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3302,function,"Returns an Op that initializes all local variables. +9583,initialize_all_variables,tensorflow/tensorflow/python/ops/variables.py,3296,function,See `tf.compat.v1.global_variables_initializer`. +9584,local_variables_initializer,tensorflow/tensorflow/python/ops/variables.py,3302,function,"Returns an Op that initializes all local variables. This is just a shortcut for `variables_initializer(local_variables())` Returns: An Op that initializes all local variables in the graph." -10131,initialize_local_variables,tensorflow/tensorflow/python/ops/variables.py,3318,function,See `tf.compat.v1.local_variables_initializer`. -10132,is_variable_initialized,tensorflow/tensorflow/python/ops/variables.py,3325,function,"Tests if a variable has been initialized. +9585,initialize_local_variables,tensorflow/tensorflow/python/ops/variables.py,3318,function,See `tf.compat.v1.local_variables_initializer`. +9586,is_variable_initialized,tensorflow/tensorflow/python/ops/variables.py,3325,function,"Tests if a variable has been initialized. Args: variable: A `Variable`. @@ -91276,7 +98248,7 @@ Args: Returns: Returns a scalar boolean Tensor, `True` if the variable has been initialized, `False` otherwise." -10133,assert_variables_initialized,tensorflow/tensorflow/python/ops/variables.py,3340,function,"Returns an Op to check if variables are initialized. +9587,assert_variables_initialized,tensorflow/tensorflow/python/ops/variables.py,3340,function,"Returns an Op to check if variables are initialized. NOTE: This function is obsolete and will be removed in 6 months. Please change your implementation to use `report_uninitialized_variables()`. @@ -91294,7 +98266,7 @@ Args: Returns: An Op, or None if there are no variables." -10134,report_uninitialized_variables,tensorflow/tensorflow/python/ops/variables.py,3383,function,"Adds ops to list the names of uninitialized variables. +9588,report_uninitialized_variables,tensorflow/tensorflow/python/ops/variables.py,3383,function,"Adds ops to list the names of uninitialized variables. When run, it returns a 1-D tensor containing the names of uninitialized variables if there are any, or an empty array if there are none. @@ -91307,9 +98279,7 @@ Args: Returns: A 1-D tensor containing names of the uninitialized variables, or an empty 1-D tensor if there are no variables or no uninitialized variables." -10135,_has_valid_dims,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,33,function, -10136,_has_valid_nonscalar_shape,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,46,function, -10137,assert_broadcastable,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,63,function,"Asserts `weights` can be broadcast to `values`. +9589,assert_broadcastable,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,63,function,"Asserts `weights` can be broadcast to `values`. In `tf.losses` and `tf.metrics`, we support limited weight broadcasting. We let weights be either scalar, or the same rank as the target values, with each @@ -91325,7 +98295,7 @@ Returns: Raises: ValueError: If static checks determine `weights` has incorrect shape." -10138,broadcast_weights,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,136,function,"Broadcast `weights` to the same shape as `values`. +9590,broadcast_weights,tensorflow/tensorflow/python/ops/weights_broadcast_ops.py,136,function,"Broadcast `weights` to the same shape as `values`. This returns a version of `weights` following the same broadcast rules as `mul(weights, values)`, but limited to the weights shapes allowed by @@ -91341,194 +98311,8 @@ Args: Returns: `weights` broadcast to `values` shape according to the rules of `assert_broadcastable`." -10139,while_loop,tensorflow/tensorflow/python/ops/while_v2.py,58,function,"Like tf.while_loop, except emits a single While op." -10140,_WhileGrad,tensorflow/tensorflow/python/ops/while_v2.py,309,function,The gradient of a While op produced by while_loop. -10141,_build_while_op,tensorflow/tensorflow/python/ops/while_v2.py,414,function,Builds the functional StatelessWhile/While op. -10142,_get_intermediates,tensorflow/tensorflow/python/ops/while_v2.py,443,function,Returns all tensors in `func_graph` that should be accumulated. -10143,_preprocess_grad,tensorflow/tensorflow/python/ops/while_v2.py,486,function,"Returns the initial gradient to be used for a given output tensor. - -Args: - grad: the original gradient Tensor passed to the gradient function. - body_graph_output: the corresponding Tensor in the body graph. - while_op_input: the corresponding Tensor input of the While op. - while_op_output: the corresponding Tensor output of the While op. - -Returns: - A Tensor or None." -10144,_zeros_like,tensorflow/tensorflow/python/ops/while_v2.py,528,function,Like array_ops.zeros_like() but also accepts resource var handles. -10145,_is_trainable,tensorflow/tensorflow/python/ops/while_v2.py,540,function,Returns whether the given tensor is trainable. -10146,_get_graph,tensorflow/tensorflow/python/ops/while_v2.py,558,function,"Returns `FuncGraph` for the given function attribute. - -Args: - while_op: The While Operation. - func_attr_name: string - attr_graph_name: cached forward graph name - -Returns: - `FuncGraph`" -10147,_create_grad_func,tensorflow/tensorflow/python/ops/while_v2.py,581,function,"Builds and returns the gradient FuncGraph of `func_graph` and its args. - -The returned grad_func_graph must be called with the returned -args + grad_func_graph.captures. - -Args: - ys: A `Tensor` or list of tensors to be differentiated. - xs: A `Tensor` or list of tensors to be used for differentiation. - grads: The incoming grads for `ys`. - cond_graph: FuncGraph for the forward cond function. - body_graph: FuncGraph for the forward body function. - name: Name of the returned gradient function. - while_op: The forward While op. - maximum_iterations: Tensor. The maximum number of iterations. - -Returns: - 2-tuple of (grad_func_graph, args)." -10148,_grad_fn,tensorflow/tensorflow/python/ops/while_v2.py,654,function,"Computes the gradient of `func_graph` in the current graph. - -This function builds the gradient graph of the corresponding forward-pass -`func_graph` by differentiating `func_graph`'s outputs w.r.t. its inputs. - -Args: - ys: A `Tensor` or list of tensors to be differentiated. - xs: A `Tensor` or list of tensors to be used for differentiation. - args: The input arguments. - args[0] - Loop counter - args[1] - Total number of iterations. - args[2] - maximum_iterations. - args[3:] - Incoming gradients for `ys`. - func_graph: function.FuncGraph. The corresponding forward-pass function. - -Returns: - The output gradient Tensors." -10149,_resolve_grad_captures,tensorflow/tensorflow/python/ops/while_v2.py,693,function,"Returns the tensors to pass as captured inputs to `body_grad_graph`. - -`body_grad_graph` may have external references to: -1. Its outer graph containing the input gradients. These are left as-is. -2. Accumulators captured from the forward-pass graph. These should have been - added as `while_op` outputs after the gradient graph was built. We replace - these with the corresponding output of `while_op`, i.e. a tensor in - `body_graph.outer_graph`. In the case of nested control flow or functions, - the gradient logic handling `body_grad_graph.outer_graph` will make sure - the tensor from `body_graph.outer_graph` is also correctly captured. - -Args: - body_graph: FuncGraph. The forward-pass body function. - body_grad_graph: FuncGraph. The body gradients function. - while_op: The forward-pass While Operation calling `body_graph`. - -Returns: - A list of input tensors to be passed as the captured inputs to - `body_grad_graph`." -10150,_get_structured_grad_output,tensorflow/tensorflow/python/ops/while_v2.py,738,function,"Returns the values that should be returned from the while grad function. - -Args: - outputs: the raw Tensor outputs of the grad While op. - grads: the input gradients to the gradient function. - body_grad_graph: _WhileBodyGradFuncGraph. - -Returns: - A list of gradient values. May include Nones." -10151,_get_accumulator,tensorflow/tensorflow/python/ops/while_v2.py,778,function,"Returns TensorList if any containing accumulated values of tensor. - -We try to find a pattern of the form: - - input_tl tensor - \ / - (TensorListPushBack) - | - output_tl - -which satisfies the following conditions: - -1. input_tl must be in tensor.graph.inputs. -2. output_tl or Identity(output_tl) must be in tensor.graph.outputs. -3. tensor.graph.input_index(input_tl) == tensor.graph.output_index(output_t). - -output_tl or Identity(output_tl) (whichever is in tensor.graph.outputs) is -returned if such a pattern is found else None is returned. - -Args: - tensor: The Tensor to be accumulated. - -Returns: - A variant tensor in the same graph as `tensor` or None if no accumulator is - found." -10152,_WhileBodyGradFuncGraph,tensorflow/tensorflow/python/ops/while_v2.py,847,class,"FuncGraph for the gradient function of the body of a While op. - -Contains the logic for capturing the tensors from the body of the forward -While op which is as follows: -1. If the tensor is of resource type (these are not accumulated): - a. Ensure that the tensor is a loop invariant, i.e., it exists in both loop - inputs and outputs at the same index. - b. Lookup the corresponding resource tensor in the forward outer graph and - try to capture that. -2. If the tensor is not of resource type: - a. Create an accumulator for that tensor and output it from the forward - pass. Note this also requires adding it as an input to the forward pass. - b. Capture the accumulator from the forward pass in this FuncGraph. This - will later be resolved to the correct output of the forward While op. - c. Pop a value from the captured placeholder and use it as the captured - value for the forward pass tensor. - -This only allows capturing tensors in the forward graph. A ValueError is -raised if an attempt is made to capture a tensor not in the forward graph. -To manually capture capture a tensor that is not in the forward graph, call -`capture` with `allowlisted=True`. - -Note: The `captures` dict does not contain the forward tensor since it is not -directly captured. It contains the accumulator corresponding to this forward -tensor. - -Attributes: - while_op_needs_rewrite: True if any non-resource intermediates were - captured, meaning the forward While op needs to be rewritten to output the - corresponding accumulators. - extra_inputs: list of EmptyTensorList tensors to be used as initial input to - the new accumulators in the forward graph. It may also contain external - captures of the custom gradient function. - popped_tensor_lists: dict from the captured accumulator placeholder to the - TensorList obtained after popping the intermediate tensor from it. The - values of this dict need to be added to the list of outputs." -10153,_check_shapes_compat,tensorflow/tensorflow/python/ops/while_v2.py,1143,function, -10154,_check_num_inputs_outputs,tensorflow/tensorflow/python/ops/while_v2.py,1154,function,Checks the number of inputs/outputs of `cond_graph` and `body_graph`. -10155,_check_inputs_outputs_types_match,tensorflow/tensorflow/python/ops/while_v2.py,1169,function, -10156,_build_cond_placeholders_name_prefix,tensorflow/tensorflow/python/ops/while_v2.py,1178,function, -10157,_duplicate_body_captures_in_cond,tensorflow/tensorflow/python/ops/while_v2.py,1182,function,"Creates placeholders for body captures in cond_graph. - -This is needed to match signatures of cond and body graphs. - -Args: - cond_graph: cond branch graph - body_graph_captures: Tensors which were captured when building the - `body_graph`." -10158,_copy_handle_data,tensorflow/tensorflow/python/ops/while_v2.py,1222,function, -10159,_graph_name,tensorflow/tensorflow/python/ops/while_v2.py,1227,function, -10160,_pack_sequence_as,tensorflow/tensorflow/python/ops/while_v2.py,1233,function,Like `nest.pack_sequence_as` but also replaces flows with TensorArrays. -10161,_tensor_array_to_flow,tensorflow/tensorflow/python/ops/while_v2.py,1249,function, -10162,_build_maximum_iterations_loop_var,tensorflow/tensorflow/python/ops/while_v2.py,1259,function, -10163,_build_accumulator_name,tensorflow/tensorflow/python/ops/while_v2.py,1269,function, -10164,_is_loop_invariant,tensorflow/tensorflow/python/ops/while_v2.py,1274,function, -10165,_OperationWithOutputs,tensorflow/tensorflow/python/ops/while_v2.py,1278,class,"Operation with pre-built `TF_Output`s. - -The C API for creating the extra placeholders for the cond graph returns -SWIG wrapped TF_Output* pointers which we can use directly for -`Operation.outputs`. The default constructor for `Operation` does not provide -a way of specifying pre-built output tensors and always creates them. This is -a performance overhead. It is not clear if adding that feature to the -`Operation` API would be generally useful so for now we just have our own -lightweight `Operation` implementation. Note that this does not extract a -stacktrace as well since we don't expect this operation to be used. - -TODO(b/143286622): This should not be required once captures are separated -from regular loop vars." -10166,_set_read_only_resource_inputs_attr,tensorflow/tensorflow/python/ops/while_v2.py,1302,function,"Sets the list of resource inputs which are read-only. - -This is used by AutomaticControlDependencies. - -Args: - op: While Operation. - branch_graphs: List of branch FuncGraphs." -10167,rewrite_grad_indexed_slices,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,31,function,"Handles special case of IndexedSlices returned from while gradient. +9591,while_loop,tensorflow/tensorflow/python/ops/while_v2.py,58,function,"Like tf.while_loop, except emits a single While op." +9592,rewrite_grad_indexed_slices,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,31,function,"Handles special case of IndexedSlices returned from while gradient. Some gradient functions return IndexedSlices instead of a Tensor (e.g. the gradient of Gather ops). When this happens in the gradient of a while body, @@ -91550,92 +98334,13 @@ Args: Returns: The new loop_vars to pass to body_grad_graph." -10168,_get_tensor_index_in_iterable,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,84,function,"Returns index of first occurence of `t`, raises ValueError if not found." -10169,_rewrite_output_as_tensor,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,92,function,"Rewrites grad_output_slices to be a Tensor output. - -Args: - body_grad_graph: _WhileBodyGradFuncGraph. - grad_output_slices: IndexedSlices output of body_grad_graph." -10170,_rewrite_input_as_indexed_slices,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,109,function,"Rewrites grad_output_slices's corresponding input to be an IndexedSlices. - -This rewrite requires that forward_input was captured in the forward loop, -i.e. is not a user-specified loop variable. This is important because the -rewrite assumes that forward_input is passed through to its corresponding -output unchanged. This assumption is used in _rewrite_input_as_indexed_slices, -which depends on the exact gradient structure produced by the input's fanout. - -This can yield a more efficient computation than using -_rewrite_output_as_tensor, since it preserves the IndexedSlices structure -instead of converting the IndexedSlices to a dense Tensor. - -Args: - body_grad_graph: _WhileBodyGradFuncGraph. - grad_output_slices: IndexedSlices output of body_grad_graph. - forward_input: the corresponding Tensor input to the forward loop. - loop_vars: list of Tensors. The inputs to body_grad_graph. - -Returns: - The new loop_vars to pass to body_grad_graph." -10171,_create_grad_indexed_slices_init,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,167,function,"Creates an IndexedSlices to pass as input to the while grad function. - -Args: - grad_output_slices: IndexedSlices. The corresponding while grad function - output. - forward_input: Tensor. The corresponding input to the forward while op. - -Returns: - Zeros IndexedSlices, created in current Graph." -10172,_rewrite_grad_indexed_slices_output,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,213,function,"Creates a new version of old_output_slices with new_input_slices as input. - -This method assumes that old_output_slices.{values,indices} are produced by -concatenating the incoming gradient Tensor input with the IndexedSlices -produced by the gradient computation of the while body. See -backprop.aggregate_indexed_slices_gradients for where these concats are -constructed. We build new concats that use new_input_slices instead of the -original Tensor input. - -Args: - old_output_slices: original IndexedSlices output of while gradient. - new_input_slices: new IndexedSlices to use as input to while gradient. - -Returns: - A new IndexedSlices to replace old_output_slices." -10173,_update_indexed_slices_param,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,248,function,"Updates graph with new IndexedSlices input/output. - -Updates graph's metadata to output the gradient computation defined by -init_slices, input_slices, and output_slices, instead of outputting -old_output_slices. Also returns a new version of loop_vars with init_slices -replacing the old input. - -Args: - graph: _WhileBodyGradFuncGraph. - loop_vars: the inputs to graph. - init_slices: the new IndexedSlices to use as input to graph. - input_slices: the new IndexedSlices in graph that should be fed by - init_slices. - output_slices: the new IndexedSlices in graph that should be the - corresponding output to input_slices. - old_output_slices: the IndexedSlices in graph that are currently - being output. - -Returns: - New loop_vars to pass to graph." -10174,_flatten,tensorflow/tensorflow/python/ops/while_v2_indexed_slices_rewriter.py,290,function, -10175,Bernoulli,tensorflow/tensorflow/python/ops/distributions/bernoulli.py,36,class,"Bernoulli distribution. +9593,Bernoulli,tensorflow/tensorflow/python/ops/distributions/bernoulli.py,36,class,"Bernoulli distribution. The Bernoulli distribution with `probs` parameter, i.e., the probability of a `1` outcome (vs a `0` outcome)." -10176,_kl_bernoulli_bernoulli,tensorflow/tensorflow/python/ops/distributions/bernoulli.py,170,function,"Calculate the batched KL divergence KL(a || b) with a and b Bernoulli. - -Args: - a: instance of a Bernoulli distribution object. - b: instance of a Bernoulli distribution object. - name: (optional) Name to use for created operations. - default is ""kl_bernoulli_bernoulli"". - -Returns: - Batchwise KL(a || b)" -10177,Beta,tensorflow/tensorflow/python/ops/distributions/beta.py,51,class,"Beta distribution. +9594,logits,tensorflow/tensorflow/python/ops/distributions/bernoulli.py,104,method,Log-odds of a `1` outcome (vs `0`). +9595,probs,tensorflow/tensorflow/python/ops/distributions/bernoulli.py,109,method,Probability of a `1` outcome (vs `0`). +9596,Beta,tensorflow/tensorflow/python/ops/distributions/beta.py,51,class,"Beta distribution. The Beta distribution is defined over the `(0, 1)` interval using parameters `concentration1` (aka ""alpha"") and `concentration0` (aka ""beta""). @@ -91739,19 +98444,11 @@ References: (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) ([pdf] (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -10178,BetaWithSoftplusConcentration,tensorflow/tensorflow/python/ops/distributions/beta.py,354,class,Beta with softplus transform of `concentration1` and `concentration0`. -10179,_kl_beta_beta,tensorflow/tensorflow/python/ops/distributions/beta.py,383,function,"Calculate the batchwise KL divergence KL(d1 || d2) with d1 and d2 Beta. - -Args: - d1: instance of a Beta distribution object. - d2: instance of a Beta distribution object. - name: (optional) Name to use for created operations. - default is ""kl_beta_beta"". - -Returns: - Batchwise KL(d1 || d2)" -10180,_Mapping,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,45,class,Helper class to make it easier to manage caching in `Bijector`. -10181,Bijector,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,136,class,"Interface for transformations of a `Distribution` sample. +9597,concentration1,tensorflow/tensorflow/python/ops/distributions/beta.py,221,method,Concentration parameter associated with a `1` outcome. +9598,concentration0,tensorflow/tensorflow/python/ops/distributions/beta.py,226,method,Concentration parameter associated with a `0` outcome. +9599,total_concentration,tensorflow/tensorflow/python/ops/distributions/beta.py,231,method,Sum of concentration parameters. +9600,BetaWithSoftplusConcentration,tensorflow/tensorflow/python/ops/distributions/beta.py,354,class,Beta with softplus transform of `concentration1` and `concentration0`. +9601,Bijector,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,136,class,"Interface for transformations of a `Distribution` sample. Bijectors can be used to represent any differentiable and injective (one to one) function defined on an open subset of `R^n`. Some non-injective @@ -92104,11 +98801,142 @@ abs.inverse(0.) abs.inverse_log_det_jacobian(0., event_ndims=0) ==> (0., 0.) ```" -10182,assert_finite,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,28,function, -10183,assert_strictly_increasing,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,33,function, -10184,assert_strictly_decreasing,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,37,function, -10185,assert_strictly_monotonic,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,41,function, -10186,assert_scalar_congruency,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,48,function,"Assert `bijector`'s forward/inverse/inverse_log_det_jacobian are congruent. +9602,graph_parents,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,591,method,Returns this `Bijector`'s graph_parents as a Python list. +9603,forward_min_event_ndims,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,596,method,Returns the minimal number of dimensions bijector.forward operates on. +9604,inverse_min_event_ndims,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,601,method,Returns the minimal number of dimensions bijector.inverse operates on. +9605,is_constant_jacobian,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,606,method,"Returns true iff the Jacobian matrix is not a function of x. + +Note: Jacobian matrix is either constant for both forward and inverse or +neither. + +Returns: + is_constant_jacobian: Python `bool`." +9606,validate_args,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,634,method,Returns True if Tensor arguments will be validated. +9607,dtype,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,639,method,dtype of `Tensor`s transformable by this distribution. +9608,name,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,644,method,Returns the string name of this `Bijector`. +9609,forward_event_shape_tensor,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,653,method,"Shape of a single sample from a single batch as an `int32` 1D `Tensor`. + +Args: + input_shape: `Tensor`, `int32` vector indicating event-portion shape + passed into `forward` function. + name: name to give to the op + +Returns: + forward_event_shape_tensor: `Tensor`, `int32` vector indicating + event-portion shape after applying `forward`." +9610,forward_event_shape,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,677,method,"Shape of a single sample from a single batch as a `TensorShape`. + +Same meaning as `forward_event_shape_tensor`. May be only partially defined. + +Args: + input_shape: `TensorShape` indicating event-portion shape passed into + `forward` function. + +Returns: + forward_event_shape_tensor: `TensorShape` indicating event-portion shape + after applying `forward`. Possibly unknown." +9611,inverse_event_shape_tensor,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,697,method,"Shape of a single sample from a single batch as an `int32` 1D `Tensor`. + +Args: + output_shape: `Tensor`, `int32` vector indicating event-portion shape + passed into `inverse` function. + name: name to give to the op + +Returns: + inverse_event_shape_tensor: `Tensor`, `int32` vector indicating + event-portion shape after applying `inverse`." +9612,inverse_event_shape,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,721,method,"Shape of a single sample from a single batch as a `TensorShape`. + +Same meaning as `inverse_event_shape_tensor`. May be only partially defined. + +Args: + output_shape: `TensorShape` indicating event-portion shape passed into + `inverse` function. + +Returns: + inverse_event_shape_tensor: `TensorShape` indicating event-portion shape + after applying `inverse`. Possibly unknown." +9613,forward,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,753,method,"Returns the forward `Bijector` evaluation, i.e., X = g(Y). + +Args: + x: `Tensor`. The input to the ""forward"" evaluation. + name: The name to give this op. + +Returns: + `Tensor`. + +Raises: + TypeError: if `self.dtype` is specified and `x.dtype` is not + `self.dtype`. + NotImplementedError: if `_forward` is not implemented." +9614,inverse,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,787,method,"Returns the inverse `Bijector` evaluation, i.e., X = g^{-1}(Y). + +Args: + y: `Tensor`. The input to the ""inverse"" evaluation. + name: The name to give this op. + +Returns: + `Tensor`, if this bijector is injective. + If not injective, returns the k-tuple containing the unique + `k` points `(x1, ..., xk)` such that `g(xi) = y`. + +Raises: + TypeError: if `self.dtype` is specified and `y.dtype` is not + `self.dtype`. + NotImplementedError: if `_inverse` is not implemented." +9615,inverse_log_det_jacobian,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,871,method,"Returns the (log o det o Jacobian o inverse)(y). + +Mathematically, returns: `log(det(dX/dY))(Y)`. (Recall that: `X=g^{-1}(Y)`.) + +Note that `forward_log_det_jacobian` is the negative of this function, +evaluated at `g^{-1}(y)`. + +Args: + y: `Tensor`. The input to the ""inverse"" Jacobian determinant evaluation. + event_ndims: Number of dimensions in the probabilistic events being + transformed. Must be greater than or equal to + `self.inverse_min_event_ndims`. The result is summed over the final + dimensions to produce a scalar Jacobian determinant for each event, + i.e. it has shape `y.shape.ndims - event_ndims` dimensions. + name: The name to give this op. + +Returns: + `Tensor`, if this bijector is injective. + If not injective, returns the tuple of local log det + Jacobians, `log(det(Dg_i^{-1}(y)))`, where `g_i` is the restriction + of `g` to the `ith` partition `Di`. + +Raises: + TypeError: if `self.dtype` is specified and `y.dtype` is not + `self.dtype`. + NotImplementedError: if `_inverse_log_det_jacobian` is not implemented." +9616,forward_log_det_jacobian,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,973,method,"Returns both the forward_log_det_jacobian. + +Args: + x: `Tensor`. The input to the ""forward"" Jacobian determinant evaluation. + event_ndims: Number of dimensions in the probabilistic events being + transformed. Must be greater than or equal to + `self.forward_min_event_ndims`. The result is summed over the final + dimensions to produce a scalar Jacobian determinant for each event, + i.e. it has shape `x.shape.ndims - event_ndims` dimensions. + name: The name to give this op. + +Returns: + `Tensor`, if this bijector is injective. + If not injective this is not implemented. + +Raises: + TypeError: if `self.dtype` is specified and `y.dtype` is not + `self.dtype`. + NotImplementedError: if neither `_forward_log_det_jacobian` + nor {`_inverse`, `_inverse_log_det_jacobian`} are implemented, or + this is a non-injective bijector." +9617,camel_to_snake,tensorflow/tensorflow/python/ops/distributions/bijector_impl.py,581,method, +9618,assert_finite,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,28,function, +9619,assert_strictly_increasing,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,33,function, +9620,assert_strictly_decreasing,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,37,function, +9621,assert_strictly_monotonic,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,41,function, +9622,assert_scalar_congruency,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,48,function,"Assert `bijector`'s forward/inverse/inverse_log_det_jacobian are congruent. We draw samples `X ~ U(lower_x, upper_x)`, then feed these through the `bijector` in order to check that: @@ -92135,7 +98963,7 @@ Args: Raises: AssertionError: If tests fail." -10187,assert_bijective_and_finite,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,163,function,"Assert that forward/inverse (along with jacobians) are inverses and finite. +9623,assert_bijective_and_finite,tensorflow/tensorflow/python/ops/distributions/bijector_test_util.py,163,function,"Assert that forward/inverse (along with jacobians) are inverses and finite. It is recommended to use x and y values that are very very close to the edge of the Bijector's domain. @@ -92152,8 +98980,7 @@ Args: Raises: AssertionError: If tests fail." -10188,_broadcast_cat_event_and_params,tensorflow/tensorflow/python/ops/distributions/categorical.py,36,function,Broadcasts the event or distribution parameters. -10189,Categorical,tensorflow/tensorflow/python/ops/distributions/categorical.py,63,class,"Categorical distribution. +9624,Categorical,tensorflow/tensorflow/python/ops/distributions/categorical.py,63,class,"Categorical distribution. The Categorical distribution is parameterized by either probabilities or log-probabilities of a set of `K` classes. It is defined over the integers @@ -92239,17 +99066,10 @@ dist.prob(counts) # Shape [2] counts = [[...]] # Shape [5, 7, 3] dist.prob(counts) # Shape [5, 7, 3] ```" -10190,_kl_categorical_categorical,tensorflow/tensorflow/python/ops/distributions/categorical.py,329,function,"Calculate the batched KL divergence KL(a || b) with a and b Categorical. - -Args: - a: instance of a Categorical distribution object. - b: instance of a Categorical distribution object. - name: (optional) Name to use for created operations. - default is ""kl_categorical_categorical"". - -Returns: - Batchwise KL(a || b)" -10191,Dirichlet,tensorflow/tensorflow/python/ops/distributions/dirichlet.py,49,class,"Dirichlet distribution. +9625,event_size,tensorflow/tensorflow/python/ops/distributions/categorical.py,245,method,Scalar `int32` tensor: the number of classes. +9626,logits,tensorflow/tensorflow/python/ops/distributions/categorical.py,250,method,Vector of coordinatewise logits. +9627,probs,tensorflow/tensorflow/python/ops/distributions/categorical.py,255,method,Vector of coordinatewise probabilities. +9628,Dirichlet,tensorflow/tensorflow/python/ops/distributions/dirichlet.py,49,class,"Dirichlet distribution. The Dirichlet distribution is defined over the [`(k-1)`-simplex](https://en.wikipedia.org/wiki/Simplex) using a positive, @@ -92361,17 +99181,9 @@ References: (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) ([pdf] (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -10192,_kl_dirichlet_dirichlet,tensorflow/tensorflow/python/ops/distributions/dirichlet.py,339,function,"Batchwise KL divergence KL(d1 || d2) with d1 and d2 Dirichlet. - -Args: - d1: instance of a Dirichlet distribution object. - d2: instance of a Dirichlet distribution object. - name: (optional) Name to use for created operations. - default is ""kl_dirichlet_dirichlet"". - -Returns: - Batchwise KL(d1 || d2)" -10193,DirichletMultinomial,tensorflow/tensorflow/python/ops/distributions/dirichlet_multinomial.py,55,class,"Dirichlet-Multinomial compound distribution. +9629,concentration,tensorflow/tensorflow/python/ops/distributions/dirichlet.py,213,method,Concentration parameter; expected counts for that coordinate. +9630,total_concentration,tensorflow/tensorflow/python/ops/distributions/dirichlet.py,218,method,Sum of last dim of concentration parameter. +9631,DirichletMultinomial,tensorflow/tensorflow/python/ops/distributions/dirichlet_multinomial.py,55,class,"Dirichlet-Multinomial compound distribution. The Dirichlet-Multinomial distribution is parameterized by a (batch of) length-`K` `concentration` vectors (`K > 1`) and a `total_count` number of @@ -92477,21 +99289,10 @@ dist = DirichletMultinomial(n, alpha) counts = [2., 1., 0.] dist.prob(counts) # Shape [2] ```" -10194,_BaseDistribution,tensorflow/tensorflow/python/ops/distributions/distribution.py,73,class,Abstract base class needed for resolving subclass hierarchy. -10195,_copy_fn,tensorflow/tensorflow/python/ops/distributions/distribution.py,78,function,"Create a deep copy of fn. - -Args: - fn: a callable - -Returns: - A `FunctionType`: a deep copy of fn. - -Raises: - TypeError: if `fn` is not a callable." -10196,_update_docstring,tensorflow/tensorflow/python/ops/distributions/distribution.py,110,function,"Update old_str by inserting append_str just before the ""Args:"" section." -10197,_convert_to_tensor,tensorflow/tensorflow/python/ops/distributions/distribution.py,132,function,Converts to tensor avoiding an eager bug that loses float precision. -10198,_DistributionMeta,tensorflow/tensorflow/python/ops/distributions/distribution.py,144,class, -10199,ReparameterizationType,tensorflow/tensorflow/python/ops/distributions/distribution.py,216,class,"Instances of this class represent how sampling is reparameterized. +9632,total_count,tensorflow/tensorflow/python/ops/distributions/dirichlet_multinomial.py,234,method,Number of trials used to construct a sample. +9633,concentration,tensorflow/tensorflow/python/ops/distributions/dirichlet_multinomial.py,239,method,Concentration parameter; expected prior counts for that coordinate. +9634,total_concentration,tensorflow/tensorflow/python/ops/distributions/dirichlet_multinomial.py,244,method,Sum of last dim of concentration parameter. +9635,ReparameterizationType,tensorflow/tensorflow/python/ops/distributions/distribution.py,216,class,"Instances of this class represent how sampling is reparameterized. Two static instances exist in the distributions library, signifying one of two possible properties for samples from a distribution: @@ -92505,7 +99306,7 @@ one of two possible properties for samples from a distribution: e.g. RL or variational inference, it is generally safest to wrap the sample results in a `stop_gradients` call and use policy gradients / surrogate loss instead." -10200,Distribution,tensorflow/tensorflow/python/ops/distributions/distribution.py,280,class,"A generic probability distribution base class. +9636,Distribution,tensorflow/tensorflow/python/ops/distributions/distribution.py,280,class,"A generic probability distribution base class. `Distribution` is a base class for constructing and organizing properties (e.g., mean, variance) of random variables (e.g, Bernoulli, Gaussian). @@ -92638,7 +99439,354 @@ negative_a = -1.0 * a # beta distribution by definition has a > 0. dist = distributions.beta(negative_a, b, allow_nan_stats=True) dist.mean().eval() ```" -10201,Exponential,tensorflow/tensorflow/python/ops/distributions/exponential.py,41,class,"Exponential distribution. +9637,param_shapes,tensorflow/tensorflow/python/ops/distributions/distribution.py,498,method,"Shapes of parameters given the desired shape of a call to `sample()`. + +This is a class method that describes what key/value arguments are required +to instantiate the given `Distribution` so that a particular shape is +returned for that instance's call to `sample()`. + +Subclasses should override class method `_param_shapes`. + +Args: + sample_shape: `Tensor` or python list/tuple. Desired shape of a call to + `sample()`. + name: name to prepend ops with. + +Returns: + `dict` of parameter name to `Tensor` shapes." +9638,param_static_shapes,tensorflow/tensorflow/python/ops/distributions/distribution.py,519,method,"param_shapes with static (i.e. `TensorShape`) shapes. + +This is a class method that describes what key/value arguments are required +to instantiate the given `Distribution` so that a particular shape is +returned for that instance's call to `sample()`. Assumes that the sample's +shape is known statically. + +Subclasses should override class method `_param_shapes` to return +constant-valued tensors when constant values are fed. + +Args: + sample_shape: `TensorShape` or python list/tuple. Desired shape of a call + to `sample()`. + +Returns: + `dict` of parameter name to `TensorShape`. + +Raises: + ValueError: if `sample_shape` is a `TensorShape` and is not fully defined." +9639,name,tensorflow/tensorflow/python/ops/distributions/distribution.py,562,method,Name prepended to all ops created by this `Distribution`. +9640,dtype,tensorflow/tensorflow/python/ops/distributions/distribution.py,567,method,The `DType` of `Tensor`s handled by this `Distribution`. +9641,parameters,tensorflow/tensorflow/python/ops/distributions/distribution.py,572,method,Dictionary of parameters used to instantiate this `Distribution`. +9642,reparameterization_type,tensorflow/tensorflow/python/ops/distributions/distribution.py,581,method,"Describes how samples from the distribution are reparameterized. + +Currently this is one of the static instances +`distributions.FULLY_REPARAMETERIZED` +or `distributions.NOT_REPARAMETERIZED`. + +Returns: + An instance of `ReparameterizationType`." +9643,allow_nan_stats,tensorflow/tensorflow/python/ops/distributions/distribution.py,594,method,"Python `bool` describing behavior when a stat is undefined. + +Stats return +/- infinity when it makes sense. E.g., the variance of a +Cauchy distribution is infinity. However, sometimes the statistic is +undefined, e.g., if a distribution's pdf does not achieve a maximum within +the support of the distribution, the mode is undefined. If the mean is +undefined, then by definition the variance is undefined. E.g. the mean for +Student's T for df = 1 is undefined (no clear way to say it is either + or - +infinity), so the variance = E[(X - mean)**2] is also undefined. + +Returns: + allow_nan_stats: Python `bool`." +9644,validate_args,tensorflow/tensorflow/python/ops/distributions/distribution.py,611,method,Python `bool` indicating possibly expensive checks are enabled. +9645,copy,tensorflow/tensorflow/python/ops/distributions/distribution.py,615,method,"Creates a deep copy of the distribution. + +Note: the copy distribution may continue to depend on the original +initialization arguments. + +Args: + **override_parameters_kwargs: String/value dictionary of initialization + arguments to override with new values. + +Returns: + distribution: A new instance of `type(self)` initialized from the union + of self.parameters and override_parameters_kwargs, i.e., + `dict(self.parameters, **override_parameters_kwargs)`." +9646,batch_shape_tensor,tensorflow/tensorflow/python/ops/distributions/distribution.py,637,method,"Shape of a single sample from a single event index as a 1-D `Tensor`. + +The batch dimensions are indexes into independent, non-identical +parameterizations of this distribution. + +Args: + name: name to give to the op + +Returns: + batch_shape: `Tensor`." +9647,batch_shape,tensorflow/tensorflow/python/ops/distributions/distribution.py,660,method,"Shape of a single sample from a single event index as a `TensorShape`. + +May be partially defined or unknown. + +The batch dimensions are indexes into independent, non-identical +parameterizations of this distribution. + +Returns: + batch_shape: `TensorShape`, possibly unknown." +9648,event_shape_tensor,tensorflow/tensorflow/python/ops/distributions/distribution.py,677,method,"Shape of a single sample from a single batch as a 1-D int32 `Tensor`. + +Args: + name: name to give to the op + +Returns: + event_shape: `Tensor`." +9649,event_shape,tensorflow/tensorflow/python/ops/distributions/distribution.py,697,method,"Shape of a single sample from a single batch as a `TensorShape`. + +May be partially defined or unknown. + +Returns: + event_shape: `TensorShape`, possibly unknown." +9650,is_scalar_event,tensorflow/tensorflow/python/ops/distributions/distribution.py,707,method,"Indicates that `event_shape == []`. + +Args: + name: Python `str` prepended to names of ops created by this function. + +Returns: + is_scalar_event: `bool` scalar `Tensor`." +9651,is_scalar_batch,tensorflow/tensorflow/python/ops/distributions/distribution.py,721,method,"Indicates that `batch_shape == []`. + +Args: + name: Python `str` prepended to names of ops created by this function. + +Returns: + is_scalar_batch: `bool` scalar `Tensor`." +9652,sample,tensorflow/tensorflow/python/ops/distributions/distribution.py,752,method,"Generate samples of the specified shape. + +Note that a call to `sample()` without arguments will generate a single +sample. + +Args: + sample_shape: 0D or 1D `int32` `Tensor`. Shape of the generated samples. + seed: Python integer seed for RNG + name: name to give to the op. + +Returns: + samples: a `Tensor` with prepended dimensions `sample_shape`." +9653,log_prob,tensorflow/tensorflow/python/ops/distributions/distribution.py,784,method,"Log probability density/mass function. + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + log_prob: a `Tensor` of shape `sample_shape(x) + self.batch_shape` with + values of type `self.dtype`." +9654,prob,tensorflow/tensorflow/python/ops/distributions/distribution.py,813,method,"Probability density/mass function. + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + prob: a `Tensor` of shape `sample_shape(x) + self.batch_shape` with + values of type `self.dtype`." +9655,log_cdf,tensorflow/tensorflow/python/ops/distributions/distribution.py,842,method,"Log cumulative distribution function. + +Given random variable `X`, the cumulative distribution function `cdf` is: + +```none +log_cdf(x) := Log[ P[X <= x] ] +``` + +Often, a numerical approximation can be used for `log_cdf(x)` that yields +a more accurate answer than simply taking the logarithm of the `cdf` when +`x << -1`. + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + logcdf: a `Tensor` of shape `sample_shape(x) + self.batch_shape` with + values of type `self.dtype`." +9656,cdf,tensorflow/tensorflow/python/ops/distributions/distribution.py,881,method,"Cumulative distribution function. + +Given random variable `X`, the cumulative distribution function `cdf` is: + +```none +cdf(x) := P[X <= x] +``` + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + cdf: a `Tensor` of shape `sample_shape(x) + self.batch_shape` with + values of type `self.dtype`." +9657,log_survival_function,tensorflow/tensorflow/python/ops/distributions/distribution.py,917,method,"Log survival function. + +Given random variable `X`, the survival function is defined: + +```none +log_survival_function(x) = Log[ P[X > x] ] + = Log[ 1 - P[X <= x] ] + = Log[ 1 - cdf(x) ] +``` + +Typically, different numerical approximations can be used for the log +survival function, which are more accurate than `1 - cdf(x)` when `x >> 1`. + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + `Tensor` of shape `sample_shape(x) + self.batch_shape` with values of type + `self.dtype`." +9658,survival_function,tensorflow/tensorflow/python/ops/distributions/distribution.py,957,method,"Survival function. + +Given random variable `X`, the survival function is defined: + +```none +survival_function(x) = P[X > x] + = 1 - P[X <= x] + = 1 - cdf(x). +``` + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + `Tensor` of shape `sample_shape(x) + self.batch_shape` with values of type + `self.dtype`." +9659,entropy,tensorflow/tensorflow/python/ops/distributions/distribution.py,982,method,Shannon entropy in nats. +9660,mean,tensorflow/tensorflow/python/ops/distributions/distribution.py,991,method,Mean. +9661,quantile,tensorflow/tensorflow/python/ops/distributions/distribution.py,1006,method,"Quantile function. Aka ""inverse cdf"" or ""percent point function"". + +Given random variable `X` and `p in [0, 1]`, the `quantile` is: + +```none +quantile(p) := x such that P[X <= x] == p +``` + +Args: + value: `float` or `double` `Tensor`. + name: Python `str` prepended to names of ops created by this function. + +Returns: + quantile: a `Tensor` of shape `sample_shape(x) + self.batch_shape` with + values of type `self.dtype`." +9662,variance,tensorflow/tensorflow/python/ops/distributions/distribution.py,1029,method,"Variance. + +Variance is defined as, + +```none +Var = E[(X - E[X])**2] +``` + +where `X` is the random variable associated with this distribution, `E` +denotes expectation, and `Var.shape = batch_shape + event_shape`. + +Args: + name: Python `str` prepended to names of ops created by this function. + +Returns: + variance: Floating-point `Tensor` with shape identical to + `batch_shape + event_shape`, i.e., the same shape as `self.mean()`." +9663,stddev,tensorflow/tensorflow/python/ops/distributions/distribution.py,1061,method,"Standard deviation. + +Standard deviation is defined as, + +```none +stddev = E[(X - E[X])**2]**0.5 +``` + +where `X` is the random variable associated with this distribution, `E` +denotes expectation, and `stddev.shape = batch_shape + event_shape`. + +Args: + name: Python `str` prepended to names of ops created by this function. + +Returns: + stddev: Floating-point `Tensor` with shape identical to + `batch_shape + event_shape`, i.e., the same shape as `self.mean()`." +9664,covariance,tensorflow/tensorflow/python/ops/distributions/distribution.py,1094,method,"Covariance. + +Covariance is (possibly) defined only for non-scalar-event distributions. + +For example, for a length-`k`, vector-valued distribution, it is calculated +as, + +```none +Cov[i, j] = Covariance(X_i, X_j) = E[(X_i - E[X_i]) (X_j - E[X_j])] +``` + +where `Cov` is a (batch of) `k x k` matrix, `0 <= (i, j) < k`, and `E` +denotes expectation. + +Alternatively, for non-vector, multivariate distributions (e.g., +matrix-valued, Wishart), `Covariance` shall return a (batch of) matrices +under some vectorization of the events, i.e., + +```none +Cov[i, j] = Covariance(Vec(X)_i, Vec(X)_j) = [as above] +``` + +where `Cov` is a (batch of) `k' x k'` matrices, +`0 <= (i, j) < k' = reduce_prod(event_shape)`, and `Vec` is some function +mapping indices of this distribution's event dimensions to indices of a +length-`k'` vector. + +Args: + name: Python `str` prepended to names of ops created by this function. + +Returns: + covariance: Floating-point `Tensor` with shape `[B1, ..., Bn, k', k']` + where the first `n` dimensions are batch coordinates and + `k' = reduce_prod(self.event_shape)`." +9665,mode,tensorflow/tensorflow/python/ops/distributions/distribution.py,1137,method,Mode. +9666,cross_entropy,tensorflow/tensorflow/python/ops/distributions/distribution.py,1146,method,"Computes the (Shannon) cross entropy. + +Denote this distribution (`self`) by `P` and the `other` distribution by +`Q`. Assuming `P, Q` are absolutely continuous with respect to +one another and permit densities `p(x) dr(x)` and `q(x) dr(x)`, (Shanon) +cross entropy is defined as: + +```none +H[P, Q] = E_p[-log q(X)] = -int_F p(x) log q(x) dr(x) +``` + +where `F` denotes the support of the random variable `X ~ P`. + +Args: + other: `tfp.distributions.Distribution` instance. + name: Python `str` prepended to names of ops created by this function. + +Returns: + cross_entropy: `self.dtype` `Tensor` with shape `[B1, ..., Bn]` + representing `n` different calculations of (Shanon) cross entropy." +9667,kl_divergence,tensorflow/tensorflow/python/ops/distributions/distribution.py,1175,method,"Computes the Kullback--Leibler divergence. + +Denote this distribution (`self`) by `p` and the `other` distribution by +`q`. Assuming `p, q` are absolutely continuous with respect to reference +measure `r`, the KL divergence is defined as: + +```none +KL[p, q] = E_p[log(p(X)/q(X))] + = -int_F p(x) log q(x) dr(x) + int_F p(x) log p(x) dr(x) + = H[p, q] - H[p] +``` + +where `F` denotes the support of the random variable `X ~ p`, `H[., .]` +denotes (Shanon) cross entropy, and `H[.]` denotes (Shanon) entropy. + +Args: + other: `tfp.distributions.Distribution` instance. + name: Python `str` prepended to names of ops created by this function. + +Returns: + kl_divergence: `self.dtype` `Tensor` with shape `[B1, ..., Bn]` + representing `n` different calculations of the Kullback-Leibler + divergence." +9668,Exponential,tensorflow/tensorflow/python/ops/distributions/exponential.py,41,class,"Exponential distribution. The Exponential distribution is parameterized by an event `rate` parameter. @@ -92667,8 +99815,9 @@ which can be intuited as, X ~ Exponential(rate=1) Y = X / rate ```" -10202,ExponentialWithSoftplusRate,tensorflow/tensorflow/python/ops/distributions/exponential.py,147,class,Exponential with softplus transform on `rate`. -10203,Gamma,tensorflow/tensorflow/python/ops/distributions/gamma.py,47,class,"Gamma distribution. +9669,rate,tensorflow/tensorflow/python/ops/distributions/exponential.py,123,method, +9670,ExponentialWithSoftplusRate,tensorflow/tensorflow/python/ops/distributions/exponential.py,147,class,Exponential with softplus transform on `rate`. +9671,Gamma,tensorflow/tensorflow/python/ops/distributions/gamma.py,47,class,"Gamma distribution. The Gamma distribution is defined over positive real numbers using parameters `concentration` (aka ""alpha"") and `rate` (aka ""beta""). @@ -92746,18 +99895,10 @@ References: [Figurnov et al., 2018] (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) ([pdf](http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -10204,GammaWithSoftplusConcentrationRate,tensorflow/tensorflow/python/ops/distributions/gamma.py,291,class,`Gamma` with softplus of `concentration` and `rate`. -10205,_kl_gamma_gamma,tensorflow/tensorflow/python/ops/distributions/gamma.py,318,function,"Calculate the batched KL divergence KL(g0 || g1) with g0 and g1 Gamma. - -Args: - g0: instance of a Gamma distribution object. - g1: instance of a Gamma distribution object. - name: (optional) Name to use for created operations. - Default is ""kl_gamma_gamma"". - -Returns: - kl_gamma_gamma: `Tensor`. The batchwise KL(g0 || g1)." -10206,Identity,tensorflow/tensorflow/python/ops/distributions/identity_bijector.py,31,class,"Compute Y = g(X) = X. +9672,concentration,tensorflow/tensorflow/python/ops/distributions/gamma.py,193,method,Concentration parameter. +9673,rate,tensorflow/tensorflow/python/ops/distributions/gamma.py,198,method,Rate parameter. +9674,GammaWithSoftplusConcentrationRate,tensorflow/tensorflow/python/ops/distributions/gamma.py,291,class,`Gamma` with softplus of `concentration` and `rate`. +9675,Identity,tensorflow/tensorflow/python/ops/distributions/identity_bijector.py,31,class,"Compute Y = g(X) = X. Example Use: @@ -92769,8 +99910,7 @@ x = [[1., 2], [3, 4]] x == identity.forward(x) == identity.inverse(x) ```" -10207,_registered_kl,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,39,function,Get the KL function registered for classes a and b. -10208,kl_divergence,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,64,function,"Get the KL-divergence KL(distribution_a || distribution_b). +9676,kl_divergence,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,64,function,"Get the KL-divergence KL(distribution_a || distribution_b). If there is no KL method registered specifically for `type(distribution_a)` and `type(distribution_b)`, then the class hierarchies of these types are @@ -92802,7 +99942,7 @@ Returns: Raises: NotImplementedError: If no KL method is defined for distribution types of `distribution_a` and `distribution_b`." -10209,cross_entropy,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,132,function,"Computes the (Shannon) cross entropy. +9677,cross_entropy,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,132,function,"Computes the (Shannon) cross entropy. Denote two distributions by `P` (`ref`) and `Q` (`other`). Assuming `P, Q` are absolutely continuous with respect to one another and permit densities @@ -92826,14 +99966,14 @@ Args: Returns: cross_entropy: `ref.dtype` `Tensor` with shape `[B1, ..., Bn]` representing `n` different calculations of (Shanon) cross entropy." -10210,RegisterKL,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,165,class,"Decorator to register a KL divergence implementation function. +9678,RegisterKL,tensorflow/tensorflow/python/ops/distributions/kullback_leibler.py,165,class,"Decorator to register a KL divergence implementation function. Usage: @distributions.RegisterKL(distributions.Normal, distributions.Normal) def _kl_normal_mvn(norm_a, norm_b): # Return KL(norm_a || norm_b)" -10211,Laplace,tensorflow/tensorflow/python/ops/distributions/laplace.py,47,class,"The Laplace distribution with location `loc` and `scale` parameters. +9679,Laplace,tensorflow/tensorflow/python/ops/distributions/laplace.py,47,class,"The Laplace distribution with location `loc` and `scale` parameters. #### Mathematical details @@ -92857,8 +99997,10 @@ constructed as, X ~ Laplace(loc=0, scale=1) Y = loc + scale * X ```" -10212,LaplaceWithSoftplusScale,tensorflow/tensorflow/python/ops/distributions/laplace.py,220,class,Laplace with softplus applied to `scale`. -10213,Multinomial,tensorflow/tensorflow/python/ops/distributions/multinomial.py,56,class,"Multinomial distribution. +9680,loc,tensorflow/tensorflow/python/ops/distributions/laplace.py,135,method,Distribution parameter for the location. +9681,scale,tensorflow/tensorflow/python/ops/distributions/laplace.py,140,method,Distribution parameter for scale. +9682,LaplaceWithSoftplusScale,tensorflow/tensorflow/python/ops/distributions/laplace.py,220,class,Laplace with softplus applied to `scale`. +9683,Multinomial,tensorflow/tensorflow/python/ops/distributions/multinomial.py,56,class,"Multinomial distribution. This Multinomial distribution is parameterized by `probs`, a (batch of) length-`K` `prob` (probability) vectors (`K > 1`) such that @@ -92951,7 +100093,10 @@ dist.prob(counts) # Shape [2] dist.sample(5) # Shape [5, 2, 3] ```" -10214,Normal,tensorflow/tensorflow/python/ops/distributions/normal.py,46,class,"The Normal distribution with location `loc` and `scale` parameters. +9684,total_count,tensorflow/tensorflow/python/ops/distributions/multinomial.py,220,method,Number of trials used to construct a sample. +9685,logits,tensorflow/tensorflow/python/ops/distributions/multinomial.py,225,method,Vector of coordinatewise logits. +9686,probs,tensorflow/tensorflow/python/ops/distributions/multinomial.py,230,method,Probability of drawing a `1` in that coordinate. +9687,Normal,tensorflow/tensorflow/python/ops/distributions/normal.py,46,class,"The Normal distribution with location `loc` and `scale` parameters. #### Mathematical details @@ -93011,18 +100156,10 @@ dist = tfd.Normal(loc=1., scale=[11, 22.]) # returning a length 2 tensor. dist.prob(3.0) ```" -10215,NormalWithSoftplusScale,tensorflow/tensorflow/python/ops/distributions/normal.py,249,class,Normal with softplus applied to `scale`. -10216,_kl_normal_normal,tensorflow/tensorflow/python/ops/distributions/normal.py,275,function,"Calculate the batched KL divergence KL(n_a || n_b) with n_a and n_b Normal. - -Args: - n_a: instance of a Normal distribution object. - n_b: instance of a Normal distribution object. - name: (optional) Name to use for created operations. - default is ""kl_normal_normal"". - -Returns: - Batchwise KL(n_a || n_b)" -10217,ndtr,tensorflow/tensorflow/python/ops/distributions/special_math.py,111,function,"Normal distribution function. +9688,loc,tensorflow/tensorflow/python/ops/distributions/normal.py,169,method,Distribution parameter for the mean. +9689,scale,tensorflow/tensorflow/python/ops/distributions/normal.py,174,method,Distribution parameter for standard deviation. +9690,NormalWithSoftplusScale,tensorflow/tensorflow/python/ops/distributions/normal.py,249,class,Normal with softplus applied to `scale`. +9691,ndtr,tensorflow/tensorflow/python/ops/distributions/special_math.py,111,function,"Normal distribution function. Returns the area under the Gaussian probability density function, integrated from minus infinity to x: @@ -93045,8 +100182,7 @@ Returns: Raises: TypeError: if `x` is not floating-type." -10218,_ndtr,tensorflow/tensorflow/python/ops/distributions/special_math.py,146,function,Implements ndtr core logic. -10219,ndtri,tensorflow/tensorflow/python/ops/distributions/special_math.py,159,function,"The inverse of the CDF of the Normal distribution function. +9692,ndtri,tensorflow/tensorflow/python/ops/distributions/special_math.py,159,function,"The inverse of the CDF of the Normal distribution function. Returns x such that the area under the pdf from minus infinity to x is equal to p. @@ -93063,8 +100199,7 @@ Returns: Raises: TypeError: if `p` is not floating-type." -10220,_ndtri,tensorflow/tensorflow/python/ops/distributions/special_math.py,188,function,Implements ndtri core logic. -10221,log_ndtr,tensorflow/tensorflow/python/ops/distributions/special_math.py,282,function,"Log Normal distribution function. +9693,log_ndtr,tensorflow/tensorflow/python/ops/distributions/special_math.py,282,function,"Log Normal distribution function. For details of the Normal distribution function see `ndtr`. @@ -93112,9 +100247,7 @@ Raises: TypeError: if `x.dtype` is not handled. TypeError: if `series_order` is a not Python `integer.` ValueError: if `series_order` is not in `[0, 30]`." -10222,_log_ndtr_lower,tensorflow/tensorflow/python/ops/distributions/special_math.py,374,function,"Asymptotic expansion version of `Log[cdf(x)]`, appropriate for `x<<-1`." -10223,_log_ndtr_asymptotic_series,tensorflow/tensorflow/python/ops/distributions/special_math.py,382,function,Calculates the asymptotic series used in log_ndtr. -10224,erfinv,tensorflow/tensorflow/python/ops/distributions/special_math.py,401,function,"The inverse function for erf, the error function. +9694,erfinv,tensorflow/tensorflow/python/ops/distributions/special_math.py,401,function,"The inverse function for erf, the error function. Args: x: `Tensor` of type `float32`, `float64`. @@ -93125,8 +100258,7 @@ Returns: Raises: TypeError: if `x` is not floating-type." -10225,_double_factorial,tensorflow/tensorflow/python/ops/distributions/special_math.py,424,function,The double factorial function for small Python integer `n`. -10226,log_cdf_laplace,tensorflow/tensorflow/python/ops/distributions/special_math.py,429,function,"Log Laplace distribution function. +9695,log_cdf_laplace,tensorflow/tensorflow/python/ops/distributions/special_math.py,429,function,"Log Laplace distribution function. This function calculates `Log[L(x)]`, where `L(x)` is the cumulative distribution function of the Laplace distribution, i.e. @@ -93152,7 +100284,7 @@ Returns: Raises: TypeError: if `x.dtype` is not handled." -10227,StudentT,tensorflow/tensorflow/python/ops/distributions/student_t.py,47,class,"Student's t-distribution. +9696,StudentT,tensorflow/tensorflow/python/ops/distributions/student_t.py,47,class,"Student's t-distribution. This distribution has parameters: degree of freedom `df`, location `loc`, and `scale`. @@ -93249,17 +100381,11 @@ References: [Figurnov et al., 2018] (http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients) ([pdf](http://papers.nips.cc/paper/7326-implicit-reparameterization-gradients.pdf))" -10228,StudentTWithAbsDfSoftplusScale,tensorflow/tensorflow/python/ops/distributions/student_t.py,371,class,StudentT with `df = floor(abs(df))` and `scale = softplus(scale)`. -10229,_static_value,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,45,function,Returns the static value of a `Tensor` or `None`. -10230,_logical_and,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,50,function,Convenience function which attempts to statically `reduce_all`. -10231,_logical_equal,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,62,function,Convenience function which attempts to statically compute `x == y`. -10232,_logical_not,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,71,function,Convenience function which attempts to statically apply `logical_not`. -10233,_concat_vectors,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,79,function,Convenience function which concatenates input vectors. -10234,_pick_scalar_condition,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,87,function,Convenience function which chooses the condition based on the predicate. -10235,_ones_like,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,98,function,Convenience function attempts to statically construct `ones_like`. -10236,_ndims_from_shape,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,106,function,Returns `Tensor`'s `rank` implied by a `Tensor` shape. -10237,_is_scalar_from_shape,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,117,function,Returns `True` `Tensor` if `Tensor` shape implies a scalar. -10238,TransformedDistribution,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,122,class,"A Transformed Distribution. +9697,df,tensorflow/tensorflow/python/ops/distributions/student_t.py,217,method,Degrees of freedom in these Student's t distribution(s). +9698,loc,tensorflow/tensorflow/python/ops/distributions/student_t.py,222,method,Locations of these Student's t distribution(s). +9699,scale,tensorflow/tensorflow/python/ops/distributions/student_t.py,227,method,Scaling factors of these Student's t distribution(s). +9700,StudentTWithAbsDfSoftplusScale,tensorflow/tensorflow/python/ops/distributions/student_t.py,371,class,StudentT with `df = floor(abs(df))` and `scale = softplus(scale)`. +9701,TransformedDistribution,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,122,class,"A Transformed Distribution. A `TransformedDistribution` models `p(y)` given a base distribution `p(x)`, and a deterministic, invertible, differentiable transform, `Y = g(X)`. The @@ -93364,7 +100490,9 @@ mvn1 = ds.TransformedDistribution( mvn2 = ds.MultivariateNormalTriL(loc=mean, scale_tril=chol_cov) # mvn1.log_prob(x) == mvn2.log_prob(x) ```" -10239,Uniform,tensorflow/tensorflow/python/ops/distributions/uniform.py,37,class,"Uniform distribution with `low` and `high` parameters. +9702,distribution,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,330,method,"Base distribution, p(x)." +9703,bijector,tensorflow/tensorflow/python/ops/distributions/transformed_distribution.py,335,method,Function transforming x => y. +9704,Uniform,tensorflow/tensorflow/python/ops/distributions/uniform.py,37,class,"Uniform distribution with `low` and `high` parameters. #### Mathematical Details @@ -93403,7 +100531,10 @@ u3 = Uniform(low=[[1.0, 2.0], # With broadcasting: u1 = Uniform(low=3.0, high=[5.0, 6.0, 7.0]) # 3 distributions ```" -10240,assert_integer_form,tensorflow/tensorflow/python/ops/distributions/util.py,40,function,"Assert that x has integer components (or floats equal to integers). +9705,low,tensorflow/tensorflow/python/ops/distributions/uniform.py,140,method,Lower boundary of the output interval. +9706,high,tensorflow/tensorflow/python/ops/distributions/uniform.py,145,method,Upper boundary of the output interval. +9707,range,tensorflow/tensorflow/python/ops/distributions/uniform.py,149,method,`high - low`. +9708,assert_integer_form,tensorflow/tensorflow/python/ops/distributions/util.py,40,function,"Assert that x has integer components (or floats equal to integers). Args: x: Floating-point `Tensor` @@ -93417,9 +100548,9 @@ Args: Returns: Op raising `InvalidArgumentError` if `cast(x, int_dtype) != x`." -10241,assert_symmetric,tensorflow/tensorflow/python/ops/distributions/util.py,84,function, -10242,embed_check_nonnegative_integer_form,tensorflow/tensorflow/python/ops/distributions/util.py,90,function,"Assert x is a non-negative tensor, and optionally of integers." -10243,same_dynamic_shape,tensorflow/tensorflow/python/ops/distributions/util.py,108,function,"Returns whether a and b have the same dynamic shape. +9709,assert_symmetric,tensorflow/tensorflow/python/ops/distributions/util.py,84,function, +9710,embed_check_nonnegative_integer_form,tensorflow/tensorflow/python/ops/distributions/util.py,90,function,"Assert x is a non-negative tensor, and optionally of integers." +9711,same_dynamic_shape,tensorflow/tensorflow/python/ops/distributions/util.py,108,function,"Returns whether a and b have the same dynamic shape. Args: a: `Tensor` @@ -93427,7 +100558,7 @@ Args: Returns: `bool` `Tensor` representing if both tensors have the same shape." -10244,maybe_get_static_value,tensorflow/tensorflow/python/ops/distributions/util.py,139,function,"Helper which tries to return a static value. +9712,maybe_get_static_value,tensorflow/tensorflow/python/ops/distributions/util.py,139,function,"Helper which tries to return a static value. Given `x`, extract it's value statically, optionally casting to a specific dtype. If this is not possible, None is returned. @@ -93438,7 +100569,7 @@ Args: Returns: Statically inferred value if possible, otherwise None." -10245,get_logits_and_probs,tensorflow/tensorflow/python/ops/distributions/util.py,164,function,"Converts logit to probabilities (or vice-versa), and returns both. +9713,get_logits_and_probs,tensorflow/tensorflow/python/ops/distributions/util.py,164,function,"Converts logit to probabilities (or vice-versa), and returns both. Args: logits: Floating-point `Tensor` representing log-odds. @@ -93460,13 +100591,7 @@ Returns: Raises: ValueError: if neither `probs` nor `logits` were passed in, or both were." -10246,_is_known_unsigned_by_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,245,function,Helper returning True if dtype is known to be unsigned. -10247,_is_known_signed_by_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,254,function,Helper returning True if dtype is known to be signed. -10248,_is_known_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,267,function,Helper returning True if dtype is known. -10249,_largest_integer_by_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,272,function,Helper returning the largest integer exactly representable by dtype. -10250,_smallest_integer_by_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,286,function,Helper returning the smallest integer exactly representable by dtype. -10251,_is_integer_like_by_dtype,tensorflow/tensorflow/python/ops/distributions/util.py,295,function,Helper returning True if dtype.is_integer or is `bool`. -10252,embed_check_categorical_event_shape,tensorflow/tensorflow/python/ops/distributions/util.py,302,function,"Embeds checks that categorical distributions don't have too many classes. +9714,embed_check_categorical_event_shape,tensorflow/tensorflow/python/ops/distributions/util.py,302,function,"Embeds checks that categorical distributions don't have too many classes. A categorical-type distribution is one which, e.g., returns the class label rather than a one-hot encoding. E.g., `Categorical(probs)`. @@ -93504,7 +100629,7 @@ Raises: TypeError: if `categorical_param` has an unknown `dtype`. ValueError: if we can statically identify `categorical_param` as being too large (for being closed under int32/float casting)." -10253,embed_check_integer_casting_closed,tensorflow/tensorflow/python/ops/distributions/util.py,397,function,"Ensures integers remain unaffected despite casting to/from int/float types. +9715,embed_check_integer_casting_closed,tensorflow/tensorflow/python/ops/distributions/util.py,397,function,"Ensures integers remain unaffected despite casting to/from int/float types. Example integer-types: `uint8`, `int32`, `bool`. Example floating-types: `float32`, `float64`. @@ -93531,7 +100656,7 @@ Raises: TypeError: if `x` is neither integer- nor floating-type. TypeError: if `target_dtype` is neither integer- nor floating-type. TypeError: if neither `x` nor `target_dtype` are integer-type." -10254,log_combinations,tensorflow/tensorflow/python/ops/distributions/util.py,488,function,"Multinomial coefficient. +9716,log_combinations,tensorflow/tensorflow/python/ops/distributions/util.py,488,function,"Multinomial coefficient. Given `n` and `counts`, where `counts` has last dimension `k`, we compute the multinomial coefficient as: @@ -93549,7 +100674,7 @@ Args: Returns: `Tensor` representing the multinomial coefficient between `n` and `counts`." -10255,matrix_diag_transform,tensorflow/tensorflow/python/ops/distributions/util.py,522,function,"Transform diagonal of [batch-]matrix, leave rest of matrix unchanged. +9717,matrix_diag_transform,tensorflow/tensorflow/python/ops/distributions/util.py,522,function,"Transform diagonal of [batch-]matrix, leave rest of matrix unchanged. Create a trainable covariance defined by a Cholesky factor: @@ -93597,7 +100722,7 @@ Args: Returns: A `Tensor` with same shape and `dtype` as `matrix`." -10256,rotate_transpose,tensorflow/tensorflow/python/ops/distributions/util.py,584,function,"Circularly moves dims left or right. +9718,rotate_transpose,tensorflow/tensorflow/python/ops/distributions/util.py,584,function,"Circularly moves dims left or right. Effectively identical to: @@ -93631,7 +100756,7 @@ Returns: Raises: TypeError: if shift is not integer type." -10257,pick_vector,tensorflow/tensorflow/python/ops/distributions/util.py,660,function,"Picks possibly different length row `Tensor`s based on condition. +9719,pick_vector,tensorflow/tensorflow/python/ops/distributions/util.py,660,function,"Picks possibly different length row `Tensor`s based on condition. Value `Tensor`s should have exactly one dimension. @@ -93655,7 +100780,7 @@ Raises: TypeError: if `cond.dtype != tf.bool` TypeError: if `cond` is not a constant and `true_vector.dtype != false_vector.dtype`" -10258,prefer_static_broadcast_shape,tensorflow/tensorflow/python/ops/distributions/util.py,706,function,"Convenience function which statically broadcasts shape when possible. +9720,prefer_static_broadcast_shape,tensorflow/tensorflow/python/ops/distributions/util.py,706,function,"Convenience function which statically broadcasts shape when possible. Args: shape1: `1-D` integer `Tensor`. Already converted to tensor! @@ -93665,29 +100790,29 @@ Args: Returns: The broadcast shape, either as `TensorShape` (if broadcast can be done statically), or as a `Tensor`." -10259,prefer_static_rank,tensorflow/tensorflow/python/ops/distributions/util.py,751,function,"Return static rank of tensor `x` if available, else `tf.rank(x)`. +9721,prefer_static_rank,tensorflow/tensorflow/python/ops/distributions/util.py,751,function,"Return static rank of tensor `x` if available, else `tf.rank(x)`. Args: x: `Tensor` (already converted). Returns: Numpy array (if static rank is obtainable), else `Tensor`." -10260,prefer_static_shape,tensorflow/tensorflow/python/ops/distributions/util.py,763,function,"Return static shape of tensor `x` if available, else `tf.shape(x)`. +9722,prefer_static_shape,tensorflow/tensorflow/python/ops/distributions/util.py,763,function,"Return static shape of tensor `x` if available, else `tf.shape(x)`. Args: x: `Tensor` (already converted). Returns: Numpy array (if static shape is obtainable), else `Tensor`." -10261,prefer_static_value,tensorflow/tensorflow/python/ops/distributions/util.py,775,function,"Return static value of tensor `x` if available, else `x`. +9723,prefer_static_value,tensorflow/tensorflow/python/ops/distributions/util.py,775,function,"Return static value of tensor `x` if available, else `x`. Args: x: `Tensor` (already converted). Returns: Numpy array (if static value is obtainable), else `Tensor`." -10262,gen_new_seed,tensorflow/tensorflow/python/ops/distributions/util.py,790,function,"Generate a new seed, from the given seed and salt." -10263,fill_triangular,tensorflow/tensorflow/python/ops/distributions/util.py,798,function,"Creates a (batch of) triangular matrix from a vector of inputs. +9724,gen_new_seed,tensorflow/tensorflow/python/ops/distributions/util.py,790,function,"Generate a new seed, from the given seed and salt." +9725,fill_triangular,tensorflow/tensorflow/python/ops/distributions/util.py,798,function,"Creates a (batch of) triangular matrix from a vector of inputs. Created matrix can be lower- or upper-triangular. (It is more efficient to create the matrix as upper or lower, rather than transpose.) @@ -93727,7 +100852,7 @@ Returns: Raises: ValueError: if `x` cannot be mapped to a triangular matrix." -10264,fill_triangular_inverse,tensorflow/tensorflow/python/ops/distributions/util.py,913,function,"Creates a vector from a (batch of) triangular matrix. +9726,fill_triangular_inverse,tensorflow/tensorflow/python/ops/distributions/util.py,913,function,"Creates a vector from a (batch of) triangular matrix. The vector is created from the lower-triangular or upper-triangular portion depending on the value of the parameter `upper`. @@ -93762,7 +100887,7 @@ Args: Returns: flat_tril: (Batch of) vector-shaped `Tensor` representing vectorized lower (or upper) triangular elements from `x`." -10265,tridiag,tensorflow/tensorflow/python/ops/distributions/util.py,982,function,"Creates a matrix with values set above, below, and on the diagonal. +9727,tridiag,tensorflow/tensorflow/python/ops/distributions/util.py,982,function,"Creates a matrix with values set above, below, and on the diagonal. Example: @@ -93792,7 +100917,7 @@ Returns: Raises: ValueError: if all inputs are `None`." -10266,reduce_weighted_logsumexp,tensorflow/tensorflow/python/ops/distributions/util.py,1050,function,"Computes `log(abs(sum(weight * exp(elements across tensor dimensions))))`. +9728,reduce_weighted_logsumexp,tensorflow/tensorflow/python/ops/distributions/util.py,1050,function,"Computes `log(abs(sum(weight * exp(elements across tensor dimensions))))`. If all weights `w` are known to be positive, it is more efficient to directly use `reduce_logsumexp`, i.e., `tf.reduce_logsumexp(logx + tf.math.log(w))` is @@ -93849,7 +100974,7 @@ Args: Returns: lswe: The `log(abs(sum(weight * exp(x))))` reduced tensor. sign: (Optional) The sign of `sum(weight * exp(x))`." -10267,softplus_inverse,tensorflow/tensorflow/python/ops/distributions/util.py,1148,function,"Computes the inverse softplus, i.e., x = softplus_inverse(softplus(x)). +9729,softplus_inverse,tensorflow/tensorflow/python/ops/distributions/util.py,1148,function,"Computes the inverse softplus, i.e., x = softplus_inverse(softplus(x)). Mathematically this op is equivalent to: @@ -93863,8 +100988,8 @@ Args: Returns: `Tensor`. Has the same type/shape as input `x`." -10268,dimension_size,tensorflow/tensorflow/python/ops/distributions/util.py,1205,function,Returns the size of a specific dimension. -10269,process_quadrature_grid_and_probs,tensorflow/tensorflow/python/ops/distributions/util.py,1216,function,"Validates quadrature grid, probs or computes them as necessary. +9730,dimension_size,tensorflow/tensorflow/python/ops/distributions/util.py,1205,function,Returns the size of a specific dimension. +9731,process_quadrature_grid_and_probs,tensorflow/tensorflow/python/ops/distributions/util.py,1216,function,"Validates quadrature grid, probs or computes them as necessary. Args: quadrature_grid_and_probs: Python pair of `float`-like `Tensor`s @@ -93886,7 +101011,7 @@ Returns: Raises: ValueError: if `quadrature_grid_and_probs is not None` and `len(quadrature_grid_and_probs[0]) != len(quadrature_grid_and_probs[1])`" -10270,pad,tensorflow/tensorflow/python/ops/distributions/util.py,1283,function,"Pads `value` to the front and/or back of a `Tensor` dim, `count` times. +9732,pad,tensorflow/tensorflow/python/ops/distributions/util.py,1283,function,"Pads `value` to the front and/or back of a `Tensor` dim, `count` times. Args: x: `Tensor` input. @@ -93909,7 +101034,7 @@ Returns: Raises: ValueError: if both `front` and `back` are `False`. TypeError: if `count` is not `int`-like." -10271,parent_frame_arguments,tensorflow/tensorflow/python/ops/distributions/util.py,1354,function,"Returns parent frame arguments. +9733,parent_frame_arguments,tensorflow/tensorflow/python/ops/distributions/util.py,1354,function,"Returns parent frame arguments. When called inside a function, returns a dictionary with the caller's function arguments. These are positional arguments and keyword arguments (**kwargs), @@ -93922,7 +101047,7 @@ WARNING: If caller function argument names are overloaded before invoking this method, then values will reflect the overloaded value. For this reason, we recommend calling `parent_frame_arguments` at the beginning of the function." -10272,AppendDocstring,tensorflow/tensorflow/python/ops/distributions/util.py,1391,class,"Helper class to promote private subclass docstring to public counterpart. +9734,AppendDocstring,tensorflow/tensorflow/python/ops/distributions/util.py,1391,class,"Helper class to promote private subclass docstring to public counterpart. Example: @@ -93940,63 +101065,7 @@ the docstring of `prob` (not `_prob`) and adds a new `kwargs` section with each dictionary item as a bullet-point. For a more detailed example, see `TransformedDistribution`." -10273,_adjoint_linear_operator,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,36,function, -10274,_adjoint_adjoint_linear_operator,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,47,function, -10275,_adjoint_identity,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,53,function, -10276,_adjoint_scaled_identity,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,59,function, -10277,_adjoint_diag,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,75,function, -10278,_adjoint_block_diag,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,90,function, -10279,_adjoint_kronecker,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,103,function, -10280,_adjoint_circulant,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,117,function, -10281,_adjoint_householder,tensorflow/tensorflow/python/ops/linalg/adjoint_registrations.py,133,function, -10282,_cholesky_linear_operator,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,35,function, -10283,_cholesky_diag,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,45,function, -10284,_cholesky_identity,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,56,function, -10285,_cholesky_scaled_identity,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,69,function, -10286,_cholesky_block_diag,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,81,function, -10287,_cholesky_kronecker,tensorflow/tensorflow/python/ops/linalg/cholesky_registrations.py,93,function, -10288,_inverse_linear_operator,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,39,function, -10289,_inverse_inverse_linear_operator,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,50,function, -10290,_inverse_diag,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,56,function, -10291,_inverse_identity,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,67,function, -10292,_inverse_scaled_identity,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,73,function, -10293,_inverse_block_diag,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,85,function, -10294,_inverse_block_lower_triangular,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,98,function,"Inverse of LinearOperatorBlockLowerTriangular. - -We recursively apply the identity: - -```none -|A 0|' = | A' 0| -|B C| |-C'BA' C'| -``` - -where `A` is n-by-n, `B` is m-by-n, `C` is m-by-m, and `'` denotes inverse. - -This identity can be verified through multiplication: - -```none -|A 0|| A' 0| -|B C||-C'BA' C'| - - = | AA' 0| - |BA'-CC'BA' CC'| - - = |I 0| - |0 I| -``` - -Args: - block_lower_triangular_operator: Instance of - `LinearOperatorBlockLowerTriangular`. - -Returns: - block_lower_triangular_operator_inverse: Instance of - `LinearOperatorBlockLowerTriangular`, the inverse of - `block_lower_triangular_operator`." -10295,_inverse_kronecker,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,197,function, -10296,_inverse_circulant,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,211,function, -10297,_inverse_householder,tensorflow/tensorflow/python/ops/linalg/inverse_registrations.py,224,function, -10298,logdet,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,70,function,"Computes log of the determinant of a hermitian positive definite matrix. +9735,logdet,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,70,function,"Computes log of the determinant of a hermitian positive definite matrix. ```python # Compute the determinant of a matrix while reducing the chance of over- or @@ -94017,7 +101086,7 @@ Returns: Equivalent to numpy.linalg.slogdet, although no sign is returned since only hermitian positive definite matrices are supported. @end_compatibility" -10299,adjoint,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,104,function,"Transposes the last two dimensions of and conjugates tensor `matrix`. +9736,adjoint,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,104,function,"Transposes the last two dimensions of and conjugates tensor `matrix`. For example: @@ -94037,12 +101106,7 @@ Args: Returns: The adjoint (a.k.a. Hermitian transpose a.k.a. conjugate transpose) of matrix." -10300,_matrix_exp_pade3,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,133,function,3rd-order Pade approximant for matrix exponential. -10301,_matrix_exp_pade5,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,148,function,5th-order Pade approximant for matrix exponential. -10302,_matrix_exp_pade7,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,164,function,7th-order Pade approximant for matrix exponential. -10303,_matrix_exp_pade9,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,181,function,9th-order Pade approximant for matrix exponential. -10304,_matrix_exp_pade13,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,206,function,13th-order Pade approximant for matrix exponential. -10305,matrix_exponential,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,234,function,"Computes the matrix exponential of one or more square matrices. +9737,matrix_exponential,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,234,function,"Computes the matrix exponential of one or more square matrices. exp(A) = \sum_{n=0}^\infty A^n/n! @@ -94069,7 +101133,7 @@ Raises: @compatibility(scipy) Equivalent to scipy.linalg.expm @end_compatibility" -10306,banded_triangular_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,344,function,"Solve triangular systems of equations with a banded solver. +9738,banded_triangular_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,344,function,"Solve triangular systems of equations with a banded solver. `bands` is a tensor of shape `[..., K, M]`, where `K` represents the number of bands stored. This corresponds to a batch of `M` by `M` matrices, whose @@ -94152,7 +101216,7 @@ Args: Returns: A `Tensor` of shape [..., M] or [..., M, N] containing the solutions." -10307,tridiagonal_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,441,function,"Solves tridiagonal systems of equations. +9739,tridiagonal_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,441,function,"Solves tridiagonal systems of equations. The input can be supplied in various formats: `matrix`, `sequence` and `compact`, specified by the `diagonals_format` arg. @@ -94241,8 +101305,7 @@ Raises: [1] Nicholas J. Higham (2002). Accuracy and Stability of Numerical Algorithms: Second Edition. SIAM. p. 175. ISBN 978-0-89871-802-7." -10308,_tridiagonal_solve_compact_format,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,593,function,Helper function used after the input has been cast to compact form. -10309,tridiagonal_matmul,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,643,function,"Multiplies tridiagonal matrix by matrix. +9740,tridiagonal_matmul,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,643,function,"Multiplies tridiagonal matrix by matrix. `diagonals` is representation of 3-diagonal NxN matrix, which depends on `diagonals_format`. @@ -94289,8 +101352,7 @@ Returns: Raises: ValueError: An unsupported type is provided as input, or when the input tensors have incorrect shapes." -10310,_maybe_validate_matrix,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,722,function,Checks that input is a `float` matrix. -10311,matrix_rank,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,741,function,"Compute the matrix rank of one or more matrices. +9741,matrix_rank,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,741,function,"Compute the matrix rank of one or more matrices. Arguments: a: (Batch of) `float`-like matrix-shaped `Tensor`(s) which are to be @@ -94306,7 +101368,7 @@ Arguments: Returns: matrix_rank: (Batch of) `int32` scalars representing the number of non-zero singular values." -10312,pinv,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,780,function,"Compute the Moore-Penrose pseudo-inverse of one or more matrices. +9742,pinv,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,780,function,"Compute the Moore-Penrose pseudo-inverse of one or more matrices. Calculate the [generalized inverse of a matrix]( https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse) using its @@ -94373,7 +101435,7 @@ tf.matmul(tf.linalg..pinv(a), a) [1]: G. Strang. 'Linear Algebra and Its Applications, 2nd Ed.' Academic Press, Inc., 1980, pp. 139-142." -10313,lu_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,910,function,"Solves systems of linear eqns `A X = RHS`, given LU factorizations. +9743,lu_solve,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,910,function,"Solves systems of linear eqns `A X = RHS`, given LU factorizations. Note: this function does not verify the implied matrix is actually invertible nor is this condition checked even when `validate_args=True`. @@ -94411,7 +101473,7 @@ inv_x = tf.linalg.lu_solve(*tf.linalg.lu(x), rhs=tf.eye(2)) tf.assert_near(tf.matrix_inverse(x), inv_x) # ==> True ```" -10314,lu_matrix_inverse,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1008,function,"Computes the inverse given the LU decomposition(s) of one or more matrices. +9744,lu_matrix_inverse,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1008,function,"Computes the inverse given the LU decomposition(s) of one or more matrices. This op is conceptually identical to, @@ -94453,7 +101515,7 @@ inv_x = tf.linalg.lu_matrix_inverse(*tf.linalg.lu(x)) tf.assert_near(tf.matrix_inverse(x), inv_x) # ==> True ```" -10315,lu_reconstruct,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1073,function,"The reconstruct one or more matrices from their LU decomposition(s). +9745,lu_reconstruct,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1073,function,"The reconstruct one or more matrices from their LU decomposition(s). Args: lower_upper: `lu` as returned by `tf.linalg.lu`, i.e., if `matmul(P, @@ -94483,9 +101545,8 @@ x_reconstructed = tf.linalg.lu_reconstruct(*tf.linalg.lu(x)) tf.assert_near(x, x_reconstructed) # ==> True ```" -10316,lu_reconstruct_assertions,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1145,function,Returns list of assertions related to `lu_reconstruct` assumptions. -10317,_lu_solve_assertions,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1177,function,Returns list of assertions related to `lu_solve` assumptions. -10318,LinearOperator,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,50,class,"Base class defining a [batch of] linear operator[s]. +9746,lu_reconstruct_assertions,tensorflow/tensorflow/python/ops/linalg/linalg_impl.py,1145,function,Returns list of assertions related to `lu_reconstruct` assumptions. +9747,LinearOperator,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,50,class,"Base class defining a [batch of] linear operator[s]. Subclasses of `LinearOperator` provide access to common methods on a (batch) matrix, without the need to materialize the matrix. This allows: @@ -94583,16 +101644,376 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10319,_adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1136,function, -10320,_cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1141,function, -10321,_diag_part,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1149,function, -10322,_det,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1160,function, -10323,_inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1165,function, -10324,_logdet,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1173,function, -10325,_matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1180,function, -10326,_solve,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1207,function, -10327,_trace,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1219,function, -10328,add_operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,38,function,"Efficiently add one or more linear operators. +9748,dtype,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,225,method,The `DType` of `Tensor`s handled by this `LinearOperator`. +9749,name,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,230,method,Name prepended to all ops created by this `LinearOperator`. +9750,graph_parents,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,236,method,List of graph dependencies of this `LinearOperator`. +9751,is_non_singular,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,241,method, +9752,is_self_adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,245,method, +9753,is_positive_definite,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,249,method, +9754,is_square,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,253,method,Return `True/False` depending on if this operator is square. +9755,shape,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,272,method,"`TensorShape` of this `LinearOperator`. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns +`TensorShape([B1,...,Bb, M, N])`, equivalent to `A.shape`. + +Returns: + `TensorShape`, statically determined, may be undefined." +9756,shape_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,290,method,"Shape of this `LinearOperator`, determined at runtime. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns a `Tensor` holding +`[B1,...,Bb, M, N]`, equivalent to `tf.shape(A)`. + +Args: + name: A name for this `Op`. + +Returns: + `int32` `Tensor`" +9757,batch_shape,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,311,method,"`TensorShape` of batch dimensions of this `LinearOperator`. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns +`TensorShape([B1,...,Bb])`, equivalent to `A.shape[:-2]` + +Returns: + `TensorShape`, statically determined, may be undefined." +9758,batch_shape_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,324,method,"Shape of batch dimensions of this operator, determined at runtime. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns a `Tensor` holding +`[B1,...,Bb]`. + +Args: + name: A name for this `Op`. + +Returns: + `int32` `Tensor`" +9759,tensor_rank,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,352,method,"Rank (in the sense of tensors) of matrix corresponding to this operator. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns `b + 2`. + +Args: + name: A name for this `Op`. + +Returns: + Python integer, or None if the tensor rank is undefined." +9760,tensor_rank_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,368,method,"Rank (in the sense of tensors) of matrix corresponding to this operator. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns `b + 2`. + +Args: + name: A name for this `Op`. + +Returns: + `int32` `Tensor`, determined at runtime." +9761,range_dimension,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,438,method,"Dimension (in the sense of vector spaces) of the range of this operator. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns `M`. + +Returns: + `Dimension` object." +9762,range_dimension_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,453,method,"Dimension (in the sense of vector spaces) of the range of this operator. + +Determined at runtime. + +If this operator acts like the batch matrix `A` with +`A.shape = [B1,...,Bb, M, N]`, then this returns `M`. + +Args: + name: A name for this `Op`. + +Returns: + `int32` `Tensor`" +9763,assert_non_singular,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,510,method,"Returns an `Op` that asserts this operator is non singular. + +This operator is considered non-singular if + +``` +ConditionNumber < max{100, range_dimension, domain_dimension} * eps, +eps := np.finfo(self.dtype.as_numpy_dtype).eps +``` + +Args: + name: A string name to prepend to created ops. + +Returns: + An `Assert` `Op`, that, when run, will raise an `InvalidArgumentError` if + the operator is singular." +9764,assert_positive_definite,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,546,method,"Returns an `Op` that asserts this operator is positive definite. + +Here, positive definite means that the quadratic form `x^H A x` has positive +real part for all nonzero `x`. Note that we do not require the operator to +be self-adjoint to be positive definite. + +Args: + name: A name to give this `Op`. + +Returns: + An `Assert` `Op`, that, when run, will raise an `InvalidArgumentError` if + the operator is not positive definite." +9765,assert_self_adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,573,method,"Returns an `Op` that asserts this operator is self-adjoint. + +Here we check that this operator is *exactly* equal to its hermitian +transpose. + +Args: + name: A string name to prepend to created ops. + +Returns: + An `Assert` `Op`, that, when run, will raise an `InvalidArgumentError` if + the operator is not self-adjoint." +9766,matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,600,method,"Transform [batch] matrix `x` with left multiplication: `x --> Ax`. + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +X = ... # shape [..., N, R], batch matrix, R > 0. + +Y = operator.matmul(X) +Y.shape +==> [..., M, R] + +Y[..., :, r] = sum_j A[..., :, j] X[j, r] +``` + +Args: + x: `LinearOperator` or `Tensor` with compatible shape and same `dtype` as + `self`. See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + adjoint_arg: Python `bool`. If `True`, compute `A x^H` where `x^H` is + the hermitian transpose (transposition and complex conjugation). + name: A name for this `Op`. + +Returns: + A `LinearOperator` or `Tensor` with shape `[..., M, R]` and same `dtype` + as `self`." +9767,matvec,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,663,method,"Transform [batch] vector `x` with left multiplication: `x --> Ax`. + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) + +X = ... # shape [..., N], batch vector + +Y = operator.matvec(X) +Y.shape +==> [..., M] + +Y[..., :] = sum_j A[..., :, j] X[..., j] +``` + +Args: + x: `Tensor` with compatible shape and same `dtype` as `self`. + `x` is treated as a [batch] vector meaning for every set of leading + dimensions, the last dimension defines a vector. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + name: A name for this `Op`. + +Returns: + A `Tensor` with shape `[..., M]` and same `dtype` as `self`." +9768,determinant,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,706,method,"Determinant for every batch member. + +Args: + name: A name for this `Op`. + +Returns: + `Tensor` with shape `self.batch_shape` and same `dtype` as `self`. + +Raises: + NotImplementedError: If `self.is_square` is `False`." +9769,log_abs_determinant,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,735,method,"Log absolute value of determinant for every batch member. + +Args: + name: A name for this `Op`. + +Returns: + `Tensor` with shape `self.batch_shape` and same `dtype` as `self`. + +Raises: + NotImplementedError: If `self.is_square` is `False`." +9770,solve,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,773,method,"Solve (exact or approx) `R` (batch) systems of equations: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve R > 0 linear systems for every member of the batch. +RHS = ... # shape [..., M, R] + +X = operator.solve(RHS) +# X[..., :, r] is the solution to the r'th linear system +# sum_j A[..., :, j] X[..., j, r] = RHS[..., :, r] + +operator.matmul(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator and compatible shape. + `rhs` is treated like a [batch] matrix meaning for every set of leading + dimensions, the last two dimensions defines a matrix. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + adjoint_arg: Python `bool`. If `True`, solve `A X = rhs^H` where `rhs^H` + is the hermitian transpose (transposition and complex conjugation). + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N, R]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9771,solvevec,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,854,method,"Solve single equation with best effort: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve one linear system for every member of the batch. +RHS = ... # shape [..., M] + +X = operator.solvevec(RHS) +# X is the solution to the linear system +# sum_j A[..., :, j] X[..., j] = RHS[..., :] + +operator.matvec(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator. + `rhs` is treated like a [batch] vector meaning for every set of leading + dimensions, the last dimension defines a vector. See class docstring + for definition of compatibility regarding batch dimensions. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9772,adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,902,method,"Returns the adjoint of the current `LinearOperator`. + +Given `A` representing this `LinearOperator`, return `A*`. +Note that calling `self.adjoint()` and `self.H` are equivalent. + +Args: + name: A name for this `Op`. + +Returns: + `LinearOperator` which represents the adjoint of this `LinearOperator`." +9773,inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,922,method,"Returns the Inverse of this `LinearOperator`. + +Given `A` representing this `LinearOperator`, return a `LinearOperator` +representing `A^-1`. + +Args: + name: A name scope to use for ops added by this method. + +Returns: + `LinearOperator` representing inverse of this matrix. + +Raises: + ValueError: When the `LinearOperator` is not hinted to be `non_singular`." +9774,cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,947,method,"Returns a Cholesky factor as a `LinearOperator`. + +Given `A` representing this `LinearOperator`, if `A` is positive definite +self-adjoint, return `L`, where `A = L L^T`, i.e. the cholesky +decomposition. + +Args: + name: A name for this `Op`. + +Returns: + `LinearOperator` which represents the lower triangular matrix + in the Cholesky decomposition. + +Raises: + ValueError: When the `LinearOperator` is not hinted to be positive + definite and self adjoint." +9775,to_dense,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,988,method,Return a dense (batch) matrix representing this operator. +9776,diag_part,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,997,method,"Efficiently get the [batch] diagonal part of this operator. + +If this operator has shape `[B1,...,Bb, M, N]`, this returns a +`Tensor` `diagonal`, of shape `[B1,...,Bb, min(M, N)]`, where +`diagonal[b1,...,bb, i] = self.to_dense()[b1,...,bb, i, i]`. + +``` +my_operator = LinearOperatorDiag([1., 2.]) + +# Efficiently get the diagonal +my_operator.diag_part() +==> [1., 2.] + +# Equivalent, but inefficient method +tf.linalg.diag_part(my_operator.to_dense()) +==> [1., 2.] +``` + +Args: + name: A name for this `Op`. + +Returns: + diag_part: A `Tensor` of same `dtype` as self." +9777,trace,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1028,method,"Trace of the linear operator, equal to sum of `self.diag_part()`. + +If the operator is square, this is also the sum of the eigenvalues. + +Args: + name: A name for this `Op`. + +Returns: + Shape `[B1,...,Bb]` `Tensor` of same `dtype` as `self`." +9778,add_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1046,method,"Add matrix represented by this operator to `x`. Equivalent to `A + x`. + +Args: + x: `Tensor` with same `dtype` and shape broadcastable to `self.shape`. + name: A name to give this `Op`. + +Returns: + A `Tensor` with broadcast shape and same `dtype` as `self`." +9779,eigvals,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1064,method,"Returns the eigenvalues of this linear operator. + +If the operator is marked as self-adjoint (via `is_self_adjoint`) +this computation can be more efficient. + +Note: This currently only supports self-adjoint operators. + +Args: + name: A name for this `Op`. + +Returns: + Shape `[B1,...,Bb, N]` `Tensor` of same `dtype` as `self`." +9780,cond,tensorflow/tensorflow/python/ops/linalg/linear_operator.py,1096,method,"Returns the condition number of this linear operator. + +Args: + name: A name for this `Op`. + +Returns: + Shape `[B1,...,Bb]` `Tensor` of same `dtype` as `self`." +9781,add_operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,38,function,"Efficiently add one or more linear operators. Given operators `[A1, A2,...]`, this `Op` returns a possibly shorter list of operators `[B1, B2,...]` such that @@ -94647,37 +102068,7 @@ Returns: Raises: ValueError: If `operators` argument is empty. ValueError: If shapes are incompatible." -10329,_pop_a_match_at_tier,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,141,function, -10330,_infer_hints_allowing_override,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,152,function,"Infer hints from op1 and op2. hints argument is an override. - -Args: - op1: LinearOperator - op2: LinearOperator - hints: _Hints object holding ""is_X"" boolean hints to use for returned - operator. - If some hint is None, try to set using op1 and op2. If the - hint is provided, ignore op1 and op2 hints. This allows an override - of previous hints, but does not allow forbidden hints (e.g. you still - cannot say a real diagonal operator is not self-adjoint. - -Returns: - _Hints object." -10331,_static_check_for_same_dimensions,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,193,function,ValueError if operators determined to have different dimensions. -10332,_static_check_for_broadcastable_batch_shape,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,215,function,ValueError if operators determined to have non-broadcastable shapes. -10333,_Hints,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,226,class,Holds 'is_X' flags that every LinearOperator is initialized with. -10334,_Adder,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,244,class,"Abstract base class to add two operators. - -Each `Adder` acts independently, adding everything it can, paying no attention -as to whether another `Adder` could have done the addition more efficiently." -10335,_AddAndReturnScaledIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,293,class,"Handles additions resulting in an Identity family member. - -The Identity (`LinearOperatorScaledIdentity`, `LinearOperatorIdentity`) family -is closed under addition. This `Adder` respects that, and returns an Identity" -10336,_AddAndReturnDiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,326,class,Handles additions resulting in a Diag operator. -10337,_AddAndReturnTriL,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,342,class,Handles additions resulting in a TriL operator. -10338,_AddAndReturnMatrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,363,class,"""Handles additions resulting in a `LinearOperatorFullMatrix`." -10339,_type,tensorflow/tensorflow/python/ops/linalg/linear_operator_addition.py,410,function,Returns the type name constant (e.g. _TRIL) for operator. -10340,LinearOperatorAdjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_adjoint.py,33,class,"`LinearOperator` representing the adjoint of another operator. +9782,LinearOperatorAdjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_adjoint.py,33,class,"`LinearOperator` representing the adjoint of another operator. This operator represents the adjoint of another operator. @@ -94719,13 +102110,8 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10341,_registered_function,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,35,function,"Given a list of classes, finds the most specific function registered." -10342,_registered_adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,51,function,Get the Adjoint function registered for class a. -10343,_registered_cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,56,function,Get the Cholesky function registered for class a. -10344,_registered_matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,61,function,Get the Matmul function registered for classes a and b. -10345,_registered_solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,66,function,Get the Solve function registered for classes a and b. -10346,_registered_inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,71,function,Get the Cholesky function registered for class a. -10347,adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,76,function,"Get the adjoint associated to lin_op_a. +9783,operator,tensorflow/tensorflow/python/ops/linalg/linear_operator_adjoint.py,158,method,The operator before taking the adjoint. +9784,adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,76,function,"Get the adjoint associated to lin_op_a. Args: lin_op_a: The LinearOperator to take the adjoint of. @@ -94737,7 +102123,7 @@ Returns: Raises: NotImplementedError: If no Adjoint method is defined for the LinearOperator type of `lin_op_a`." -10348,cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,99,function,"Get the Cholesky factor associated to lin_op_a. +9785,cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,99,function,"Get the Cholesky factor associated to lin_op_a. Args: lin_op_a: The LinearOperator to decompose. @@ -94749,7 +102135,7 @@ Returns: Raises: NotImplementedError: If no Cholesky method is defined for the LinearOperator type of `lin_op_a`." -10349,matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,122,function,"Compute lin_op_a.matmul(lin_op_b). +9786,matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,122,function,"Compute lin_op_a.matmul(lin_op_b). Args: lin_op_a: The LinearOperator on the left. @@ -94763,7 +102149,7 @@ Returns: Raises: NotImplementedError: If no matmul method is defined between types of `lin_op_a` and `lin_op_b`." -10350,solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,147,function,"Compute lin_op_a.solve(lin_op_b). +9787,solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,147,function,"Compute lin_op_a.solve(lin_op_b). Args: lin_op_a: The LinearOperator on the left. @@ -94777,7 +102163,7 @@ Returns: Raises: NotImplementedError: If no solve method is defined between types of `lin_op_a` and `lin_op_b`." -10351,inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,172,function,"Get the Inverse associated to lin_op_a. +9788,inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,172,function,"Get the Inverse associated to lin_op_a. Args: lin_op_a: The LinearOperator to decompose. @@ -94789,21 +102175,21 @@ Returns: Raises: NotImplementedError: If no Inverse method is defined for the LinearOperator type of `lin_op_a`." -10352,RegisterAdjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,195,class,"Decorator to register an Adjoint implementation function. +9789,RegisterAdjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,195,class,"Decorator to register an Adjoint implementation function. Usage: @linear_operator_algebra.RegisterAdjoint(lin_op.LinearOperatorIdentity) def _adjoint_identity(lin_op_a): # Return the identity matrix." -10353,RegisterCholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,237,class,"Decorator to register a Cholesky implementation function. +9790,RegisterCholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,237,class,"Decorator to register a Cholesky implementation function. Usage: @linear_operator_algebra.RegisterCholesky(lin_op.LinearOperatorIdentity) def _cholesky_identity(lin_op_a): # Return the identity matrix." -10354,RegisterMatmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,279,class,"Decorator to register a Matmul implementation function. +9791,RegisterMatmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,279,class,"Decorator to register a Matmul implementation function. Usage: @@ -94812,7 +102198,7 @@ Usage: lin_op.LinearOperatorIdentity) def _matmul_identity(a, b): # Return the identity matrix." -10355,RegisterSolve,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,325,class,"Decorator to register a Solve implementation function. +9792,RegisterSolve,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,325,class,"Decorator to register a Solve implementation function. Usage: @@ -94821,14 +102207,14 @@ Usage: lin_op.LinearOperatorIdentity) def _solve_identity(a, b): # Return the identity matrix." -10356,RegisterInverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,371,class,"Decorator to register an Inverse implementation function. +9793,RegisterInverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_algebra.py,371,class,"Decorator to register an Inverse implementation function. Usage: @linear_operator_algebra.RegisterInverse(lin_op.LinearOperatorIdentity) def _inverse_identity(lin_op_a): # Return the identity matrix." -10357,LinearOperatorBlockDiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,37,class,"Combines one or more `LinearOperators` in to a Block Diagonal matrix. +9794,LinearOperatorBlockDiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,37,class,"Combines one or more `LinearOperators` in to a Block Diagonal matrix. This operator combines one or more linear operators `[op1,...,opJ]`, building a new `LinearOperator`, whose underlying matrix representation is @@ -94922,7 +102308,141 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10358,LinearOperatorBlockLowerTriangular,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,39,class,"Combines `LinearOperators` into a blockwise lower-triangular matrix. +9795,operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,233,method, +9796,matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,281,method,"Transform [batch] matrix `x` with left multiplication: `x --> Ax`. + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +X = ... # shape [..., N, R], batch matrix, R > 0. + +Y = operator.matmul(X) +Y.shape +==> [..., M, R] + +Y[..., :, r] = sum_j A[..., :, j] X[j, r] +``` + +Args: + x: `LinearOperator`, `Tensor` with compatible shape and same `dtype` as + `self`, or a blockwise iterable of `LinearOperator`s or `Tensor`s. See + class docstring for definition of shape compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + adjoint_arg: Python `bool`. If `True`, compute `A x^H` where `x^H` is + the hermitian transpose (transposition and complex conjugation). + name: A name for this `Op`. + +Returns: + A `LinearOperator` or `Tensor` with shape `[..., M, R]` and same `dtype` + as `self`, or if `x` is blockwise, a list of `Tensor`s with shapes that + concatenate to `[..., M, R]`." +9797,matvec,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,373,method,"Transform [batch] vector `x` with left multiplication: `x --> Ax`. + +```python +# Make an operator acting like batch matric A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) + +X = ... # shape [..., N], batch vector + +Y = operator.matvec(X) +Y.shape +==> [..., M] + +Y[..., :] = sum_j A[..., :, j] X[..., j] +``` + +Args: + x: `Tensor` with compatible shape and same `dtype` as `self`, or an + iterable of `Tensor`s (for blockwise operators). `Tensor`s are treated + a [batch] vectors, meaning for every set of leading dimensions, the last + dimension defines a vector. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + name: A name for this `Op`. + +Returns: + A `Tensor` with shape `[..., M]` and same `dtype` as `self`." +9798,solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,436,method,"Solve (exact or approx) `R` (batch) systems of equations: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve R > 0 linear systems for every member of the batch. +RHS = ... # shape [..., M, R] + +X = operator.solve(RHS) +# X[..., :, r] is the solution to the r'th linear system +# sum_j A[..., :, j] X[..., j, r] = RHS[..., :, r] + +operator.matmul(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator and compatible shape, + or a list of `Tensor`s (for blockwise operators). `Tensor`s are treated + like a [batch] matrices meaning for every set of leading dimensions, the + last two dimensions defines a matrix. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + adjoint_arg: Python `bool`. If `True`, solve `A X = rhs^H` where `rhs^H` + is the hermitian transpose (transposition and complex conjugation). + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N, R]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9799,solvevec,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_diag.py,540,method,"Solve single equation with best effort: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve one linear system for every member of the batch. +RHS = ... # shape [..., M] + +X = operator.solvevec(RHS) +# X is the solution to the linear system +# sum_j A[..., :, j] X[..., j] = RHS[..., :] + +operator.matvec(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator, or list of `Tensor`s + (for blockwise operators). `Tensor`s are treated as [batch] vectors, + meaning for every set of leading dimensions, the last dimension defines + a vector. See class docstring for definition of compatibility regarding + batch dimensions. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9800,LinearOperatorBlockLowerTriangular,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,39,class,"Combines `LinearOperators` into a blockwise lower-triangular matrix. This operator is initialized with a nested list of linear operators, which are combined into a new `LinearOperator` whose underlying matrix @@ -95070,10 +102590,168 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10359,_BaseLinearOperatorCirculant,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,52,class,"Base class for circulant operators. Not user facing. +9801,operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,335,method, +9802,matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,384,method,"Transform [batch] matrix `x` with left multiplication: `x --> Ax`. -`LinearOperator` acting like a [batch] [[nested] block] circulant matrix." -10360,LinearOperatorCirculant,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,516,class,"`LinearOperator` acting like a circulant matrix. +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +X = ... # shape [..., N, R], batch matrix, R > 0. + +Y = operator.matmul(X) +Y.shape +==> [..., M, R] + +Y[..., :, r] = sum_j A[..., :, j] X[j, r] +``` + +Args: + x: `LinearOperator`, `Tensor` with compatible shape and same `dtype` as + `self`, or a blockwise iterable of `LinearOperator`s or `Tensor`s. See + class docstring for definition of shape compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + adjoint_arg: Python `bool`. If `True`, compute `A x^H` where `x^H` is + the hermitian transpose (transposition and complex conjugation). + name: A name for this `Op`. + +Returns: + A `LinearOperator` or `Tensor` with shape `[..., M, R]` and same `dtype` + as `self`, or if `x` is blockwise, a list of `Tensor`s with shapes that + concatenate to `[..., M, R]`." +9803,matvec,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,512,method,"Transform [batch] vector `x` with left multiplication: `x --> Ax`. + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) + +X = ... # shape [..., N], batch vector + +Y = operator.matvec(X) +Y.shape +==> [..., M] + +Y[..., :] = sum_j A[..., :, j] X[..., j] +``` + +Args: + x: `Tensor` with compatible shape and same `dtype` as `self`, or an + iterable of `Tensor`s. `Tensor`s are treated a [batch] vectors, meaning + for every set of leading dimensions, the last dimension defines a + vector. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, left multiply by the adjoint: `A^H x`. + name: A name for this `Op`. + +Returns: + A `Tensor` with shape `[..., M]` and same `dtype` as `self`." +9804,solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,577,method,"Solve (exact or approx) `R` (batch) systems of equations: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Given the blockwise `n + 1`-by-`n + 1` linear operator: + +op = [[A_00 0 ... 0 ... 0], + [A_10 A_11 ... 0 ... 0], + ... + [A_k0 A_k1 ... A_kk ... 0], + ... + [A_n0 A_n1 ... A_nk ... A_nn]] + +we find `x = op.solve(y)` by observing that + +`y_k = A_k0.matmul(x_0) + A_k1.matmul(x_1) + ... + A_kk.matmul(x_k)` + +and therefore + +`x_k = A_kk.solve(y_k - + A_k0.matmul(x_0) - ... - A_k(k-1).matmul(x_(k-1)))` + +where `x_k` and `y_k` are the `k`th blocks obtained by decomposing `x` +and `y` along their appropriate axes. + +We first solve `x_0 = A_00.solve(y_0)`. Proceeding inductively, we solve +for `x_k`, `k = 1..n`, given `x_0..x_(k-1)`. + +The adjoint case is solved similarly, beginning with +`x_n = A_nn.solve(y_n, adjoint=True)` and proceeding backwards. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve R > 0 linear systems for every member of the batch. +RHS = ... # shape [..., M, R] + +X = operator.solve(RHS) +# X[..., :, r] is the solution to the r'th linear system +# sum_j A[..., :, j] X[..., j, r] = RHS[..., :, r] + +operator.matmul(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator and compatible shape, + or a list of `Tensor`s. `Tensor`s are treated like a [batch] matrices + meaning for every set of leading dimensions, the last two dimensions + defines a matrix. + See class docstring for definition of compatibility. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + adjoint_arg: Python `bool`. If `True`, solve `A X = rhs^H` where `rhs^H` + is the hermitian transpose (transposition and complex conjugation). + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N, R]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9805,solvevec,tensorflow/tensorflow/python/ops/linalg/linear_operator_block_lower_triangular.py,752,method,"Solve single equation with best effort: `A X = rhs`. + +The returned `Tensor` will be close to an exact solution if `A` is well +conditioned. Otherwise closeness will vary. See class docstring for details. + +Examples: + +```python +# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N] +operator = LinearOperator(...) +operator.shape = [..., M, N] + +# Solve one linear system for every member of the batch. +RHS = ... # shape [..., M] + +X = operator.solvevec(RHS) +# X is the solution to the linear system +# sum_j A[..., :, j] X[..., j] = RHS[..., :] + +operator.matvec(X) +==> RHS +``` + +Args: + rhs: `Tensor` with same `dtype` as this operator, or list of `Tensor`s + (for blockwise operators). `Tensor`s are treated as [batch] vectors, + meaning for every set of leading dimensions, the last dimension defines + a vector. See class docstring for definition of compatibility regarding + batch dimensions. + adjoint: Python `bool`. If `True`, solve the system involving the adjoint + of this `LinearOperator`: `A^H X = rhs`. + name: A name scope to use for ops added by this method. + +Returns: + `Tensor` with shape `[...,N]` and same `dtype` as `rhs`. + +Raises: + NotImplementedError: If `self.is_non_singular` or `is_square` is False." +9806,LinearOperatorCirculant,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,516,class,"`LinearOperator` acting like a circulant matrix. This operator acts like a circulant matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95256,7 +102934,7 @@ References: Toeplitz and Circulant Matrices - A Review: [Gray, 2006](https://www.nowpublishers.com/article/Details/CIT-006) ([pdf](https://ee.stanford.edu/~gray/toeplitz.pdf))" -10361,LinearOperatorCirculant2D,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,762,class,"`LinearOperator` acting like a block circulant matrix. +9807,LinearOperatorCirculant2D,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,762,class,"`LinearOperator` acting like a block circulant matrix. This operator acts like a block circulant matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95373,7 +103051,7 @@ These have the following meaning * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10362,LinearOperatorCirculant3D,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,939,class,"`LinearOperator` acting like a nested block circulant matrix. +9808,LinearOperatorCirculant3D,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,939,class,"`LinearOperator` acting like a nested block circulant matrix. This operator acts like a block circulant matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95463,8 +103141,7 @@ These have the following meaning * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10363,_to_complex,tensorflow/tensorflow/python/ops/linalg/linear_operator_circulant.py,1088,function, -10364,LinearOperatorComposition,tensorflow/tensorflow/python/ops/linalg/linear_operator_composition.py,34,class,"Composes one or more `LinearOperators`. +9809,LinearOperatorComposition,tensorflow/tensorflow/python/ops/linalg/linear_operator_composition.py,34,class,"Composes one or more `LinearOperators`. This operator composes one or more linear operators `[op1,...,opJ]`, building a new `LinearOperator` with action defined by: @@ -95540,7 +103217,8 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10365,LinearOperatorDiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_diag.py,34,class,"`LinearOperator` acting like a [batch] square diagonal matrix. +9810,operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_composition.py,190,method, +9811,LinearOperatorDiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_diag.py,34,class,"`LinearOperator` acting like a [batch] square diagonal matrix. This operator acts like a [batch] diagonal matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95617,7 +103295,8 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10366,LinearOperatorFullMatrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_full_matrix.py,33,class,"`LinearOperator` that wraps a [batch] matrix. +9812,diag,tensorflow/tensorflow/python/ops/linalg/linear_operator_diag.py,187,method, +9813,LinearOperatorFullMatrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_full_matrix.py,33,class,"`LinearOperator` that wraps a [batch] matrix. This operator wraps a [batch] matrix `A` (which is a `Tensor`) with shape `[B1,...,Bb, M, N]` for some `b >= 0`. The first `b` indices index a @@ -95690,7 +103369,7 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10367,LinearOperatorHouseholder,tensorflow/tensorflow/python/ops/linalg/linear_operator_householder.py,35,class,"`LinearOperator` acting like a [batch] of Householder transformations. +9814,LinearOperatorHouseholder,tensorflow/tensorflow/python/ops/linalg/linear_operator_householder.py,35,class,"`LinearOperator` acting like a [batch] of Householder transformations. This operator acts like a [batch] of householder reflections with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95747,8 +103426,9 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10368,BaseLinearOperatorIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,42,class,Base class for Identity operators. -10369,LinearOperatorIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,102,class,"`LinearOperator` acting like a [batch] square identity matrix. +9815,reflection_axis,tensorflow/tensorflow/python/ops/linalg/linear_operator_householder.py,262,method, +9816,BaseLinearOperatorIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,42,class,Base class for Identity operators. +9817,LinearOperatorIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,102,class,"`LinearOperator` acting like a [batch] square identity matrix. This operator acts like a [batch] identity matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95850,7 +103530,15 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10370,LinearOperatorScaledIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,475,class,"`LinearOperator` acting like a scaled [batch] identity matrix `A = c I`. +9818,add_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,386,method,"Add matrix represented by this operator to `mat`. Equiv to `I + mat`. + +Args: + mat: `Tensor` with same `dtype` and shape broadcastable to `self`. + name: A name to give this `Op`. + +Returns: + A `Tensor` with broadcast shape and same `dtype` as `self`." +9819,LinearOperatorScaledIdentity,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,475,class,"`LinearOperator` acting like a scaled [batch] identity matrix `A = c I`. This operator acts like a scaled [batch] identity matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -95932,7 +103620,16 @@ These have the following meaning * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10371,LinearOperatorInversion,tensorflow/tensorflow/python/ops/linalg/linear_operator_inversion.py,30,class,"`LinearOperator` representing the inverse of another operator. +9820,add_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,708,method,"Add matrix represented by this operator to `mat`. Equiv to `I + mat`. + +Args: + mat: `Tensor` with same `dtype` and shape broadcastable to `self`. + name: A name to give this `Op`. + +Returns: + A `Tensor` with broadcast shape and same `dtype` as `self`." +9821,multiplier,tensorflow/tensorflow/python/ops/linalg/linear_operator_identity.py,745,method,"The [batch] scalar `Tensor`, `c` in `cI`." +9822,LinearOperatorInversion,tensorflow/tensorflow/python/ops/linalg/linear_operator_inversion.py,30,class,"`LinearOperator` representing the inverse of another operator. This operator represents the inverse of another operator. @@ -95975,10 +103672,8 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10372,_vec,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,36,function,Stacks column of matrix to form a single column. -10373,_unvec_by,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,44,function,"Unstack vector to form a matrix, with a specified amount of columns." -10374,_rotate_last_dim,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,53,function,Rotate the last dimension either left or right. -10375,LinearOperatorKronecker,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,66,class,"Kronecker product between two `LinearOperators`. +9823,operator,tensorflow/tensorflow/python/ops/linalg/linear_operator_inversion.py,171,method,The operator before inversion. +9824,LinearOperatorKronecker,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,66,class,"Kronecker product between two `LinearOperators`. This operator composes one or more linear operators `[op1,...,opJ]`, building a new `LinearOperator` representing the Kronecker product: @@ -96046,7 +103741,8 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10376,LinearOperatorLowRankUpdate,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,39,class,"Perturb a `LinearOperator` with a rank `K` update. +9825,operators,tensorflow/tensorflow/python/ops/linalg/linear_operator_kronecker.py,234,method, +9826,LinearOperatorLowRankUpdate,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,39,class,"Perturb a `LinearOperator` with a rank `K` update. This operator acts like a [batch] matrix `A` with shape `[B1,...,Bb, M, N]` for some `b >= 0`. The first `b` indices index a @@ -96136,7 +103832,13 @@ for `X = non_singular`, `self_adjoint`, `positive_definite`, * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10377,LinearOperatorLowerTriangular,tensorflow/tensorflow/python/ops/linalg/linear_operator_lower_triangular.py,35,class,"`LinearOperator` acting like a [batch] square lower triangular matrix. +9827,u,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,298,method,"If this operator is `A = L + U D V^H`, this is the `U`." +9828,v,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,303,method,"If this operator is `A = L + U D V^H`, this is the `V`." +9829,is_diag_update_positive,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,308,method,"If this operator is `A = L + U D V^H`, this hints `D > 0` elementwise." +9830,diag_update,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,313,method,"If this operator is `A = L + U D V^H`, this is the diagonal of `D`." +9831,diag_operator,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,318,method,"If this operator is `A = L + U D V^H`, this is `D`." +9832,base_operator,tensorflow/tensorflow/python/ops/linalg/linear_operator_low_rank_update.py,323,method,"If this operator is `A = L + U D V^H`, this is the `L`." +9833,LinearOperatorLowerTriangular,tensorflow/tensorflow/python/ops/linalg/linear_operator_lower_triangular.py,35,class,"`LinearOperator` acting like a [batch] square lower triangular matrix. This operator acts like a [batch] lower triangular matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -96207,7 +103909,7 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10378,LinearOperatorPermutation,tensorflow/tensorflow/python/ops/linalg/linear_operator_permutation.py,39,class,"`LinearOperator` acting like a [batch] of permutation matrices. +9834,LinearOperatorPermutation,tensorflow/tensorflow/python/ops/linalg/linear_operator_permutation.py,39,class,"`LinearOperator` acting like a [batch] of permutation matrices. This operator acts like a [batch] of permutations with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -96271,46 +103973,13 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10379,OperatorShapesInfo,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,45,class,"Object encoding expected shape for a test. +9835,perm,tensorflow/tensorflow/python/ops/linalg/linear_operator_permutation.py,251,method, +9836,OperatorShapesInfo,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,45,class,"Object encoding expected shape for a test. Encodes the expected shape of a matrix for a test. Also allows additional metadata for the test harness." -10380,CheckTapeSafeSkipOptions,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,57,class, -10381,LinearOperatorDerivedClassTest,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,67,class,"Tests for derived classes. - -Subclasses should implement every abstractmethod, and this will enable all -test methods to work." -10382,_test_to_dense,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,275,function, -10383,_test_det,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,289,function, -10384,_test_log_abs_det,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,304,function, -10385,_test_matmul_base,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,321,function, -10386,_test_matmul,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,386,function, -10387,_test_matmul_with_broadcast,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,406,function, -10388,_test_adjoint,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,426,function, -10389,_test_cholesky,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,442,function, -10390,_test_eigvalsh,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,461,function, -10391,_test_cond,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,491,function, -10392,_test_solve_base,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,537,function, -10393,_test_solve,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,603,function, -10394,_test_solve_with_broadcast,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,618,function, -10395,_test_inverse,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,633,function, -10396,_test_trace,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,645,function, -10397,_test_add_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,660,function, -10398,_test_diag_part,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,677,function, -10399,add_tests,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,699,function,Add tests for LinearOperator methods. -10400,SquareLinearOperatorDerivedClassTest,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,763,class,"Base test class appropriate for square operators. - -Sub-classes must still define all abstractmethods from -LinearOperatorDerivedClassTest that are not defined here." -10401,NonSquareLinearOperatorDerivedClassTest,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,819,class,"Base test class appropriate for generic rectangular operators. - -Square shapes are never tested by this class, so if you want to test your -operator with a square shape, create two test classes, the other subclassing -SquareLinearOperatorFullMatrixTest. - -Sub-classes must still define all abstractmethods from -LinearOperatorDerivedClassTest that are not defined here." -10402,random_positive_definite_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,895,function,"[batch] positive definite Wisart matrix. +9837,CheckTapeSafeSkipOptions,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,57,class, +9838,random_positive_definite_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,895,function,"[batch] positive definite Wisart matrix. A Wishart(N, S) matrix is the S sample covariance matrix of an N-variate (standard) Normal random variable. @@ -96326,7 +103995,7 @@ Args: Returns: `Tensor` with desired shape and dtype." -10403,random_tril_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,938,function,"[batch] lower triangular matrix. +9839,random_tril_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,938,function,"[batch] lower triangular matrix. Args: shape: `TensorShape` or Python `list`. Shape of the returned matrix. @@ -96341,7 +104010,7 @@ Args: Returns: `Tensor` with desired shape and dtype." -10404,random_normal,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,974,function,"Tensor with (possibly complex) Gaussian entries. +9840,random_normal,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,974,function,"Tensor with (possibly complex) Gaussian entries. Samples are distributed like @@ -96359,7 +104028,7 @@ Args: Returns: `Tensor` with desired shape and dtype." -10405,random_uniform,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1008,function,"Tensor with (possibly complex) Uniform entries. +9841,random_uniform,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1008,function,"Tensor with (possibly complex) Uniform entries. Samples are distributed like @@ -96377,7 +104046,7 @@ Args: Returns: `Tensor` with desired shape and dtype." -10406,random_sign_uniform,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1050,function,"Tensor with (possibly complex) random entries from a ""sign Uniform"". +9842,random_sign_uniform,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1050,function,"Tensor with (possibly complex) random entries from a ""sign Uniform"". Letting `Z` be a random variable equal to `-1` and `1` with equal probability, Samples from this `Op` are distributed like @@ -96396,7 +104065,7 @@ Args: Returns: `Tensor` with desired shape and dtype." -10407,random_normal_correlated_columns,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1087,function,"Batch matrix with (possibly complex) Gaussian entries and correlated cols. +9843,random_normal_correlated_columns,tensorflow/tensorflow/python/ops/linalg/linear_operator_test_util.py,1087,function,"Batch matrix with (possibly complex) Gaussian entries and correlated cols. Returns random batch matrix `A` with specified element-wise `mean`, `stddev`, living close to an embedded hyperplane. @@ -96432,7 +104101,7 @@ Returns: Raises: ValueError: If `shape` is not at least length 2." -10408,LinearOperatorToeplitz,tensorflow/tensorflow/python/ops/linalg/linear_operator_toeplitz.py,37,class,"`LinearOperator` acting like a [batch] of toeplitz matrices. +9844,LinearOperatorToeplitz,tensorflow/tensorflow/python/ops/linalg/linear_operator_toeplitz.py,37,class,"`LinearOperator` acting like a [batch] of toeplitz matrices. This operator acts like a [batch] Toeplitz matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -96503,8 +104172,9 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10409,_to_complex,tensorflow/tensorflow/python/ops/linalg/linear_operator_toeplitz.py,274,function, -10410,LinearOperatorTridiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_tridiag.py,42,class,"`LinearOperator` acting like a [batch] square tridiagonal matrix. +9845,col,tensorflow/tensorflow/python/ops/linalg/linear_operator_toeplitz.py,266,method, +9846,row,tensorflow/tensorflow/python/ops/linalg/linear_operator_toeplitz.py,270,method, +9847,LinearOperatorTridiag,tensorflow/tensorflow/python/ops/linalg/linear_operator_tridiag.py,42,class,"`LinearOperator` acting like a [batch] square tridiagonal matrix. This operator acts like a [batch] square tridiagonal matrix `A` with shape `[B1,...,Bb, N, N]` for some `b >= 0`. The first `b` indices index a @@ -96587,7 +104257,9 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10411,convert_nonref_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,40,function,"Converts the given `value` to a `Tensor` if input is nonreference type. +9848,diagonals,tensorflow/tensorflow/python/ops/linalg/linear_operator_tridiag.py,368,method, +9849,diagonals_format,tensorflow/tensorflow/python/ops/linalg/linear_operator_tridiag.py,372,method, +9850,convert_nonref_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,40,function,"Converts the given `value` to a `Tensor` if input is nonreference type. This function converts Python objects of various types to `Tensor` objects except if the input has nonreference semantics. Reference semantics are @@ -96649,10 +104321,10 @@ tf.is_tensor(y) tf.equal(y, 13.37) # ==> True ```" -10412,base_dtype,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,121,function,Returns a non-reference `dtype` based on this `dtype`. -10413,dtype_name,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,129,function,Returns the string name for this `dtype`. -10414,check_dtype,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,139,function,Check that arg.dtype == self.dtype. -10415,is_ref,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,147,function,"Evaluates if the object has reference semantics. +9851,base_dtype,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,121,function,Returns a non-reference `dtype` based on this `dtype`. +9852,dtype_name,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,129,function,Returns the string name for this `dtype`. +9853,check_dtype,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,139,function,Check that arg.dtype == self.dtype. +9854,is_ref,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,147,function,"Evaluates if the object has reference semantics. An object is deemed ""reference"" if it is a `tf.Variable` instance or is derived from a `tf.Module` with `dtype` and `shape` properties. @@ -96663,8 +104335,8 @@ Args: Returns: is_ref: Python `bool` indicating input is has nonreference semantics, i.e., is a `tf.Variable` or a `tf.Module` with `dtype` and `shape` properties." -10416,assert_not_ref_type,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,168,function, -10417,assert_no_entries_with_modulus_zero,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,179,function,"Returns `Op` that asserts Tensor `x` has no entries with modulus zero. +9855,assert_not_ref_type,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,168,function, +9856,assert_no_entries_with_modulus_zero,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,179,function,"Returns `Op` that asserts Tensor `x` has no entries with modulus zero. Args: x: Numeric `Tensor`, real, integer, or complex. @@ -96673,7 +104345,7 @@ Args: Returns: An `Op` that asserts `x` has no entries with modulus zero." -10418,assert_zero_imag_part,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,199,function,"Returns `Op` that asserts Tensor `x` has no non-zero imaginary parts. +9857,assert_zero_imag_part,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,199,function,"Returns `Op` that asserts Tensor `x` has no non-zero imaginary parts. Args: x: Numeric `Tensor`, real, integer, or complex. @@ -96682,7 +104354,7 @@ Args: Returns: An `Op` that asserts `x` has no entries with modulus zero." -10419,assert_compatible_matrix_dimensions,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,221,function,"Assert that an argument to solve/matmul has proper domain dimension. +9858,assert_compatible_matrix_dimensions,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,221,function,"Assert that an argument to solve/matmul has proper domain dimension. If `operator.shape[-2:] = [M, N]`, and `x.shape[-2:] = [Q, R]`, then `operator.matmul(x)` is defined only if `N = Q`. This `Op` returns an @@ -96695,9 +104367,9 @@ Args: Returns: `Assert` `Op`." -10420,assert_is_batch_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,248,function,Static assert that `tensor` has rank `2` or higher. -10421,shape_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,257,function,"Convert Tensor using default type, unless empty list or tuple." -10422,broadcast_matrix_batch_dims,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,273,function,"Broadcast leading dimensions of zero or more [batch] matrices. +9859,assert_is_batch_matrix,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,248,function,Static assert that `tensor` has rank `2` or higher. +9860,shape_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,257,function,"Convert Tensor using default type, unless empty list or tuple." +9861,broadcast_matrix_batch_dims,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,273,function,"Broadcast leading dimensions of zero or more [batch] matrices. Example broadcasting one batch dim of two simple matrices. @@ -96742,9 +104414,8 @@ Returns: Raises: ValueError: If any input `Tensor` is statically determined to have less than two dimensions." -10423,matrix_solve_with_broadcast,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,366,function,Solve systems of linear equations. -10424,_reshape_for_efficiency,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,385,function,"Maybe reshape a, b, and return an inverse map. For matmul/solve." -10425,use_operator_or_provided_hint_unless_contradicting,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,484,function,"Get combined hint in the case where operator.hint should equal hint. +9862,matrix_solve_with_broadcast,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,366,function,Solve systems of linear equations. +9863,use_operator_or_provided_hint_unless_contradicting,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,484,function,"Get combined hint in the case where operator.hint should equal hint. Args: operator: LinearOperator that a meta-operator was initialized with. @@ -96757,8 +104428,8 @@ Returns: Raises: ValueError: If hints contradict." -10426,arg_is_blockwise,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,519,function,Detect if input should be interpreted as a list of blocks. -10427,split_arg_into_blocks,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,566,function,"Split `x` into blocks matching `operators`'s `domain_dimension`. +9864,arg_is_blockwise,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,519,function,Detect if input should be interpreted as a list of blocks. +9865,split_arg_into_blocks,tensorflow/tensorflow/python/ops/linalg/linear_operator_util.py,566,function,"Split `x` into blocks matching `operators`'s `domain_dimension`. Specifically, if we have a blockwise lower-triangular matrix, with block sizes along the diagonal `[M_j, M_j] j = 0,1,2..J`, this method splits `arg` @@ -96772,7 +104443,7 @@ Args: Returns: A list of `Tensor`s." -10428,LinearOperatorZeros,tensorflow/tensorflow/python/ops/linalg/linear_operator_zeros.py,43,class,"`LinearOperator` acting like a [batch] zero matrix. +9866,LinearOperatorZeros,tensorflow/tensorflow/python/ops/linalg/linear_operator_zeros.py,43,class,"`LinearOperator` acting like a [batch] zero matrix. This operator acts like a [batch] zero matrix `A` with shape `[B1,...,Bb, N, M]` for some `b >= 0`. The first `b` indices index a @@ -96852,33 +104523,19 @@ These have the following meaning: * If `is_X == False`, callers should expect the operator to not have `X`. * If `is_X == None` (the default), callers should have no expectation either way." -10429,_matmul_linear_operator,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,35,function,Generic matmul of two `LinearOperator`s. -10430,_matmul_linear_operator_identity_left,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,64,function, -10431,_matmul_linear_operator_identity_right,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,72,function, -10432,_matmul_linear_operator_scaled_identity,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,80,function,Matmul of two ScaledIdentity `LinearOperators`. -10433,_matmul_linear_operator_zeros_right,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,101,function, -10434,_matmul_linear_operator_zeros_left,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,111,function, -10435,_matmul_linear_operator_diag,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,124,function, -10436,_matmul_linear_operator_diag_scaled_identity_right,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,140,function, -10437,_matmul_linear_operator_diag_scaled_identity_left,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,157,function, -10438,_matmul_linear_operator_diag_tril,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,174,function, -10439,_matmul_linear_operator_tril_diag,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,190,function, -10440,_matmul_linear_operator_circulant_circulant,tensorflow/tensorflow/python/ops/linalg/matmul_registrations.py,208,function, -10441,combined_commuting_self_adjoint_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,23,function,Get combined hint for self-adjoint-ness. -10442,is_square,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,47,function,Return a hint to whether the composition is square. -10443,combined_commuting_positive_definite_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,68,function,Get combined PD hint for compositions. -10444,combined_non_singular_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,81,function,Get combined hint for when . -10445,_solve_linear_operator,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,35,function,Generic solve of two `LinearOperator`s. -10446,_solve_inverse_linear_operator,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,65,function,Solve inverse of generic `LinearOperator`s. -10447,_solve_linear_operator_identity_left,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,74,function, -10448,_solve_linear_operator_identity_right,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,82,function, -10449,_solve_linear_operator_scaled_identity,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,90,function,Solve of two ScaledIdentity `LinearOperators`. -10450,_solve_linear_operator_diag,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,111,function, -10451,_solve_linear_operator_diag_scaled_identity_right,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,127,function, -10452,_solve_linear_operator_diag_scaled_identity_left,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,144,function, -10453,_solve_linear_operator_diag_tril,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,161,function, -10454,_solve_linear_operator_circulant_circulant,tensorflow/tensorflow/python/ops/linalg/solve_registrations.py,180,function, -10455,conjugate_gradient,tensorflow/tensorflow/python/ops/linalg/sparse/conjugate_gradient.py,36,function,"Conjugate gradient solver. +9867,add_to_tensor,tensorflow/tensorflow/python/ops/linalg/linear_operator_zeros.py,338,method,"Add matrix represented by this operator to `mat`. Equiv to `I + mat`. + +Args: + mat: `Tensor` with same `dtype` and shape broadcastable to `self`. + name: A name to give this `Op`. + +Returns: + A `Tensor` with broadcast shape and same `dtype` as `self`." +9868,combined_commuting_self_adjoint_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,23,function,Get combined hint for self-adjoint-ness. +9869,is_square,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,47,function,Return a hint to whether the composition is square. +9870,combined_commuting_positive_definite_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,68,function,Get combined PD hint for compositions. +9871,combined_non_singular_hint,tensorflow/tensorflow/python/ops/linalg/registrations_util.py,81,function,Get combined hint for when . +9872,conjugate_gradient,tensorflow/tensorflow/python/ops/linalg/sparse/conjugate_gradient.py,36,function,"Conjugate gradient solver. Solves a linear system of equations `A*x = rhs` for self-adjoint, positive definite matrix `A` and right-hand side vector `rhs`, using an iterative, @@ -96912,20 +104569,9 @@ Returns: - p: A rank-1 `Tensor` of shape `[..., N]`. `A`-conjugate basis vector. - gamma: \\(r \dot M \dot r\\), equivalent to \\(||r||_2^2\\) when `preconditioner=None`." -10456,_DenseToCSRSparseMatrixGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,28,function,Gradient for dense_to_csr_sparse_matrix op. -10457,_CSRSparseMatrixToDenseGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,38,function,Gradient for csr_sparse_matrix_to_dense op. -10458,_SparseMatrixAddGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,51,function,Gradient for sparse_matrix_add op. -10459,_SparseMatrixTransposeGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,71,function,Gradient for sparse_matrix_transpose op. -10460,_SparseMatrixSoftmaxGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,78,function,Gradient for sparse_matrix_softmax op. -10461,_SparseMatrixMatMulGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,86,function,Gradient for sparse_matrix_mat_mul op. -10462,_SparseMatrixSparseMatMulGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,173,function,Gradient for sparse_matrix_sparse_mat_mul op. -10463,_SparseMatrixMulGrad,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py,226,function,Gradient for sparse_matrix_mul op. -10464,DenseShapeAndType,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,50,class, -10465,_get_handle_data,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,55,function, -10466,_create_handle_data_proto,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,59,function,Create handle data based on shape and dtype protos. -10467,_make_handle_data,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,72,function,Create handle data based on tensor shape and dtype. -10468,get_shape_and_type,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,78,function,Return matrix's shape and type if available. -10469,dense_shape_and_type,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,90,function,"Get dense shape and dtype of the tf.Tensor containing the matrix. +9873,DenseShapeAndType,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,50,class, +9874,get_shape_and_type,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,78,function,Return matrix's shape and type if available. +9875,dense_shape_and_type,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,90,function,"Get dense shape and dtype of the tf.Tensor containing the matrix. Args: matrix: A `tf.Tensor` of type `tf.variant` storing a sparse matrix. @@ -96938,8 +104584,8 @@ Raises: TypeError: if `matrix` is not a tensor or its dtype is not variant. ValueError: if `matrix` lacks static handle data containing the dense shape and dtype." -10470,matmul_shape_inference,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,121,function,Helper function for matmul to set the result matrix's handle data. -10471,matmul,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,147,function,"Perform a sparse matrix matmul between `a` and `b`. +9876,matmul_shape_inference,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,121,function,Helper function for matmul to set the result matrix's handle data. +9877,matmul,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,147,function,"Perform a sparse matrix matmul between `a` and `b`. Performs a contraction between `a` and `b` along the two innermost dimensions. If both `a` and `b` are instances of `SparseMatrix`, returns a new instance @@ -96965,9 +104611,22 @@ Args: Returns: A `SparseMatrix` if both `a` and `b` are instances of `SparseMatrix`, otherwise a dense `Tensor`." -10472,SparseMatrix,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,248,class,Abstract class for sparse matrix types. -10473,CSRSparseMatrix,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,315,class,(Optionally batched) CSR Sparse Matrix. -10474,ReductionV2,tensorflow/tensorflow/python/ops/losses/loss_reduction.py,21,class,"Types of loss reduction. +9878,SparseMatrix,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,248,class,Abstract class for sparse matrix types. +9879,to_dense,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,264,method, +9880,to_sparse_tensor,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,268,method, +9881,graph,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,272,method, +9882,shape,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,276,method, +9883,dtype,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,280,method, +9884,eager_handle_data,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,284,method,Return the matrix's handle data iff in eager mode. +9885,conj,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,288,method, +9886,hermitian_transpose,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,292,method,Return the hermitian transpose of the matrix. +9887,nnz,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,299,method,"Number of stored values, including explicit zeros." +9888,sorted_indices,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,305,method, +9889,transpose,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,309,method, +9890,CSRSparseMatrix,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,315,class,(Optionally batched) CSR Sparse Matrix. +9891,to_dense,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,372,method, +9892,to_sparse_tensor,tensorflow/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_ops.py,375,method, +9893,ReductionV2,tensorflow/tensorflow/python/ops/losses/loss_reduction.py,21,class,"Types of loss reduction. Contains the following values: @@ -96999,7 +104658,9 @@ Contains the following values: Please see the [custom training guide](https://www.tensorflow.org/tutorials/distribute/custom_training) # pylint: disable=line-too-long for more details on this." -10475,Reduction,tensorflow/tensorflow/python/ops/losses/losses_impl.py,39,class,"Types of loss reduction. +9894,all,tensorflow/tensorflow/python/ops/losses/loss_reduction.py,62,method, +9895,validate,tensorflow/tensorflow/python/ops/losses/loss_reduction.py,66,method, +9896,Reduction,tensorflow/tensorflow/python/ops/losses/losses_impl.py,39,class,"Types of loss reduction. Contains the following values: @@ -97010,37 +104671,9 @@ Contains the following values: * `SUM_OVER_NONZERO_WEIGHTS`: Scalar `SUM` divided by number of non-zero weights. DEPRECATED. * `SUM_BY_NONZERO_WEIGHTS`: Same as `SUM_OVER_NONZERO_WEIGHTS`. DEPRECATED." -10476,_safe_mean,tensorflow/tensorflow/python/ops/losses/losses_impl.py,76,function,"Computes a safe mean of the losses. - -Args: - losses: `Tensor` whose elements contain individual loss measurements. - num_present: The number of measurable elements in `losses`. - -Returns: - A scalar representing the mean of `losses`. If `num_present` is zero, - then zero is returned." -10477,_num_present,tensorflow/tensorflow/python/ops/losses/losses_impl.py,91,function,"Computes the number of elements in the loss function induced by `weights`. - -A given weights tensor induces different numbers of usable elements in the -`losses` tensor. The `weights` tensor is broadcast across `losses` for all -possible dimensions. For example, if `losses` is a tensor of dimension -`[4, 5, 6, 3]` and `weights` is a tensor of shape `[4, 5]`, then `weights` is, -in effect, tiled to match the shape of `losses`. Following this effective -tile, the total number of present elements is the number of non-zero weights. - -Args: - losses: `Tensor` of shape `[batch_size, d1, ... dN]`. - weights: `Tensor` of shape `[]`, `[batch_size]` or - `[batch_size, d1, ... dK]`, where K < N. - per_batch: Whether to return the number of elements per batch or as a sum - total. - -Returns: - The number of present (non-zero) elements in the losses tensor. If - `per_batch` is `True`, the value is returned as a tensor of size - `[batch_size]`. Otherwise, a single scalar tensor is returned." -10478,_num_elements,tensorflow/tensorflow/python/ops/losses/losses_impl.py,133,function,Computes the number of elements in `losses` tensor. -10479,compute_weighted_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,141,function,"Computes the weighted loss. +9897,all,tensorflow/tensorflow/python/ops/losses/losses_impl.py,61,method, +9898,validate,tensorflow/tensorflow/python/ops/losses/losses_impl.py,71,method, +9899,compute_weighted_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,141,function,"Computes the weighted loss. Args: losses: `Tensor` of shape `[batch_size, d1, ... dN]`. @@ -97071,7 +104704,7 @@ Note: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10480,absolute_difference,tensorflow/tensorflow/python/ops/losses/losses_impl.py,210,function,"Adds an Absolute Difference loss to the training procedure. +9900,absolute_difference,tensorflow/tensorflow/python/ops/losses/losses_impl.py,210,function,"Adds an Absolute Difference loss to the training procedure. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a `Tensor` of @@ -97104,7 +104737,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10481,cosine_distance,tensorflow/tensorflow/python/ops/losses/losses_impl.py,265,function,"Adds a cosine-distance loss to the training procedure. +9901,cosine_distance,tensorflow/tensorflow/python/ops/losses/losses_impl.py,265,function,"Adds a cosine-distance loss to the training procedure. Note that the function assumes that `predictions` and `labels` are already unit-normalized. @@ -97133,7 +104766,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10482,hinge_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,321,function,"Adds a hinge loss to the training procedure. +9902,hinge_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,321,function,"Adds a hinge loss to the training procedure. Args: labels: The ground truth output tensor. Its shape should match the shape of @@ -97161,7 +104794,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10483,huber_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,372,function,"Adds a [Huber Loss](https://en.wikipedia.org/wiki/Huber_loss) term to the training procedure. +9903,huber_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,372,function,"Adds a [Huber Loss](https://en.wikipedia.org/wiki/Huber_loss) term to the training procedure. For each value x in `error=labels-predictions`, the following is calculated: @@ -97205,7 +104838,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10484,log_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,449,function,"Adds a Log Loss term to the training procedure. +9904,log_loss,tensorflow/tensorflow/python/ops/losses/losses_impl.py,449,function,"Adds a Log Loss term to the training procedure. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a tensor of size @@ -97239,7 +104872,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10485,mean_pairwise_squared_error,tensorflow/tensorflow/python/ops/losses/losses_impl.py,507,function,"Adds a pairwise-errors-squared loss to the training procedure. +9905,mean_pairwise_squared_error,tensorflow/tensorflow/python/ops/losses/losses_impl.py,507,function,"Adds a pairwise-errors-squared loss to the training procedure. Unlike `mean_squared_error`, which is a measure of the differences between corresponding elements of `predictions` and `labels`, @@ -97284,7 +104917,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10486,mean_squared_error,tensorflow/tensorflow/python/ops/losses/losses_impl.py,604,function,"Adds a Sum-of-Squares loss to the training procedure. +9906,mean_squared_error,tensorflow/tensorflow/python/ops/losses/losses_impl.py,604,function,"Adds a Sum-of-Squares loss to the training procedure. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a tensor of size @@ -97317,7 +104950,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10487,sigmoid_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,658,function,"Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. +9907,sigmoid_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,658,function,"Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a @@ -97355,7 +104988,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10488,softmax_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,724,function,"Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits_v2. +9908,softmax_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,724,function,"Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits_v2. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a @@ -97394,26 +105027,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10489,_remove_squeezable_dimensions,tensorflow/tensorflow/python/ops/losses/losses_impl.py,795,function,"Internal version of _remove_squeezable_dimensions which handles weights. - -Squeezes `predictions` and `labels` if their ranks differ from expected by -exactly 1. -Squeezes `weights` if its rank is 1 more than the new rank of `predictions` - -This will use static shape if available. Otherwise, it will add graph -operations, which could result in a performance hit. - -Args: - labels: Label values, a `Tensor` whose dimensions match `predictions`. - predictions: Predicted values, a `Tensor` of arbitrary dimensions. - weights: Optional weight `Tensor`. It will be squeezed if it's not scalar, - and its rank is 1 more than the new rank of `labels`. - expected_rank_diff: Expected result of `rank(predictions) - rank(labels)`. - -Returns: - Tuple of `predictions`, `labels` and `weights`, possibly with the last - dimension squeezed." -10490,sparse_softmax_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,847,function,"Cross-entropy loss using `tf.nn.sparse_softmax_cross_entropy_with_logits`. +9909,sparse_softmax_cross_entropy,tensorflow/tensorflow/python/ops/losses/losses_impl.py,847,function,"Cross-entropy loss using `tf.nn.sparse_softmax_cross_entropy_with_logits`. `weights` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weights` is a @@ -97447,7 +105061,7 @@ Raises: The `loss_collection` argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a `tf.keras.Model`. @end_compatibility" -10491,squeeze_or_expand_dimensions,tensorflow/tensorflow/python/ops/losses/util.py,34,function,"Squeeze or expand last dimension if needed. +9910,squeeze_or_expand_dimensions,tensorflow/tensorflow/python/ops/losses/util.py,34,function,"Squeeze or expand last dimension if needed. 1. Squeezes last dim of `y_pred` or `y_true` if their rank differs by 1 (using `confusion_matrix.remove_squeezable_dimensions`). @@ -97469,7 +105083,7 @@ Returns: the last dimension squeezed, `sample_weight` could be extended by one dimension. If `sample_weight` is None, (y_pred, y_true) is returned." -10492,scale_losses_by_sample_weight,tensorflow/tensorflow/python/ops/losses/util.py,123,function,"Scales loss values by the given sample weights. +9911,scale_losses_by_sample_weight,tensorflow/tensorflow/python/ops/losses/util.py,123,function,"Scales loss values by the given sample weights. `sample_weight` dimensions are updated to match with the dimension of `losses` if possible by using squeeze/expand/broadcast. @@ -97480,19 +105094,19 @@ Args: Returns: `losses` scaled by `sample_weight` with dtype float32." -10493,check_per_example_loss_rank,tensorflow/tensorflow/python/ops/losses/util.py,148,function,"Context manager that checks that the rank of per_example_loss is atleast 1. +9912,check_per_example_loss_rank,tensorflow/tensorflow/python/ops/losses/util.py,148,function,"Context manager that checks that the rank of per_example_loss is atleast 1. Args: per_example_loss: Per example loss tensor. Yields: A context manager." -10494,add_loss,tensorflow/tensorflow/python/ops/losses/util.py,178,function,"Adds a externally defined loss to the collection of losses. +9913,add_loss,tensorflow/tensorflow/python/ops/losses/util.py,178,function,"Adds a externally defined loss to the collection of losses. Args: loss: A loss `Tensor`. loss_collection: Optional collection to add the loss to." -10495,get_losses,tensorflow/tensorflow/python/ops/losses/util.py,193,function,"Gets the list of losses from the loss_collection. +9914,get_losses,tensorflow/tensorflow/python/ops/losses/util.py,193,function,"Gets the list of losses from the loss_collection. Args: scope: An optional scope name for filtering the losses to return. @@ -97500,14 +105114,14 @@ Args: Returns: a list of loss tensors." -10496,get_regularization_losses,tensorflow/tensorflow/python/ops/losses/util.py,207,function,"Gets the list of regularization losses. +9915,get_regularization_losses,tensorflow/tensorflow/python/ops/losses/util.py,207,function,"Gets the list of regularization losses. Args: scope: An optional scope name for filtering the losses to return. Returns: A list of regularization losses as Tensors." -10497,get_regularization_loss,tensorflow/tensorflow/python/ops/losses/util.py,220,function,"Gets the total regularization loss. +9916,get_regularization_loss,tensorflow/tensorflow/python/ops/losses/util.py,220,function,"Gets the total regularization loss. Args: scope: An optional scope name for filtering the losses to return. @@ -97515,7 +105129,7 @@ Args: Returns: A scalar regularization loss." -10498,get_total_loss,tensorflow/tensorflow/python/ops/losses/util.py,238,function,"Returns a tensor whose value represents the total loss. +9917,get_total_loss,tensorflow/tensorflow/python/ops/losses/util.py,238,function,"Returns a tensor whose value represents the total loss. In particular, this adds any losses you have added with `tf.add_loss()` to any regularization losses that have been added by regularization parameters @@ -97536,30 +105150,28 @@ Returns: Raises: ValueError: if `losses` is not iterable." -10499,LossesUtilTest,tensorflow/tensorflow/python/ops/losses/util_test.py,28,class, -10500,max,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,185,function, -10501,min,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,190,function, -10502,round,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,195,function, -10503,empty,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,49,function, -10504,empty_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,54,function, -10505,zeros,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,59,function, -10506,zeros_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,68,function, -10507,ones,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,83,function, -10508,ones_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,92,function, -10509,eye,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,103,function, -10510,identity,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,135,function, -10511,full,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,140,function, -10512,full_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,152,function,"order, subok and shape arguments mustn't be changed." -10513,_array_internal,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,168,function,Main implementation of np.array(). -10514,array,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,225,function,"Since Tensors are immutable, a copy is made only if val is placed on a +9918,max,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,185,function, +9919,min,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,190,function, +9920,round,tensorflow/tensorflow/python/ops/numpy_ops/__init__.py,195,function, +9921,empty,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,49,function, +9922,empty_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,54,function, +9923,zeros,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,59,function, +9924,zeros_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,68,function, +9925,ones,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,83,function, +9926,ones_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,92,function, +9927,eye,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,103,function, +9928,identity,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,135,function, +9929,full,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,140,function, +9930,full_like,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,152,function,"order, subok and shape arguments mustn't be changed." +9931,array,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,225,function,"Since Tensors are immutable, a copy is made only if val is placed on a different device than the current one. Even if `copy` is False, a new Tensor may need to be built to satisfy `dtype` and `ndim`. This is used only if `val` is an ndarray or a Tensor." -10515,asarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,241,function, -10516,asanyarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,250,function, -10517,ascontiguousarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,255,function, -10518,arange,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,261,function,"Returns `step`-separated values in the range [start, stop). +9932,asarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,241,function, +9933,asanyarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,250,function, +9934,ascontiguousarray,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,255,function, +9935,arange,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,261,function,"Returns `step`-separated values in the range [start, stop). Args: start: Start of the interval. Included in the range. @@ -97576,130 +105188,65 @@ Args: Raises: ValueError: If step is zero." -10519,diag,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,303,function,Raises an error if input is not 1- or 2-d. -10520,diagonal,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,338,function, -10521,diagflat,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,369,function, -10522,_promote_dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,374,function, -10523,_promote_dtype_binary,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,383,function, -10524,all,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,393,function, -10525,any,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,400,function, -10526,compress,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,407,function, -10527,copy,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,438,function, -10528,_maybe_promote_to_int,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,442,function, -10529,cumprod,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,454,function, -10530,cumsum,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,470,function, -10531,imag,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,486,function, -10532,_reduce,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,497,function,"A general reduction function. - -Args: - tf_fn: the TF reduction function. - a: the array to be reduced. - axis: (optional) the axis along which to do the reduction. If None, all - dimensions are reduced. - dtype: (optional) the dtype of the result. - keepdims: (optional) whether to keep the reduced dimension(s). - promote_int: how to promote integer and bool inputs. There are three - choices. (1) `_TO_INT_` always promotes them to np.int_ or np.uint; (2) - `_TO_FLOAT` always promotes them to a float type (determined by - dtypes.default_float_type); (3) None: don't promote. - tf_bool_fn: (optional) the TF reduction function for bool inputs. It will - only be used if `dtype` is explicitly set to `np.bool_` or if `a`'s dtype - is `np.bool_` and `preserve_bool` is True. - preserve_bool: a flag to control whether to use `tf_bool_fn` if `a`'s dtype - is `np.bool_` (some reductions such as np.sum convert bools to integers, - while others such as np.max preserve bools. - -Returns: - An ndarray." -10533,sum,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,566,function, -10534,prod,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,577,function, -10535,mean,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,588,function, -10536,amax,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,599,function, -10537,amin,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,612,function, -10538,var,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,625,function, -10539,std,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,672,function, -10540,ravel,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,683,function, -10541,real,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,695,function, -10542,repeat,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,703,function, -10543,around,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,734,function, -10544,reshape,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,756,function,order argument can only b 'C' or 'F'. -10545,_reshape_method_wrapper,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,776,function, -10546,expand_dims,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,788,function, -10547,squeeze,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,794,function, -10548,transpose,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,800,function, -10549,swapaxes,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,808,function, -10550,moveaxis,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,824,function,"Raises ValueError if source, destination not in (-ndim(a), ndim(a))." -10551,pad,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,888,function,"Only supports modes 'constant', 'reflect' and 'symmetric' currently." -10552,take,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,905,function,"out argument is not supported, and default mode is clip." -10553,where,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,932,function,Raises ValueError if exactly one of x or y is not None. -10554,select,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,945,function, -10555,shape,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,962,function, -10556,ndim,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,968,function, -10557,isscalar,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,974,function, -10558,_boundaries_to_sizes,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,978,function,"Converting boundaries of splits to sizes of splits. - -Args: - a: the array to be split. - boundaries: the boundaries, as in np.split. - axis: the axis along which to split. - -Returns: - A list of sizes of the splits, as in tf.split." -10559,split,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1009,function, -10560,_split_on_axis,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1017,function, -10561,broadcast_to,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1032,function, -10562,stack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1037,function, -10563,hstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1052,function, -10564,vstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1066,function, -10565,dstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1076,function, -10566,_pad_left_to,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1085,function, -10567,_atleast_nd,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1093,function,"Reshape arrays to be at least `n`-dimensional. - -Args: - n: The minimal rank. - new_shape: a function that takes `n` and the old shape and returns the - desired new shape. - *arys: ndarray(s) to be reshaped. - -Returns: - The reshaped array(s)." -10568,atleast_1d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1123,function, -10569,atleast_2d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1128,function, -10570,atleast_3d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1133,function, -10571,nonzero,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1150,function, -10572,diag_indices,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1164,function, -10573,tri,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1177,function, -10574,tril,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1204,function, -10575,triu,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1226,function, -10576,flip,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1248,function, -10577,flipud,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1261,function, -10578,fliplr,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1266,function, -10579,roll,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1271,function, -10580,rot90,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1284,function, -10581,vander,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1304,function, -10582,ix_,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1343,function, -10583,broadcast_arrays,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1375,function, -10584,sign,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1388,function, -10585,take_along_axis,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1409,function, -10586,_as_index,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1472,function,"Helper function to parse idx as an index. - -Args: - idx: index - need_scalar: If idx needs to be a scalar value. - -Returns: - A pair, (indx, bool). First one is the parsed index and can be a tensor, - or scalar integer / Dimension. Second one is True if rank is known to be 0. - -Raises: - IndexError: For incorrect indices." -10587,_slice_helper,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1512,function,Helper function for __getitem__. -10588,_as_spec_tuple,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1654,function,Convert slice_spec to tuple. -10589,_getitem,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1671,function,Implementation of ndarray.__getitem__. -10590,ArrayCreationTest,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops_test.py,38,class, -10591,ArrayMethodsTest,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops_test.py,525,class, -10592,ArrayManipulationTest,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops_test.py,1058,class, -10593,convert_to_tensor,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,37,function,"Wrapper over `tf.convert_to_tensor`. +9936,diag,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,303,function,Raises an error if input is not 1- or 2-d. +9937,diagonal,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,338,function, +9938,diagflat,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,369,function, +9939,all,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,393,function, +9940,any,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,400,function, +9941,compress,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,407,function, +9942,copy,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,438,function, +9943,cumprod,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,454,function, +9944,cumsum,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,470,function, +9945,imag,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,486,function, +9946,sum,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,566,function, +9947,prod,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,577,function, +9948,mean,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,588,function, +9949,amax,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,599,function, +9950,amin,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,612,function, +9951,var,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,625,function, +9952,std,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,672,function, +9953,ravel,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,683,function, +9954,real,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,695,function, +9955,repeat,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,703,function, +9956,around,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,734,function, +9957,reshape,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,756,function,order argument can only b 'C' or 'F'. +9958,expand_dims,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,788,function, +9959,squeeze,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,794,function, +9960,transpose,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,800,function, +9961,swapaxes,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,808,function, +9962,moveaxis,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,824,function,"Raises ValueError if source, destination not in (-ndim(a), ndim(a))." +9963,pad,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,888,function,"Only supports modes 'constant', 'reflect' and 'symmetric' currently." +9964,take,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,905,function,"out argument is not supported, and default mode is clip." +9965,where,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,932,function,Raises ValueError if exactly one of x or y is not None. +9966,select,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,945,function, +9967,shape,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,962,function, +9968,ndim,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,968,function, +9969,isscalar,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,974,function, +9970,split,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1009,function, +9971,broadcast_to,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1032,function, +9972,stack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1037,function, +9973,hstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1052,function, +9974,vstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1066,function, +9975,dstack,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1076,function, +9976,atleast_1d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1123,function, +9977,atleast_2d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1128,function, +9978,atleast_3d,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1133,function, +9979,nonzero,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1150,function, +9980,diag_indices,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1164,function, +9981,tri,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1177,function, +9982,tril,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1204,function, +9983,triu,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1226,function, +9984,flip,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1248,function, +9985,flipud,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1261,function, +9986,fliplr,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1266,function, +9987,roll,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1271,function, +9988,rot90,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1284,function, +9989,vander,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1304,function, +9990,ix_,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1343,function, +9991,broadcast_arrays,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1375,function, +9992,sign,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1388,function, +9993,take_along_axis,tensorflow/tensorflow/python/ops/numpy_ops/np_array_ops.py,1409,function, +9994,convert_to_tensor,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,37,function,"Wrapper over `tf.convert_to_tensor`. Args: value: value to convert @@ -97711,8 +105258,8 @@ Args: Returns: Value converted to tf.Tensor." -10594,NdarraySpec,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,61,class,Type specification for a `tf.experiemntal.numpy.ndarray`. -10595,ndarray,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,99,class,"Equivalent of numpy.ndarray backed by TensorFlow tensors. +9995,NdarraySpec,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,61,class,Type specification for a `tf.experiemntal.numpy.ndarray`. +9996,ndarray,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,99,class,"Equivalent of numpy.ndarray backed by TensorFlow tensors. This does not support all features of NumPy ndarrays e.g. strides and memory order since, unlike NumPy, the backing storage is not a raw memory @@ -97720,169 +105267,157 @@ buffer. TODO(srbs): Clearly specify which attributes and methods are not supported or if there are any differences in behavior." -10596,tensor_to_ndarray,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,326,function, -10597,ndarray_to_tensor,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,330,function, -10598,ArrayTest,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays_test.py,38,class, -10599,is_allow_float64,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,69,function, -10600,set_allow_float64,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,73,function, -10601,canonicalize_dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,78,function, -10602,_result_type,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,87,function, -10603,_get_cached_dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,92,function,Returns an np.dtype for the TensorFlow DType. -10604,default_float_type,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,104,function,"Gets the default float type. +9997,from_tensor,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,165,method, +9998,data,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,182,method,"Tensor object containing the array data. + +This has a few key differences from the Python buffer object used in +NumPy arrays. +1. Tensors are immutable. So operations requiring in-place edit, e.g. + __setitem__, are performed by replacing the underlying buffer with a new + one. +2. Tensors do not provide access to their raw buffer. + +Returns: + A Tensor." +9999,shape,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,198,method,Returns a tuple or tf.Tensor of array dimensions. +10000,dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,207,method, +10001,ndim,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,216,method, +10002,size,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,224,method,Returns the number of elements in the array. +10003,T,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,233,method, +10004,astype,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,245,method, +10005,tolist,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,316,method, +10006,tensor_to_ndarray,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,326,function, +10007,ndarray_to_tensor,tensorflow/tensorflow/python/ops/numpy_ops/np_arrays.py,330,function, +10008,is_allow_float64,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,69,function, +10009,set_allow_float64,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,73,function, +10010,canonicalize_dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,78,function, +10011,default_float_type,tensorflow/tensorflow/python/ops/numpy_ops/np_dtypes.py,104,function,"Gets the default float type. Returns: If `is_allow_float64()` is true, returns float64; otherwise returns float32." -10605,public_name,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,24,function, -10606,np_export,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,28,function, -10607,np_export_constant,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,32,function, -10608,ReadmeTest,tensorflow/tensorflow/python/ops/numpy_ops/np_interop_test.py,28,class, -10609,InteropTest,tensorflow/tensorflow/python/ops/numpy_ops/np_interop_test.py,71,class, -10610,FunctionTest,tensorflow/tensorflow/python/ops/numpy_ops/np_interop_test.py,319,class, -10611,VariableTest,tensorflow/tensorflow/python/ops/numpy_ops/np_interop_test.py,366,class, -10612,LogicTest,tensorflow/tensorflow/python/ops/numpy_ops/np_logic_test.py,31,class, -10613,make_numpy_compatible,tensorflow/tensorflow/python/ops/numpy_ops/np_logic_test.py,104,function, -10614,dot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,54,function, -10615,_bin_op,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,71,function, -10616,add,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,81,function, -10617,subtract,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,93,function, -10618,multiply,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,98,function, -10619,true_divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,110,function, -10620,divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,134,function, -10621,floor_divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,139,function, -10622,mod,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,152,function, -10623,remainder,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,165,function, -10624,divmod,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,170,function, -10625,maximum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,175,function, -10626,minimum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,194,function, -10627,clip,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,206,function, -10628,matmul,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,221,function, -10629,tensordot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,242,function, -10630,inner,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,247,function, -10631,cross,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,260,function, -10632,vdot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,336,function, -10633,power,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,346,function, -10634,float_power,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,351,function, -10635,arctan2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,356,function, -10636,nextafter,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,361,function, -10637,heaviside,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,366,function, -10638,hypot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,380,function, -10639,kron,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,385,function, -10640,outer,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,416,function, -10641,logaddexp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,426,function, -10642,logaddexp2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,436,function, -10643,polyval,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,446,function, -10644,isclose,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,464,function, -10645,allclose,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,482,function, -10646,_tf_gcd,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,487,function, -10647,gcd,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,517,function, -10648,lcm,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,523,function, -10649,_bitwise_binary_op,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,537,function, -10650,bitwise_and,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,554,function, -10651,bitwise_or,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,559,function, -10652,bitwise_xor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,564,function, -10653,bitwise_not,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,569,function, -10654,_scalar,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,579,function,"Computes the tf_fn(x) for each element in `x`. - -Args: - tf_fn: function that takes a single Tensor argument. - x: array_like. Could be an ndarray, a Tensor or any object that can be - converted to a Tensor using `ops.convert_to_tensor`. - promote_to_float: whether to cast the argument to a float dtype - (`np_dtypes.default_float_type`) if it is not already. - -Returns: - An ndarray with the same shape as `x`. The default output dtype is - determined by `np_dtypes.default_float_type`, unless x is an ndarray with a - floating point type, in which case the output type is same as x.dtype." -10655,log,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,601,function, -10656,exp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,606,function, -10657,sqrt,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,611,function, -10658,abs,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,616,function, -10659,absolute,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,621,function, -10660,fabs,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,626,function, -10661,ceil,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,631,function, -10662,floor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,636,function, -10663,conj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,641,function, -10664,negative,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,646,function, -10665,reciprocal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,651,function, -10666,signbit,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,656,function, -10667,sin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,667,function, -10668,cos,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,672,function, -10669,tan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,677,function, -10670,sinh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,682,function, -10671,cosh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,687,function, -10672,tanh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,692,function, -10673,arcsin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,697,function, -10674,arccos,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,702,function, -10675,arctan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,707,function, -10676,arcsinh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,712,function, -10677,arccosh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,717,function, -10678,arctanh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,722,function, -10679,deg2rad,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,727,function, -10680,rad2deg,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,736,function, -10681,angle,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,746,function, -10682,cbrt,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,762,function, -10683,conjugate,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,773,function, -10684,exp2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,778,function, -10685,expm1,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,787,function, -10686,fix,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,792,function, -10687,iscomplex,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,801,function, -10688,isreal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,806,function, -10689,iscomplexobj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,811,function, -10690,isrealobj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,817,function, -10691,isnan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,822,function, -10692,_make_nan_reduction,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,826,function,Helper to generate nan* functions. -10693,nanmean,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,847,function, -10694,isfinite,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,860,function, -10695,isinf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,865,function, -10696,isneginf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,870,function, -10697,isposinf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,875,function, -10698,log2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,880,function, -10699,log10,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,885,function, -10700,log1p,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,890,function, -10701,positive,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,895,function, -10702,sinc,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,900,function, -10703,square,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,911,function, -10704,diff,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,916,function, -10705,_wrap,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,943,function,Wraps binary ops so they can be added as operator overloads on ndarray. -10706,_comparison,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,978,function,Helper function for comparision. -10707,equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,993,function, -10708,not_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,998,function, -10709,greater,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1003,function, -10710,greater_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1008,function, -10711,less,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1013,function, -10712,less_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1018,function, -10713,array_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1023,function, -10714,_logical_binary_op,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1039,function, -10715,logical_and,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1046,function, -10716,logical_or,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1051,function, -10717,logical_xor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1056,function, -10718,logical_not,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1061,function, -10719,linspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1076,function, -10720,logspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1115,function, -10721,geomspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1126,function, -10722,ptp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1150,function, -10723,concatenate,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1156,function, -10724,tile,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1167,function, -10725,count_nonzero,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1184,function, -10726,argsort,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1190,function, -10727,sort,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1215,function, -10728,_argminmax,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1230,function, -10729,argmax,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1241,function, -10730,argmin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1246,function, -10731,append,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1251,function, -10732,average,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1259,function, -10733,trace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1322,function, -10734,meshgrid,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1340,function,This currently requires copy=True and sparse=False. -10735,einsum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1364,function, -10736,MathTest,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops_test.py,34,class, -10737,seed,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,37,function,"Sets the seed for the random number generator. +10012,public_name,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,24,function, +10013,np_export,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,28,function, +10014,np_export_constant,tensorflow/tensorflow/python/ops/numpy_ops/np_export.py,32,function, +10015,make_numpy_compatible,tensorflow/tensorflow/python/ops/numpy_ops/np_logic_test.py,104,function, +10016,dot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,54,function, +10017,add,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,81,function, +10018,subtract,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,93,function, +10019,multiply,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,98,function, +10020,true_divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,110,function, +10021,divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,134,function, +10022,floor_divide,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,139,function, +10023,mod,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,152,function, +10024,divmod,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,170,function, +10025,maximum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,175,function, +10026,minimum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,194,function, +10027,clip,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,206,function, +10028,matmul,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,221,function, +10029,tensordot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,242,function, +10030,inner,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,247,function, +10031,cross,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,260,function, +10032,vdot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,336,function, +10033,power,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,346,function, +10034,float_power,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,351,function, +10035,arctan2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,356,function, +10036,nextafter,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,361,function, +10037,heaviside,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,366,function, +10038,hypot,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,380,function, +10039,kron,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,385,function, +10040,outer,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,416,function, +10041,logaddexp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,426,function, +10042,logaddexp2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,436,function, +10043,polyval,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,446,function, +10044,isclose,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,464,function, +10045,allclose,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,482,function, +10046,gcd,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,517,function, +10047,lcm,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,523,function, +10048,bitwise_and,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,554,function, +10049,bitwise_or,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,559,function, +10050,bitwise_xor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,564,function, +10051,bitwise_not,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,569,function, +10052,log,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,601,function, +10053,exp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,606,function, +10054,sqrt,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,611,function, +10055,abs,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,616,function, +10056,absolute,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,621,function, +10057,fabs,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,626,function, +10058,ceil,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,631,function, +10059,floor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,636,function, +10060,conj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,641,function, +10061,negative,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,646,function, +10062,reciprocal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,651,function, +10063,signbit,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,656,function, +10064,sin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,667,function, +10065,cos,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,672,function, +10066,tan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,677,function, +10067,sinh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,682,function, +10068,cosh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,687,function, +10069,tanh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,692,function, +10070,arcsin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,697,function, +10071,arccos,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,702,function, +10072,arctan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,707,function, +10073,arcsinh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,712,function, +10074,arccosh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,717,function, +10075,arctanh,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,722,function, +10076,deg2rad,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,727,function, +10077,rad2deg,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,736,function, +10078,angle,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,746,function, +10079,cbrt,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,762,function, +10080,conjugate,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,773,function, +10081,exp2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,778,function, +10082,expm1,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,787,function, +10083,fix,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,792,function, +10084,iscomplex,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,801,function, +10085,isreal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,806,function, +10086,iscomplexobj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,811,function, +10087,isrealobj,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,817,function, +10088,isnan,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,822,function, +10089,nanmean,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,847,function, +10090,isfinite,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,860,function, +10091,isinf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,865,function, +10092,isneginf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,870,function, +10093,isposinf,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,875,function, +10094,log2,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,880,function, +10095,log10,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,885,function, +10096,log1p,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,890,function, +10097,positive,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,895,function, +10098,sinc,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,900,function, +10099,square,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,911,function, +10100,diff,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,916,function, +10101,equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,993,function, +10102,not_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,998,function, +10103,greater,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1003,function, +10104,greater_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1008,function, +10105,less,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1013,function, +10106,less_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1018,function, +10107,array_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1023,function, +10108,logical_and,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1046,function, +10109,logical_or,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1051,function, +10110,logical_xor,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1056,function, +10111,logical_not,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1061,function, +10112,linspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1076,function, +10113,logspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1115,function, +10114,geomspace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1126,function, +10115,ptp,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1150,function, +10116,concatenate,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1156,function, +10117,tile,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1167,function, +10118,count_nonzero,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1184,function, +10119,argsort,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1190,function, +10120,sort,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1215,function, +10121,argmax,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1241,function, +10122,argmin,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1246,function, +10123,append,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1251,function, +10124,average,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1259,function, +10125,trace,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1322,function, +10126,meshgrid,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1340,function,This currently requires copy=True and sparse=False. +10127,einsum,tensorflow/tensorflow/python/ops/numpy_ops/np_math_ops.py,1364,function, +10128,seed,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,37,function,"Sets the seed for the random number generator. Uses `tf.set_random_seed`. Args: s: an integer." -10738,randn,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,54,function,"Returns samples from a normal distribution. +10129,randn,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,54,function,"Returns samples from a normal distribution. Uses `tf.random_normal`. @@ -97891,58 +105426,16 @@ Args: Returns: An ndarray with shape `args` and dtype `float64`." -10739,uniform,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,73,function, -10740,random,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,85,function, -10741,rand,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,90,function, -10742,randint,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,95,function, -10743,SeedTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,35,class, -10744,RandomTestBase,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,44,class, -10745,RandNTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,65,class, -10746,UniformTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,81,class, -10747,RandomTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,109,class, -10748,RandTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,121,class, -10749,RandIntTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,133,class, -10750,RandNDistriutionTest,tensorflow/tensorflow/python/ops/numpy_ops/np_random_test.py,147,class, -10751,_canonicalize_axis,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,44,function, -10752,_canonicalize_axes,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,48,function, -10753,_supports_signature,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,60,function, -10754,_to_tf_type,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,64,function,"Converts a native python or numpy type to TF DType. - -Args: - dtype: Could be a python type, a numpy type or a TF DType. - -Returns: - A tensorflow `DType`." -10755,_to_numpy_type,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,76,function,"Converts a native python or TF DType to numpy type. - -Args: - dtype: Could be a python type, a numpy type or a TF DType. - -Returns: - A NumPy `dtype`." -10756,isscalar,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,90,function,Returns whether `val` is a scalar value or scalar Tensor. -10757,_has_docstring,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,104,function, -10758,_add_blank_line,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,109,function, -10759,_np_signature,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,116,function,An enhanced inspect.signature that can handle numpy.ufunc. -10760,_is_compatible_param_kind,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,170,function, -10761,_prepare_np_fun_name_and_fun,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,180,function,"Mutually propagates information between `np_fun_name` and `np_fun`. - -If one is None and the other is not, we'll try to make the former not None in -a best effort. - -Args: - np_fun_name: name for the np_fun symbol. At least one of np_fun or - np_fun_name shoud be set. - np_fun: the numpy function whose docstring will be used. - -Returns: - Processed `np_fun_name` and `np_fun`." -10762,_np_doc_helper,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,210,function,Helper to get docs. -10763,get_np_doc_form,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,231,function,"Gets the form of the original numpy docstrings. +10130,uniform,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,73,function, +10131,random,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,85,function, +10132,rand,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,90,function, +10133,randint,tensorflow/tensorflow/python/ops/numpy_ops/np_random.py,95,function, +10134,isscalar,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,90,function,Returns whether `val` is a scalar value or scalar Tensor. +10135,get_np_doc_form,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,231,function,"Gets the form of the original numpy docstrings. Returns: See `set_np_doc_form` for the list of valid values." -10764,set_np_doc_form,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,240,function,"Selects the form of the original numpy docstrings. +10136,set_np_doc_form,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,240,function,"Selects the form of the original numpy docstrings. This function sets a global variable that controls how a tf-numpy symbol's docstring should refer to the original numpy docstring. If `value` is @@ -97956,20 +105449,9 @@ added. Which numpy version the link points to depends on `value`: Args: value: the value to set the global variable to." -10765,_add_np_doc,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,260,function,"Appends the numpy docstring to `doc`, according to `set_np_doc_form`. - -See `set_np_doc_form` for how it controls the form of the numpy docstring. - -Args: - doc: the docstring to be appended to. - np_fun_name: the name of the numpy function. - np_f: (optional) the numpy function. - -Returns: - `doc` with numpy docstring appended." -10766,is_sig_mismatch_an_error,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,305,function, -10767,set_is_sig_mismatch_an_error,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,309,function, -10768,np_doc,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,314,function,"Attachs numpy docstring to a function. +10137,is_sig_mismatch_an_error,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,305,function, +10138,set_is_sig_mismatch_an_error,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,309,function, +10139,np_doc,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,314,function,"Attachs numpy docstring to a function. Args: np_fun_name: name for the np_fun symbol. At least one of np_fun or @@ -97983,7 +105465,7 @@ Args: Returns: A function decorator that attaches the docstring from `np_fun` to the decorated function." -10769,np_doc_only,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,378,function,"Attachs numpy docstring to a function. +10140,np_doc_only,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,378,function,"Attachs numpy docstring to a function. This differs from np_doc in that it doesn't check for a match in signature. @@ -97999,20 +105481,18 @@ Args: Returns: A function decorator that attaches the docstring from `np_fun` to the decorated function." -10770,finfo,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,410,function,"Note that currently it just forwards to the numpy namesake, while +10141,finfo,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,410,function,"Note that currently it just forwards to the numpy namesake, while tensorflow and numpy dtypes may have different properties." -10771,_maybe_get_dtype,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,417,function,Returns a numpy type if available from x. Skips if x is numpy.ndarray. -10772,result_type,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,436,function, -10773,_result_type_binary,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,446,function,A specialization of result_type for 2 arguments for performance reasons. -10774,promote_types,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,456,function, -10775,tf_broadcast,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,462,function,"Broadcast tensors. +10142,result_type,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,436,function, +10143,promote_types,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,456,function, +10144,tf_broadcast,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,462,function,"Broadcast tensors. Args: *args: a list of tensors whose shapes are broadcastable against each other. Returns: Tensors broadcasted to the common shape." -10776,get_static_value,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,483,function,"A version of tf.get_static_value that returns None on float dtypes. +10145,get_static_value,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,483,function,"A version of tf.get_static_value that returns None on float dtypes. It returns None on float dtypes in order to avoid breaking gradients. @@ -98022,32 +105502,38 @@ Args: Returns: Same as `tf.get_static_value`, except that it returns None when `x` has a float dtype." -10777,_maybe_static,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,500,function, -10778,cond,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,512,function,A version of tf.cond that tries to evaluate the condition. -10779,add,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,523,function,A version of tf.add that eagerly evaluates if possible. -10780,subtract,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,528,function,A version of tf.subtract that eagerly evaluates if possible. -10781,greater,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,533,function,A version of tf.greater that eagerly evaluates if possible. -10782,greater_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,538,function,A version of tf.greater_equal that eagerly evaluates if possible. -10783,less_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,543,function,A version of tf.less_equal that eagerly evaluates if possible. -10784,logical_and,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,548,function,A version of tf.logical_and that eagerly evaluates if possible. -10785,logical_or,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,563,function,A version of tf.logical_or that eagerly evaluates if possible. -10786,getitem,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,578,function,A version of __getitem__ that eagerly evaluates if possible. -10787,reduce_all,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,583,function,A version of tf.reduce_all that eagerly evaluates if possible. -10788,reduce_any,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,592,function,A version of tf.reduce_any that eagerly evaluates if possible. -10789,tf_rank,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,601,function, -10790,UtilsTest,tensorflow/tensorflow/python/ops/numpy_ops/np_utils_test.py,27,class, -10791,PublicSymbolTest,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/public_symbol_test.py,28,class, -10792,MicroBenchmarks,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,46,class,Main micro benchmark class. -10793,MLP,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/numpy_mlp.py,27,class,"MLP model. +10146,cond,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,512,function,A version of tf.cond that tries to evaluate the condition. +10147,add,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,523,function,A version of tf.add that eagerly evaluates if possible. +10148,subtract,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,528,function,A version of tf.subtract that eagerly evaluates if possible. +10149,greater,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,533,function,A version of tf.greater that eagerly evaluates if possible. +10150,greater_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,538,function,A version of tf.greater_equal that eagerly evaluates if possible. +10151,less_equal,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,543,function,A version of tf.less_equal that eagerly evaluates if possible. +10152,logical_and,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,548,function,A version of tf.logical_and that eagerly evaluates if possible. +10153,logical_or,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,563,function,A version of tf.logical_or that eagerly evaluates if possible. +10154,getitem,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,578,function,A version of __getitem__ that eagerly evaluates if possible. +10155,reduce_all,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,583,function,A version of tf.reduce_all that eagerly evaluates if possible. +10156,reduce_any,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,592,function,A version of tf.reduce_any that eagerly evaluates if possible. +10157,tf_rank,tensorflow/tensorflow/python/ops/numpy_ops/np_utils.py,601,function, +10158,MicroBenchmarks,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,46,class,Main micro benchmark class. +10159,benchmark_tf_np_mlp_inference_batch_1_cpu,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,83,method, +10160,benchmark_tf_np_tf_function_mlp_inference_batch_1_cpu,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,89,method, +10161,benchmark_numpy_mlp_inference_batch_1_cpu,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,96,method, +10162,benchmark_count_nonzero,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,136,method, +10163,benchmark_log,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,139,method, +10164,benchmark_exp,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,142,method, +10165,benchmark_tanh,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,145,method, +10166,benchmark_matmul,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py,148,method, +10167,MLP,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/numpy_mlp.py,27,class,"MLP model. T = Relu(Add(MatMul(A, B), C)) R = Relu(Add(MatMul(T, D), E))" -10794,MLP,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/tf_numpy_mlp.py,29,class,"MLP model. +10168,inference,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/numpy_mlp.py,45,method, +10169,MLP,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/tf_numpy_mlp.py,29,class,"MLP model. T = Relu(Add(MatMul(A, B), C)) R = Relu(Add(MatMul(T, D), E))" -10795,ArrayTest,tensorflow/tensorflow/python/ops/parallel_for/array_test.py,36,class, -10796,for_loop,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,44,function,"Runs `loop_fn` `iters` times and stacks the outputs. +10170,inference,tensorflow/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/tf_numpy_mlp.py,47,method, +10171,for_loop,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,44,function,"Runs `loop_fn` `iters` times and stacks the outputs. Runs `loop_fn` `iters` times, with input values from 0 to `iters - 1`, and @@ -98065,9 +105551,7 @@ Args: Returns: Returns a nested structure of stacked output tensor objects with the same nested structure as the output of `loop_fn`." -10797,_flatten_first_two_dims,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,110,function,Flattens the first two dimensions of x into a single dimension. -10798,_is_under_xla_context,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,121,function,Check if we are currently inside an XLA compile context. -10799,pfor,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,136,function,"Equivalent to running `loop_fn` `iters` times and stacking the outputs. +10172,pfor,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,136,function,"Equivalent to running `loop_fn` `iters` times and stacking the outputs. `pfor` has functionality similar to `for_loop`, i.e. running `loop_fn` `iters` times, with input from 0 to `iters - 1`, and stacking corresponding output of @@ -98114,9 +105598,7 @@ Returns: structure as the output of `loop_fn`. Raises: ValueError: If parallel_iterations is not None and not an integer > 1." -10800,_loop_fn_has_config,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,210,function,Test if `loop_fn` has a `pfor_config` argument. -10801,_pfor_impl,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,228,function,Implementation of pfor. -10802,vectorized_map,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,353,function,"Parallel map on the list of tensors unpacked from `elems` on dimension 0. +10173,vectorized_map,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops.py,353,function,"Parallel map on the list of tensors unpacked from `elems` on dimension 0. This method works similar to `tf.map_fn` but is optimized to run much faster, @@ -98201,33 +105683,22 @@ Returns: Raises: ValueError: If vectorization fails and fallback_to_while_loop is False." -10803,PForTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,73,class, -10804,IndexedSlicesTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,156,class, -10805,ReductionTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,179,class, -10806,BitwiseTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,282,class, -10807,ImageTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,325,class, -10808,NNTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,356,class, -10809,RandomTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,610,class, -10810,StatelessRandomTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,705,class, -10811,LoggingTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,740,class, -10812,TensorArrayTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,763,class, -10813,TensorListTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,892,class, -10814,StackTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1022,class, -10815,WhileV1Test,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1093,class, -10816,dynamic_lstm_input_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1288,function, -10817,create_dynamic_lstm,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1298,function, -10818,WhileV2Test,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1353,class, -10819,NestedControlFlowTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1492,class, -10820,StatelessIfTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1551,class, -10821,IfTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1599,class, -10822,RNNTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1616,class, -10823,Benchmarks,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1634,class, -10824,SparseTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1764,class, -10825,ParsingTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1872,class, -10826,PartitionedCallTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1923,class, -10827,SpectralTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,2009,class, -10828,VariableTest,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,2071,class, -10829,jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients.py,28,function,"Computes jacobian of `output` w.r.t. `inputs`. +10174,dynamic_lstm_input_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1288,function, +10175,create_dynamic_lstm,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1298,function, +10176,Benchmarks,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1634,class, +10177,benchmark_sess_run_overhead,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1660,method, +10178,benchmark_add,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1665,method, +10179,benchmark_matmul,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1685,method, +10180,benchmark_map_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1704,method, +10181,benchmark_basic_while,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1721,method, +10182,benchmark_dynamic_rnn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1736,method, +10183,benchmark_reduction,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1743,method, +10184,loop_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1672,method, +10185,loop_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1692,method, +10186,pfor_map_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1711,method, +10187,loop_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1724,method, +10188,loop_fn,tensorflow/tensorflow/python/ops/parallel_for/control_flow_ops_test.py,1749,method, +10189,jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients.py,28,function,"Computes jacobian of `output` w.r.t. `inputs`. Args: output: A tensor. @@ -98245,7 +105716,7 @@ Returns: [y_1, ..., y_n, x_1, ..., x_m]. Note that in cases where the gradient is sparse (IndexedSlices), jacobian function currently makes it dense and returns a Tensor instead. This may change in the future." -10830,batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients.py,83,function,"Computes and stacks jacobians of `output[i,...]` w.r.t. `input[i,...]`. +10190,batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients.py,83,function,"Computes and stacks jacobians of `output[i,...]` w.r.t. `input[i,...]`. e.g. x = tf.constant([[1, 2], [3, 4]], dtype=tf.float32) @@ -98272,33 +105743,53 @@ Returns: Raises: ValueError: if first dimension of `output` and `inp` do not match." -10831,FullyConnectedModel,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,51,class, -10832,fully_connected_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,66,function, -10833,lstm_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,72,function, -10834,dynamic_lstm_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,85,function, -10835,create_fc_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,103,function, -10836,create_lstm_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,111,function, -10837,create_dynamic_lstm_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,119,function, -10838,create_lstm_batch_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,133,function, -10839,create_lstm_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,145,function, -10840,create_fc_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,161,function, -10841,create_lstm_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,185,function, -10842,Mnist,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,217,class, -10843,create_mnist_autobatch,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,264,function, -10844,create_mnist_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,280,function, -10845,create_mnist_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,303,function, -10846,create_mnist_per_eg_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,313,function, -10847,create_fc_per_eg_jacobians,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,332,function, -10848,GradientsTest,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,355,class, -10849,GradientsBenchmarks,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,571,class, -10850,MathTest,tensorflow/tensorflow/python/ops/parallel_for/math_test.py,41,class, -10851,LinalgTest,tensorflow/tensorflow/python/ops/parallel_for/math_test.py,655,class, -10852,_stack,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,77,function,stacks `t` `length` times. -10853,_is_stateful_pfor_op,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,129,function, -10854,WhileOp,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,144,class,Object for storing state for converting the outputs of a while_loop. -10855,ConversionNotImplementedError,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,715,class, -10856,_PforInput,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,719,class,Input object passed to registered pfor converters. -10857,RegisterPFor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,846,class,"Utility to register converters for pfor. +10191,FullyConnectedModel,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,51,class, +10192,fully_connected_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,66,function, +10193,lstm_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,72,function, +10194,dynamic_lstm_model_fn,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,85,function, +10195,create_fc_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,103,function, +10196,create_lstm_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,111,function, +10197,create_dynamic_lstm_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,119,function, +10198,create_lstm_batch_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,133,function, +10199,create_lstm_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,145,function, +10200,create_fc_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,161,function, +10201,create_lstm_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,185,function, +10202,Mnist,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,217,class, +10203,create_mnist_autobatch,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,264,function, +10204,create_mnist_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,280,function, +10205,create_mnist_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,303,function, +10206,create_mnist_per_eg_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,313,function, +10207,create_fc_per_eg_jacobians,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,332,function, +10208,GradientsBenchmarks,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,571,class, +10209,benchmark_fc_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,596,method, +10210,benchmark_lstm_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,602,method, +10211,benchmark_lstm_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,609,method, +10212,benchmark_lstm_batch_hessian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,615,method, +10213,benchmark_fc_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,621,method, +10214,benchmark_lstm_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,627,method, +10215,benchmark_mnist_autobatch,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,633,method, +10216,benchmark_mnist_per_eg_grad,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,643,method, +10217,benchmark_mnist_per_eg_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,652,method, +10218,benchmark_mnist_batch_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,663,method, +10219,benchmark_fc_per_eg_jacobian,tensorflow/tensorflow/python/ops/parallel_for/gradients_test.py,674,method, +10220,WhileOp,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,144,class,Object for storing state for converting the outputs of a while_loop. +10221,inputs,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,264,method,Input to all the Enter nodes. +10222,control_inputs,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,269,method,Control input to all the Enter nodes. +10223,outputs,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,277,method,Outputs of all the Exit nodes. +10224,name,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,282,method,Context name for the while loop. +10225,is_inside_loop,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,287,method,Returns true if the while_loop was created inside the pfor. +10226,op_is_inside_loop,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,291,method,True if op was created inside the pfor loop body. +10227,is_stateful,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,300,method, +10228,pfor_converter,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,304,method,Return a converter for the while loop. +10229,true_fn,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,553,method,"Converts the body function for all but last iteration. + +This essentially converts body_output. Additionally, it needs to handle +any control dependencies on the NextIteration node. So it creates another +Identity node with the converted dependencies." +10230,cond,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,644,method, +10231,body,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,647,method, +10232,ConversionNotImplementedError,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,715,class, +10233,RegisterPFor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,846,class,"Utility to register converters for pfor. Usage: @RegisterPFor(foo_op_type) @@ -98363,7 +105854,7 @@ def _convert_reshape(pfor_input): # The converted output is marked as not loop invariant using the call to # wrap. return wrap(new_output, True)" -10858,RegisterPForWithArgs,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,925,class,"Utility to register converters for pfor. +10234,RegisterPForWithArgs,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,925,class,"Utility to register converters for pfor. Usage: @RegisteRPFor(foo_op_type, foo=value, ....) @@ -98373,11 +105864,54 @@ def _foo_converter(pfor_input, foo=None, ....): See RegisterPFor for details on the conversion function. `RegisterPForWithArgs` allows binding extra arguments to the conversion function at registration time." -10859,_create_op,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,953,function,Utility to create an op. -10860,wrap,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,984,function,Helper to create a WrappedTensor object. -10861,_fallback_converter,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,996,function, -10862,PForConfig,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1028,class,A configuration object used to communicate with loop body function. -10863,PFor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1152,class,"Implementation of rewrite of parallel-for loops. +10235,wrap,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,984,function,Helper to create a WrappedTensor object. +10236,PForConfig,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1028,class,A configuration object used to communicate with loop body function. +10237,reduce,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1046,method,"Performs reduction `fn` on `args` vectorized across pfor iterations. + +Note that `fn` is traced once inside the loop function context. Hence any +captures or side-effects will happen in that context. Call to the traced +version of `fn` happens during the construction of the vectorized code. + +Note that this currently may not work inside a control flow construct. +Args: + fn: a reduction function. It will be called with arguments that have the + same structure as *args but with individual values whose rank may be + higher by 1 since they represent loop invariant vectorized versions of + the corresponding Tensors in *args. + *args: unvectorized Tensors. + +Returns: + The result of running `fn` on the vectorized versions of `*args`. These + outputs will be available as loop invariant values to all the iterations." +10238,reduce_concat,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1106,method,"Performs a concat reduction on `x` across pfor iterations. + +Note that this currently may not work inside a control flow construct. +Args: + x: an unvectorized Tensor. + +Returns: + A Tensor that has rank one higher than `x`. The value is the vectorized + version of `x`, i.e. stacking the value of `x` across different pfor + iterations." +10239,reduce_mean,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1120,method,"Performs a mean reduction on `x` across pfor iterations. + +Note that this currently may not work inside a control flow construct. +Args: + x: an unvectorized Tensor. + +Returns: + A Tensor that has same rank as `x`. The value is the mean of the values + of `x` across the pfor iterations." +10240,reduce_sum,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1133,method,"Performs a sum reduction on `x` across pfor iterations. + +Note that this currently may not work inside a control flow construct. +Args: + x: an unvectorized Tensor. + +Returns: + A Tensor that has same rank as `x`. The value is the sum of the values + of `x` across the pfor iterations." +10241,PFor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1152,class,"Implementation of rewrite of parallel-for loops. This class takes a DAG or a set of DAGs representing the body of a parallel-for loop, and adds new operations to the graph that implements @@ -98407,155 +105941,33 @@ new set of nodes. When converting an op several cases are possible: corresponding to control dependencies of the original op. If the op returned multiple outputs, ""converted outputs"" could be produced by different ops in this set." -10864,_convert_adjust_contrastv2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1619,function, -10865,_convert_adjust_hue,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1626,function, -10866,_convert_adjust_saturation,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1633,function, -10867,_flatten_first_two_dims,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1642,function,Merges first two dimensions. -10868,_unflatten_first_dim,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1649,function,"Splits first dimension into [first_dim, -1]." -10869,_inputs_with_flattening,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1656,function,Stacks and flattens first dim of inputs at indices `input_indices`. -10870,_convert_flatten_batch,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1688,function, -10871,_convert_batch_to_space_nd,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1704,function, -10872,_convert_space_to_batch_nd,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1730,function, -10873,_channel_flatten_input,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1750,function,"Merge the stack dimension with the channel dimension. - -If S is pfor's stacking dimension, then, - - for SNCHW, we transpose to NSCHW. If N dimension has size 1, the transpose - should be cheap. - - for SNHWC, we transpose to NHWCS. -We then merge the S and C dimension. +10242,op_is_inside_loop,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1233,method,True if op was created inside the pfor loop body. +10243,convert,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1315,method,"Returns the converted value corresponding to y. Args: - x: ops.Tensor to transform. - data_format: ""NCHW"" or ""NHWC"". + y: A ops.Tensor or a ops.Operation object. If latter, y should not have + any outputs. Returns: - A 3-element tuple with the transformed value, along with the shape for - reshape and order for transpose required to transform back." -10874,_convert_fused_batch_norm,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1803,function, -10875,_convert_fused_batch_norm_grad,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1855,function, -10876,_convert_flatten_batch_shape_input,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1882,function, -10877,_convert_conv2d_backprop_filter,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1900,function, -10878,_convert_softmax,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1960,function, -10879,_convert_identity,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1972,function, -10880,_convert_identity_n,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1978,function, -10881,_convert_reshape,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1986,function, -10882,_convert_fill,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1994,function, -10883,_convert_broadcast_to,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2009,function, -10884,_convert_expanddims,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2029,function, -10885,_convert_searchsorted,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2038,function, -10886,_convert_matrix_band_part,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2049,function, -10887,_convert_matrix_set_diag,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2059,function, -10888,_convert_matrix_diag_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2072,function, -10889,_convert_diag,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2087,function, -10890,_convert_matrix_diag_part_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2101,function, -10891,_convert_matrix_set_diag_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2116,function, -10892,_convert_diag_part,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2130,function, -10893,_convert_one_hot,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2142,function, -10894,_convert_slice,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2155,function, -10895,_convert_tile,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2165,function, -10896,_convert_pack,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2173,function, -10897,_convert_unpack,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2183,function, -10898,_convert_pad,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2193,function, -10899,_convert_split,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2201,function, -10900,_convert_split_v,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2210,function, -10901,_convert_squeeze,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2219,function, -10902,_convert_reverse,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2227,function, -10903,_convert_transpose,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2236,function, -10904,_convert_zeroslike,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2244,function, -10905,_convert_gather,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2252,function, -10906,_convert_gather_nd,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2318,function, -10907,_convert_concatv2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2328,function, -10908,_convert_strided_slice,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2339,function, -10909,_convert_strided_slice_grad,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2372,function, -10910,_convert_check_numerics,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2408,function, -10911,_convert_matmul,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2418,function, -10912,_convert_batch_mat_mul,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2474,function, -10913,_convert_batch_mat_mul_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2491,function, -10914,_convert_reduction,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2509,function, -10915,_convert_argmax_argmin,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2520,function, -10916,_convert_bucketize,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2529,function, -10917,_convert_clip_by_value,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2536,function, -10918,_convert_cumfoo,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2546,function, -10919,_convert_biasadd,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2557,function, -10920,_convert_unsortedsegmentsum,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2588,function, -10921,_flatten_array_with_offset,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2614,function,"Flattens a rank 2 tensor, adding an offset to each row." -10922,_convert_sparse_segment,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2635,function, -10923,_convert_sparse_segment_grad,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2673,function, -10924,_convert_cast,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2691,function, -10925,_convert_cwise,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2804,function, -10926,_convert_leaky_relu,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2815,function, -10927,_convert_equal,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2822,function, -10928,_convert_not_equal,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2832,function, -10929,_convert_approximate_equal,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2842,function, -10930,_convert_shape,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2851,function, -10931,_convert_shape_n,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2859,function, -10932,_convert_size,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2869,function, -10933,_convert_rank,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2878,function, -10934,_convert_addn,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2883,function, -10935,_convert_cross,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2890,function, -10936,_convert_biasaddgrad,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2898,function, -10937,_convert_grads,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2926,function, -10938,_convert_select,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2940,function, -10939,_convert_selectv2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2960,function, -10940,_transpose_dim_to_front,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2972,function, -10941,_convert_random,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,2986,function, -10942,_convert_random_with_param,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3005,function, -10943,_convert_multinomial,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3033,function, -10944,_convert_stateless_multinomial,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3075,function, -10945,_convert_einsum,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3090,function, -10946,_convert_cholesky,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3129,function, -10947,_convert_log_matrix_determinant,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3135,function, -10948,_convert_matrix_inverse,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3141,function, -10949,_convert_matrix_solve,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3148,function, -10950,_convert_matrix_triangular_solve,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3159,function, -10951,_convert_self_adjoint_eig,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3171,function, -10952,_convert_assert,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3183,function, -10953,_convert_print,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3194,function, -10954,_convert_tensor_array_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3246,function, -10955,_convert_tensor_array_size_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3269,function, -10956,_handle_inside_pfor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3278,function,Returns True if handle was created inside the pfor loop. -10957,_unstack_flow,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3295,function, -10958,_convert_tensor_array_read_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3302,function, -10959,_convert_tensor_array_write_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3349,function, -10960,_transpose_first_two_dims,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3395,function, -10961,_convert_tensor_array_gather_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3407,function, -10962,_convert_tensor_array_scatter_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3449,function, -10963,_convert_tensor_array_grad_v3,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3492,function, -10964,_stack_tensor_list_shape,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3514,function, -10965,_tile_variant,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3533,function,stacks `t` `length` times. -10966,_untile_variant,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3541,function, -10967,_convert_tensor_list_reserve,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3546,function, -10968,_convert_tensor_list_element_shape,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3560,function, -10969,_convert_tensor_list_length,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3570,function, -10970,_stack_tensor_list,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3575,function, -10971,_convert_tensor_list_get_item,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3592,function, -10972,_convert_tensor_array_set_item,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3632,function, -10973,_convert_tensor_list_stack,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3663,function, -10974,_convert_tensor_list_gather,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3681,function, -10975,_convert_tensor_list_scatter,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3723,function, -10976,_convert_tensor_list_from_tensor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3740,function, -10977,_stack_cache_key,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3786,function,Create cache key corresponding to a stack handle. -10978,_stack_handle_inside_pfor,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3797,function, -10979,_convert_stack_push_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3806,function, -10980,_convert_stack_pop_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3834,function, -10981,_convert_decode_csv,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3853,function, -10982,_convert_parse_single_example,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3874,function, -10983,_convert_parse_example_v2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3895,function, -10984,_convert_function_call,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3929,function, -10985,_convert_partitioned_call,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3958,function, -10986,_partition_inputs_for_indices,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3975,function, -10987,_outputs_for_branch,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,3985,function, -10988,_convert_if,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4015,function, -10989,WhileV2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4067,class,Object for vectorizing V2 while_loop op. -10990,_convert_while,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4389,function, -10991,_convert_fft,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4403,function, -10992,_convert_rfft,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4413,function, -10993,PForTestCase,tensorflow/tensorflow/python/ops/parallel_for/test_util.py,29,class,Base class for test cases. -10994,PForTest,tensorflow/tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py,40,class, -10995,_make_unstacked,tensorflow/tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py,125,function, -10996,WhileV2Test,tensorflow/tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py,142,class, -10997,RaggedConvertToTensorOrRaggedTensorTest,tensorflow/tensorflow/python/ops/ragged/convert_to_tensor_or_ragged_tensor_op_test.py,33,class, -10998,boolean_mask,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,45,function,"Applies a boolean mask to `data` without flattening the mask dimensions. + If y does not need to be converted, it returns y as is. Else it returns + the ""converted value"" corresponding to y." +10244,loop_len_vector,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1579,method,Returns a single element vector whose value is number of iterations. +10245,loop_var,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1584,method,Returns placeholder loop variable. +10246,pfor_ops,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1589,method, +10247,pfor_config,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1593,method, +10248,all_indices_partitioned,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1597,method,"all_indices_partitioned property. + +Returns: + True if we are inside a control flow construct and not all pfor iterations + may be active." +10249,fallback_to_while_loop,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1607,method, +10250,fn,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,1294,method, +10251,WhileV2,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4067,class,Object for vectorizing V2 while_loop op. +10252,true_fn,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4180,method,Converts the body function for all but last iteration. +10253,cond,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4270,method, +10254,body,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4273,method, +10255,while_fn,tensorflow/tensorflow/python/ops/parallel_for/pfor.py,4333,method, +10256,boolean_mask,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,45,function,"Applies a boolean mask to `data` without flattening the mask dimensions. Returns a potentially ragged tensor that is formed by retaining the elements in `data` where the corresponding value in `mask` is `True`. @@ -98603,7 +106015,7 @@ Raises: ... tf.ragged.constant([[1, 2, 3], [4], [5, 6]]), ... tf.ragged.constant([True, False, True])).to_list() [[1, 2, 3], [5, 6]]" -10999,tile,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,211,function,"Constructs a `RaggedTensor` by tiling a given `RaggedTensor`. +10257,tile,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,211,function,"Constructs a `RaggedTensor` by tiling a given `RaggedTensor`. The values of `input` are replicated `multiples[i]` times along the `i`th dimension (for each dimension `i`). For every dimension `axis` in @@ -98624,51 +106036,7 @@ Returns: >>> rt = tf.ragged.constant([[1, 2], [3]]) >>> tf.tile(rt, [3, 2]).to_list() [[1, 2, 1, 2], [3, 3], [1, 2, 1, 2], [3, 3], [1, 2, 1, 2], [3, 3]]" -11000,_tile_ragged_values,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,253,function,"Builds flat_values tensor for a tiled `RaggedTensor`. - -Returns a tensor that repeats the values in -`rt_input.flat_values` in the -appropriate pattern to construct a `RaggedTensor` that tiles `rt_input` as -specified by `multiples`. - -Args: - rt_input: The `RaggedTensor` whose values should be repeated. - multiples: A 1-D integer `tensor`, indicating how many times each dimension - should be repeated. - const_multiples: Optional constant value for multiples. Used to skip tiling - dimensions where `multiples=1`. - -Returns: - A `Tensor` with the same type and rank as `rt_input.flat_values`. - -#### Example: - ->>> rt = tf.ragged.constant([[1, 2], [3]]) ->>> _tile_ragged_values(rt, tf.constant([3, 2])).numpy() -array([1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 3], dtype=int32)" -11001,_tile_ragged_splits,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,312,function,"Builds nested_split tensors for a tiled `RaggedTensor`. - -Returns a list of split tensors that can be used to construct the -`RaggedTensor` that tiles `rt_input` as specified by `multiples`. - -Args: - rt_input: The `RaggedTensor` that is being tiled. - multiples: A 1-D integer `tensor`, indicating how many times each dimension - should be repeated. - const_multiples: Optional constant value for multiples. Used to skip tiling - dimensions where `multiples=1`. - -Returns: - A list of 1-D integer `Tensor`s (one for each ragged dimension in - `rt_input`). - -#### Example: - ->>> rt = tf.ragged.constant([[1, 2], [3]]) ->>> _tile_ragged_splits(rt, [3, 2]) -[]" -11002,expand_dims,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,384,function,"Inserts a dimension with shape 1 into a potentially ragged tensor's shape. +10258,expand_dims,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,384,function,"Inserts a dimension with shape 1 into a potentially ragged tensor's shape. Given a potentially ragged tenor `input`, this operation inserts a dimension with size 1 at the dimension `axis` of `input`'s shape. @@ -98715,7 +106083,7 @@ Returns: >>> expanded = tf.expand_dims(rt, axis=2) >>> print(expanded.shape, expanded) (2, None, 1) " -11003,size,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,458,function,"Returns the size of a potentially ragged tensor. +10259,size,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,458,function,"Returns the size of a potentially ragged tensor. The size of a ragged tensor is the size of its inner values. @@ -98731,7 +106099,7 @@ Args: Returns: A Tensor of type `out_type`." -11004,rank,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,485,function,"Returns the rank of a RaggedTensor. +10260,rank,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,485,function,"Returns the rank of a RaggedTensor. Returns a 0-D `int32` `Tensor` representing the rank of `input`. @@ -98748,8 +106116,8 @@ Args: Returns: A `Tensor` of type `int32`." -11005,ragged_one_hot,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,514,function,Applies tf.one_hot along the values of a RaggedTensor. -11006,stack_dynamic_partitions,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,544,function,"Stacks dynamic partitions of a Tensor or RaggedTensor. +10261,ragged_one_hot,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,514,function,Applies tf.one_hot along the values of a RaggedTensor. +10262,stack_dynamic_partitions,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,544,function,"Stacks dynamic partitions of a Tensor or RaggedTensor. Returns a RaggedTensor `output` with `num_partitions` rows, where the row `output[i]` is formed by stacking all slices `data[j1...jN]` such that @@ -98784,7 +106152,7 @@ Returns: `[num_partitions, (D)] + data.shape[partitions.rank:]`, where `(D)` is a ragged dimension whose length is the number of data slices stacked for each `partition`." -11007,reverse,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,648,function,"Reverses a RaggedTensor along the specified axes. +10263,reverse,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,648,function,"Reverses a RaggedTensor along the specified axes. #### Example: @@ -98801,7 +106169,7 @@ Args: Returns: A 'RaggedTensor'." -11008,cross,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,706,function,"Generates feature cross from a list of tensors. +10264,cross,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,706,function,"Generates feature cross from a list of tensors. The input tensors must have `rank=2`, and must all have the same number of rows. The result is a `RaggedTensor` with the same number of rows as the @@ -98821,7 +106189,7 @@ Args: Returns: A 2D `RaggedTensor` of type `string`." -11009,cross_hashed,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,733,function,"Generates hashed feature cross from a list of tensors. +10265,cross_hashed,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,733,function,"Generates hashed feature cross from a list of tensors. The input tensors must have `rank=2`, and must all have the same number of rows. The result is a `RaggedTensor` with the same number of rows as the @@ -98846,9 +106214,7 @@ Args: Returns: A 2D `RaggedTensor` of type `int64`." -11010,_cross_internal,tensorflow/tensorflow/python/ops/ragged/ragged_array_ops.py,771,function,Generates feature cross from a list of ragged and dense tensors. -11011,RaggedBatchGatherOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_op_test.py,37,class, -11012,batch_gather,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_ops.py,27,function,"Gathers slices from `params` according to `indices` with batch dims. +10266,batch_gather,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_ops.py,27,function,"Gathers slices from `params` according to `indices` with batch dims. This operation is similar to `gather`, but it assumes that the leading `N` dimensions of `indices` and `params` are batch dimensions, and performs a @@ -98877,7 +106243,7 @@ Returns: >>> indices = tf.ragged.constant([[1, 2, 0], [], [], [0, 0]]) >>> tf.compat.v1.batch_gather(params, indices) " -11013,batch_gather_with_default,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_with_default_op.py,38,function,"Same as `batch_gather` but inserts `default_value` for invalid indices. +10267,batch_gather_with_default,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_with_default_op.py,38,function,"Same as `batch_gather` but inserts `default_value` for invalid indices. This operation is similar to `batch_gather` except that it will substitute the value for invalid indices with `default_value` as the contents. @@ -98902,10 +106268,7 @@ Returns: >>> indices = tf.ragged.constant([[1, 2, -1], [], [], [0, 10]]) >>> batch_gather_with_default(params, indices, 'FOO') " -11014,_get_pad_shape,tensorflow/tensorflow/python/ops/ragged/ragged_batch_gather_with_default_op.py,144,function,Gets the RaggedTensorDynamicShape for the pad tensor. -11015,RaggedBooleanMaskOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_boolean_mask_op_test.py,34,class, -11016,RaggedConcatOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_concat_op_test.py,35,class, -11017,concat,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,34,function,"Concatenates potentially ragged tensors along one dimension. +10268,concat,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,34,function,"Concatenates potentially ragged tensors along one dimension. Given a list of tensors with the same rank `K` (`K >= axis`), returns a rank-`K` `RaggedTensor` `result` such that `result[i0...iaxis]` is the @@ -98937,7 +106300,7 @@ Raises: >>> tf.concat([t1, t2], axis=1) " -11018,stack,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,76,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` `RaggedTensor`. +10269,stack,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,76,function,"Stacks a list of rank-`R` tensors into one rank-`(R+1)` `RaggedTensor`. Given a list of tensors or ragged tensors with the same rank `R` (`R >= axis`), returns a rank-`R+1` `RaggedTensor` `result` such that @@ -98976,40 +106339,7 @@ Returns: Raises: ValueError: If `values` is empty, if `axis` is out of bounds or if the input tensors have different ranks." -11019,_ragged_stack_concat_helper,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,123,function,"Helper function to concatenate or stack ragged tensors. - -Args: - rt_inputs: A list of RaggedTensors or Tensors to combine. - axis: The axis along which to concatenate or stack. - stack_values: A boolean -- if true, then stack values; otherwise, - concatenate them. - -Returns: - A RaggedTensor. -Raises: - ValueError: If rt_inputs is empty, or if axis is out of range." -11020,_ragged_stack_concat_axis_0,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,209,function,"Helper function to concatenate or stack ragged tensors along axis 0. - -Args: - rt_inputs: A list of RaggedTensors, all with the same rank and ragged_rank. - stack_values: Boolean. If true, then stack values; otherwise, concatenate - them. - -Returns: - A RaggedTensor." -11021,_ragged_stack_concat_axis_1,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,244,function,"Helper function to concatenate or stack ragged tensors along axis 1. - -Args: - rt_inputs: A list of RaggedTensors, all with the same rank and ragged_rank. - stack_values: Boolean. If true, then stack values; otherwise, concatenate - them. - -Returns: - A RaggedTensor." -11022,_copy_row_shape,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,295,function,Sets splits.shape to [rt[shape[0]+1] for each rt in rt_inputs. -11023,_increase_ragged_rank_to,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,302,function,Adds ragged dimensions to `rt_input` so it has the desired ragged rank. -11024,_concat_ragged_splits,tensorflow/tensorflow/python/ops/ragged/ragged_concat_ops.py,315,function,Concatenates a list of RaggedTensor splits to form a single splits. -11025,auto_cast_partition_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_config.py,22,function,"Whether incompatible row-partitioning dtypes should be auto-converted. +10270,auto_cast_partition_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_config.py,22,function,"Whether incompatible row-partitioning dtypes should be auto-converted. If true, then operations that combine RaggedTensors but have different row-partitioning tensor dtypes will be automatically cast to a @@ -99018,54 +106348,28 @@ in an error. Returns: `bool`" -11026,RaggedConstOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_const_op_test.py,33,class, -11027,_normalize_pylist,tensorflow/tensorflow/python/ops/ragged/ragged_const_op_test.py,404,function,Convert all (possibly nested) np.arrays contained in item to list. -11028,RaggedConstantValueOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_constant_value_op_test.py,32,class, -11029,_normalize_pylist,tensorflow/tensorflow/python/ops/ragged/ragged_constant_value_op_test.py,319,function,Convert all (possibly nested) np.arrays contained in item to list. -11030,from_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,30,function, -11031,to_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,48,function, -11032,ragged_to_dense,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,55,function,Create a dense tensor from a ragged tensor. -11033,_ragged_tensor_to_tensor_grad,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,61,function,Gradient for RaggedToTensor op. -11034,_rank_ignoring_leading_dims_with_size_1,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,110,function,"Returns `rank(value)`, ignoring any leading dimensions with size 1." -11035,to_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,140,function, -11036,from_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,144,function, -11037,sparse_const,tensorflow/tensorflow/python/ops/ragged/ragged_cross_op_test.py,40,function, -11038,RaggedCrossOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_cross_op_test.py,55,class, -11039,_get_arg_infos,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,64,function,"Returns an `_ArgInfo` for each argument of `func` specified by `arg_names`. - -Args: - func: The function whose arguments should be described. - arg_names: The names of the arguments to get info for. - -Returns: - A tuple of `_ArgInfo`s." -11040,_is_convertible_to_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,90,function,Returns true if `value` is convertible to a `Tensor`. -11041,UnaryRaggedElementwiseDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,107,class,OpDispatcher for unary ops that map a base op across ragged values. -11042,BinaryRaggedElementwiseDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,163,class,"OpDispatcher for binary ops that map a base op across ragged values. +10271,from_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,30,function, +10272,to_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,48,function, +10273,ragged_to_dense,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,55,function,Create a dense tensor from a ragged tensor. +10274,to_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,140,function, +10275,from_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_conversion_ops.py,144,function, +10276,sparse_const,tensorflow/tensorflow/python/ops/ragged/ragged_cross_op_test.py,40,function, +10277,UnaryRaggedElementwiseDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,107,class,OpDispatcher for unary ops that map a base op across ragged values. +10278,handle,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,120,method, +10279,BinaryRaggedElementwiseDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,163,class,"OpDispatcher for binary ops that map a base op across ragged values. Supports broadcasting." -11043,RaggedDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,234,class,"OpDispatcher for ragged ops. +10280,handle,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,180,method, +10281,RaggedDispatcher,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,234,class,"OpDispatcher for ragged ops. Dispatches to a wrapped op-handler if at least one of the `tensor_args` arguments is a RaggedTensor or a RaggedTensorValue; and all of the `tensor_args` arguments are convertible to Tensor or RaggedTensor." -11044,_ragged_gather_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,415,function, -11045,_ragged_gather_nd_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,426,function, -11046,_ragged_expand_dims_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,434,function, -11047,_ragged_size_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,440,function, -11048,_ragged_squeeze_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,444,function, -11049,_ragged_dynamic_partition,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,450,function,RaggedTensor Dispatch override for tf.dynamic_partition. -11050,_ragged_nn_dropout_v1,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,459,function, -11051,_ragged_nn_dropout_v2,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,469,function, -11052,register_dispatchers,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,528,function,Constructs & registers OpDispatchers for ragged ops. -11053,_ragged_op_signature,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,554,function,"Returns a signature for the given op, marking ragged args in bold." -11054,_op_is_in_tf_version,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,581,function, -11055,ragged_op_list,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,591,function,Returns a string listing operators that have dispathers registered. -11056,RaggedDispatchTest,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch_test.py,145,class, -11057,RaggedSegmentStackOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_dynamic_partition_op_test.py,36,class, -11058,RaggedTensorTest,tensorflow/tensorflow/python/ops/ragged/ragged_eager_test.py,29,class, -11059,RaggedExpandDimsOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_expand_dims_op_test.py,30,class, -11060,constant,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,39,function,"Constructs a constant RaggedTensor from a nested Python list. +10282,handle,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,257,method, +10283,is_supported,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,263,method, +10284,register_dispatchers,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,528,function,Constructs & registers OpDispatchers for ragged ops. +10285,ragged_op_list,tensorflow/tensorflow/python/ops/ragged/ragged_dispatch.py,591,function,Returns a string listing operators that have dispathers registered. +10286,constant,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,39,function,"Constructs a constant RaggedTensor from a nested Python list. Example: @@ -99103,7 +106407,7 @@ Returns: Raises: ValueError: If the scalar values in `pylist` have inconsistent nesting depth; or if ragged_rank or inner_shape are incompatible with `pylist`." -11061,constant_value,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,92,function,"Constructs a RaggedTensorValue from a nested Python list. +10287,constant_value,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,92,function,"Constructs a RaggedTensorValue from a nested Python list. Warning: This function returns a `RaggedTensorValue`, not a `RaggedTensor`. If you wish to construct a constant `RaggedTensor`, use @@ -99144,39 +106448,7 @@ Returns: Raises: ValueError: If the scalar values in `pylist` have inconsistent nesting depth; or if ragged_rank or inner_shape are incompatible with `pylist`." -11062,_constant_value,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,150,function,"Constructs a constant RaggedTensor or RaggedTensorValue. - -Args: - ragged_factory: A factory function with the signature: - `ragged_factory(values, row_splits)` - inner_factory: A factory function with the signature: `inner_factory(pylist, - dtype, shape, name)` - pylist: A nested `list`, `tuple` or `np.ndarray`. - dtype: Data type for returned value. - ragged_rank: Ragged rank for returned value. - inner_shape: Inner value shape for returned value. - -Returns: - A value returned by `ragged_factory` or `inner_factory`. - -Raises: - ValueError: If the scalar values in `pylist` have inconsistent nesting - depth; or if ragged_rank or inner_shape are incompatible with `pylist`." -11063,_find_scalar_and_max_depth,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,246,function,"Finds nesting depth of scalar values in pylist. - -Args: - pylist: A nested python `list` or `tuple`. - -Returns: - A tuple `(scalar_depth, max_depth)`. `scalar_depth` is the nesting - depth of scalar values in `pylist`, or `None` if `pylist` contains no - scalars. `max_depth` is the maximum depth of `pylist` (including - empty lists). - -Raises: - ValueError: If pylist has inconsistent nesting depths for scalars." -11064,_default_inner_shape_for_pylist,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,277,function,Computes a default inner shape for the given python list. -11065,placeholder,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,318,function,"Creates a placeholder for a `tf.RaggedTensor` that will always be fed. +10288,placeholder,tensorflow/tensorflow/python/ops/ragged/ragged_factory_ops.py,318,function,"Creates a placeholder for a `tf.RaggedTensor` that will always be fed. **Important**: This ragged tensor will produce an error if evaluated. Its value must be fed using the `feed_dict` optional argument to @@ -99196,9 +106468,7 @@ Returns: Raises: RuntimeError: if eager execution is enabled" -11066,RaggedTensorToSparseOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_from_sparse_op_test.py,32,class, -11067,RaggedTensorFromTensorOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py,35,class, -11068,map_flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_functional_ops.py,33,function,"Applies `op` to the values of one or more RaggedTensors. +10289,map_flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_functional_ops.py,33,function,"Applies `op` to the values of one or more RaggedTensors. Replaces any `RaggedTensor` in `args` or `kwargs` with its `flat_values` tensor, and then calls `op`. Returns a `RaggedTensor` that is constructed @@ -99233,23 +106503,7 @@ Returns: Raises: ValueError: If args contains no `RaggedTensors`, or if the `nested_splits` of the input `RaggedTensor`s are not identical." -11069,_replace_ragged_with_flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_functional_ops.py,97,function,"Replace RaggedTensors with their flat_values, and record their splits. - -Returns a copy of `value`, with any nested `RaggedTensor`s replaced by their -`flat_values` tensor. Looks inside lists, tuples, and dicts. - -Appends each `RaggedTensor`'s `nested_splits` to `nested_splits_lists`. - -Args: - value: The value that should be transformed by replacing `RaggedTensors`. - nested_splits_lists: An output parameter used to record the `nested_splits` - for any `RaggedTensors` that were replaced. - -Returns: - A copy of `value` with nested `RaggedTensors` replaced by their `values`." -11070,RaggedGatherNdOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_gather_nd_op_test.py,35,class, -11071,RaggedGatherOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_gather_op_test.py,41,class, -11072,gather,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,36,function,"Gathers ragged slices from `params` axis `0` according to `indices`. +10290,gather,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,36,function,"Gathers ragged slices from `params` axis `0` according to `indices`. See `tf.gather` for full documentation. (This version has the same API as `tf.gather`, but supports ragged `params` and `indices`.) @@ -99288,44 +106542,7 @@ Returns: Raises: ValueError: If indices.shape.ndims is not known statically." -11073,_gather,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,114,function,"Helper that implements the body for ragged gather(). - -Assumes that `params` and `indices` have been converted to tensors or -ragged tensors, and that `axis` and `batch_dims` have been normalized to -be positive. (So these conversions & normalizations can be skipped in -recursive calls to _gather). - -Args: - params: The tensor from which to gather values. - indices: The indices of values to gather. - axis: The axis in `params` to gather `indices` from. - batch_dims: The number of batch dimensions. - -Returns: - A potentially ragged tensor." -11074,_batch_gather,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,176,function,"Helper that implements the body for ragged gather() when batch_dims>0. - -Args: - params: The tensor from which to gather values. - indices: The indices of values to gather. - axis: The axis in `params` to gather `indices` from. - batch_dims: The number of batch dimensions. - -Returns: - A potentially ragged tensor." -11075,_axis_gather,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,258,function,"Helper that implements ragged gather when axis>0 and batch_dims==0. - -Args: - params: The tensor from which to gather values. - indices: The indices of values to gather. - axis: The axis in `params` to gather `indices` from. - -Returns: - A potentially ragged tensor." -11076,_flatten_dims_0_and_1,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,298,function,Returns a copy of `t` with the outer two dimensions merged. -11077,_row_starts,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,307,function,Returns the start indices for the rows in `t`. -11078,_increase_rank_to,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,316,function,Adds *trailing* size-1 dimensions to `t` until it has the given rank. -11079,gather_nd,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,330,function,"Gather slices from `params` using `n`-dimensional indices. +10291,gather_nd,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,330,function,"Gather slices from `params` using `n`-dimensional indices. This operation is similar to `gather`, but it uses the innermost dimension of `indices` to define a slice into `params`. In particular, if: @@ -99365,8 +106582,7 @@ Returns: >>> # Gather scalars from a 3D tensor >>> tf.gather_nd(params, [[0, 0, 1], [1, 1, 2]]).numpy() array([b'001', b'112'], dtype=object)" -11080,_ragged_gather_grad,tensorflow/tensorflow/python/ops/ragged/ragged_gather_ops.py,473,function,Gradient for RaggedGather op. -11081,ragged_tensor_getitem,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,35,function,"Returns the specified piece of this RaggedTensor. +10292,ragged_tensor_getitem,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,35,function,"Returns the specified piece of this RaggedTensor. Supports multidimensional indexing and slicing, with one restriction: indexing into a ragged inner dimension is not allowed. This case is @@ -99426,113 +106642,7 @@ array([8, 9], dtype=int32) [[[4]], [[], [6]], [], [[10]]] >>> rt[:, -1:].to_list() # Last item of each row (3-D RaggedTensor) [[[4]], [[6]], [[7]], [[10]]]" -11082,_ragged_getitem,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,106,function,"Helper for indexing and slicing ragged tensors with __getitem__(). - -Extracts the specified piece of the `rt_input`. See -`RaggedTensor.__getitem__` for examples and restrictions. - -Args: - rt_input: The `RaggedTensor` from which a piece should be returned. - key_list: The list of keys specifying which piece to return. Each key - corresponds with a separate dimension. - -Returns: - The indicated piece of rt_input. - -Raises: - ValueError: If `key_list` is not supported. - TypeError: If any keys in `key_list` have an unsupported type." -11083,_slice_ragged_row_dimension,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,190,function,"Slice the outer dimension of `rt_input` according to the given `slice`. - -Args: - rt_input: The `RaggedTensor` to slice. - row_key: The `slice` object that should be used to slice `rt_input`. - -Returns: - A `RaggedTensor` containing the indicated slice of `rt_input`." -11084,_ragged_getitem_inner_dimensions,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,230,function,"Retrieve inner dimensions, keeping outermost dimension unchanged. - -Args: - rt_input: The `RaggedTensor` or `Tensor` from which a piece should be - extracted. - key_list: The __getitem__ keys for slicing the inner dimensions. - -Returns: - A `RaggedTensor`. - -Raises: - ValueError: If key_list is not supported." -11085,_slice_length,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,343,function,"Computes the number of elements in a slice of a value with a given length. - -Returns the equivalent of: `len(range(value_length)[slice_key])` - -Args: - value_length: Scalar int `Tensor`: the length of the value being sliced. - slice_key: A `slice` object used to slice elements from the the value. - -Returns: - The number of elements in the sliced value." -11086,_expand_ellipsis,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,364,function,"Expands the ellipsis at the start of `key_list`. - -Assumes that the first element of `key_list` is Ellipsis. This will either -remove the Ellipsis (if it corresponds to zero indices) or prepend a new -`slice(None, None, None)` (if it corresponds to more than zero indices). - -Args: - key_list: The arguments to `__getitem__()`. - num_remaining_dims: The number of dimensions remaining. - -Returns: - A copy of `key_list` with he ellipsis expanded. -Raises: - ValueError: If ragged_rank.shape.ndims is None - IndexError: If there are too many elements in `key_list`." -11087,_tensors_in_key_list,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,392,function,Generates all Tensors in the given slice spec. -11088,_build_ragged_tensor_from_value_ranges,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,409,function,"Returns a `RaggedTensor` containing the specified sequences of values. - -Returns a RaggedTensor `output` where: - -```python -output.shape[0] = starts.shape[0] -output[i] = values[starts[i]:limits[i]:step] -``` - -Requires that `starts.shape == limits.shape` and -`0 <= starts[i] <= limits[i] <= values.shape[0]`. - -Args: - starts: 1D integer Tensor specifying the start indices for the sequences of - values to include. - limits: 1D integer Tensor specifying the limit indices for the sequences of - values to include. - step: Integer value specifying the step size for strided slices. - values: The set of values to select from. - -Returns: - A `RaggedTensor`. - -Raises: - ValueError: Until the prerequisite ops are checked in." -11089,_if_ge_zero,tensorflow/tensorflow/python/ops/ragged/ragged_getitem.py,459,function,Returns `true_fn() if value >= 0 else false_fn()`. -11090,_SliceBuilder,tensorflow/tensorflow/python/ops/ragged/ragged_getitem_test.py,37,class,"Helper to construct arguments for __getitem__. - -Usage: _SliceBuilder()[] slice_spec Python generates for ." -11091,_make_tensor_slice_spec,tensorflow/tensorflow/python/ops/ragged/ragged_getitem_test.py,50,function,"Wraps all integers in an extended slice spec w/ a tensor. - -This function is used to help test slicing when the slice spec contains -tensors, rather than integers. - -Args: - slice_spec: The extended slice spec. - use_constant: If true, then wrap each integer with a tf.constant. If false, - then wrap each integer with a tf.placeholder. - -Returns: - A copy of slice_spec, but with each integer i replaced with tf.constant(i)." -11092,RaggedGetItemTest,tensorflow/tensorflow/python/ops/ragged/ragged_getitem_test.py,118,class, -11093,RaggedMapInnerValuesOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_map_flat_values_op_test.py,34,class, -11094,RaggedMapOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_map_fn_op_test.py,38,class, -11095,map_fn,tensorflow/tensorflow/python/ops/ragged/ragged_map_ops.py,30,function,"map on the list of tensors unpacked from `elems` on dimension 0. +10293,map_fn,tensorflow/tensorflow/python/ops/ragged/ragged_map_ops.py,30,function,"map on the list of tensors unpacked from `elems` on dimension 0. The simplest version of `map_fn` repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the @@ -99654,8 +106764,7 @@ Raises: dtype=ragged.RaggedTensorType(type=tf.int64, ragged_rank=0)) # out = tf.ragged.constant([[2, 3, 4], [5, 6], [7, 8]]) ```" -11096,_ragged_type_to_spec,tensorflow/tensorflow/python/ops/ragged/ragged_map_ops.py,174,function, -11097,range,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,43,function,"Returns a `RaggedTensor` containing the specified sequences of numbers. +10294,range,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,43,function,"Returns a `RaggedTensor` containing the specified sequences of numbers. Each row of the returned `RaggedTensor` contains a single sequence: @@ -99699,46 +106808,13 @@ Args: Returns: A `RaggedTensor` of type `dtype` with `ragged_rank=1`." -11098,_infer_matching_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,112,function,"Infers a matching dtype for tensors, and casts them to that dtype." -11099,_ragged_segment_aggregate,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,157,function,"Aggregates along segments of a RaggedTensor using `unsorted_segment_op`. - -Returns a RaggedTensor `output` with `num_segments` rows, where the row -`output[i]` is formed by combining all rows of `data` whose corresponding -`segment_id` is `i`. The values in each row are combined using -`unsorted_segment_op`. - -The length of the row `output[i]` will be the maximum of the lengths of -all rows of `data` whose corresponding `segment_id` is `i`. If no `data` -rows correspond to a given segment ID, then the output row for that segment -ID will be empty. - -Args: - unsorted_segment_op: The tensorflow `op` that should be used to combine - values in each row. Must have the same signature and basic behavior as - `unsorted_segment_sum`, `unsorted_segment_max`, etc. - data: A `RaggedTensor` containing the values to be combined. - segment_ids: A `Tensor` or `RaggedTensor`. Must have type `int64` or - `int32`. `segment_ids.shape` must be a prefix of `data.shape`. - `segment_ids` is not required to be sorted. - num_segments: An `int32` or `int64` scalar. - separator: An optional string. Defaults to None. The separator to - use when joining. Only used for string types. - name: A name prefix for the returned tensor (optional). - -Returns: - A `RaggedTensor` containing the aggregated values. The returned tensor - has the same dtype as `data`, and its shape is - `[num_segments] + data.shape[segment_ids.rank:]`. -Raises: - ValueError: If segment_ids.shape is not a prefix of data.shape." -11100,segment_sum,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,262,function, -11101,segment_prod,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,271,function, -11102,segment_min,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,280,function, -11103,segment_max,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,289,function, -11104,segment_mean,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,298,function,"For docs, see: _RAGGED_SEGMENT_DOCSTRING." -11105,segment_sqrt_n,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,313,function,"For docs, see: _RAGGED_SEGMENT_DOCSTRING." -11106,_set_ragged_segment_docstring,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,329,function, -11107,ragged_reduce_aggregate,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,426,function,"Aggregates across axes of a RaggedTensor using the given `Tensor` ops. +10295,segment_sum,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,262,function, +10296,segment_prod,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,271,function, +10297,segment_min,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,280,function, +10298,segment_max,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,289,function, +10299,segment_mean,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,298,function,"For docs, see: _RAGGED_SEGMENT_DOCSTRING." +10300,segment_sqrt_n,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,313,function,"For docs, see: _RAGGED_SEGMENT_DOCSTRING." +10301,ragged_reduce_aggregate,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,426,function,"Aggregates across axes of a RaggedTensor using the given `Tensor` ops. Reduces `rt_input` along the dimensions given in `axis`. The rank of the tensor is reduced by 1 for each entry in `axis`. If `axis` is not specified, @@ -99775,37 +106851,19 @@ Returns: specified in `axis` from `rt_input.ragged_rank`. Raises: ValueError: If `axis` contains a `Tensor` whose value is not constant." -11108,reduce_sum,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,550,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11109,reduce_prod,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,561,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11110,reduce_min,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,572,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11111,reduce_max,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,583,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11112,reduce_mean,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,594,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11113,_cast,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,613,function, -11114,reduce_all,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,618,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11115,reduce_any,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,626,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11116,_set_ragged_reduce_docstring,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,634,function, -11117,RaggedMergeDimsOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_merge_dims_op_test.py,32,class, -11118,RaggedOneHotTest,tensorflow/tensorflow/python/ops/ragged/ragged_one_hot_op_test.py,37,class, -11119,_right,tensorflow/tensorflow/python/ops/ragged/ragged_operators.py,27,function,Right-handed version of an operator: swap args x and y. -11120,_dummy_bool,tensorflow/tensorflow/python/ops/ragged/ragged_operators.py,72,function,Dummy method to prevent a RaggedTensor from being used as a Python bool. -11121,RaggedElementwiseOpsTest,tensorflow/tensorflow/python/ops/ragged/ragged_operators_test.py,27,class, -11122,RaggedPlaceholderOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_placeholder_op_test.py,30,class, -11123,RaggedPrintV2Test,tensorflow/tensorflow/python/ops/ragged/ragged_print_op_test.py,40,class, -11124,RaggedToStringTest,tensorflow/tensorflow/python/ops/ragged/ragged_print_op_test.py,130,class, -11125,RaggedRangeOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_range_op_test.py,28,class, -11126,RaggedRankOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_rank_op_test.py,29,class, -11127,mean,tensorflow/tensorflow/python/ops/ragged/ragged_reduce_op_test.py,38,function, -11128,RaggedReduceOpsTest,tensorflow/tensorflow/python/ops/ragged/ragged_reduce_op_test.py,43,class, -11129,RaggedReverseOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_reverse_op_test.py,30,class, -11130,RaggedRowLengthsOp,tensorflow/tensorflow/python/ops/ragged/ragged_row_lengths_op_test.py,31,class, -11131,RaggedSplitsToSegmentIdsOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_row_splits_to_segment_ids_op_test.py,28,class, -11132,RaggedSplitsToSegmentIdsOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_segment_ids_to_row_splits_op_test.py,28,class, -11133,prod,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,35,function, -11134,mean,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,43,function, -11135,sqrt_n,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,47,function, -11136,RaggedSegmentOpsTest,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,52,class, -11137,RaggedSizeOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_size_op_test.py,30,class, -11138,squeeze,tensorflow/tensorflow/python/ops/ragged/ragged_squeeze_op.py,31,function,"Ragged compatible squeeze. +10302,reduce_sum,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,550,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10303,reduce_prod,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,561,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10304,reduce_min,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,572,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10305,reduce_max,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,583,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10306,reduce_mean,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,594,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10307,reduce_all,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,618,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10308,reduce_any,tensorflow/tensorflow/python/ops/ragged/ragged_math_ops.py,626,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10309,mean,tensorflow/tensorflow/python/ops/ragged/ragged_reduce_op_test.py,38,function, +10310,RaggedRowLengthsOp,tensorflow/tensorflow/python/ops/ragged/ragged_row_lengths_op_test.py,31,class, +10311,prod,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,35,function, +10312,mean,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,43,function, +10313,sqrt_n,tensorflow/tensorflow/python/ops/ragged/ragged_segment_op_test.py,47,function, +10314,squeeze,tensorflow/tensorflow/python/ops/ragged/ragged_squeeze_op.py,31,function,"Ragged compatible squeeze. If `input` is a `tf.Tensor`, then this calls `tf.squeeze`. @@ -99824,9 +106882,7 @@ Args: Returns: A potentially ragged tensor. Contains the same data as input, but has one or more dimensions of size 1 removed." -11139,RaggedSqueezeTest,tensorflow/tensorflow/python/ops/ragged/ragged_squeeze_op_test.py,34,class, -11140,RaggedStackOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_stack_op_test.py,31,class, -11141,string_bytes_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,46,function,"Split string elements of `input` into bytes. +10315,string_bytes_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,46,function,"Split string elements of `input` into bytes. Examples: @@ -99847,7 +106903,7 @@ Args: Returns: A `RaggedTensor` of rank `N+1`: the bytes that make up the source strings." -11142,unicode_encode,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,94,function,"Encodes each sequence of Unicode code points in `input` into a string. +10316,unicode_encode,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,94,function,"Encodes each sequence of Unicode code points in `input` into a string. `result[i1...iN]` is the string formed by concatenating the Unicode codepoints `input[1...iN, :]`, encoded using `output_encoding`. @@ -99879,7 +106935,7 @@ Returns: >>> print(unicode_encode(input, 'UTF-8')) tf.Tensor([b'G\xc3\xb6\xc3\xb6dnight' b'\xf0\x9f\x98\x8a'], shape=(2,), dtype=string)" -11143,unicode_decode,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,192,function,"Decodes each string in `input` into a sequence of Unicode code points. +10317,unicode_decode,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,192,function,"Decodes each string in `input` into a sequence of Unicode code points. `result[i1...iN, j]` is the Unicode codepoint for the `j`th character in `input[i1...iN]`, when decoded using `input_encoding`. @@ -99911,7 +106967,7 @@ Returns: >>> input = [s.encode('utf8') for s in (u'G\xf6\xf6dnight', u'\U0001f60a')] >>> tf.strings.unicode_decode(input, 'UTF-8').to_list() [[71, 246, 246, 100, 110, 105, 103, 104, 116], [128522]]" -11144,unicode_decode_with_offsets,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,238,function,"Decodes each string into a sequence of code points with start offsets. +10318,unicode_decode_with_offsets,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,238,function,"Decodes each string into a sequence of code points with start offsets. This op is similar to `tf.strings.decode(...)`, but it also returns the start offset for each character in its respective string. This information @@ -99958,7 +107014,7 @@ Returns: [[71, 246, 246, 100, 110, 105, 103, 104, 116], [128522]] >>> result[1].to_list() # offsets [[0, 1, 3, 5, 6, 7, 8, 9, 10], [0]]" -11145,unicode_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,300,function,"Splits each string in `input` into a sequence of Unicode code points. +10319,unicode_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,300,function,"Splits each string in `input` into a sequence of Unicode code points. `result[i1...iN, j]` is the substring of `input[i1...iN]` that encodes its `j`th character, when decoded using `input_encoding`. @@ -99988,7 +107044,7 @@ Returns: >>> tf.strings.unicode_split(input, 'UTF-8').to_list() [[b'G', b'\xc3\xb6', b'\xc3\xb6', b'd', b'n', b'i', b'g', b'h', b't'], [b'\xf0\x9f\x98\x8a']]" -11146,unicode_split_with_offsets,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,348,function,"Splits each string into a sequence of code points with start offsets. +10320,unicode_split_with_offsets,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,348,function,"Splits each string into a sequence of code points with start offsets. This op is similar to `tf.strings.decode(...)`, but it also returns the start offset for each character in its respective string. This information @@ -100033,8 +107089,7 @@ Returns: [b'\xf0\x9f\x98\x8a']] >>> result[1].to_list() # offsets [[0, 1, 3, 5, 6, 7, 8, 9, 10], [0]]" -11147,_unicode_decode,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,412,function,Decodes each string into a sequence of codepoints. -11148,string_split_v2,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,472,function,"Split elements of `input` based on `sep` into a `RaggedTensor`. +10321,string_split_v2,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,472,function,"Split elements of `input` based on `sep` into a `RaggedTensor`. Let N be the size of `input` (typically N will be the batch size). Split each element of `input` based on `sep` and return a `RaggedTensor` containing the @@ -100069,7 +107124,7 @@ Raises: Returns: A `RaggedTensor` of rank `N+1`, the strings split according to the delimiter." -11149,string_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,537,function,"Split elements of `source` based on `delimiter`. +10322,string_split,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,537,function,"Split elements of `source` based on `delimiter`. Let N be the size of `source` (typically N will be the batch size). Split each element of `source` based on `delimiter` and return a `SparseTensor` @@ -100109,7 +107164,7 @@ Returns: to the delimiter. The first column of the indices corresponds to the row in `source` and the second column corresponds to the index of the split component in this row." -11150,strings_split_v1,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,599,function,"Split elements of `input` based on `sep`. +10323,strings_split_v1,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,599,function,"Split elements of `input` based on `sep`. Let N be the size of `input` (typically N will be the batch size). Split each element of `input` based on `sep` and return a `SparseTensor` or @@ -100151,8 +107206,8 @@ Raises: Returns: A `SparseTensor` or `RaggedTensor` of rank `N+1`, the strings split according to the delimiter." -11151,reduce_join,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,664,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." -11152,ngrams,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,673,function,"Create a tensor of n-grams based on `data`. +10324,reduce_join,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,664,function,"For docs, see: _RAGGED_REDUCE_DOCSTRING." +10325,ngrams,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,673,function,"Create a tensor of n-grams based on `data`. Creates a tensor of n-grams based on `data`. The n-grams are created by joining windows of `width` adjacent strings from the inner axis of `data` @@ -100210,8 +107265,8 @@ Raises: TypeError: if `pad_values` is set to an invalid type. ValueError: if `pad_values`, `padding_width`, or `ngram_width` is set to an invalid value." -11153,string_format,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,826,function,Version of tf.strings.format that handles RaggedTensors. -11154,ragged_tensor_to_string,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,851,function,"Returns a scalar string tensor with the contents of a RaggedTensor. +10326,string_format,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,826,function,Version of tf.strings.format that handles RaggedTensors. +10327,ragged_tensor_to_string,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,851,function,"Returns a scalar string tensor with the contents of a RaggedTensor. Requires that `rt.shape.rank` is not `None`. @@ -100235,17 +107290,7 @@ Args: summarize: If specified, then only the first and last `summarize` elements within each dimension are included in the string. If `-1` or `None`, then all elements are included." -11155,_ragged_tensor_to_string,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,896,function,"Returns a scalar string tensor with the contents of `string_tensor`. - -Args: - string_tensor: A potentially ragged tensor with dtype=string. - summarize: Include only the first and last `summarize` elements of each - dimension. If `-1` or `None`, then include all elements. - -Returns: - A scalar string Tensor." -11156,_nrows,tensorflow/tensorflow/python/ops/ragged/ragged_string_ops.py,924,function, -11157,RaggedTensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,59,class,"Represents a ragged tensor. +10328,RaggedTensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,59,class,"Represents a ragged tensor. A `RaggedTensor` is a tensor with one or more *ragged dimensions*, which are dimensions whose slices may have different lengths. For example, the inner @@ -100409,8 +107454,802 @@ t2 = RaggedTensor.from_uniform_row_length(t1, 8) # [20, 8, None, 2] t3 = RaggedTensor.from_uniform_row_length(t2, 4) # [5, 4, 8, None, 2] t4 = RaggedTensor.from_row_lengths(t3, [...]) # [3, None, 4, 8, None, 2] ```" -11158,is_ragged,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2092,function,Returns true if `value` is a ragged tensor or ragged tensor value. -11159,match_row_splits_dtypes,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2098,function,"Return a copy of `tensors` with row_splits all having the same dtype. +10329,from_value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,333,method,"Creates a `RaggedTensor` with rows partitioned by `value_rowids`. + +The returned `RaggedTensor` corresponds with the python list defined by: + +```python +result = [[values[i] for i in range(len(values)) if value_rowids[i] == row] + for row in range(nrows)] +``` + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + value_rowids: A 1-D integer tensor with shape `[nvals]`, which corresponds + one-to-one with `values`, and specifies each value's row index. Must be + nonnegative, and must be sorted in ascending order. + nrows: An integer scalar specifying the number of rows. This should be + specified if the `RaggedTensor` may containing empty training rows. Must + be greater than `value_rowids[-1]` (or zero if `value_rowids` is empty). + Defaults to `value_rowids[-1]` (or zero if `value_rowids` is empty). + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor`. `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`. + +Raises: + ValueError: If `nrows` is incompatible with `value_rowids`. + +#### Example: + +>>> print(tf.RaggedTensor.from_value_rowids( +... values=[3, 1, 4, 1, 5, 9, 2, 6], +... value_rowids=[0, 0, 0, 0, 2, 2, 2, 3], +... nrows=5)) +" +10330,from_row_splits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,391,method,"Creates a `RaggedTensor` with rows partitioned by `row_splits`. + +The returned `RaggedTensor` corresponds with the python list defined by: + +```python +result = [values[row_splits[i]:row_splits[i + 1]] + for i in range(len(row_splits) - 1)] +``` + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + row_splits: A 1-D integer tensor with shape `[nrows+1]`. Must not be + empty, and must be sorted in ascending order. `row_splits[0]` must be + zero and `row_splits[-1]` must be `nvals`. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor`. `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`. + +Raises: + ValueError: If `row_splits` is an empty list. + +#### Example: + +>>> print(tf.RaggedTensor.from_row_splits( +... values=[3, 1, 4, 1, 5, 9, 2, 6], +... row_splits=[0, 4, 4, 7, 8, 8])) +" +10331,from_row_lengths,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,437,method,"Creates a `RaggedTensor` with rows partitioned by `row_lengths`. + +The returned `RaggedTensor` corresponds with the python list defined by: + +```python +result = [[values.pop(0) for i in range(length)] + for length in row_lengths] +``` + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + row_lengths: A 1-D integer tensor with shape `[nrows]`. Must be + nonnegative. `sum(row_lengths)` must be `nvals`. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor`. `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`. + +#### Example: + +>>> print(tf.RaggedTensor.from_row_lengths( +... values=[3, 1, 4, 1, 5, 9, 2, 6], +... row_lengths=[4, 0, 3, 1, 0])) +" +10332,from_row_starts,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,479,method,"Creates a `RaggedTensor` with rows partitioned by `row_starts`. + +Equivalent to: `from_row_splits(values, concat([row_starts, nvals]))`. + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + row_starts: A 1-D integer tensor with shape `[nrows]`. Must be + nonnegative and sorted in ascending order. If `nrows>0`, then + `row_starts[0]` must be zero. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor`. `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`. + +#### Example: + +>>> print(tf.RaggedTensor.from_row_starts( +... values=[3, 1, 4, 1, 5, 9, 2, 6], +... row_starts=[0, 4, 4, 7, 8])) +" +10333,from_row_limits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,518,method,"Creates a `RaggedTensor` with rows partitioned by `row_limits`. + +Equivalent to: `from_row_splits(values, concat([0, row_limits]))`. + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + row_limits: A 1-D integer tensor with shape `[nrows]`. Must be sorted in + ascending order. If `nrows>0`, then `row_limits[-1]` must be `nvals`. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor`. `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`. + +#### Example: + +>>> print(tf.RaggedTensor.from_row_limits( +... values=[3, 1, 4, 1, 5, 9, 2, 6], +... row_limits=[4, 4, 7, 8, 8])) +" +10334,from_uniform_row_length,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,554,method,"Creates a `RaggedTensor` with rows partitioned by `uniform_row_length`. + +This method can be used to create `RaggedTensor`s with multiple uniform +outer dimensions. For example, a `RaggedTensor` with shape `[2, 2, None]` +can be constructed with this method from a `RaggedTensor` values with shape +`[4, None]`: + +>>> values = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) +>>> print(values.shape) +(4, None) +>>> rt1 = tf.RaggedTensor.from_uniform_row_length(values, 2) +>>> print(rt1) + +>>> print(rt1.shape) +(2, 2, None) + +Note that `rt1` only contains one ragged dimension (the innermost +dimension). In contrast, if `from_row_splits` is used to construct a similar +`RaggedTensor`, then that `RaggedTensor` will have two ragged dimensions: + +>>> rt2 = tf.RaggedTensor.from_row_splits(values, [0, 2, 4]) +>>> print(rt2.shape) +(2, None, None) + +Args: + values: A potentially ragged tensor with shape `[nvals, ...]`. + uniform_row_length: A scalar integer tensor. Must be nonnegative. The + size of the outer axis of `values` must be evenly divisible by + `uniform_row_length`. + nrows: The number of rows in the constructed RaggedTensor. If not + specified, then it defaults to `nvals/uniform_row_length` (or `0` if + `uniform_row_length==0`). `nrows` only needs to be specified if + `uniform_row_length` might be zero. `uniform_row_length*nrows` must + be `nvals`. + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + name: A name prefix for the RaggedTensor (optional). + +Returns: + A `RaggedTensor` that corresponds with the python list defined by: + + ```python + result = [[values.pop(0) for i in range(uniform_row_length)] + for _ in range(nrows)] + ``` + + `result.rank = values.rank + 1`. + `result.ragged_rank = values.ragged_rank + 1`." +10335,from_nested_value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,628,method,"Creates a `RaggedTensor` from a nested list of `value_rowids` tensors. + +Equivalent to: + +```python +result = flat_values +for (rowids, nrows) in reversed(zip(nested_value_rowids, nested_nrows)): + result = from_value_rowids(result, rowids, nrows) +``` + +Args: + flat_values: A potentially ragged tensor. + nested_value_rowids: A list of 1-D integer tensors. The `i`th tensor is + used as the `value_rowids` for the `i`th ragged dimension. + nested_nrows: A list of integer scalars. The `i`th scalar is used as the + `nrows` for the `i`th ragged dimension. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor` (or `flat_values` if `nested_value_rowids` is empty). + +Raises: + ValueError: If `len(nested_values_rowids) != len(nested_nrows)`." +10336,from_nested_row_splits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,684,method,"Creates a `RaggedTensor` from a nested list of `row_splits` tensors. + +Equivalent to: + +```python +result = flat_values +for row_splits in reversed(nested_row_splits): + result = from_row_splits(result, row_splits) +``` + +Args: + flat_values: A potentially ragged tensor. + nested_row_splits: A list of 1-D integer tensors. The `i`th tensor is + used as the `row_splits` for the `i`th ragged dimension. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor` (or `flat_values` if `nested_row_splits` is empty)." +10337,from_nested_row_lengths,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,723,method,"Creates a `RaggedTensor` from a nested list of `row_lengths` tensors. + +Equivalent to: + +```python +result = flat_values +for row_lengths in reversed(nested_row_lengths): + result = from_row_lengths(result, row_lengths) +``` + +Args: + flat_values: A potentially ragged tensor. + nested_row_lengths: A list of 1-D integer tensors. The `i`th tensor is + used as the `row_lengths` for the `i`th ragged dimension. + name: A name prefix for the RaggedTensor (optional). + validate: If true, then use assertions to check that the arguments form + a valid `RaggedTensor`. Note: these assertions incur a runtime cost, + since they must be checked for each tensor value. + +Returns: + A `RaggedTensor` (or `flat_values` if `nested_row_lengths` is empty)." +10338,dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,802,method,The `DType` of values in this tensor. +10339,shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,807,method,"The statically known shape of this ragged tensor. + +Returns: + A `TensorShape` containing the statically known shape of this ragged + tensor. Ragged dimensions have a size of `None`. + +Examples: + +>>> tf.ragged.constant([[0], [1, 2]]).shape +TensorShape([2, None]) + +>>> tf.ragged.constant([[[0, 1]], [[1, 2], [3, 4]]], ragged_rank=1).shape +TensorShape([2, None, 2])" +10340,get_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,828,method,"The statically known shape of this ragged tensor. + +Returns: + A `TensorShape` containing the statically known shape of this ragged + tensor. Ragged dimensions have a size of `None`. + +Alias for `shape` property. + +Examples: + +>>> tf.ragged.constant([[0], [1, 2]]).get_shape() +TensorShape([2, None]) + +>>> tf.ragged.constant( +... [[[0, 1]], [[1, 2], [3, 4]]], ragged_rank=1).get_shape() +TensorShape([2, None, 2])" +10341,ragged_rank,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,850,method,"The number of times the RaggedTensor's flat_values is partitioned. + +Examples: + +>>> values = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) +>>> values.ragged_rank +1 + +>>> rt = tf.RaggedTensor.from_uniform_row_length(values, 2) +>>> rt.ragged_rank +2 + +Returns: + A Python `int` indicating the number of times the underlying `flat_values` + Tensor has been partitioned to add a new dimension. + I.e., `tf.rank(rt) = tf.rank(rt.flat_values) + rt.ragged_rank`." +10342,values,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,872,method,"The concatenated rows for this ragged tensor. + +`rt.values` is a potentially ragged tensor formed by flattening the two +outermost dimensions of `rt` into a single dimension. + +`rt.values.shape = [nvals] + rt.shape[2:]` (where `nvals` is the +number of items in the outer two dimensions of `rt`). + +`rt.ragged_rank = self.ragged_rank - 1` + +Returns: + A potentially ragged tensor. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.values) +tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32)" +10343,row_splits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,907,method,"The row-split indices for this ragged tensor's `values`. + +`rt.row_splits` specifies where the values for each row begin and end in +`rt.values`. In particular, the values for row `rt[i]` are stored in +the slice `rt.values[rt.row_splits[i]:rt.row_splits[i+1]]`. + +Returns: + A 1-D integer `Tensor` with shape `[self.nrows+1]`. + The returned tensor is non-empty, and is sorted in ascending order. + `self.row_splits[0]` is zero, and `self.row_splits[-1]` is equal to + `self.values.shape[0]`. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.row_splits) # indices of row splits in rt.values +tf.Tensor([0 4 4 7 8 8], shape=(6,), dtype=int64)" +10344,uniform_row_length,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,930,method,"The length of each row in this ragged tensor, or None if rows are ragged. + +>>> rt1 = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) +>>> print(rt1.uniform_row_length) # rows are ragged. +None + +>>> rt2 = tf.RaggedTensor.from_uniform_row_length( +... values=rt1, uniform_row_length=2) +>>> print(rt2) + +>>> print(rt2.uniform_row_length) # rows are not ragged (all have size 2). +tf.Tensor(2, shape=(), dtype=int64) + +A RaggedTensor's rows are only considered to be uniform (i.e. non-ragged) +if it can be determined statically (at graph construction time) that the +rows all have the same length. + +Returns: + A scalar integer `Tensor`, specifying the length of every row in this + ragged tensor (for ragged tensors whose rows are uniform); or `None` + (for ragged tensors whose rows are ragged)." +10345,flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,956,method,"The innermost `values` tensor for this ragged tensor. + +Concretely, if `rt.values` is a `Tensor`, then `rt.flat_values` is +`rt.values`; otherwise, `rt.flat_values` is `rt.values.flat_values`. + +Conceptually, `flat_values` is the tensor formed by flattening the +outermost dimension and all of the ragged dimensions into a single +dimension. + +`rt.flat_values.shape = [nvals] + rt.shape[rt.ragged_rank + 1:]` +(where `nvals` is the number of items in the flattened dimensions). + +Returns: + A `Tensor`. + +#### Example: + +>>> rt = tf.ragged.constant([[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]) +>>> print(rt.flat_values) +tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32)" +10346,nested_row_splits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,985,method,"A tuple containing the row_splits for all ragged dimensions. + +`rt.nested_row_splits` is a tuple containing the `row_splits` tensors for +all ragged dimensions in `rt`, ordered from outermost to innermost. In +particular, `rt.nested_row_splits = (rt.row_splits,) + value_splits` where: + + * `value_splits = ()` if `rt.values` is a `Tensor`. + * `value_splits = rt.values.nested_row_splits` otherwise. + +Returns: + A `tuple` of 1-D integer `Tensor`s. + +#### Example: + +>>> rt = tf.ragged.constant( +... [[[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]]) +>>> for i, splits in enumerate(rt.nested_row_splits): +... print('Splits for dimension %d: %s' % (i+1, splits.numpy())) +Splits for dimension 1: [0 3] +Splits for dimension 2: [0 3 3 5] +Splits for dimension 3: [0 4 4 7 8 8]" +10347,value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1016,method,"Returns the row indices for the `values` in this ragged tensor. + +`rt.value_rowids()` corresponds one-to-one with the outermost dimension of +`rt.values`, and specifies the row containing each value. In particular, +the row `rt[row]` consists of the values `rt.values[j]` where +`rt.value_rowids()[j] == row`. + +Args: + name: A name prefix for the returned tensor (optional). + +Returns: + A 1-D integer `Tensor` with shape `self.values.shape[:1]`. + The returned tensor is nonnegative, and is sorted in ascending order. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.values) +tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) +>>> print(rt.value_rowids()) # corresponds 1:1 with rt.values +tf.Tensor([0 0 0 0 2 2 2 3], shape=(8,), dtype=int64)" +10348,nested_value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1043,method,"Returns a tuple containing the value_rowids for all ragged dimensions. + +`rt.nested_value_rowids` is a tuple containing the `value_rowids` tensors +for +all ragged dimensions in `rt`, ordered from outermost to innermost. In +particular, `rt.nested_value_rowids = (rt.value_rowids(),) + value_ids` +where: + + * `value_ids = ()` if `rt.values` is a `Tensor`. + * `value_ids = rt.values.nested_value_rowids` otherwise. + +Args: + name: A name prefix for the returned tensors (optional). + +Returns: + A `tuple` of 1-D integer `Tensor`s. + +#### Example: + +>>> rt = tf.ragged.constant( +... [[[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]]]) +>>> for i, ids in enumerate(rt.nested_value_rowids()): +... print('row ids for dimension %d: %s' % (i+1, ids.numpy())) +row ids for dimension 1: [0 0 0] +row ids for dimension 2: [0 0 0 2 2] +row ids for dimension 3: [0 0 0 0 2 2 2 3]" +10349,nrows,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1080,method,"Returns the number of rows in this ragged tensor. + +I.e., the size of the outermost dimension of the tensor. + +Args: + out_type: `dtype` for the returned tensor. Defaults to + `self.row_splits.dtype`. + name: A name prefix for the returned tensor (optional). + +Returns: + A scalar `Tensor` with dtype `out_type`. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.nrows()) # rt has 5 rows. +tf.Tensor(5, shape=(), dtype=int64)" +10350,row_starts,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1103,method,"Returns the start indices for rows in this ragged tensor. + +These indices specify where the values for each row begin in +`self.values`. `rt.row_starts()` is equal to `rt.row_splits[:-1]`. + +Args: + name: A name prefix for the returned tensor (optional). + +Returns: + A 1-D integer Tensor with shape `[nrows]`. + The returned tensor is nonnegative, and is sorted in ascending order. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.values) +tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) +>>> print(rt.row_starts()) # indices of row starts in rt.values +tf.Tensor([0 4 4 7 8], shape=(5,), dtype=int64)" +10351,row_limits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1128,method,"Returns the limit indices for rows in this ragged tensor. + +These indices specify where the values for each row end in +`self.values`. `rt.row_limits(self)` is equal to `rt.row_splits[:-1]`. + +Args: + name: A name prefix for the returned tensor (optional). + +Returns: + A 1-D integer Tensor with shape `[nrows]`. + The returned tensor is nonnegative, and is sorted in ascending order. + +#### Example: + +>>> rt = tf.ragged.constant([[3, 1, 4, 1], [], [5, 9, 2], [6], []]) +>>> print(rt.values) +tf.Tensor([3 1 4 1 5 9 2 6], shape=(8,), dtype=int32) +>>> print(rt.row_limits()) # indices of row limits in rt.values +tf.Tensor([4 4 7 8 8], shape=(5,), dtype=int64)" +10352,row_lengths,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1153,method,"Returns the lengths of the rows in this ragged tensor. + +`rt.row_lengths()[i]` indicates the number of values in the +`i`th row of `rt`. + +Args: + axis: An integer constant indicating the axis whose row lengths should be + returned. + name: A name prefix for the returned tensor (optional). + +Returns: + A potentially ragged integer Tensor with shape `self.shape[:axis]`. + +Raises: + ValueError: If `axis` is out of bounds. + +#### Example: + +>>> rt = tf.ragged.constant( +... [[[3, 1, 4], [1]], [], [[5, 9], [2]], [[6]], []]) +>>> print(rt.row_lengths()) # lengths of rows in rt +tf.Tensor([2 0 2 1 0], shape=(5,), dtype=int64) +>>> print(rt.row_lengths(axis=2)) # lengths of axis=2 rows. +" +10353,nested_row_lengths,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1202,method,"Returns a tuple containing the row_lengths for all ragged dimensions. + +`rt.nested_row_lengths()` is a tuple containing the `row_lengths` tensors +for all ragged dimensions in `rt`, ordered from outermost to innermost. + +Args: + name: A name prefix for the returned tensors (optional). + +Returns: + A `tuple` of 1-D integer `Tensors`. The length of the tuple is equal to + `self.ragged_rank`." +10354,bounding_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1223,method,"Returns the tight bounding box shape for this `RaggedTensor`. + +Args: + axis: An integer scalar or vector indicating which axes to return the + bounding box for. If not specified, then the full bounding box is + returned. + name: A name prefix for the returned tensor (optional). + out_type: `dtype` for the returned tensor. Defaults to + `self.row_splits.dtype`. + +Returns: + An integer `Tensor` (`dtype=self.row_splits.dtype`). If `axis` is not + specified, then `output` is a vector with + `output.shape=[self.shape.ndims]`. If `axis` is a scalar, then the + `output` is a scalar. If `axis` is a vector, then `output` is a vector, + where `output[i]` is the bounding size for dimension `axis[i]`. + +#### Example: + +>>> rt = tf.ragged.constant([[1, 2, 3, 4], [5], [], [6, 7, 8, 9], [10]]) +>>> rt.bounding_shape().numpy() +array([5, 4])" +10355,with_values,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1284,method,"Returns a copy of `self` with `values` replaced by `new_value`. + +Preserves cached row-partitioning tensors such as `self.cached_nrows` and +`self.cached_value_rowids` if they have values. + +Args: + new_values: Potentially ragged tensor to use as the `values` for the + returned `RaggedTensor`. Must have `rank > 0`, and must have the same + number of rows as `self.values`. + +Returns: + A `RaggedTensor`. `result.rank = 1 + new_values.rank`. + `result.ragged_rank = 1 + new_values.ragged_rank`" +10356,with_flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1312,method,"Returns a copy of `self` with `flat_values` replaced by `new_value`. + +Preserves cached row-partitioning tensors such as `self.cached_nrows` and +`self.cached_value_rowids` if they have values. + +Args: + new_values: Potentially ragged tensor that should replace + `self.flat_values`. Must have `rank > 0`, and must have the same number + of rows as `self.flat_values`. + +Returns: + A `RaggedTensor`. + `result.rank = self.ragged_rank + new_values.rank`. + `result.ragged_rank = self.ragged_rank + new_values.ragged_rank`." +10357,with_row_splits_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1333,method,"Returns a copy of this RaggedTensor with the given `row_splits` dtype. + +For RaggedTensors with multiple ragged dimensions, the `row_splits` for all +nested `RaggedTensor` objects are cast to the given dtype. + +Args: + dtype: The dtype for `row_splits`. One of `tf.int32` or `tf.int64`. + +Returns: + A copy of this RaggedTensor, with the `row_splits` cast to the given + type." +10358,merge_dims,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1363,method,"Merges outer_axis...inner_axis into a single dimension. + +Returns a copy of this RaggedTensor with the specified range of dimensions +flattened into a single dimension, with elements in row-major order. + +#### Examples: + +>>> rt = tf.ragged.constant([[[1, 2], [3]], [[4, 5, 6]]]) +>>> print(rt.merge_dims(0, 1)) + +>>> print(rt.merge_dims(1, 2)) + +>>> print(rt.merge_dims(0, 2)) +tf.Tensor([1 2 3 4 5 6], shape=(6,), dtype=int32) + +To mimic the behavior of `np.flatten` (which flattens all dimensions), use +`rt.merge_dims(0, -1). To mimic the behavior of `tf.layers.Flatten` (which +flattens all dimensions except the outermost batch dimension), use +`rt.merge_dims(1, -1)`. + +Args: + outer_axis: `int`: The first dimension in the range of dimensions to + merge. May be negative if `self.shape.rank` is statically known. + inner_axis: `int`: The last dimension in the range of dimensions to merge. + May be negative if `self.shape.rank` is statically known. + +Returns: + A copy of this tensor, with the specified dimensions merged into a + single dimension. The shape of the returned tensor will be + `self.shape[:outer_axis] + [N] + self.shape[inner_axis + 1:]`, where `N` + is the total number of slices in the merged dimensions." +10359,from_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1470,method,"Converts a `tf.Tensor` into a `RaggedTensor`. + +The set of absent/default values may be specified using a vector of lengths +or a padding value (but not both). If `lengths` is specified, then the +output tensor will satisfy `output[row] = tensor[row][:lengths[row]]`. If +'lengths' is a list of lists or tuple of lists, those lists will be used +as nested row lengths. If `padding` is specified, then any row *suffix* +consisting entirely of `padding` will be excluded from the returned +`RaggedTensor`. If neither `lengths` nor `padding` is specified, then the +returned `RaggedTensor` will have no absent/default values. + +Examples: + +>>> dt = tf.constant([[5, 7, 0], [0, 3, 0], [6, 0, 0]]) +>>> tf.RaggedTensor.from_tensor(dt) + +>>> tf.RaggedTensor.from_tensor(dt, lengths=[1, 0, 3]) + + +>>> tf.RaggedTensor.from_tensor(dt, padding=0) + + +>>> dt = tf.constant([[[5, 0], [7, 0], [0, 0]], +... [[0, 0], [3, 0], [0, 0]], +... [[6, 0], [0, 0], [0, 0]]]) +>>> tf.RaggedTensor.from_tensor(dt, lengths=([2, 0, 3], [1, 1, 2, 0, 1])) + + +Args: + tensor: The `Tensor` to convert. Must have rank `ragged_rank + 1` or + higher. + lengths: An optional set of row lengths, specified using a 1-D integer + `Tensor` whose length is equal to `tensor.shape[0]` (the number of rows + in `tensor`). If specified, then `output[row]` will contain + `tensor[row][:lengths[row]]`. Negative lengths are treated as zero. You + may optionally pass a list or tuple of lengths to this argument, which + will be used as nested row lengths to construct a ragged tensor with + multiple ragged dimensions. + padding: An optional padding value. If specified, then any row suffix + consisting entirely of `padding` will be excluded from the returned + RaggedTensor. `padding` is a `Tensor` with the same dtype as `tensor` + and with `shape=tensor.shape[ragged_rank + 1:]`. + ragged_rank: Integer specifying the ragged rank for the returned + `RaggedTensor`. Must be greater than zero. + name: A name prefix for the returned tensors (optional). + row_splits_dtype: `dtype` for the returned `RaggedTensor`'s `row_splits` + tensor. One of `tf.int32` or `tf.int64`. + +Returns: + A `RaggedTensor` with the specified `ragged_rank`. The shape of the + returned ragged tensor is compatible with the shape of `tensor`. +Raises: + ValueError: If both `lengths` and `padding` are specified." +10360,to_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1675,method,"Converts this `RaggedTensor` into a `tf.Tensor`. + +If `shape` is specified, then the result is padded and/or truncated to +the specified shape. + +Examples: + +>>> rt = tf.ragged.constant([[9, 8, 7], [], [6, 5], [4]]) +>>> print(rt.to_tensor()) +tf.Tensor( + [[9 8 7] [0 0 0] [6 5 0] [4 0 0]], shape=(4, 3), dtype=int32) +>>> print(rt.to_tensor(shape=[5, 2])) +tf.Tensor( + [[9 8] [0 0] [6 5] [4 0] [0 0]], shape=(5, 2), dtype=int32) + +Args: + default_value: Value to set for indices not specified in `self`. Defaults + to zero. `default_value` must be broadcastable to + `self.shape[self.ragged_rank + 1:]`. + name: A name prefix for the returned tensors (optional). + shape: The shape of the resulting dense tensor. In particular, + `result.shape[i]` is `shape[i]` (if `shape[i]` is not None), or + `self.bounding_shape(i)` (otherwise).`shape.rank` must be `None` or + equal to `self.rank`. + +Returns: + A `Tensor` with shape `ragged.bounding_shape(self)` and the + values specified by the non-empty values in `self`. Empty values are + assigned `default_value`." +10361,from_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1742,method,"Converts a 2D `tf.sparse.SparseTensor` to a `RaggedTensor`. + +Each row of the `output` `RaggedTensor` will contain the explicit values +from the same row in `st_input`. `st_input` must be ragged-right. If not +it is not ragged-right, then an error will be generated. + +Example: + +>>> indices = [[0, 0], [0, 1], [0, 2], [1, 0], [3, 0]] +>>> st = tf.sparse.SparseTensor(indices=indices, +... values=[1, 2, 3, 4, 5], +... dense_shape=[4, 3]) +>>> tf.RaggedTensor.from_sparse(st).to_list() +[[1, 2, 3], [4], [], [5]] + +Currently, only two-dimensional `SparseTensors` are supported. + +Args: + st_input: The sparse tensor to convert. Must have rank 2. + name: A name prefix for the returned tensors (optional). + row_splits_dtype: `dtype` for the returned `RaggedTensor`'s `row_splits` + tensor. One of `tf.int32` or `tf.int64`. + +Returns: + A `RaggedTensor` with the same values as `st_input`. + `output.ragged_rank = rank(st_input) - 1`. + `output.shape = [st_input.dense_shape[0], None]`. +Raises: + ValueError: If the number of dimensions in `st_input` is not known + statically, or is not two." +10362,to_sparse,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1804,method,"Converts this `RaggedTensor` into a `tf.sparse.SparseTensor`. + +Example: + +>>> rt = tf.ragged.constant([[1, 2, 3], [4], [], [5, 6]]) +>>> print(rt.to_sparse()) +SparseTensor(indices=tf.Tensor( + [[0 0] [0 1] [0 2] [1 0] [3 0] [3 1]], + shape=(6, 2), dtype=int64), + values=tf.Tensor([1 2 3 4 5 6], shape=(6,), dtype=int32), + dense_shape=tf.Tensor([4 3], shape=(2,), dtype=int64)) + +Args: + name: A name prefix for the returned tensors (optional). + +Returns: + A SparseTensor with the same values as `self`." +10363,numpy,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1944,method,"Returns a numpy `array` with the values for this `RaggedTensor`. + +Requires that this `RaggedTensor` was constructed in eager execution mode. + +Ragged dimensions are encoded using numpy `arrays` with `dtype=object` and +`rank=1`, where each element is a single row. + +#### Examples + +In the following example, the value returned by `RaggedTensor.numpy()` +contains three numpy `array` objects: one for each row (with `rank=1` and +`dtype=int64`), and one to combine them (with `rank=1` and `dtype=object`): + +>>> tf.ragged.constant([[1, 2, 3], [4, 5]], dtype=tf.int64).numpy() +array([array([1, 2, 3]), array([4, 5])], dtype=object) + +Uniform dimensions are encoded using multidimensional numpy `array`s. In +the following example, the value returned by `RaggedTensor.numpy()` contains +a single numpy `array` object, with `rank=2` and `dtype=int64`: + +>>> tf.ragged.constant([[1, 2, 3], [4, 5, 6]], dtype=tf.int64).numpy() +array([[1, 2, 3], [4, 5, 6]]) + +Returns: + A numpy `array`." +10364,to_list,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,1984,method,"Returns a nested Python `list` with the values for this `RaggedTensor`. + +Requires that `rt` was constructed in eager execution mode. + +Returns: + A nested Python `list`." +10365,consumers,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2088,method, +10366,stub,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2022,method, +10367,is_ragged,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2092,function,Returns true if `value` is a ragged tensor or ragged tensor value. +10368,match_row_splits_dtypes,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2098,function,"Return a copy of `tensors` with row_splits all having the same dtype. Args: *tensors: A list of Tensors or RaggedTensors. @@ -100420,8 +108259,65 @@ Args: Returns: The converted list of `Tensors` and `RaggedTensors`." -11160,RaggedTensorSpec,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2149,class,Type specification for a `tf.RaggedTensor`. -11161,convert_to_tensor_or_ragged_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2412,function,"Converts value to a `RaggedTensor` or `Tensor`. +10369,RaggedTensorSpec,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2149,class,Type specification for a `tf.RaggedTensor`. +10370,dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2155,method,"The `tf.dtypes.DType` specified by this type for the RaggedTensor. + +Examples: + +>>> rt = tf.ragged.constant([[""a""], [""b"", ""c""]], dtype=tf.string) +>>> tf.type_spec_from_value(rt).dtype +tf.string + +Returns: + A `tf.dtypes.DType` of the values in the RaggedTensor." +10371,shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2170,method,"The statically known shape of the RaggedTensor. + +Examples: + +>>> rt = tf.ragged.constant([[0], [1, 2]]) +>>> tf.type_spec_from_value(rt).shape +TensorShape([2, None]) + +>>> rt = tf.ragged.constant([[[0, 1]], [[1, 2], [3, 4]]], ragged_rank=1) +>>> tf.type_spec_from_value(rt).shape +TensorShape([2, None, 2]) + +Returns: + A `tf.TensorShape` containing the statically known shape of the + RaggedTensor. Ragged dimensions have a size of `None`." +10372,ragged_rank,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2190,method,"The number of times the RaggedTensor's flat_values is partitioned. + +Defaults to `shape.ndims - 1`. + +Examples: + +>>> values = tf.ragged.constant([[1, 2, 3], [4], [5, 6], [7, 8, 9, 10]]) +>>> tf.type_spec_from_value(values).ragged_rank +1 + +>>> rt1 = tf.RaggedTensor.from_uniform_row_length(values, 2) +>>> tf.type_spec_from_value(rt1).ragged_rank +2 + +Returns: + A Python `int` indicating the number of times the underlying `flat_values` + Tensor has been partitioned to add a new dimension. + I.e., `tf.rank(rt) = tf.rank(rt.flat_values) + rt.ragged_rank`." +10373,row_splits_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2213,method,"The `tf.dtypes.DType` of the the RaggedTensor's `row_splits`. + +Examples: + +>>> rt = tf.ragged.constant([[1, 2, 3], [4]], row_splits_dtype=tf.int64) +>>> tf.type_spec_from_value(rt).row_splits_dtype +tf.int64 + +Returns: + A `tf.dtypes.DType` for the RaggedTensor's `row_splits` tensor. One + of `tf.int32` or `tf.int64`." +10374,value_type,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2229,method, +10375,is_compatible_with,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2266,method, +10376,from_value,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2397,method, +10377,convert_to_tensor_or_ragged_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2412,function,"Converts value to a `RaggedTensor` or `Tensor`. * If `value` is a `RaggedTensor`, then return it as-is. * If `value` is a `RaggedTensorValue`, return a corresponding constant @@ -100440,29 +108336,11 @@ Args: Returns: A `Tensor` or `RaggedTensor`." -11162,_ragged_tensor_value_from_components,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2459,function, -11163,_ragged_tensor_session_fetch,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2467,function, -11164,_ragged_tensor_session_feed,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2472,function, -11165,_ragged_tensor_session_feed_for_partial_run,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2478,function, -11166,RaggedTensorType,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2490,class,"Encoding of a static type for a `RaggedTensor`. +10378,RaggedTensorType,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2490,class,"Encoding of a static type for a `RaggedTensor`. Use this type to express/declare that an output must have the type of `RaggedTensor`." -11167,_assert_sparse_indices_are_ragged_right,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2523,function,"Checks that the given SparseTensor.indices tensor is ragged-right. - -Example: `indices = [[0, 0], [0, 1], [2, 0], [3, 1]]` is not ragged right -because the entry `[3, 1]` skips a cell. - -Args: - indices: The SparseTensor indices to check. - -Returns: - A list of control dependency op tensors." -11168,_ragged_tensor_to_sparse_gradient,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2565,function,Gradient for RaggedTensorToSparse. -11169,_assert_monotonic_increasing,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2584,function, -11170,_assert_zero,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2589,function, -11171,_nrows,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2594,function, -11172,merge_dims,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2601,function,"Merges value[outer_axis...inner_axis] into a single dimension. +10379,merge_dims,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2601,function,"Merges value[outer_axis...inner_axis] into a single dimension. See `RaggedTensor.merge_dims()` for more details. This helper differs from `RaggedTensor.merge_dims()` in that `value` may be a dense or ragged tensor. @@ -100474,53 +108352,8 @@ Args: Returns: A flattened `RaggedTensor` or `Tensor`." -11173,_prod,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2668,function,Returns the product of the numbers in a list. -11174,_get_row_partition_type_tensor_pairs_tail,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2673,function,"Gets a row partition type tensor pair for the tail. - -If value_rowid is defined, then it is used. Otherwise, row_splits -are used. - -Args: - partition: a RowPartition. - -Returns: - A list of (row_partition_type, row_partition_tensor) pairs." -11175,_get_row_partition_type_tensor_pairs,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2691,function,"Gets a list of the row partitions for rt_input. - -If value_rowids are defined, then they are used. Otherwise, row_splits -are used. If the outermost level has value_rowids defind, then nrows is -also added. - -Args: - rt_input: a ragged tensor. - -Returns: - A list of (row_partition_type, row_partition_tensor) pairs." -11176,_shape_as_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2714,function,"Takes shape and coerces it to a shape as a tensor. - -If the object is already a tensor, simply passes it on (result is guaranteed -to be int64 or int32, but not necessarily dtype). -If not, creates a tensor of type dtype. - -Result is either a scalar equal to -1 if the shape is unknown_rank. -Otherwise, it is a vector, where unknown dimensions are represented with a -value of -1. - -In C++, see TensorShapeFromTensor for parsing shapes in kernels, and -InferenceContext::MakeShapeFromShapeTensorTreatScalarAsUnknownShape, for -use in the shape inference function. - -Args: - shape: input to coerce from TensorShape, Tensor, None, List[Optional[Int]], - Tuple[Optional[Int]]. - dtype: tf.int64 or tf.int32 - -Returns: - a scalar or vector tensor of dtype tf.int32 or tf.int64." -11177,_nvals_uniform_row_length,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2753,function,Get the number of values for uniform row length constructor. -11178,_get_optional_partition_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor.py,2765,function,"Returns the partition dtype, or None if None exists." -11179,RaggedTensorBoundingShapeOp,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_bounding_shape_op_test.py,31,class, -11180,RaggedTensorDynamicShape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,35,class,"A collection of tensors encoding the shape of a potentially ragged tensor. +10380,RaggedTensorBoundingShapeOp,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_bounding_shape_op_test.py,31,class, +10381,RaggedTensorDynamicShape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,35,class,"A collection of tensors encoding the shape of a potentially ragged tensor. Each `RaggedTensorDynamicShape` consists of an ordered list of dimension sizes. There are two dimension types: @@ -100567,7 +108400,72 @@ Tensor | Ragged | Partitioned Dim Sizes | Inner Dim `[[1, 2], [], [3, 4, 5]]` | 1 | `3, (2, 0, 3)` | `[[[1, 2], [3, 4]], [[5, 6]]]` | 1 | `2, (2, 1)` | 2 `[[[1, 2], [3]], [[4, 5]]]` | 2 | `2, (2, 1), (2, 1, 2)` |" -11181,broadcast_dynamic_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,444,function,"Returns the shape formed by broadcasting two shapes to be compatible. +10382,from_dim_sizes,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,152,method,"Constructs a ragged shape from a list of dimension sizes. + +This list contains a single tensor for each dimension, where the tensor +is a scalar if the dimension is uniform, or a vector if the dimension is +ragged. + +Args: + dim_sizes: List of int32 or int64 scalars or vectors. + +Returns: + A RaggedTensorDynamicShape." +10383,from_tensor,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,181,method,Constructs a ragged shape for a potentially ragged tensor. +10384,dimension_size,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,195,method,Returns the size of slices across the specified dimension. +10385,is_ragged,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,205,method,Returns true if the indicated dimension is ragged. +10386,rank,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,219,method,"The number of dimensions in this shape, or None if unknown." +10387,partitioned_dim_sizes,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,228,method,"The partitioned dimension sizes for this shape. + +Returns: + A `list` of 0-D or 1-D integer `Tensor`." +10388,inner_dim_sizes,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,237,method,"The inner dimension sizes for this shape. + +Returns: + A 1-D integer `Tensor`." +10389,num_partitioned_dimensions,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,246,method,The number of partitioned dimensions in this shape. +10390,num_inner_dimensions,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,251,method,"The number of inner dimensions, or `None` if not statically known." +10391,dim_size_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,256,method,DType used by this shape for dimension sizes. +10392,broadcast_to_rank,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,260,method,"Adds leading size-1 dimensions to broadcast `self` to the given rank. + +E.g., if `shape1` is `[3, (D2), 4]`, then `shape1.broadcast_to_rank(5)` +is `[1, 1, 3, (D2), 4]`. + +Args: + rank: The rank for the returned shape. + +Returns: + A RaggedTensorDynamicShape with `rank` dimensions, whose inner dimensions + have the same size as `self` and whose outer dimensions have size `1`. + +Raises: + ValueError: If `self.rank` is unknown or greater than `rank`." +10393,broadcast_dimension,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,294,method,"Returns a shape that is broadcast-compatible with self & lengths. + +* If dimension[axis] is uniform and lengths is a scalar, the check + that either lengths==1 or axis==1 or lengths==axis, and tile + dimension[axis] with tf.where(lengths==axis, 1, axis) repeats. + +* If dimension[axis] is uniform and lengths is a vector, then check + that dimension[axis]==1, and raggedly tile dimension[axis] with + lengths repeats. (we can skip tiling if we statically know that + slice_lengths == 1??) + +* If dimension[axis] is ragged and lengths is a scalar, then check + that lengths==1. + +* If dimension[axis] is ragged and lengths is a vector, then check + that self.dimension_size(axis) == lengths. + +Args: + axis: `int`. The dimension to broadcast. + lengths: 0-D or 1-D integer `Tensor`. + +Returns: + A `RaggedTensorDynamicShape`." +10394,num_slices_in_dimension,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,374,method,Returns the total number of slices across the indicated dimension. +10395,with_dim_size_dtype,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,434,method, +10396,broadcast_dynamic_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,444,function,"Returns the shape formed by broadcasting two shapes to be compatible. Args: shape_x: A `RaggedTensorDynamicShape` @@ -100577,7 +108475,7 @@ Returns: A `RaggedTensorDynamicShape`. Raises: ValueError: If `shape_x` and `shape_y` are not broadcast-compatible." -11182,broadcast_to,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,476,function,"Broadcasts a potentially ragged tensor to a ragged shape. +10397,broadcast_to,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,476,function,"Broadcasts a potentially ragged tensor to a ragged shape. Tiles `rt_input` as necessary to match the given shape. @@ -100592,23 +108490,20 @@ Args: Returns: A potentially ragged tensor whose values are taken from `rt_input`, and whose shape matches `shape`." -11183,_broadcast_to_uniform_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,506,function,Broadcasts rt_input to the uniform shape `shape`. -11184,_broadcast_to_ragged_shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,516,function,Broadcasts rt_input to the ragged shape `dst_shape`. -11185,_ragged_tile_axis,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape.py,601,function,Tile a dimension of a RaggedTensor to match a ragged shape. -11186,RaggedTensorShapeTest,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_shape_test.py,34,class, -11187,int32array,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_test.py,47,function, -11188,RaggedTensorTest,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_test.py,52,class, -11189,RaggedTensorSpecTest,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_test.py,1560,class, -11190,RaggedTensorValue,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,27,class,"Represents the value of a `RaggedTensor`. +10398,int32array,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_test.py,47,function, +10399,RaggedTensorValue,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,27,class,"Represents the value of a `RaggedTensor`. Warning: `RaggedTensorValue` should only be used in graph mode; in eager mode, the `tf.RaggedTensor` class contains its value directly. See `tf.RaggedTensor` for a description of ragged tensors." -11191,RaggedTileOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_tile_op_test.py,33,class, -11192,RaggedTensorToSparseOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_to_sparse_op_test.py,35,class, -11193,make_placeholder,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,46,function, -11194,rebuild_ragged_tensor_with_value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,50,function,"Returns a copy of `rt`, built using `from_value_rowids`. +10400,flat_values,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,66,method,The innermost `values` array for this ragged tensor value. +10401,nested_row_splits,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,74,method,The row_splits for all ragged dimensions in this ragged tensor value. +10402,ragged_rank,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,84,method,The number of ragged dimensions in this ragged tensor value. +10403,shape,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,90,method,A tuple indicating the shape of this RaggedTensorValue. +10404,to_list,tensorflow/tensorflow/python/ops/ragged/ragged_tensor_value.py,101,method,Returns this ragged tensor value as a nested Python list. +10405,make_placeholder,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,46,function, +10406,rebuild_ragged_tensor_with_value_rowids,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,50,function,"Returns a copy of `rt`, built using `from_value_rowids`. This ensures that RaggedTensor._cached_value_rowids is populated, which triggers a different code-path for converting ragged tensors to tensors. @@ -100627,9 +108522,22 @@ Args: Returns: A copy of `rt`, built using `from_value_rowids`." -11195,RaggedTensorToTensorOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,91,class, -11196,RaggedToDenseBenchmark,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,725,class, -11197,assert_splits_match,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,31,function,"Checks that the given splits lists are identical. +10407,RaggedToDenseBenchmark,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,725,class, +10408,run_benchmark,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,747,method,"Run a benchmark with the specified configuration parameters. + +Args: + shape: Bounding box for the input ragged tensor. + ragged_rank: Ragged rank for the input ragged tensor. Defaults to + `len(shape)-1`. + dtype: Data type for the input ragged tensor. + fill: How full each dimension should be (0-1). Corresponds 1:1 with + `shape`. Defaults to 0.8 for each dimension. + default_shape: Shape for the default (padding) value. + output_shape: Output shape -- ragged tensor will be padded or cropped to + this shape. + min_iters: Minimum iterations for benchmark." +10409,benchmark_ragged_to_dense,tensorflow/tensorflow/python/ops/ragged/ragged_to_tensor_op_test.py,842,method, +10410,assert_splits_match,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,31,function,"Checks that the given splits lists are identical. Performs static tests to ensure that the given splits lists are identical, and returns a list of control dependency op tensors that check that they are @@ -100644,8 +108552,8 @@ Returns: A list of control dependency op tensors. Raises: ValueError: If the splits are not identical." -11198,lengths_to_splits,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,65,function,Returns splits corresponding to the given lengths. -11199,repeat_ranges,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,70,function,"Repeats each range of `params` (as specified by `splits`) `repeats` times. +10411,lengths_to_splits,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,65,function,Returns splits corresponding to the given lengths. +10412,repeat_ranges,tensorflow/tensorflow/python/ops/ragged/ragged_util.py,70,function,"Repeats each range of `params` (as specified by `splits`) `repeats` times. Let the `i`th range of `params` be defined as `params[splits[i]:splits[i + 1]]`. Then this function returns a tensor @@ -100670,8 +108578,7 @@ Returns: ... repeats=tf.constant(3))) tf.Tensor([b'a' b'b' b'a' b'b' b'a' b'b' b'c' b'c' b'c'], shape=(9,), dtype=string)" -11200,RaggedUtilTest,tensorflow/tensorflow/python/ops/ragged/ragged_util_test.py,45,class, -11201,where,tensorflow/tensorflow/python/ops/ragged/ragged_where_op.py,30,function,"Return the elements, either from `x` or `y`, depending on the `condition`. +10413,where,tensorflow/tensorflow/python/ops/ragged/ragged_where_op.py,30,function,"Return the elements, either from `x` or `y`, depending on the `condition`. : If both `x` and `y` are `None`: Returns the coordinates of true elements of `condition`. The coordinates @@ -100736,11 +108643,7 @@ tf.Tensor( [[0 0] [0 2] [1 1]], shape=(3, 2), dtype=int64) >>> y = tf.ragged.constant([['a', 'b', 'c'], ['d', 'e']]) >>> print(where(condition, x, y)) " -11202,_elementwise_where,tensorflow/tensorflow/python/ops/ragged/ragged_where_op.py,111,function,"Ragged version of tf.where(condition, x, y)." -11203,_coordinate_where,tensorflow/tensorflow/python/ops/ragged/ragged_where_op.py,137,function,Ragged version of tf.where(condition). -11204,_nrows,tensorflow/tensorflow/python/ops/ragged/ragged_where_op.py,160,function, -11205,RaggedWhereOpTest,tensorflow/tensorflow/python/ops/ragged/ragged_where_op_test.py,29,class, -11206,RowPartition,tensorflow/tensorflow/python/ops/ragged/row_partition.py,51,class,"Partitioning of a sequence of values into contiguous subsequences (""rows""). +10414,RowPartition,tensorflow/tensorflow/python/ops/ragged/row_partition.py,51,class,"Partitioning of a sequence of values into contiguous subsequences (""rows""). A `RowPartition` describes how a sequence with `nvals` items should be divided into `nrows` contiguous subsequences (""rows""). For example, a @@ -100795,28 +108698,302 @@ such as common subexpression elimination will typically prevent these unnecessary recomputations.) To check which encodings are precomputed, use `RowPartition.has_precomputed_`. To cache an additional encoding, use `RowPartition.with_precomputed_`." -11207,RowPartitionSpec,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1029,class,Type specification for a `tf.RowPartition`. -11208,_assert_monotonic_increasing,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1178,function, -11209,_assert_zero,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1183,function, -11210,_cast_if_not_none,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1188,function, -11211,_merge_tensors,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1192,function,"Merge two optional Tensors with equal values into a single Tensor. +10415,from_value_rowids,tensorflow/tensorflow/python/ops/ragged/row_partition.py,188,method,"Creates a `RowPartition` with rows partitioned by `value_rowids`. + +This `RowPartition` divides a sequence `values` into rows by specifying +which row each value should be added to: + +```python +partitioned_rows = [[] for _ in nrows] +for (value, rowid) in zip(values, value_rowids): + partitioned_rows[rowid].append(value) +`` Args: - t1: tf.Tensor or None - t2: tf.Tensor or None - name: A name for the tensors (for error messages) - validate: If true, then check that `t1` is compatible with `t2` (if both are - non-None). + value_rowids: A 1-D integer tensor with shape `[nvals]`, which corresponds + one-to-one with `values`, and specifies each value's row index. Must be + nonnegative, and must be sorted in ascending order. + nrows: An integer scalar specifying the number of rows. This should be + specified if the `RowPartition` may containing empty training rows. Must + be greater than `value_rowids[-1]` (or greater than or equal to zero if + `value_rowids` is empty). Defaults to `value_rowids[-1]` (or zero if + `value_rowids` is empty). + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: The dtype to encode value_rowids if it doesn't already + have one. The default is tf.int64. Returns: - A pair `(merged_value, validated)`: - * `merged_value` is `t1` if it is not None; or `t2` otherwise. - * `validated` is true if we validated that t1 and t2 are equal (either - by adding a check, or because t1 is t2)." -11212,RowPartitionTest,tensorflow/tensorflow/python/ops/ragged/row_partition_test.py,39,class, -11213,RowPartitionSpecTest,tensorflow/tensorflow/python/ops/ragged/row_partition_test.py,670,class, -11214,_assert_row_partition_equal,tensorflow/tensorflow/python/ops/ragged/row_partition_test.py,864,function, -11215,row_splits_to_segment_ids,tensorflow/tensorflow/python/ops/ragged/segment_id_ops.py,36,function,"Generates the segmentation corresponding to a RaggedTensor `row_splits`. + A `RowPartition`. + +Raises: + ValueError: If `nrows` is incompatible with `value_rowids`. + +#### Example: + +>>> print(RowPartition.from_value_rowids( +... value_rowids=[0, 0, 0, 0, 2, 2, 2, 3], +... nrows=4)) +tf.RowPartition(row_splits=tf.Tensor([0 4 4 7 8], shape=(5,), dtype=int64))" +10416,from_row_splits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,302,method,"Creates a `RowPartition` with rows partitioned by `row_splits`. + +This `RowPartition` divides a sequence `values` into rows by indicating +where each row begins and ends: + +```python +partitioned_rows = [] +for i in range(len(row_splits) - 1): + row_start = row_splits[i] + row_end = row_splits[i + 1] + partitioned_rows.append(values[row_start:row_end]) +``` + +Args: + row_splits: A 1-D integer tensor with shape `[nrows+1]`. Must not be + empty, and must be sorted in ascending order. `row_splits[0]` must be + zero. + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: If row_splits has an unspecified type, use this one. If + preferred_dtype is None, defaults to dtypes.int64. + +Returns: + A `RowPartition`. + +Raises: + ValueError: If `row_splits` is an empty list." +10417,from_row_lengths,tensorflow/tensorflow/python/ops/ragged/row_partition.py,356,method,"Creates a `RowPartition` with rows partitioned by `row_lengths`. + +This `RowPartition` divides a sequence `values` into rows by indicating +the length of each row: + +```python +partitioned_rows = [[values.pop(0) for _ in range(length)] + for length in row_lengths] +``` + +Args: + row_lengths: A 1-D integer tensor with shape `[nrows]`. Must be + nonnegative. + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: If row_lengths has an unspecified type, use this one. If + preferred_dtype is None, defaults to dtypes.int64. + +Returns: + A `RowPartition`." +10418,from_row_starts,tensorflow/tensorflow/python/ops/ragged/row_partition.py,401,method,"Creates a `RowPartition` with rows partitioned by `row_starts`. + +Equivalent to: `from_row_splits(concat([row_starts, nvals], axis=0))`. + +Args: + row_starts: A 1-D integer tensor with shape `[nrows]`. Must be + nonnegative and sorted in ascending order. If `nrows>0`, then + `row_starts[0]` must be zero. + nvals: A scalar tensor indicating the number of values. + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: If row_limits has an unspecified type, use this one. If + preferred_dtype is None, defaults to dtypes.int64. + +Returns: + A `RowPartition`." +10419,from_row_limits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,444,method,"Creates a `RowPartition` with rows partitioned by `row_limits`. + +Equivalent to: `from_row_splits(values, concat([0, row_limits], axis=0))`. + +Args: + row_limits: A 1-D integer tensor with shape `[nrows]`. Must be sorted in + ascending order. + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: If row_limits has an unspecified type, use this one. If + preferred_dtype is None, defaults to dtypes.int64. + +Returns: + A `RowPartition`." +10420,from_uniform_row_length,tensorflow/tensorflow/python/ops/ragged/row_partition.py,483,method,"Creates a `RowPartition` with rows partitioned by `uniform_row_length`. + +This `RowPartition` divides a sequence `values` into rows that all have +the same length: + +```python +partitioned_rows = [[values.pop(0) for _ in range(uniform_row_length)] + for _ in range(nrows)] +``` + +Args: + uniform_row_length: A scalar integer tensor. Must be nonnegative. The + size of the outer axis of `values` must be evenly divisible by + `uniform_row_length`. + nvals: a non-negative scalar integer tensor for the number of values. + nrows: The number of rows in the constructed RowPartition. If not + specified, then it defaults to `nvals/uniform_row_length` (or `0` if + `uniform_row_length==0`). `nrows` only needs to be specified if + `uniform_row_length` might be zero. `uniform_row_length*nrows` must be + `nvals`. + validate: If true, then use assertions to check that the arguments form a + valid `RowPartition`. + preferred_dtype: if uniform_row_length has no dtype, use this one. + +Returns: + A `RowPartition`." +10421,with_dependencies,tensorflow/tensorflow/python/ops/ragged/row_partition.py,622,method,"Returns a new RowPartition equal to self with control dependencies. + +Specifically, self._row_splits is gated by the given control dependencies. +Used to add sanity checks to the constructors. + +Args: + dependencies: a list of tensors to use as dependencies. + +Returns: + A new RowPartition object." +10422,dtype,tensorflow/tensorflow/python/ops/ragged/row_partition.py,649,method,The `DType` used to encode the row partition (either int32 or int64). +10423,row_splits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,653,method,"Returns the row-split indices for this row partition. + +`row_splits` specifies where the values for each row begin and end. +In particular, the values for row `i` are stored in the slice +`values[row_splits[i]:row_splits[i+1]]`. + +Returns: + A 1-D integer `Tensor` with shape `[self.nrows+1]`. + The returned tensor is non-empty, and is sorted in ascending order. + `self.row_splits()[0] == 0`. + `self.row_splits()[-1] == self.nvals()`." +10424,value_rowids,tensorflow/tensorflow/python/ops/ragged/row_partition.py,668,method,"Returns the row indices for this row partition. + +`value_rowids` specifies the row index fo reach value. In particular, +`value_rowids[i]` is the row index for `values[i]`. + +Returns: + A 1-D integer `Tensor` with shape `[self.nvals()]`. + The returned tensor is nonnegative, and is sorted in ascending order." +10425,nvals,tensorflow/tensorflow/python/ops/ragged/row_partition.py,682,method,"Returns the number of values partitioned by this `RowPartition`. + +If the sequence partitioned by this `RowPartition` is a tensor, then +`nvals` is the size of that tensor's outermost dimension -- i.e., +`nvals == values.shape[0]`. + +Args: + out_type: `dtype` for the returned tensor. Defaults to `self.dtype`. + +Returns: + scalar integer Tensor" +10426,nrows,tensorflow/tensorflow/python/ops/ragged/row_partition.py,701,method,"Returns the number of rows created by this `RowPartition`. + +Args: + out_type: `dtype` for the returned tensor. Defaults to `self.dtype`. + +Returns: + scalar integer Tensor" +10427,uniform_row_length,tensorflow/tensorflow/python/ops/ragged/row_partition.py,722,method,"Returns the length of each row in this partition, if rows are uniform. + +If all rows in this `RowPartition` have the same length, then this returns +that length as a scalar integer `Tensor`. Otherwise, it returns `None`. + +Returns: + scalar Tensor with `type=self.dtype`, or `None`." +10428,row_starts,tensorflow/tensorflow/python/ops/ragged/row_partition.py,733,method,"Returns the start indices for rows in this row partition. + +These indices specify where the values for each row begin. +`partition.row_starts()` is equal to `partition.row_splits()[:-1]`. + +Returns: + A 1-D integer Tensor with shape `[self.nrows()]`. + The returned tensor is nonnegative, and is sorted in ascending order. + `self.row_starts()[0] == 0`. + `self.row_starts()[-1] <= self.nvals()`." +10429,row_limits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,747,method,"Returns the limit indices for rows in this row partition. + +These indices specify where the values for each row end. +`partition.row_limits()` is equal to `partition.row_splits()[:-1]`. + +Returns: + A 1-D integer Tensor with shape `[self.nrows]`. + The returned tensor is nonnegative, and is sorted in ascending order. + `self.row_limits()[-1] == self.nvals()`." +10430,row_lengths,tensorflow/tensorflow/python/ops/ragged/row_partition.py,760,method,"Returns the lengths of rows in this `RowPartition`. + +Returns: + A 1-D integer Tensor with shape `[self.nrows]`. + The returned tensor is nonnegative. + `tf.reduce_sum(self.row_lengths) == self.nvals()`." +10431,static_nrows,tensorflow/tensorflow/python/ops/ragged/row_partition.py,774,method,"The number of rows in this partition, if statically known. + +```python +self.row_lengths().shape == [self.static_nrows] +self.row_starts().shape == [self.static_nrows] +self.row_limits().shape == [self.static_nrows] +self.row_splits().shape == [self.static_nrows + 1] +``` + +Returns: + The number of rows in this partition as an `int` (if statically known); + or `None` (otherwise)." +10432,static_nvals,tensorflow/tensorflow/python/ops/ragged/row_partition.py,801,method,"The number of values in this partition, if statically known. + +```python +self.value_rowids().shape == [self.static_vals] +``` + +Returns: + The number of values in this partition as an `int` (if statically known); + or `None` (otherwise)." +10433,static_uniform_row_length,tensorflow/tensorflow/python/ops/ragged/row_partition.py,819,method,"The number of values in each row of this partition, if statically known. + +Returns: + The number of values in each row of this partition as an `int` (if + statically known); or `None` (otherwise)." +10434,with_row_splits_dtype,tensorflow/tensorflow/python/ops/ragged/row_partition.py,834,method,"Returns a copy of this RowPartition with the given `row_splits` dtype. + +For RaggedTensors with multiple ragged dimensions, the `row_splits` for all +nested `RaggedTensor` objects are cast to the given dtype. + +Args: + dtype: The dtype for `row_splits`. One of `tf.int32` or `tf.int64`. + +Returns: + A copy of this RaggedTensor, with the `row_splits` cast to the given + type." +10435,has_precomputed_row_splits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,872,method,"Returns true if `row_splits` has already been computed. + +If true, then `self.row_splits()` will return its value without calling +any TensorFlow ops." +10436,has_precomputed_row_lengths,tensorflow/tensorflow/python/ops/ragged/row_partition.py,880,method,"Returns true if `row_lengths` has already been computed. + +If true, then `self.row_lengths()` will return its value without calling +any TensorFlow ops." +10437,has_precomputed_value_rowids,tensorflow/tensorflow/python/ops/ragged/row_partition.py,888,method,"Returns true if `value_rowids` has already been computed. + +If true, then `self.value_rowids()` will return its value without calling +any TensorFlow ops." +10438,has_precomputed_nrows,tensorflow/tensorflow/python/ops/ragged/row_partition.py,896,method,"Returns true if `nrows` has already been computed. + +If true, then `self.nrows()` will return its value without calling +any TensorFlow ops." +10439,with_precomputed_row_splits,tensorflow/tensorflow/python/ops/ragged/row_partition.py,904,method,Returns a copy of `self` with `row_splits` precomputed. +10440,with_precomputed_row_lengths,tensorflow/tensorflow/python/ops/ragged/row_partition.py,914,method,Returns a copy of `self` with `row_lengths` precomputed. +10441,with_precomputed_value_rowids,tensorflow/tensorflow/python/ops/ragged/row_partition.py,924,method,Returns a copy of `self` with `value_rowids` precomputed. +10442,with_precomputed_nrows,tensorflow/tensorflow/python/ops/ragged/row_partition.py,934,method,Returns a copy of `self` with `nrows` precomputed. +10443,merge_precomputed_encodings,tensorflow/tensorflow/python/ops/ragged/row_partition.py,944,method,"Returns a RowPartition that merges encodings from `self` and `other`. + +Requires that `self` and `other` describe the same partition. + +Args: + other: A `RowPartition` that encodes the same partition as `self`. + validate: If true, then add runtime checks to verify that `self` and + `other` encode the same row partition. + +Returns: + A `RowPartition`." +10444,RowPartitionSpec,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1029,class,Type specification for a `tf.RowPartition`. +10445,is_compatible_with,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1096,method, +10446,nrows,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1116,method, +10447,nvals,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1120,method, +10448,uniform_row_length,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1124,method, +10449,dtype,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1128,method, +10450,from_value,tensorflow/tensorflow/python/ops/ragged/row_partition.py,1144,method, +10451,row_splits_to_segment_ids,tensorflow/tensorflow/python/ops/ragged/segment_id_ops.py,36,function,"Generates the segmentation corresponding to a RaggedTensor `row_splits`. Returns an integer vector `segment_ids`, where `segment_ids[i] == j` if `splits[j] <= i < splits[j+1]`. Example: @@ -100835,7 +109012,7 @@ Returns: Raises: ValueError: If `splits` is invalid." -11216,segment_ids_to_row_splits,tensorflow/tensorflow/python/ops/ragged/segment_id_ops.py,80,function,"Generates the RaggedTensor `row_splits` corresponding to a segmentation. +10452,segment_ids_to_row_splits,tensorflow/tensorflow/python/ops/ragged/segment_id_ops.py,80,function,"Generates the RaggedTensor `row_splits` corresponding to a segmentation. Returns an integer vector `splits`, where `splits[0] = 0` and `splits[i] = splits[i-1] + count(segment_ids==i)`. Example: @@ -100853,10 +109030,7 @@ Args: Returns: A sorted 1-D integer Tensor, with `shape=[num_segments + 1]`." -11217,StringNgramsTest,tensorflow/tensorflow/python/ops/ragged/string_ngrams_op_test.py,34,class, -11218,StringsReduceJoinOpTest,tensorflow/tensorflow/python/ops/ragged/strings_reduce_join_op_test.py,29,class, -11219,_validate_dct_arguments,tensorflow/tensorflow/python/ops/signal/dct_ops.py,32,function,Checks that DCT/IDCT arguments are compatible and well formed. -11220,dct,tensorflow/tensorflow/python/ops/signal/dct_ops.py,55,function,"Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`. +10453,dct,tensorflow/tensorflow/python/ops/signal/dct_ops.py,55,function,"Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`. Types I, II, III and IV are supported. Type I is implemented using a length `2N` padded `tf.signal.rfft`. @@ -100898,7 +109072,7 @@ Raises: ValueError: If `type` is `1` and `norm` is `ortho`. [dct]: https://en.wikipedia.org/wiki/Discrete_cosine_transform" -11221,idct,tensorflow/tensorflow/python/ops/signal/dct_ops.py,187,function,"Computes the 1D [Inverse Discrete Cosine Transform (DCT)][idct] of `input`. +10454,idct,tensorflow/tensorflow/python/ops/signal/dct_ops.py,187,function,"Computes the 1D [Inverse Discrete Cosine Transform (DCT)][idct] of `input`. Currently Types I, II, III, IV are supported. Type III is the inverse of Type II, and vice versa. @@ -100935,21 +109109,7 @@ Raises: [idct]: https://en.wikipedia.org/wiki/Discrete_cosine_transform#Inverse_transforms" -11222,_infer_fft_length_for_rfft,tensorflow/tensorflow/python/ops/signal/fft_ops.py,33,function,Infers the `fft_length` argument for a `rank` RFFT from `input_tensor`. -11223,_infer_fft_length_for_irfft,tensorflow/tensorflow/python/ops/signal/fft_ops.py,46,function,Infers the `fft_length` argument for a `rank` IRFFT from `input_tensor`. -11224,_maybe_pad_for_rfft,tensorflow/tensorflow/python/ops/signal/fft_ops.py,64,function,Pads `input_tensor` to `fft_length` on its inner-most `fft_rank` dims. -11225,_rfft_wrapper,tensorflow/tensorflow/python/ops/signal/fft_ops.py,112,function,Wrapper around gen_spectral_ops.rfft* that infers fft_length argument. -11226,_irfft_wrapper,tensorflow/tensorflow/python/ops/signal/fft_ops.py,146,function,Wrapper around gen_spectral_ops.irfft* that infers fft_length argument. -11227,_fft_size_for_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,204,function, -11228,_fft_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,209,function, -11229,_ifft_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,215,function, -11230,_fft2d_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,223,function, -11231,_ifft2d_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,229,function, -11232,_fft3d_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,237,function, -11233,_ifft3d_grad,tensorflow/tensorflow/python/ops/signal/fft_ops.py,243,function, -11234,_rfft_grad_helper,tensorflow/tensorflow/python/ops/signal/fft_ops.py,250,function,Returns a gradient function for an RFFT of the provided rank. -11235,_irfft_grad_helper,tensorflow/tensorflow/python/ops/signal/fft_ops.py,332,function,Returns a gradient function for an IRFFT of the provided rank. -11236,fftshift,tensorflow/tensorflow/python/ops/signal/fft_ops.py,374,function,"Shift the zero-frequency component to the center of the spectrum. +10455,fftshift,tensorflow/tensorflow/python/ops/signal/fft_ops.py,374,function,"Shift the zero-frequency component to the center of the spectrum. This function swaps half-spaces for all axes listed (defaults to all). Note that ``y[0]`` is the Nyquist component only if ``len(x)`` is even. @@ -100974,7 +109134,7 @@ Args: Returns: A `Tensor`, The shifted tensor." -11237,ifftshift,tensorflow/tensorflow/python/ops/signal/fft_ops.py,419,function,"The inverse of fftshift. +10456,ifftshift,tensorflow/tensorflow/python/ops/signal/fft_ops.py,419,function,"The inverse of fftshift. Although identical for even-length x, the functions differ by one sample for odd-length x. @@ -100999,26 +109159,7 @@ Args: Returns: A `Tensor`, The shifted tensor." -11238,_mel_to_hertz,tensorflow/tensorflow/python/ops/signal/mel_ops.py,36,function,"Converts frequencies in `mel_values` from the mel scale to linear scale. - -Args: - mel_values: A `Tensor` of frequencies in the mel scale. - name: An optional name for the operation. - -Returns: - A `Tensor` of the same shape and type as `mel_values` containing linear - scale frequencies in Hertz." -11239,_hertz_to_mel,tensorflow/tensorflow/python/ops/signal/mel_ops.py,54,function,"Converts frequencies in `frequencies_hertz` in Hertz to the mel scale. - -Args: - frequencies_hertz: A `Tensor` of frequencies in Hertz. - name: An optional name for the operation. - -Returns: - A `Tensor` of the same shape and type of `frequencies_hertz` containing - frequencies in the mel scale." -11240,_validate_arguments,tensorflow/tensorflow/python/ops/signal/mel_ops.py,71,function,Checks the inputs to linear_to_mel_weight_matrix. -11241,linear_to_mel_weight_matrix,tensorflow/tensorflow/python/ops/signal/mel_ops.py,95,function,"Returns a matrix to warp linear scale spectrograms to the [mel scale][mel]. +10457,linear_to_mel_weight_matrix,tensorflow/tensorflow/python/ops/signal/mel_ops.py,95,function,"Returns a matrix to warp linear scale spectrograms to the [mel scale][mel]. Returns a weight matrix that can be used to re-weight a `Tensor` containing `num_spectrogram_bins` linearly sampled frequency information from @@ -101076,7 +109217,7 @@ Raises: ordered, `upper_edge_hertz` is larger than the Nyquist frequency. [mel]: https://en.wikipedia.org/wiki/Mel_scale" -11242,mfccs_from_log_mel_spectrograms,tensorflow/tensorflow/python/ops/signal/mfcc_ops.py,31,function,"Computes [MFCCs][mfcc] of `log_mel_spectrograms`. +10458,mfccs_from_log_mel_spectrograms,tensorflow/tensorflow/python/ops/signal/mfcc_ops.py,31,function,"Computes [MFCCs][mfcc] of `log_mel_spectrograms`. Implemented with GPU-compatible ops and supports gradients. @@ -101134,7 +109275,7 @@ Raises: [mfcc]: https://en.wikipedia.org/wiki/Mel-frequency_cepstrum [htk]: https://en.wikipedia.org/wiki/HTK_(software)" -11243,overlap_and_add,tensorflow/tensorflow/python/ops/signal/reconstruction_ops.py,32,function,"Reconstructs a signal from a framed representation. +10459,overlap_and_add,tensorflow/tensorflow/python/ops/signal/reconstruction_ops.py,32,function,"Reconstructs a signal from a framed representation. Adds potentially overlapping frames of a signal with shape `[..., frames, frame_length]`, offsetting subsequent frames by `frame_step`. @@ -101156,8 +109297,7 @@ Returns: Raises: ValueError: If `signal`'s rank is less than 2, or `frame_step` is not a scalar integer." -11244,_infer_frame_shape,tensorflow/tensorflow/python/ops/signal/shape_ops.py,32,function,Infers the shape of the return value of `frame`. -11245,frame,tensorflow/tensorflow/python/ops/signal/shape_ops.py,60,function,"Expands `signal`'s `axis` dimension into frames of `frame_length`. +10460,frame,tensorflow/tensorflow/python/ops/signal/shape_ops.py,60,function,"Expands `signal`'s `axis` dimension into frames of `frame_length`. Slides a window of size `frame_length` over `signal`'s `axis` dimension with a stride of `frame_step`, replacing the `axis` dimension with @@ -101211,7 +109351,7 @@ Returns: Raises: ValueError: If `frame_length`, `frame_step`, `pad_value`, or `axis` are not scalar." -11246,stft,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,40,function,"Computes the [Short-time Fourier Transform][stft] of `signals`. +10461,stft,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,40,function,"Computes the [Short-time Fourier Transform][stft] of `signals`. Implemented with TPU/GPU-compatible ops and supports gradients. @@ -101239,7 +109379,7 @@ Raises: not scalar, or `frame_step` is not scalar. [stft]: https://en.wikipedia.org/wiki/Short-time_Fourier_transform" -11247,inverse_stft_window_fn,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,101,function,"Generates a window function that can be used in `inverse_stft`. +10462,inverse_stft_window_fn,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,101,function,"Generates a window function that can be used in `inverse_stft`. Constructs a window that is equal to the forward window with a further pointwise amplitude correction. `inverse_stft_window_fn` is equivalent to @@ -101257,7 +109397,7 @@ Returns: returns a `[window_length]` `Tensor` of samples in the provided datatype. The returned window is suitable for reconstructing original waveform in inverse_stft." -11248,inverse_stft,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,163,function,"Computes the inverse [Short-time Fourier Transform][stft] of `stfts`. +10463,inverse_stft,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,163,function,"Computes the inverse [Short-time Fourier Transform][stft] of `stfts`. To reconstruct an original waveform, a complementary window function should be used with `inverse_stft`. Such a window function can be constructed with @@ -101315,8 +109455,7 @@ Raises: `frame_step` is not scalar, or `fft_length` is not scalar. [stft]: https://en.wikipedia.org/wiki/Short-time_Fourier_transform" -11249,_enclosing_power_of_two,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,283,function,Return 2**N for integer N such that 2**N >= value. -11250,mdct,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,299,function,"Computes the [Modified Discrete Cosine Transform][mdct] of `signals`. +10464,mdct,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,299,function,"Computes the [Modified Discrete Cosine Transform][mdct] of `signals`. Implemented with TPU/GPU-compatible ops and supports gradients. @@ -101350,7 +109489,7 @@ Raises: not scalar, or `frame_length` is not a multiple of `4`. [mdct]: https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform" -11251,inverse_mdct,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,375,function,"Computes the inverse modified DCT of `mdcts`. +10465,inverse_mdct,tensorflow/tensorflow/python/ops/signal/spectral_ops.py,375,function,"Computes the inverse modified DCT of `mdcts`. To reconstruct an original waveform, the same window function should be used with `mdct` and `inverse_mdct`. @@ -101402,7 +109541,7 @@ Raises: ValueError: If `mdcts` is not at least rank 2. [mdct]: https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform" -11252,gcd,tensorflow/tensorflow/python/ops/signal/util_ops.py,32,function,"Returns the greatest common divisor via Euclid's algorithm. +10466,gcd,tensorflow/tensorflow/python/ops/signal/util_ops.py,32,function,"Returns the greatest common divisor via Euclid's algorithm. Args: a: The dividend. A scalar integer `Tensor`. @@ -101415,19 +109554,7 @@ Returns: Raises: ValueError: If `a` or `b` are not scalar integers." -11253,_check_params,tensorflow/tensorflow/python/ops/signal/window_ops.py,35,function,"Check window_length and dtype params. - -Args: - window_length: A scalar value or `Tensor`. - dtype: The data type to produce. Must be a floating point type. - -Returns: - window_length converted to a tensor of type int32. - -Raises: - ValueError: If `dtype` is not a floating point type or window_length is not - a scalar." -11254,kaiser_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,58,function,"Generate a [Kaiser window][kaiser]. +10467,kaiser_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,58,function,"Generate a [Kaiser window][kaiser]. Args: window_length: A scalar `Tensor` indicating the window length to generate. @@ -101440,7 +109567,7 @@ Returns: [kaiser]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.kaiser.html" -11255,kaiser_bessel_derived_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,98,function,"Generate a [Kaiser Bessel derived window][kbd]. +10468,kaiser_bessel_derived_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,98,function,"Generate a [Kaiser Bessel derived window][kbd]. Args: window_length: A scalar `Tensor` indicating the window length to generate. @@ -101453,7 +109580,7 @@ Returns: [kbd]: https://en.wikipedia.org/wiki/Kaiser_window#Kaiser%E2%80%93Bessel-derived_(KBD)_window" -11256,vorbis_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,126,function,"Generate a [Vorbis power complementary window][vorbis]. +10469,vorbis_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,126,function,"Generate a [Vorbis power complementary window][vorbis]. Args: window_length: A scalar `Tensor` indicating the window length to generate. @@ -101465,7 +109592,7 @@ Returns: [vorbis]: https://en.wikipedia.org/wiki/Modified_discrete_cosine_transform#Window_functions" -11257,hann_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,151,function,"Generate a [Hann window][hann]. +10470,hann_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,151,function,"Generate a [Hann window][hann]. Args: window_length: A scalar `Tensor` indicating the window length to generate. @@ -101483,7 +109610,7 @@ Raises: ValueError: If `dtype` is not a floating point type. [hann]: https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows" -11258,hamming_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,177,function,"Generate a [Hamming][hamming] window. +10471,hamming_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,177,function,"Generate a [Hamming][hamming] window. Args: window_length: A scalar `Tensor` indicating the window length to generate. @@ -101502,25 +109629,7 @@ Raises: [hamming]: https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows" -11259,_raised_cosine_window,tensorflow/tensorflow/python/ops/signal/window_ops.py,203,function,"Helper function for computing a raised cosine window. - -Args: - name: Name to use for the scope. - default_name: Default name to use for the scope. - window_length: A scalar `Tensor` or integer indicating the window length. - periodic: A bool `Tensor` indicating whether to generate a periodic or - symmetric window. - dtype: A floating point `DType`. - a: The alpha parameter to the raised cosine window. - b: The beta parameter to the raised cosine window. - -Returns: - A `Tensor` of shape `[window_length]` of type `dtype`. - -Raises: - ValueError: If `dtype` is not a floating point type or `window_length` is - not scalar or `periodic` is not scalar." -11260,StructuredTensor,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,43,class,"A multidimensional collection of structures with the same schema. +10472,StructuredTensor,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,43,class,"A multidimensional collection of structures with the same schema. A **`StructuredTensor`** is a multi-dimensional collection of ***structures*** with the same ***schema***, where: @@ -101562,204 +109671,269 @@ TensorShape([3]) A *field path* is a tuple of field names, specifying the path to a nested field." -11261,StructuredTensorSpec,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,716,class,Type specification for `StructuredTensor`s. -11262,_convert_to_structured_field_value,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,799,function,"Converts `value` to a Tensor, RaggedTensor, or StructuredTensor." -11263,_find_shape_dtype,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,813,function,"Return a consistent dtype for fields, nrows, & row_partitions." -11264,_merge_nrows,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,834,function,"Merges `nrows` with `nrows(value)`. - -Checks that `value` has the expected number of rows (`nrows`), and returns -`nrows`. If `validate` is true, then add validation ops that check that -the `nrows` values match. +10473,from_fields,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,122,method,"Creates a `StructuredTensor` from a dictionary of fields. Args: - nrows: scalar integer Tensor. - static_nrows: tf.Dimension: static value of nrows, if known. - value: Tensor or RaggedTensor or StructuredTensor - dtype: dtype for `nrows`. - validate: bool -- whether to add validation ops. + fields: A dictionary mapping from string to `Tensor`, `RaggedTensor`, or + `StructuredTensor`, providing the values for individual fields in each + structure. If `shape.rank > 0`, then every tensor in `fields` must have + the same shape in the first `shape.rank` dimensions; and that shape must + be compatible with `shape`; and + `result[i1...iN][key] = fields[key][i1...iN]` (where `N==shape.rank`). + shape: A `TensorShape`: static information about the shape of the + `StructuredTensor`. Must have a known `rank`. Defaults to scalar + shape (i.e. `rank=0`). + nrows: scalar integer tensor containing the number of rows in this + `StructuredTensor`. Should only be specified if `shape.rank > 0`. + Default value is inferred from the `fields` values. If `fields` is + empty, then this must be specified. + row_partitions: A list of `RowPartition`s describing the (possibly ragged) + shape of this `StructuredTensor`. Should only be specified if + `shape.rank > 1`. Default value is inferred from the `fields` values. + If `fields` is empty, then this must be specified. + validate: If true, then add runtime validation ops that check that the + field values all have compatible shapes in the outer `shape.rank` + dimensions. Returns: - A tuple `(nrows, static_nrows)`." -11265,_merge_row_partitions,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,871,function,Merges `row_partitions` with `row_partitions(value)`. -11266,_row_partitions_for_tensor,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,893,function,Returns the row partitions for a tf.Tensor. -11267,_row_partitions_for_ragged_tensor,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,899,function,Returns the row partitions for a tf.RaggedTensor. -11268,_row_partitions_for_uniform_shape,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,910,function,"Returns row partitions for the given shape Tensor. - -Args: - shape: A vector describing a uniform shape. - rank: The number of dimensions to generate row partitions for - -Returns: - A list of (rank-1) `RowPartition`s with uniform row length." -11269,_pyval_field_major_to_node_major,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,930,function,"Regroup each field (k, v) from dict-of-list to list-of-dict. - -Given a ""field-major"" encoding of the StructuredTensor (which maps each key to -a single nested list containing the values for all structs), return a -corresponding ""node-major"" encoding, consisting of a nested list of dicts. -`shape` is used to determine how far to recurse; and if `keys` is empty -it is used to determine the sizes for empty lists. - -Args: - keys: The field names (list of string). - values: The field values (list of python values). Must have the same length - as `keys`. - shape: A tuple specifying the shape of the `StructuredTensor`. - -Returns: - A nested list of dict." -11270,_pyval_find_struct_keys_and_depth,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,964,function,"Finds the keys & depth of nested dictionaries in `pyval`. - -Args: - pyval: A nested structure of lists, tuples, and dictionaries. - keys: (output parameter) A set, which will be updated with any keys that are - found in the nested dictionaries. - -Returns: - The nesting depth of dictionaries in `pyval`, or `None` if `pyval` does - not contain any dictionaries. -Raises: - ValueError: If dictionaries have inconsistent depth." -11271,_pyval_update_fields,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,995,function,"Append the field values from `pyval` to `fields`. - -Args: - pyval: A python `dict`, or nested list/tuple of `dict`, whose value(s) - should be appended to `fields`. - fields: A dictionary mapping string keys to field values. Field values - extracted from `pyval` are appended to this dictionary's values. - depth: The depth at which `pyval` should be appended to the field values." -11272,_pyval_empty_list_depth,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,1018,function,"Find the max depth for nested empty lists. - -Args: - pyval: A nested python list. - -Returns: - The maximum depth of empty lists in `pyval`, or None if `pyval` contains - anything other than nested empty lists." -11273,_replace_row_partitions,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,1040,function,"Updates `value` to use `new_partitions` as its (outer) row partitions. - -This is used to ensure that all fields in a `StructuredTensor` use identical -`RowPartition` objects for the shared dimensions. In particular, -`StructuredTensor.from_fields` first merges all of the row partitions from -any fields, and then replaces the outer row partitions of all fields with -the merged row partitions (using this function). - -Args: - value: A `Tensor`, `RaggedTensor`, or `StructuredTensor`. - new_partitions: A list of row-partitions that should be used by `value`. - Must be equivalent to `value`'s current row partitions. - -Returns: - A value that is equivalent to `value`, where outer row partitions have been - replaced by `new_partitions`." -11274,_partition_outer_dimension,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,1078,function,"Partitions the outer dimension of `value` using `row_partitions`. + A `StructuredTensor`. Examples: - >>> partition = RowPartition.from_row_lengths([2, 0, 1]) - >>> _partition_outer_dimension(tf.constant([1, 2, 3]), partition) - - - >>> struct_value = StructuredTensor.from_pyval( - ... [{'x': 1}, {'x': 2}, {'x': 3}]) - >>> _partition_outer_dimension(struct_value, partition) + >>> StructuredTensor.from_fields({'x': 1, 'y': [1, 2, 3]}) }, - shape=(3, None))> + ""x"": tf.Tensor(1, shape=(), dtype=int32), + ""y"": tf.Tensor([1 2 3], shape=(3,), dtype=int32)}, + shape=())> -Args: - value: Tensor, RaggedTensor, or StructuredTensor - row_partition: RowPartition + >>> StructuredTensor.from_fields({'foo': [1, 2], 'bar': [3, 4]}, + ... shape=[2]) + " +10474,rank,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,260,method,The rank of this StructuredTensor. Guaranteed not to be `None`. +10475,shape,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,265,method,"The static shape of this StructuredTensor. + +The returned `TensorShape` is guaranteed to have a known rank, but the +individual dimension sizes may be unknown. Returns: - A value with the same type as `value`, where - `result.rank = value.rank + 1`." -11275,_merge_dims,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,1129,function,Merges `outer_axis...inner_axis` of `value` into a single dimension. -11276,_SliceBuilder,tensorflow/tensorflow/python/ops/structured/structured_tensor_slice_test.py,34,class,"Helper to construct arguments for __getitem__. + `tf.TensorShape`" +10476,row_partitions,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,279,method,"A tuple of `RowPartition`s defining the shape of this `StructuredTensor`. -Usage: _SliceBuilder()[] slice_spec Python generates for ." -11277,_make_tensor_slice_spec,tensorflow/tensorflow/python/ops/structured/structured_tensor_slice_test.py,49,function,"Wraps all integers in an extended slice spec w/ a tensor. +If this `StructuredTensor` has a ragged shape, then all fields will be +encoded as either `RaggedTensor`s or `StructuredTensor`s with these +`RowPartition`s used to define their outermost `self.rank` dimensions. -This function is used to help test slicing when the slice spec contains -tensors, rather than integers. - -Args: - slice_spec: The extended slice spec. - use_constant: If true, then wrap each integer with a tf.constant. If false, - then wrap each integer with a tf.placeholder. +If this `StructuredTensor` has a uniform (non-ragged) shape, then these +row partitions will all be defined using `uniform_row_length`. Returns: - A copy of slice_spec, but with each integer i replaced with tf.constant(i)." -11278,StructuredTensorSliceTest,tensorflow/tensorflow/python/ops/structured/structured_tensor_slice_test.py,126,class, -11279,StructuredTensorSpecTest,tensorflow/tensorflow/python/ops/structured/structured_tensor_spec_test.py,49,class, -11280,StructuredTensorTest,tensorflow/tensorflow/python/ops/structured/structured_tensor_test.py,46,class, -11281,track_usage,tensorflow/tensorflow/python/platform/analytics.py,21,function,"No usage tracking for external library. + A `tuple` of `RowPartition` objects with length `self.rank - 1` + (or `0` if `self.rank < 2`)." +10477,nrows,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,295,method,"The number of rows in this StructuredTensor (if rank>0). + +Returns: + A scalar integer `Tensor` (or `None` if `self.rank == 0`)." +10478,field_names,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,312,method,Returns the string field names for this `StructuredTensor`. +10479,field_value,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,316,method,"Returns the tensor value for the specified field or path. + +If `field_name` is a `string`, then it names a field directly owned by this +`StructuredTensor`. If this `StructuredTensor` has shape `[D1...DN]`, then +the returned tensor will have shape `[D1...DN, V1...VM]`, where the slice +`result[d1...dN]` contains the field value for the structure at +`self[d1...dN]`. + +If `field_name` is a `tuple` of `string`, then it specifies a path to a +field owned by nested `StructuredTensor`. In particular, +`struct.field_value((f1, f2, ..., fN))` is equivalent to +`struct.field_value(f1).field_value(f2)....field_value(fN)` + +Args: + field_name: `string` or `tuple` of `string`: The field whose values should + be returned. + +Returns: + `Tensor`, `StructuredTensor`, or `RaggedTensor`. + +Raises: + KeyError: If the given field_name is not found." +10480,to_pyval,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,454,method,"Returns this StructuredTensor as a nested Python dict or list of dicts. + +Converts this `StructuredTensor` to a nested python value: + +* `StructTensors` with `rank=0` are converted into a dictionary, with an + entry for each field. Field names are used as keys and field values are + converted to python values. In particular: + + * Scalar Tensor fields are converted to simple values (such as + `int` or `float` or `string`) + * Non-scalar Tensor fields and RaggedTensor fields are converted to + nested lists of simple values. + * StructuredTensor fields are converted recursively using `to_pyval`. + +* `StructTensors` with `rank>0` are converted to nested python `list`s, + containing one dictionary for each structure (where each structure's + dictionary is defined as described above). + +Requires that all fields are Eager tensors. + +>>> StructuredTensor.from_fields( +... {'a': [1, 2, 3]}, [3]).to_pyval() +[{'a': 1}, {'a': 2}, {'a': 3}] + +Note that `StructuredTensor.from_pyval(pyval).to_pyval() == pyval`. + +Returns: + A nested Python dict or list of dicts." +10481,from_pyval,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,510,method,"Constructs a StructuredTensor from a nested Python structure. + +>>> StructuredTensor.from_pyval( +... {'a': [1, 2, 3], 'b': [[4, 5], [6, 7]]}) +}, + shape=())> + +Note that `StructuredTensor.from_pyval(pyval).to_pyval() == pyval`. + +Args: + pyval: The nested Python structure that should be used to create the new + `StructuredTensor`. + typespec: A `StructuredTensorSpec` specifying the expected type for each + field. If not specified, then all nested dictionaries are turned into + StructuredTensors, and all nested lists are turned into Tensors (if + rank<2) or RaggedTensors (if rank>=2). + +Returns: + A `StructuredTensor`." +10482,partition_outer_dimension,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,637,method,"Partitions the outer dimension of this StructuredTensor. + +Returns a new `StructuredTensor` with the same values as `self`, where +the outer dimension is partitioned into two (possibly ragged) dimensions. +Requires that this StructuredTensor have an outer dimension (i.e., +`self.shape.rank > 0`). + +>>> st = StructuredTensor.from_pyval( +... [{'foo': 12}, {'foo': 33}, {'foo': 99}]) +>>> partition = RowPartition.from_row_lengths([2, 0, 1]) +>>> st.partition_outer_dimension(partition) +}, + shape=(3, None))> + +Args: + row_partition: A `RowPartition`. + +Returns: + A `StructuredTensor` with rank `values.rank + 1`." +10483,merge_dims,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,666,method,"Merges outer_axis...inner_axis into a single dimension. + +Returns a copy of this RaggedTensor with the specified range of dimensions +flattened into a single dimension, with elements in row-major order. + +>>> st = StructuredTensor.from_pyval( +... [[{'foo': 12}, {'foo': 33}], [], [{'foo': 99}]]) +>>> st.merge_dims(0, 1) + + +Args: + outer_axis: `int`: The first dimension in the range of dimensions to + merge. May be negative (to index from the last dimension). + inner_axis: `int`: The last dimension in the range of dimensions to merge. + May be negative (to index from the last dimension). + +Returns: + A copy of this tensor, with the specified dimensions merged into a + single dimension. The shape of the returned tensor will be + `self.shape[:outer_axis] + [N] + self.shape[inner_axis + 1:]`, where `N` + is the total number of slices in the merged dimensions." +10484,StructuredTensorSpec,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,716,class,Type specification for `StructuredTensor`s. +10485,value_type,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,752,method, +10486,from_value,tensorflow/tensorflow/python/ops/structured/structured_tensor.py,766,method, +10487,track_usage,tensorflow/tensorflow/python/platform/analytics.py,21,function,"No usage tracking for external library. Args: tool_id: A string identifier for tool to be tracked. tags: list of string tags that will be added to the tracking." -11282,_parse_flags_tolerate_undef,tensorflow/tensorflow/python/platform/app.py,29,function,"Parse args, returning any unknown flags (ABSL defaults to crashing)." -11283,run,tensorflow/tensorflow/python/platform/app.py,35,function,Runs the program with an optional 'main' function and 'argv' list. -11284,main,tensorflow/tensorflow/python/platform/app_test.py,29,function, -11285,_rename_function,tensorflow/tensorflow/python/platform/benchmark.py,56,function,Rename the given function's name appears in the stack trace. -11286,_global_report_benchmark,tensorflow/tensorflow/python/platform/benchmark.py,80,function,"Method for recording a benchmark directly. - -Args: - name: The BenchmarkEntry name. - iters: (optional) How many iterations were run - cpu_time: (optional) Total cpu time in seconds - wall_time: (optional) Total wall time in seconds - throughput: (optional) Throughput (in MB/s) - extras: (optional) Dict mapping string keys to additional benchmark info. - metrics: (optional) A list of dict representing metrics generated by the - benchmark. Each dict should contain keys 'name' and'value'. A dict - can optionally contain keys 'min_value' and 'max_value'. - -Raises: - TypeError: if extras is not a dict. - IOError: if the benchmark output file already exists." -11287,_BenchmarkRegistrar,tensorflow/tensorflow/python/platform/benchmark.py,161,class,The Benchmark class registrar. Used by abstract Benchmark class. -11288,ParameterizedBenchmark,tensorflow/tensorflow/python/platform/benchmark.py,171,class,Metaclass to generate parameterized benchmarks. -11289,Benchmark,tensorflow/tensorflow/python/platform/benchmark.py,203,class,"Abstract class that provides helper functions for running benchmarks. +10488,run,tensorflow/tensorflow/python/platform/app.py,35,function,Runs the program with an optional 'main' function and 'argv' list. +10489,ParameterizedBenchmark,tensorflow/tensorflow/python/platform/benchmark.py,171,class,Metaclass to generate parameterized benchmarks. +10490,create_benchmark_function,tensorflow/tensorflow/python/platform/benchmark.py,192,method, +10491,Benchmark,tensorflow/tensorflow/python/platform/benchmark.py,203,class,"Abstract class that provides helper functions for running benchmarks. Any class subclassing this one is immediately registered in the global benchmark registry. Only methods whose names start with the word ""benchmark"" will be run during benchmarking." -11290,benchmark_config,tensorflow/tensorflow/python/platform/benchmark.py,275,function,"Returns a tf.compat.v1.ConfigProto for disabling the dependency optimizer. +10492,is_abstract,tensorflow/tensorflow/python/platform/benchmark.py,214,method, +10493,report_benchmark,tensorflow/tensorflow/python/platform/benchmark.py,242,method,"Report a benchmark. + +Args: + iters: (optional) How many iterations were run + cpu_time: (optional) Median or mean cpu time in seconds. + wall_time: (optional) Median or mean wall time in seconds. + throughput: (optional) Throughput (in MB/s) + extras: (optional) Dict mapping string keys to additional benchmark info. + Values may be either floats or values that are convertible to strings. + name: (optional) Override the BenchmarkEntry name with `name`. + Otherwise it is inferred from the top-level method name. + metrics: (optional) A list of dict, where each dict has the keys below + name (required), string, metric name + value (required), double, metric value + min_value (optional), double, minimum acceptable metric value + max_value (optional), double, maximum acceptable metric value" +10494,benchmark_config,tensorflow/tensorflow/python/platform/benchmark.py,275,function,"Returns a tf.compat.v1.ConfigProto for disabling the dependency optimizer. Returns: A TensorFlow ConfigProto object." -11291,TensorFlowBenchmark,tensorflow/tensorflow/python/platform/benchmark.py,288,class,Abstract class that provides helpers for TensorFlow benchmarks. -11292,_run_benchmarks,tensorflow/tensorflow/python/platform/benchmark.py,423,function,"Run benchmarks that match regex `regex`. - -This function goes through the global benchmark registry, and matches -benchmark class and method names of the form -`module.name.BenchmarkClass.benchmarkMethod` to the given regex. -If a method matches, it is run. +10495,TensorFlowBenchmark,tensorflow/tensorflow/python/platform/benchmark.py,288,class,Abstract class that provides helpers for TensorFlow benchmarks. +10496,is_abstract,tensorflow/tensorflow/python/platform/benchmark.py,298,method, +10497,run_op_benchmark,tensorflow/tensorflow/python/platform/benchmark.py,303,method,"Run an op or tensor in the given session. Report the results. Args: - regex: The string regular expression to match Benchmark classes against. + sess: `Session` object to use for timing. + op_or_tensor: `Operation` or `Tensor` to benchmark. + feed_dict: A `dict` of values to feed for each op iteration (see the + `feed_dict` parameter of `Session.run`). + burn_iters: Number of burn-in iterations to run. + min_iters: Minimum number of iterations to use for timing. + store_trace: Boolean, whether to run an extra untimed iteration and + store the trace of iteration in returned extras. + The trace will be stored as a string in Google Chrome trace format + in the extras field ""full_trace_chrome_format"". Note that trace + will not be stored in test_log_pb2.TestResults proto. + store_memory_usage: Boolean, whether to run an extra untimed iteration, + calculate memory usage, and store that in extras fields. + name: (optional) Override the BenchmarkEntry name with `name`. + Otherwise it is inferred from the top-level method name. + extras: (optional) Dict mapping string keys to additional benchmark info. + Values may be either floats or values that are convertible to strings. + mbs: (optional) The number of megabytes moved by this op, used to + calculate the ops throughput. -Raises: - ValueError: If no benchmarks were selected by the input regex." -11293,benchmarks_main,tensorflow/tensorflow/python/platform/benchmark.py,467,function,"Run benchmarks as declared in argv. +Returns: + A `dict` containing the key-value pairs that were passed to + `report_benchmark`. If `store_trace` option is used, then + `full_chrome_trace_format` will be included in return dictionary even + though it is not passed to `report_benchmark` with `extras`." +10498,evaluate,tensorflow/tensorflow/python/platform/benchmark.py,410,method,"Evaluates tensors and returns numpy values. Args: - true_main: True main function to run if benchmarks are not requested. - argv: the command line arguments (if None, uses sys.argv)." -11294,BenchmarkTest,tensorflow/tensorflow/python/platform/benchmark_test.py,27,class, -11295,BuildInfoTest,tensorflow/tensorflow/python/platform/build_info_test.py,25,class, -11296,enclosing_tpu_context,tensorflow/tensorflow/python/platform/device_context.py,21,function, -11297,_wrap_define_function,tensorflow/tensorflow/python/platform/flags.py,44,function,Wraps absl.flags's define functions so tf.flags accepts old names. -11298,_FlagValuesWrapper,tensorflow/tensorflow/python/platform/flags.py,64,class,"Wrapper class for absl.flags.FLAGS. + tensors: A Tensor or a nested list/tuple of Tensors. -The difference is that tf.flags.FLAGS implicitly parses flags with sys.argv -when accessing the FLAGS values before it's explicitly parsed, -while absl.flags.FLAGS raises an exception." -11299,FlagsTest,tensorflow/tensorflow/python/platform/flags_test.py,51,class, -11300,GFile,tensorflow/tensorflow/python/platform/gfile.py,41,class,"File I/O wrappers without thread locking. +Returns: + tensors numpy values." +10499,enclosing_tpu_context,tensorflow/tensorflow/python/platform/device_context.py,21,function, +10500,GFile,tensorflow/tensorflow/python/platform/gfile.py,41,class,"File I/O wrappers without thread locking. The main roles of the `tf.io.gfile` module are: @@ -101778,42 +109952,17 @@ API without any problem. differences to make `tf.io.gfile` more efficient for backing filesystems. For example, a write mode file will not be opened until the first write call, to minimize RPC invocations in network filesystems." -11301,FastGFile,tensorflow/tensorflow/python/platform/gfile.py,68,class,"File I/O wrappers without thread locking. +10501,FastGFile,tensorflow/tensorflow/python/platform/gfile.py,68,class,"File I/O wrappers without thread locking. Note, that this is somewhat like builtin Python file I/O, but there are semantic differences to make it more efficient for some backing filesystems. For example, a write mode file will not be opened until the first write call (to minimize RPC invocations in network filesystems)." -11302,g_main,tensorflow/tensorflow/python/platform/googletest.py,53,function,Delegate to absltest.main. -11303,main,tensorflow/tensorflow/python/platform/googletest.py,60,function, -11304,GetTempDir,tensorflow/tensorflow/python/platform/googletest.py,69,function,Return a temporary directory for tests to use. -11305,test_src_dir_path,tensorflow/tensorflow/python/platform/googletest.py,97,function,"Creates an absolute test srcdir path given a relative path. - -Args: - relative_path: a path relative to tensorflow root. - e.g. ""contrib/session_bundle/example"". - -Returns: - An absolute path to the linked in runfiles." -11306,StatefulSessionAvailable,tensorflow/tensorflow/python/platform/googletest.py,111,function, -11307,StubOutForTesting,tensorflow/tensorflow/python/platform/googletest.py,116,class,"Support class for stubbing methods out for unit testing. - -Sample Usage: - -You want os.path.exists() to always return true during testing. - - stubs = StubOutForTesting() - stubs.Set(os.path, 'exists', lambda x: 1) - ... - stubs.CleanUp() - -The above changes os.path.exists into a lambda that returns 1. Once -the ... part of the code finishes, the CleanUp() looks up the old -value of os.path.exists and restores it." -11308,EventLoaderTest,tensorflow/tensorflow/python/platform/logging_test.py,24,class, -11309,get_default_communication_protocol,tensorflow/tensorflow/python/platform/remote_utils.py,21,function, -11310,load_resource,tensorflow/tensorflow/python/platform/resource_loader.py,35,function,"Load the resource at given path, where path is relative to tensorflow/. +10502,GetTempDir,tensorflow/tensorflow/python/platform/googletest.py,69,function,Return a temporary directory for tests to use. +10503,StatefulSessionAvailable,tensorflow/tensorflow/python/platform/googletest.py,111,function, +10504,get_default_communication_protocol,tensorflow/tensorflow/python/platform/remote_utils.py,21,function, +10505,load_resource,tensorflow/tensorflow/python/platform/resource_loader.py,35,function,"Load the resource at given path, where path is relative to tensorflow/. Args: path: a string resource path relative to tensorflow/. @@ -101823,18 +109972,18 @@ Returns: Raises: IOError: If the path is not found, or the resource can't be opened." -11311,get_data_files_path,tensorflow/tensorflow/python/platform/resource_loader.py,53,function,"Get a direct path to the data files colocated with the script. +10506,get_data_files_path,tensorflow/tensorflow/python/platform/resource_loader.py,53,function,"Get a direct path to the data files colocated with the script. Returns: The directory where files specified in data attribute of py_test and py_binary are stored." -11312,get_root_dir_with_all_resources,tensorflow/tensorflow/python/platform/resource_loader.py,64,function,"Get a root directory containing all the data attributes in the build rule. +10507,get_root_dir_with_all_resources,tensorflow/tensorflow/python/platform/resource_loader.py,64,function,"Get a root directory containing all the data attributes in the build rule. Returns: The path to the specified file present in the data attribute of py_test or py_binary. Falls back to returning the same as get_data_files_path if it fails to detect a bazel runfiles directory." -11313,get_path_to_datafile,tensorflow/tensorflow/python/platform/resource_loader.py,104,function,"Get the path to the specified file in the data dependencies. +10508,get_path_to_datafile,tensorflow/tensorflow/python/platform/resource_loader.py,104,function,"Get the path to the specified file in the data dependencies. The path is relative to tensorflow/ @@ -101847,32 +109996,30 @@ Returns: Raises: IOError: If the path is not found, or the resource can't be opened." -11314,readahead_file_path,tensorflow/tensorflow/python/platform/resource_loader.py,134,function,Readahead files not implemented; simply returns given path. -11315,ResourceLoaderTest,tensorflow/tensorflow/python/platform/resource_loader_test.py,24,class, -11316,preload_check,tensorflow/tensorflow/python/platform/self_check.py,34,function,"Raises an exception if the environment is not correctly configured. +10509,readahead_file_path,tensorflow/tensorflow/python/platform/resource_loader.py,134,function,Readahead files not implemented; simply returns given path. +10510,preload_check,tensorflow/tensorflow/python/platform/self_check.py,34,function,"Raises an exception if the environment is not correctly configured. Raises: ImportError: If the check detects that the environment is not correctly configured, and attempting to load the TensorFlow runtime will fail." -11317,StacktraceHandlerTest,tensorflow/tensorflow/python/platform/stacktrace_handler_test.py,38,class, -11318,SetupStatusBarInsideGoogle,tensorflow/tensorflow/python/platform/status_bar.py,23,function, -11319,get_include,tensorflow/tensorflow/python/platform/sysconfig.py,33,function,"Get the directory containing the TensorFlow C++ header files. +10511,SetupStatusBarInsideGoogle,tensorflow/tensorflow/python/platform/status_bar.py,23,function, +10512,get_include,tensorflow/tensorflow/python/platform/sysconfig.py,33,function,"Get the directory containing the TensorFlow C++ header files. Returns: The directory as string." -11320,get_lib,tensorflow/tensorflow/python/platform/sysconfig.py,48,function,"Get the directory containing the TensorFlow framework library. +10513,get_lib,tensorflow/tensorflow/python/platform/sysconfig.py,48,function,"Get the directory containing the TensorFlow framework library. Returns: The directory as string." -11321,get_compile_flags,tensorflow/tensorflow/python/platform/sysconfig.py,59,function,"Get the compilation flags for custom operators. +10514,get_compile_flags,tensorflow/tensorflow/python/platform/sysconfig.py,59,function,"Get the compilation flags for custom operators. Returns: The compilation flags." -11322,get_link_flags,tensorflow/tensorflow/python/platform/sysconfig.py,72,function,"Get the link flags for custom operators. +10515,get_link_flags,tensorflow/tensorflow/python/platform/sysconfig.py,72,function,"Get the link flags for custom operators. Returns: The link flags." -11323,get_build_info,tensorflow/tensorflow/python/platform/sysconfig.py,91,function,"Get a dictionary describing TensorFlow's build environment. +10516,get_build_info,tensorflow/tensorflow/python/platform/sysconfig.py,91,function,"Get a dictionary describing TensorFlow's build environment. Values are generated when TensorFlow is compiled, and are static for each TensorFlow package. The return value is a dictionary with string keys such as: @@ -101891,50 +110038,28 @@ change across different versions of TensorFlow or across platforms. Returns: A Dictionary describing TensorFlow's build environment." -11324,SysconfigTest,tensorflow/tensorflow/python/platform/sysconfig_test.py,25,class, -11325,main,tensorflow/tensorflow/python/platform/test.py,55,function,Runs all unit tests. -11326,get_temp_dir,tensorflow/tensorflow/python/platform/test.py,62,function,"Returns a temporary directory for use during tests. +10517,get_temp_dir,tensorflow/tensorflow/python/platform/test.py,62,function,"Returns a temporary directory for use during tests. There is no need to delete the directory after the test. Returns: The temporary directory." -11327,test_src_dir_path,tensorflow/tensorflow/python/platform/test.py,74,function,"Creates an absolute test srcdir path given a relative path. - -Args: - relative_path: a path relative to tensorflow root. - e.g. ""core/platform"". - -Returns: - An absolute path to the linked in runfiles." -11328,is_built_with_cuda,tensorflow/tensorflow/python/platform/test.py,88,function,Returns whether TensorFlow was built with CUDA (GPU) support. -11329,is_built_with_rocm,tensorflow/tensorflow/python/platform/test.py,94,function,Returns whether TensorFlow was built with ROCm (GPU) support. -11330,is_built_with_gpu_support,tensorflow/tensorflow/python/platform/test.py,100,function,Returns whether TensorFlow was built with GPU (i.e. CUDA or ROCm) support. -11331,is_built_with_xla,tensorflow/tensorflow/python/platform/test.py,106,function,Returns whether TensorFlow was built with XLA support. -11332,_get_caller,tensorflow/tensorflow/python/platform/tf_logging.py,45,function,Returns a code and frame object for the lowest non-logging stack frame. -11333,_logger_find_caller,tensorflow/tensorflow/python/platform/tf_logging.py,64,function, -11334,_logger_find_caller,tensorflow/tensorflow/python/platform/tf_logging.py,75,function, -11335,_logger_find_caller,tensorflow/tensorflow/python/platform/tf_logging.py,85,function, -11336,get_logger,tensorflow/tensorflow/python/platform/tf_logging.py,94,function,Return TF logger instance. -11337,log,tensorflow/tensorflow/python/platform/tf_logging.py,147,function, -11338,debug,tensorflow/tensorflow/python/platform/tf_logging.py,152,function, -11339,error,tensorflow/tensorflow/python/platform/tf_logging.py,157,function, -11340,fatal,tensorflow/tensorflow/python/platform/tf_logging.py,162,function, -11341,info,tensorflow/tensorflow/python/platform/tf_logging.py,167,function, -11342,warn,tensorflow/tensorflow/python/platform/tf_logging.py,172,function, -11343,warning,tensorflow/tensorflow/python/platform/tf_logging.py,177,function, -11344,TaskLevelStatusMessage,tensorflow/tensorflow/python/platform/tf_logging.py,200,function, -11345,flush,tensorflow/tensorflow/python/platform/tf_logging.py,205,function, -11346,vlog,tensorflow/tensorflow/python/platform/tf_logging.py,211,function, -11347,_GetNextLogCountPerToken,tensorflow/tensorflow/python/platform/tf_logging.py,215,function,"Wrapper for _log_counter_per_token. - -Args: - token: The token for which to look up the count. - -Returns: - The number of times this function has been called with - *token* as an argument (starting at 0)" -11348,log_every_n,tensorflow/tensorflow/python/platform/tf_logging.py,231,function,"Log 'msg % args' at level 'level' once per 'n' times. +10518,is_built_with_cuda,tensorflow/tensorflow/python/platform/test.py,88,function,Returns whether TensorFlow was built with CUDA (GPU) support. +10519,is_built_with_rocm,tensorflow/tensorflow/python/platform/test.py,94,function,Returns whether TensorFlow was built with ROCm (GPU) support. +10520,is_built_with_gpu_support,tensorflow/tensorflow/python/platform/test.py,100,function,Returns whether TensorFlow was built with GPU (i.e. CUDA or ROCm) support. +10521,is_built_with_xla,tensorflow/tensorflow/python/platform/test.py,106,function,Returns whether TensorFlow was built with XLA support. +10522,get_logger,tensorflow/tensorflow/python/platform/tf_logging.py,94,function,Return TF logger instance. +10523,log,tensorflow/tensorflow/python/platform/tf_logging.py,147,function, +10524,debug,tensorflow/tensorflow/python/platform/tf_logging.py,152,function, +10525,error,tensorflow/tensorflow/python/platform/tf_logging.py,157,function, +10526,fatal,tensorflow/tensorflow/python/platform/tf_logging.py,162,function, +10527,info,tensorflow/tensorflow/python/platform/tf_logging.py,167,function, +10528,warn,tensorflow/tensorflow/python/platform/tf_logging.py,172,function, +10529,warning,tensorflow/tensorflow/python/platform/tf_logging.py,177,function, +10530,TaskLevelStatusMessage,tensorflow/tensorflow/python/platform/tf_logging.py,200,function, +10531,flush,tensorflow/tensorflow/python/platform/tf_logging.py,205,function, +10532,vlog,tensorflow/tensorflow/python/platform/tf_logging.py,211,function, +10533,log_every_n,tensorflow/tensorflow/python/platform/tf_logging.py,231,function,"Log 'msg % args' at level 'level' once per 'n' times. Logs the 1st call, (N+1)st call, (2N+1)st call, etc. Not threadsafe. @@ -101944,7 +110069,7 @@ Args: msg: The message to be logged. n: The number of times this should be called before it is logged. *args: The args to be substituted into the msg." -11349,log_first_n,tensorflow/tensorflow/python/platform/tf_logging.py,248,function,"Log 'msg % args' at level 'level' only first 'n' times. +10534,log_first_n,tensorflow/tensorflow/python/platform/tf_logging.py,248,function,"Log 'msg % args' at level 'level' only first 'n' times. Not threadsafe. @@ -101953,26 +110078,11 @@ Args: msg: The message to be logged. n: The number of times this should be called before it is logged. *args: The args to be substituted into the msg." -11350,log_if,tensorflow/tensorflow/python/platform/tf_logging.py,264,function,Log 'msg % args' at level 'level' only if condition is fulfilled. -11351,_GetFileAndLine,tensorflow/tensorflow/python/platform/tf_logging.py,270,function,"Returns (filename, linenumber) for the stack frame." -11352,google2_log_prefix,tensorflow/tensorflow/python/platform/tf_logging.py,278,function,Assemble a logline prefix using the google2 format. -11353,get_verbosity,tensorflow/tensorflow/python/platform/tf_logging.py,313,function,Return how much logging output will be produced. -11354,set_verbosity,tensorflow/tensorflow/python/platform/tf_logging.py,319,function,Sets the threshold for what messages will be logged. -11355,_get_thread_id,tensorflow/tensorflow/python/platform/tf_logging.py,324,function,"Get id of current thread, suitable for logging as an unsigned quantity." -11356,_graph_string,tensorflow/tensorflow/python/profiler/model_analyzer.py,51,function,Helper to serialize a graph to string. -11357,_build_options,tensorflow/tensorflow/python/profiler/model_analyzer.py,59,function,"Build tfprof.OptionsProto. - -Args: - options: A dictionary of options. -Returns: - tfprof.OptionsProto." -11358,_build_advisor_options,tensorflow/tensorflow/python/profiler/model_analyzer.py,106,function,"Build tfprof.AdvisorOptionsProto. - -Args: - options: A dictionary of options. See ALL_ADVICE example. -Returns: - tfprof.AdvisorOptionsProto." -11359,Profiler,tensorflow/tensorflow/python/profiler/model_analyzer.py,126,class,"TensorFlow multi-step profiler. +10535,log_if,tensorflow/tensorflow/python/platform/tf_logging.py,264,function,Log 'msg % args' at level 'level' only if condition is fulfilled. +10536,google2_log_prefix,tensorflow/tensorflow/python/platform/tf_logging.py,278,function,Assemble a logline prefix using the google2 format. +10537,get_verbosity,tensorflow/tensorflow/python/platform/tf_logging.py,313,function,Return how much logging output will be produced. +10538,set_verbosity,tensorflow/tensorflow/python/platform/tf_logging.py,319,function,Sets the threshold for what messages will be logged. +10539,Profiler,tensorflow/tensorflow/python/profiler/model_analyzer.py,126,class,"TensorFlow multi-step profiler. https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/README.md @@ -102009,7 +110119,55 @@ Typical use case: # Auto detect problems and generate advice. profiler.advise() ```" -11360,profile,tensorflow/tensorflow/python/profiler/model_analyzer.py,310,function,"Profile model. +10540,add_step,tensorflow/tensorflow/python/profiler/model_analyzer.py,189,method,"Add statistics of a step. + +Args: + step: int, An id used to group one or more different `run_meta` together. + When profiling with the profile_xxx APIs, user can use the `step` + id in the `options` to profile these `run_meta` together. + run_meta: RunMetadata proto that contains statistics of a session run." +10541,profile_python,tensorflow/tensorflow/python/profiler/model_analyzer.py,207,method,"Profile the statistics of the Python codes. + + By default, it shows the call stack from root. To avoid + redundant output, you may use options to filter as below + options['show_name_regexes'] = ['.*my_code.py.*'] + +Args: + options: A dict of options. See core/profiler/g3doc/options.md. +Returns: + a MultiGraphNodeProto that records the results." +10542,profile_operations,tensorflow/tensorflow/python/profiler/model_analyzer.py,228,method,"Profile the statistics of the Operation types (e.g. MatMul, Conv2D). + +Args: + options: A dict of options. See core/profiler/g3doc/options.md. +Returns: + a MultiGraphNodeProto that records the results." +10543,profile_name_scope,tensorflow/tensorflow/python/profiler/model_analyzer.py,245,method,"Profile the statistics of graph nodes, organized by name scope. + +Args: + options: A dict of options. See core/profiler/g3doc/options.md. +Returns: + a GraphNodeProto that records the results." +10544,profile_graph,tensorflow/tensorflow/python/profiler/model_analyzer.py,262,method,"Profile the statistics of graph nodes, organized by dataflow graph. + +Args: + options: A dict of options. See core/profiler/g3doc/options.md. +Returns: + a GraphNodeProto that records the results." +10545,advise,tensorflow/tensorflow/python/profiler/model_analyzer.py,279,method,"Automatically detect problems and generate reports. + +Args: + options: A dict of options. See ALL_ADVICE example above. +Returns: + An Advise proto that contains the reports from all checkers." +10546,serialize_to_string,tensorflow/tensorflow/python/profiler/model_analyzer.py,293,method,"Serialize the ProfileProto to a binary string. + + Users can write it to file for offline analysis by tfprof commandline + or graphical interface. + +Returns: + ProfileProto binary string." +10547,profile,tensorflow/tensorflow/python/profiler/model_analyzer.py,310,function,"Profile model. Tutorials and examples can be found in: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/profiler/g3doc/python_api.md @@ -102032,7 +110190,7 @@ Returns: If cmd is 'scope' or 'graph', returns GraphNodeProto proto. If cmd is 'op' or 'code', returns MultiGraphNodeProto proto. Side effect: stdout/file/timeline.json depending on options['output']" -11361,advise,tensorflow/tensorflow/python/profiler/model_analyzer.py,385,function,"Auto profile and advise. +10548,advise,tensorflow/tensorflow/python/profiler/model_analyzer.py,385,function,"Auto profile and advise. Builds profiles and automatically check anomalies of various aspects. For more details: @@ -102046,8 +110204,7 @@ Args: options: see ALL_ADVICE example above. Default checks everything. Returns: Returns AdviceProto proto" -11362,PrintModelAnalysisTest,tensorflow/tensorflow/python/profiler/model_analyzer_test.py,51,class, -11363,ProfileOptionBuilder,tensorflow/tensorflow/python/profiler/option_builder.py,27,class,"Option Builder for Profiling API. +10549,ProfileOptionBuilder,tensorflow/tensorflow/python/profiler/option_builder.py,27,class,"Option Builder for Profiling API. For tutorial on the options, see https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/options.md @@ -102077,17 +110234,263 @@ _ = tf.compat.v1.profiler.profile(tf.compat.v1.get_default_graph(), cmd='scope', options=opts) ```" -11364,StringTable,tensorflow/tensorflow/python/profiler/pprof_profiler.py,63,class,Keeps track of strings to add to string_table in pprof proto. -11365,Functions,tensorflow/tensorflow/python/profiler/pprof_profiler.py,104,class,Keeps track of `Function` protos for pprof profile. -11366,Locations,tensorflow/tensorflow/python/profiler/pprof_profiler.py,148,class,"Keeps track of `Location` protos for pprof profile. +10550,trainable_variables_parameter,tensorflow/tensorflow/python/profiler/option_builder.py,89,method,"Options used to profile trainable variable parameters. + +Normally used together with 'scope' view. + +Returns: + A dict of profiling options." +10551,float_operation,tensorflow/tensorflow/python/profiler/option_builder.py,115,method,"Options used to profile float operations. + +Please see https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/profile_model_architecture.md +on the caveats of calculating float operations. + +Returns: + A dict of profiling options." +10552,time_and_memory,tensorflow/tensorflow/python/profiler/option_builder.py,144,method,"Show operation time and memory consumptions. + +Args: + min_micros: Only show profiler nodes with execution time + no less than this. It sums accelerator and cpu times. + min_bytes: Only show profiler nodes requested to allocate no less bytes + than this. + min_accelerator_micros: Only show profiler nodes spend no less than + this time on accelerator (e.g. GPU). + min_cpu_micros: Only show profiler nodes spend no less than + this time on cpu. + min_peak_bytes: Only show profiler nodes using no less than this bytes + at peak (high watermark). For profiler nodes consist of multiple + graph nodes, it sums the graph nodes' peak_bytes. + min_residual_bytes: Only show profiler nodes have no less than + this bytes not being de-allocated after Compute() ends. For + profiler nodes consist of multiple graph nodes, it sums the + graph nodes' residual_bytes. + min_output_bytes: Only show profiler nodes have no less than this bytes + output. The output are not necessarily allocated by this profiler + nodes. +Returns: + A dict of profiling options." +10553,build,tensorflow/tensorflow/python/profiler/option_builder.py,193,method,"Build a profiling option. + +Returns: + A dict of profiling options." +10554,with_max_depth,tensorflow/tensorflow/python/profiler/option_builder.py,201,method,"Set the maximum depth of display. + +The depth depends on profiling view. For 'scope' view, it's the +depth of name scope hierarchy (tree), for 'op' view, it's the number +of operation types (list), etc. + +Args: + max_depth: Maximum depth of the data structure to display. +Returns: + self" +10555,with_min_memory,tensorflow/tensorflow/python/profiler/option_builder.py,216,method,"Only show profiler nodes consuming no less than 'min_bytes'. + +Args: + min_bytes: Only show profiler nodes requested to allocate no less bytes + than this. + min_peak_bytes: Only show profiler nodes using no less than this bytes + at peak (high watermark). For profiler nodes consist of multiple + graph nodes, it sums the graph nodes' peak_bytes. + min_residual_bytes: Only show profiler nodes have no less than + this bytes not being de-allocated after Compute() ends. For + profiler nodes consist of multiple graph nodes, it sums the + graph nodes' residual_bytes. + min_output_bytes: Only show profiler nodes have no less than this bytes + output. The output are not necessarily allocated by this profiler + nodes. +Returns: + self" +10556,with_min_execution_time,tensorflow/tensorflow/python/profiler/option_builder.py,245,method,"Only show profiler nodes consuming no less than 'min_micros'. + +Args: + min_micros: Only show profiler nodes with execution time + no less than this. It sums accelerator and cpu times. + min_accelerator_micros: Only show profiler nodes spend no less than + this time on accelerator (e.g. GPU). + min_cpu_micros: Only show profiler nodes spend no less than + this time on cpu. +Returns: + self" +10557,with_min_parameters,tensorflow/tensorflow/python/profiler/option_builder.py,266,method,"Only show profiler nodes holding no less than 'min_params' parameters. + +'Parameters' normally refers the weights of in TensorFlow variables. +It reflects the 'capacity' of models. + +Args: + min_params: Only show profiler nodes holding number parameters + no less than this. +Returns: + self" +10558,with_min_occurrence,tensorflow/tensorflow/python/profiler/option_builder.py,281,method,"Only show profiler nodes including no less than 'min_occurrence' graph nodes. + +A ""node"" means a profiler output node, which can be a python line +(code view), an operation type (op view), or a graph node +(graph/scope view). A python line includes all graph nodes created by that +line, while an operation type includes all graph nodes of that type. + +Args: + min_occurrence: Only show nodes including no less than this. +Returns: + self" +10559,with_min_float_operations,tensorflow/tensorflow/python/profiler/option_builder.py,299,method,"Only show profiler nodes consuming no less than 'min_float_ops'. + +Please see https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/profile_model_architecture.md +on the caveats of calculating float operations. + +Args: + min_float_ops: Only show profiler nodes with float operations + no less than this. +Returns: + self" +10560,with_accounted_types,tensorflow/tensorflow/python/profiler/option_builder.py,316,method,"Selectively counting statistics based on node types. + +Here, 'types' means the profiler nodes' properties. Profiler by default +consider device name (e.g. /job:xx/.../device:GPU:0) and operation type +(e.g. MatMul) as profiler nodes' properties. User can also associate +customized 'types' to profiler nodes through OpLogProto proto. + +For example, user can select profiler nodes placed on gpu:0 with: +`account_type_regexes=['.*gpu:0.*']` + +If none of a node's properties match the specified regexes, the node is +not displayed nor accounted. + +Args: + account_type_regexes: A list of regexes specifying the types. +Returns: + self." +10561,with_node_names,tensorflow/tensorflow/python/profiler/option_builder.py,338,method,"Regular expressions used to select profiler nodes to display. + +After 'with_accounted_types' is evaluated, 'with_node_names' are +evaluated as follows: + + For a profile data structure, profiler first finds the profiler + nodes matching 'start_name_regexes', and starts displaying profiler + nodes from there. Then, if a node matches 'show_name_regexes' and + doesn't match 'hide_name_regexes', it's displayed. If a node matches + 'trim_name_regexes', profiler stops further searching that branch. + +Args: + start_name_regexes: list of node name regexes to start displaying. + show_name_regexes: list of node names regexes to display. + hide_name_regexes: list of node_names regexes that should be hidden. + trim_name_regexes: list of node name regexes from where to stop. +Returns: + self" +10562,account_displayed_op_only,tensorflow/tensorflow/python/profiler/option_builder.py,372,method,"Whether only account the statistics of displayed profiler nodes. + +Args: + is_true: If true, only account statistics of nodes eventually + displayed by the outputs. + Otherwise, a node's statistics are accounted by its parents + as long as it's types match 'account_type_regexes', even if + it is hidden from the output, say, by hide_name_regexes. +Returns: + self" +10563,with_empty_output,tensorflow/tensorflow/python/profiler/option_builder.py,387,method,Do not generate side-effect outputs. +10564,with_stdout_output,tensorflow/tensorflow/python/profiler/option_builder.py,392,method,Print the result to stdout. +10565,with_file_output,tensorflow/tensorflow/python/profiler/option_builder.py,397,method,Print the result to a file. +10566,with_timeline_output,tensorflow/tensorflow/python/profiler/option_builder.py,402,method,Generate a timeline json file. +10567,with_pprof_output,tensorflow/tensorflow/python/profiler/option_builder.py,407,method,"Generate a pprof profile gzip file. + +To use the pprof file: + pprof -png --nodecount=100 --sample_index=1 + +Args: + pprof_file: filename for output, usually suffixed with .pb.gz. +Returns: + self." +10568,order_by,tensorflow/tensorflow/python/profiler/option_builder.py,421,method,"Order the displayed profiler nodes based on a attribute. + +Supported attribute includes micros, bytes, occurrence, params, etc. +https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/options.md + +Args: + attribute: An attribute the profiler node has. +Returns: + self" +10569,select,tensorflow/tensorflow/python/profiler/option_builder.py,437,method,"Select the attributes to display. + +See https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/options.md +for supported attributes. + +Args: + attributes: A list of attribute the profiler node has. +Returns: + self" +10570,with_step,tensorflow/tensorflow/python/profiler/option_builder.py,453,method,"Which profile step to use for profiling. + +The 'step' here refers to the step defined by `Profiler.add_step()` API. + +Args: + step: When multiple steps of profiles are available, select which step's + profile to use. If -1, use average of all available steps. +Returns: + self" +10571,StringTable,tensorflow/tensorflow/python/profiler/pprof_profiler.py,63,class,Keeps track of strings to add to string_table in pprof proto. +10572,index_of,tensorflow/tensorflow/python/profiler/pprof_profiler.py,71,method,"Get index of value_str in the string table. + +If value_str is not in the string table, we will add it at the end +and then return the new index. +Args: + value_str: (string) Value to lookup/add in/to the string table. + +Returns: + Index of value_str in the string table." +10573,next_index,tensorflow/tensorflow/python/profiler/pprof_profiler.py,91,method,"Gets index that would be assigned to the next added string. + +Returns: + Index of the next string if it was added." +10574,string_table,tensorflow/tensorflow/python/profiler/pprof_profiler.py,99,method,Returns a list of strings to store in pprof's string_table. +10575,Functions,tensorflow/tensorflow/python/profiler/pprof_profiler.py,104,class,Keeps track of `Function` protos for pprof profile. +10576,index_of,tensorflow/tensorflow/python/profiler/pprof_profiler.py,118,method,"Returns index of the function, adding the function if needed. + +Args: + file_path: (string) Path to file where the function is defined. + function_name: (string) Function name. + function_start_line: (integer) Start line number of function definition. + +Returns: + Function index." +10577,function_protos,tensorflow/tensorflow/python/profiler/pprof_profiler.py,143,method,Returns list of `profile_pb2.Function` protos. +10578,Locations,tensorflow/tensorflow/python/profiler/pprof_profiler.py,148,class,"Keeps track of `Location` protos for pprof profile. `Locations` store information about function call locations." -11367,Samples,tensorflow/tensorflow/python/profiler/pprof_profiler.py,205,class,"Keeps track of `Sample` protos for pprof profile. +10579,index_of,tensorflow/tensorflow/python/profiler/pprof_profiler.py,165,method,"Returns index of the location, adding the location if needed. + +Args: + file_path: (string) Path to file that makes the call. + line_number: (integer) Call line number. + called_function_name: (string) Function name of the function called at + `file_path` and `line_number`. + called_file_path: (string) Path to file where the called function is + defined. + called_function_start_line: (integer) Start line number of called + function definition in `called_file_path` file. + +Returns: + Index of location." +10580,location_protos,tensorflow/tensorflow/python/profiler/pprof_profiler.py,200,method,Returns list of `profile_pb2.Location` protos. +10581,Samples,tensorflow/tensorflow/python/profiler/pprof_profiler.py,205,class,"Keeps track of `Sample` protos for pprof profile. Samples store the following statistics in order: count, all_time, op_time" -11368,PprofProfiler,tensorflow/tensorflow/python/profiler/pprof_profiler.py,258,class,Creates profiles in pprof format. -11369,get_profiles,tensorflow/tensorflow/python/profiler/pprof_profiler.py,389,function,"Generate profiles in pprof format. +10582,add,tensorflow/tensorflow/python/profiler/pprof_profiler.py,223,method,"Adds a sample data point. + +Args: + datum: `ProfileDatum` to add a sample for. + location_ids: List of numberic location ids for this + sample." +10583,get_sample_protos,tensorflow/tensorflow/python/profiler/pprof_profiler.py,253,method,Returns list of `Sample` protos for pprof profile. +10584,PprofProfiler,tensorflow/tensorflow/python/profiler/pprof_profiler.py,258,class,Creates profiles in pprof format. +10585,profile,tensorflow/tensorflow/python/profiler/pprof_profiler.py,274,method,"Generates pprof profiles. + +Returns: + Dictionary mapping from device name to proto in `profile_pb2.Profile` + format." +10586,profile_data_generator,tensorflow/tensorflow/python/profiler/pprof_profiler.py,377,method, +10587,get_profiles,tensorflow/tensorflow/python/profiler/pprof_profiler.py,389,function,"Generate profiles in pprof format. See https://github.com/google/pprof/blob/master/proto/profile.proto for pprof proto format. @@ -102098,7 +110501,7 @@ Args: Returns: A dictionary mapping from device name to pprof proto for that device." -11370,profile,tensorflow/tensorflow/python/profiler/pprof_profiler.py,405,function,"Generate profiles in pprof format. +10588,profile,tensorflow/tensorflow/python/profiler/pprof_profiler.py,405,function,"Generate profiles in pprof format. See https://github.com/google/pprof/blob/master/proto/profile.proto for pprof proto format. @@ -102114,10 +110517,7 @@ Args: Returns: List of output files created by this profile call. (Note: this list will be empty if output_dir is None)" -11371,PprofProfilerTest,tensorflow/tensorflow/python/profiler/pprof_profiler_test.py,34,class, -11372,_profiled_init,tensorflow/tensorflow/python/profiler/profile_context.py,40,function,Overwrites the session.__init__. -11373,_profiled_run,tensorflow/tensorflow/python/profiler/profile_context.py,45,function,Overwrites the session.run(). -11374,ProfileContext,tensorflow/tensorflow/python/profiler/profile_context.py,113,class,"A Context that captures RunMetadata and performs profiling. +10589,ProfileContext,tensorflow/tensorflow/python/profiler/profile_context.py,113,class,"A Context that captures RunMetadata and performs profiling. ```python # Trace steps 100~200, profile at [150, 200] and dump profile at 200. @@ -102154,8 +110554,33 @@ Args: user to only enable profiling when needed. debug: If true, also dumps the raw trace RunMetadata text file to profile_dir. And print debugging message. Useful for bug report." -11375,ProfilerContextTest,tensorflow/tensorflow/python/profiler/profile_context_test.py,37,class, -11376,trace,tensorflow/tensorflow/python/profiler/profiler_client.py,29,function,"Sends grpc requests to profiler server to perform on-demand profiling. +10590,get_profiles,tensorflow/tensorflow/python/profiler/profile_context.py,194,method,"Returns profiling results for each step at which `cmd` was run. + +Args: + cmd: string, profiling command used in an `add_auto_profiling` call. + +Returns: + dict[int: (MultiGraphNodeProto | GraphNodeProto)]. Keys are steps at which + the profiling command was run. Values are the outputs of profiling. + For ""code"" and ""op"" commands this will be a `MultiGraphNodeProto`, for + ""scope"" and ""graph"" commands this will be a `GraphNodeProto. + +Raises: + ValueError: if `cmd` was never run (either because no session.run call was + made or because there was no `add_auto_profiling` call with the specified + `cmd`." +10591,add_auto_profiling,tensorflow/tensorflow/python/profiler/profile_context.py,215,method,"Traces and profiles at some session run steps. + +Args: + cmd: The profiling commands. (i.e. scope, op, python, graph) + options: The profiling options. + profile_steps: A list/set of integers. The profiling command and options + will be run automatically at these integer steps. Each step is + a session.run." +10592,profiler,tensorflow/tensorflow/python/profiler/profile_context.py,232,method,Returns the current profiler object. +10593,trace_next_step,tensorflow/tensorflow/python/profiler/profile_context.py,240,method,Enables tracing and adds traces to profiler at next step. +10594,dump_next_step,tensorflow/tensorflow/python/profiler/profile_context.py,247,method,Enable tracing and dump profiles at next step. +10595,trace,tensorflow/tensorflow/python/profiler/profiler_client.py,29,function,"Sends grpc requests to profiler server to perform on-demand profiling. This method will block caller thread until it receives tracing result. This method supports CPU, GPU, and Cloud TPU. This method supports profiling a @@ -102210,7 +110635,7 @@ tf.profiler.experimental.client.trace('grpc://10.0.0.2:8466', Launch TensorBoard and point it to the same logdir you provided to this API. $ tensorboard --logdir=/tmp/tb_log (or gs://your_tb_dir in the above examples) Open your browser and go to localhost:6006/#profile to view profiling results." -11377,monitor,tensorflow/tensorflow/python/profiler/profiler_client.py,99,function,"Sends grpc requests to profiler server to perform on-demand monitoring. +10596,monitor,tensorflow/tensorflow/python/profiler/profiler_client.py,99,function,"Sends grpc requests to profiler server to perform on-demand monitoring. The monitoring result is a light weight performance summary of your model execution. This method will block the caller thread until it receives the @@ -102231,10 +110656,7 @@ Example usage: ```python for query in range(0, 100): print(tf.profiler.experimental.client.monitor('grpc://10.0.0.2:8466', 1000))" -11378,_strip_prefix,tensorflow/tensorflow/python/profiler/profiler_client.py,128,function, -11379,ProfilerClientTest,tensorflow/tensorflow/python/profiler/profiler_client_test.py,30,class, -11380,ProfilerTest,tensorflow/tensorflow/python/profiler/profiler_test.py,37,class, -11381,ProfilerOptions,tensorflow/tensorflow/python/profiler/profiler_v2.py,50,class,"Options for finer control over the profiler. +10597,ProfilerOptions,tensorflow/tensorflow/python/profiler/profiler_v2.py,50,class,"Options for finer control over the profiler. Use `tf.profiler.ProfilerOptions` to control `tf.profiler` behavior. @@ -102246,7 +110668,7 @@ Fields: - enabled, 0 - disabled [default value is 0] device_tracer_level: Adjust device (TPU/GPU) tracing level. Values are: 1 - enabled, 0 - disabled [default value is 1]" -11382,start,tensorflow/tensorflow/python/profiler/profiler_v2.py,78,function,"Start profiling TensorFlow performance. +10598,start,tensorflow/tensorflow/python/profiler/profiler_v2.py,78,function,"Start profiling TensorFlow performance. Args: logdir: Profiling results log directory. @@ -102269,7 +110691,7 @@ tf.profiler.experimental.stop() To view the profiling results, launch TensorBoard and point it to `logdir`. Open your browser and go to `localhost:6006/#profile` to view profiling results." -11383,stop,tensorflow/tensorflow/python/profiler/profiler_v2.py,127,function,"Stops the current profiling session. +10599,stop,tensorflow/tensorflow/python/profiler/profiler_v2.py,127,function,"Stops the current profiling session. The profiler session will be stopped and profile results can be saved. @@ -102278,12 +110700,12 @@ Args: Raises: UnavailableError: If there is no active profiling session." -11384,warmup,tensorflow/tensorflow/python/profiler/profiler_v2.py,153,function,"Warm-up the profiler session. +10600,warmup,tensorflow/tensorflow/python/profiler/profiler_v2.py,153,function,"Warm-up the profiler session. The profiler session will set up profiling context, including loading CUPTI library for GPU profiling. This is used for improving the accuracy of the profiling results." -11385,start_server,tensorflow/tensorflow/python/profiler/profiler_v2.py,166,function,"Start a profiler grpc server that listens to given port. +10601,start_server,tensorflow/tensorflow/python/profiler/profiler_v2.py,166,function,"Start a profiler grpc server that listens to given port. The profiler server will exit when the process finishes. The service is defined in tensorflow/core/profiler/profiler_service.proto. @@ -102292,7 +110714,7 @@ Args: port: port profiler server listens to. Example usage: ```python tf.profiler.experimental.server.start('6009') # do your training here." -11386,Profile,tensorflow/tensorflow/python/profiler/profiler_v2.py,181,class,"Context-manager profile API. +10602,Profile,tensorflow/tensorflow/python/profiler/profiler_v2.py,181,class,"Context-manager profile API. Profiling will start when entering the scope, and stop and save the results to the logdir when exits the scope. Open TensorBoard profile tab to view results. @@ -102302,21 +110724,7 @@ Example usage: with tf.profiler.experimental.Profile(""/path/to/logdir""): # do some work ```" -11387,ProfilerTest,tensorflow/tensorflow/python/profiler/profiler_v2_test.py,33,class, -11388,_fill_missing_graph_shape,tensorflow/tensorflow/python/profiler/tfprof_logger.py,39,function,Fill Tensor shapes in 'graph' with run time shape from 'run_meta'. -11389,_str_id,tensorflow/tensorflow/python/profiler/tfprof_logger.py,68,function,Maps string to id. -11390,_get_logged_ops,tensorflow/tensorflow/python/profiler/tfprof_logger.py,77,function,"Extract trainable model parameters and FLOPs for ops from a Graph. - -Args: - graph: tf.Graph. - run_meta: RunMetadata proto used to complete shape information. - add_trace: Whether to add op trace information. - add_trainable_var: Whether to assign tf.compat.v1.trainable_variables() op - type '_trainable_variables'. -Returns: - logged_ops: dict mapping from op_name to OpLogEntry. - string_to_id: dict mapping from string to id." -11391,merge_default_with_oplog,tensorflow/tensorflow/python/profiler/tfprof_logger.py,145,function,"Merge the tfprof default extra info with caller's op_log. +10603,merge_default_with_oplog,tensorflow/tensorflow/python/profiler/tfprof_logger.py,145,function,"Merge the tfprof default extra info with caller's op_log. Args: graph: tf.Graph. If None and eager execution is not enabled, use @@ -102328,7 +110736,7 @@ Args: type '_trainable_variables'. Returns: tmp_op_log: Merged OpLogProto proto." -11392,write_op_log,tensorflow/tensorflow/python/profiler/tfprof_logger.py,193,function,"Log provided 'op_log', and add additional model information below. +10604,write_op_log,tensorflow/tensorflow/python/profiler/tfprof_logger.py,193,function,"Log provided 'op_log', and add additional model information below. The API also assigns ops in tf.compat.v1.trainable_variables() an op type called '_trainable_variables'. @@ -102347,8 +110755,7 @@ Args: run time shape information. add_trace: Whether to add python code trace information. Used to support ""code"" view." -11393,TFProfLoggerTest,tensorflow/tensorflow/python/profiler/tfprof_logger_test.py,27,class, -11394,Trace,tensorflow/tensorflow/python/profiler/trace.py,30,class,"Context manager that generates a trace event in the profiler. +10605,Trace,tensorflow/tensorflow/python/profiler/trace.py,30,class,"Context manager that generates a trace event in the profiler. A trace event will start when entering the context, and stop and save the result to the profiler when exiting the context. Open TensorBoard Profile tab @@ -102367,117 +110774,46 @@ for step in range(num_steps): train_fn() tf.profiler.experimental.stop() ```" -11395,traceme_wrapper,tensorflow/tensorflow/python/profiler/traceme.py,24,function, -11396,_zero_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,46,function,Returns zero flops. -11397,_list_product,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,52,function,Computes product of element of the list. -11398,_unary_op_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,64,function,Common code which compute flops for unary operations. -11399,_reciprocal_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,72,function,Compute flops for Reciprocal operation. -11400,_square_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,78,function,Compute flops for Square operation. -11401,_rsqrt_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,84,function,Compute flops for Rsqrt operation. -11402,_log_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,91,function,Compute flops for Log operation. -11403,_neg_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,97,function,Compute flops for Neg operation. -11404,_assign_sub_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,103,function,Compute flops for AssignSub operation. -11405,_assign_add_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,109,function,Compute flops for AssignAdd operation. -11406,_l2_loss_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,115,function,Compute flops for L2Loss operation. -11407,_softmax_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,125,function,Compute flops for Softmax operation. -11408,_binary_per_element_op_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,140,function,Common code which compute flops for binary operations. -11409,_add_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,148,function,Compute flops for Add operation. -11410,_sub_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,154,function,Compute flops for Sub operation. -11411,_mul_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,160,function,Compute flops for Mul operation. -11412,_real_div_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,166,function,Compute flops for RealDiv operation. -11413,_maximum_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,172,function,Compute flops for Maximum operation. -11414,_minimum_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,178,function,Compute flops for Minimum operation. -11415,_pow_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,184,function,Compute flops for Pow operation. -11416,_rsqrt_grad_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,190,function,Compute flops for RsqrtGrad operation. -11417,_greater_equal_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,196,function,Compute flops for GreaterEqual operation. -11418,_greater_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,202,function,Compute flops for Greater operation. -11419,_less_equal_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,208,function,Compute flops for LessEqual operation. -11420,_less_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,214,function,Compute flops for Less operation. -11421,_equal_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,220,function,Compute flops for Equal operation. -11422,_not_equal_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,226,function,Compute flops for NotEqual operation. -11423,_squared_difference_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,232,function,Compute flops for SquaredDifference operation. -11424,_reduction_op_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,241,function,Common code which compute flops for reduction operations. -11425,_mean_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,253,function,Compute flops for Mean operation. -11426,_sum_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,260,function,Compute flops for Sum operation. -11427,_arg_max_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,267,function,Compute flops for ArgMax operation. -11428,_arg_min_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,274,function,Compute flops for ArgMin operation. -11429,_bias_add_grad_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,281,function,Compute flops for BiasAddGrad operation. -11430,_verify_conv_data_format,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,293,function,Verifies data format for pooling and convolutional operations. -11431,_pool_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,300,function,Common code which compute flops for pooling operations. -11432,_avg_pool_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,325,function,Compute flops for AvgPool operation. -11433,_max_pool_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,331,function,Compute flops for MaxPool operation. -11434,_avg_pool_grad_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,337,function,Compute flops for AvgPoolGrad operation. -11435,_max_pool_grad_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,354,function,Compute flops for MaxPoolGrad operation. -11436,_conv_2d_backprop_input_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,382,function,Compute flops for Conv2DBackpropInput operation. -11437,_conv_2d_backprop_filter_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,414,function,Compute flops for Conv2DBackpropFilter operation. -11438,_add_n_flops,tensorflow/tensorflow/python/profiler/internal/flops_registry.py,441,function,Compute flops for AddN operation. -11439,BuildSmallModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,38,function,Build a small forward conv model. -11440,BuildFullModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,58,function,"Build the full model with conv,rnn,opt." -11441,BuildSplittableModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,75,function,Build a small model that can be run partially in each step. -11442,SearchTFProfNode,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,95,function,Search a node in the tree. -11443,ProfilerFromFile,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,106,function,Initialize a profiler from profile file. -11444,CheckAndRemoveDoc,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,114,function, -11445,PrintModelAnalysisTest,tensorflow/tensorflow/python/profiler/internal/print_model_analysis_test.py,52,class, -11446,_extract_node,tensorflow/tensorflow/python/profiler/internal/run_metadata_test.py,45,function, -11447,_run_model,tensorflow/tensorflow/python/profiler/internal/run_metadata_test.py,65,function, -11448,_run_loop_model,tensorflow/tensorflow/python/profiler/internal/run_metadata_test.py,92,function, -11449,RunMetadataTest,tensorflow/tensorflow/python/profiler/internal/run_metadata_test.py,116,class, -11450,_SavedModelBuilder,tensorflow/tensorflow/python/saved_model/builder_impl.py,46,class,"Builds the `SavedModel` protocol buffer and saves variables and assets. - -The `SavedModelBuilder` class provides the functionality to build a -`SavedModel` protocol buffer. Specifically, this allows multiple meta -graphs to be saved as part of a single language-neutral `SavedModel`, -while sharing variables and assets. - -To build a SavedModel, the first meta graph must be saved with variables. -Subsequent meta graphs will simply be saved with their graph definitions. If -assets need to be saved and written or copied to disk, they can be provided -when the meta graph def is added. If multiple meta graph defs are associated -an asset of the same name, only the first version is retained. - -Each meta graph added to the SavedModel must be annotated with tags. The tags -provide a means to identify the specific meta graph to load and restore, along -with the shared set of variables and assets. - -Typical usage for the `SavedModelBuilder`: - -```python -... -builder = tf.compat.v1.saved_model.Builder(export_dir) - -with tf.compat.v1.Session(graph=tf.Graph()) as sess: - ... - builder.add_meta_graph_and_variables(sess, - [""foo-tag""], - signature_def_map=foo_signatures, - assets_list=foo_assets) -... - -with tf.compat.v1.Session(graph=tf.Graph()) as sess: - ... - builder.add_meta_graph([""bar-tag"", ""baz-tag""]) -... - -builder.save() -``` - -Note: This function will only be available through the v1 compatibility -library as tf.compat.v1.saved_model.builder.SavedModelBuilder or -tf.compat.v1.saved_model.Builder. Tensorflow 2.0 will introduce a new -object-based method of creating SavedModels." -11451,SavedModelBuilder,tensorflow/tensorflow/python/saved_model/builder_impl.py,432,class, -11452,_maybe_save_assets,tensorflow/tensorflow/python/saved_model/builder_impl.py,624,function,"Saves assets to the meta graph. +10606,set_metadata,tensorflow/tensorflow/python/profiler/trace.py,89,method,"Sets metadata in this trace event. Args: - write_fn: A function callback that writes assets into meta graph. - assets_to_add: The list where the asset paths are setup. + **kwargs: metadata in key-value pairs. -Returns: - A dict of asset basenames for saving to the original full path to the asset. +This method enables setting metadata in a trace event after it is +created. -Raises: - ValueError: Indicating an invalid filepath tensor." -11453,get_asset_filename_to_add,tensorflow/tensorflow/python/saved_model/builder_impl.py,670,function,"Get a unique basename to add to the SavedModel if this file is unseen. +Example usage: + +```python + + def call(function): + with tf.profiler.experimental.Trace(""call"", + function_name=function.name) as tm: + binary, in_cache = jit_compile(function) + tm.set_metadata(in_cache=in_cache) + execute(binary) + +``` +In this example, we want to trace how much time spent on +calling a function, which includes compilation and execution. +The compilation can be either getting a cached copy of the +binary or actually generating the binary, which is indicated +by the boolean ""in_cache"" returned by jit_compile(). We need +to use set_metadata() to pass in_cache because we did not know +the in_cache value when the trace was created (and we cannot +create the trace after jit_compile(), because we want +to measure the entire duration of call())." +10607,traceme_wrapper,tensorflow/tensorflow/python/profiler/traceme.py,24,function, +10608,BuildSmallModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,38,function,Build a small forward conv model. +10609,BuildFullModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,58,function,"Build the full model with conv,rnn,opt." +10610,BuildSplittableModel,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,75,function,Build a small model that can be run partially in each step. +10611,SearchTFProfNode,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,95,function,Search a node in the tree. +10612,ProfilerFromFile,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,106,function,Initialize a profiler from profile file. +10613,CheckAndRemoveDoc,tensorflow/tensorflow/python/profiler/internal/model_analyzer_testlib.py,114,function, +10614,SavedModelBuilder,tensorflow/tensorflow/python/saved_model/builder_impl.py,432,class, +10615,add_meta_graph,tensorflow/tensorflow/python/saved_model/builder_impl.py,516,method, +10616,add_meta_graph_and_variables,tensorflow/tensorflow/python/saved_model/builder_impl.py,560,method, +10617,get_asset_filename_to_add,tensorflow/tensorflow/python/saved_model/builder_impl.py,670,function,"Get a unique basename to add to the SavedModel if this file is unseen. Assets come from users as full paths, and we save them out to the SavedModel as basenames. In some cases, the basenames collide. Here, @@ -102493,56 +110829,12 @@ Args: Returns: Uniquified filename string if the file is not a duplicate, or the original filename if the file has already been seen and saved." -11454,_get_unique_asset_filename,tensorflow/tensorflow/python/saved_model/builder_impl.py,709,function, -11455,_asset_path_from_tensor,tensorflow/tensorflow/python/saved_model/builder_impl.py,719,function,"Returns the filepath value stored in constant `path_tensor`. - -Args: - path_tensor: Tensor of a file-path. - -Returns: - The string value i.e. path of the tensor, if valid. - -Raises: - TypeError if tensor does not match expected op type, dtype or value." -11456,_add_asset_to_metagraph,tensorflow/tensorflow/python/saved_model/builder_impl.py,743,function,"Builds an asset proto and adds it to the meta graph def. - -Args: - meta_graph_def: The meta graph def to which the asset will be added. - asset_filename: The filename of the asset to be added. - asset_tensor: The asset tensor used to populate the tensor info of the asset - proto." -11457,copy_assets_to_destination_dir,tensorflow/tensorflow/python/saved_model/builder_impl.py,757,function,Copy all assets from source path to destination path. -11458,_add_asset_to_collection,tensorflow/tensorflow/python/saved_model/builder_impl.py,778,function,"Builds an asset proto and adds it to the asset collection of the graph. - -Args: - asset_filename: The filename of the asset to be added. - asset_tensor: The asset tensor used to populate the tensor info of the - asset proto." -11459,_add_op_to_signature_def_map,tensorflow/tensorflow/python/saved_model/builder_impl.py,795,function, -11460,_is_tensor,tensorflow/tensorflow/python/saved_model/function_deserialization.py,42,function, -11461,_call_concrete_function,tensorflow/tensorflow/python/saved_model/function_deserialization.py,48,function,"Calls a restored Function with structured inputs. - -This differs from `function.__call__` in that inputs and outputs are -structured and that it casts inputs to tensors if needed. - -Note: this does not checks that non-tensor inputs match. That should be -done before via `_concrete_function_callable_with`. - -Args: - function: ConcreteFunction to call. - inputs: Structured inputs compatible with - `function.graph.structured_input_signature`. - -Returns: - The structured function output." -11462,_try_convert_to_tensor_spec,tensorflow/tensorflow/python/saved_model/function_deserialization.py,80,function,Returns None or TensorSpec obtained if `arg` is converted to tensor. -11463,_concrete_function_callable_with,tensorflow/tensorflow/python/saved_model/function_deserialization.py,91,function,Returns whether concrete `function` can be called with `inputs`. -11464,_deserialize_function_spec_as_nonmethod,tensorflow/tensorflow/python/saved_model/function_deserialization.py,121,function,Deserialize a FunctionSpec object from its proto representation. -11465,setup_bare_concrete_function,tensorflow/tensorflow/python/saved_model/function_deserialization.py,153,function,Makes a restored bare concrete function callable. -11466,RestoredFunction,tensorflow/tensorflow/python/saved_model/function_deserialization.py,170,class,"Wrapper class for a function that has been restored from saved state. +10618,copy_assets_to_destination_dir,tensorflow/tensorflow/python/saved_model/builder_impl.py,757,function,Copy all assets from source path to destination path. +10619,setup_bare_concrete_function,tensorflow/tensorflow/python/saved_model/function_deserialization.py,153,function,Makes a restored bare concrete function callable. +10620,RestoredFunction,tensorflow/tensorflow/python/saved_model/function_deserialization.py,170,class,"Wrapper class for a function that has been restored from saved state. See `def_function.Function`." -11467,recreate_function,tensorflow/tensorflow/python/saved_model/function_deserialization.py,192,function,"Creates a `Function` from a `SavedFunction`. +10621,recreate_function,tensorflow/tensorflow/python/saved_model/function_deserialization.py,192,function,"Creates a `Function` from a `SavedFunction`. Args: saved_function: `SavedFunction` proto. @@ -102552,7 +110844,7 @@ Args: Returns: A `Function`." -11468,load_function_def_library,tensorflow/tensorflow/python/saved_model/function_deserialization.py,278,function,"Load a set of functions as concrete functions without captured inputs. +10622,load_function_def_library,tensorflow/tensorflow/python/saved_model/function_deserialization.py,278,function,"Load a set of functions as concrete functions without captured inputs. Functions names are manipulated during load such that they do not overlap with previously created ones. @@ -102568,31 +110860,11 @@ Returns: Raises: ValueError: if functions dependencies have a cycle." -11469,_restore_gradient_functions,tensorflow/tensorflow/python/saved_model/function_deserialization.py,348,function,Populate function op's _gradient_function with default gradient. -11470,_sort_function_defs,tensorflow/tensorflow/python/saved_model/function_deserialization.py,360,function,Return a topologic sort of FunctionDefs in a library. -11471,fix_node_def,tensorflow/tensorflow/python/saved_model/function_deserialization.py,393,function,Replace functions calls and shared names in `node_def`. -11472,_fix_fdef,tensorflow/tensorflow/python/saved_model/function_deserialization.py,438,function,"Fixes a FunctionDef proto to be loaded in current context. - -In particular, when loading a function library into an eager context, one -must rename the functions to avoid conflicts with existent functions. - -Args: - orig_fdef: FunctionDef proto to fix. It is not modified. - functions: map from function name to a ConcreteFunction instance. - shared_name_suffix: A unique string for this load which helps to avoid - `shared_name` collisions across loads. Two functions from the same load - using the same `shared_name` still need to share, but functions from - different loads with the same `shared_name` should not. - -Returns: - A fixed copy of the original FunctionDef." -11473,_list_function_deps,tensorflow/tensorflow/python/saved_model/function_deserialization.py,464,function,Find functions referenced in `fdef`. -11474,_clean_function_name,tensorflow/tensorflow/python/saved_model/function_deserialization.py,488,function,Vanity function to keep the function names comprehensible. -11475,_serialize_function_spec,tensorflow/tensorflow/python/saved_model/function_serialization.py,29,function,Serialize a FunctionSpec object into its proto representation. -11476,serialize_concrete_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,52,function,Build a SavedConcreteFunction. -11477,serialize_bare_concrete_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,78,function,Build a SavedBareConcreteFunction. -11478,serialize_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,94,function,Build a SavedFunction proto. -11479,wrap_cached_variables,tensorflow/tensorflow/python/saved_model/function_serialization.py,110,function,"Wraps the concrete function if it uses cached read tensors. +10623,fix_node_def,tensorflow/tensorflow/python/saved_model/function_deserialization.py,393,function,Replace functions calls and shared names in `node_def`. +10624,serialize_concrete_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,52,function,Build a SavedConcreteFunction. +10625,serialize_bare_concrete_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,78,function,Build a SavedBareConcreteFunction. +10626,serialize_function,tensorflow/tensorflow/python/saved_model/function_serialization.py,94,function,Build a SavedFunction proto. +10627,wrap_cached_variables,tensorflow/tensorflow/python/saved_model/function_serialization.py,110,function,"Wraps the concrete function if it uses cached read tensors. This function creates a new concrete function that captures variables instead of the cached read tensors. @@ -102606,24 +110878,11 @@ Returns: captures variables instead. If the original function did not capture any cached values, then the function is not wrapped and the original object is returned." -11480,_unused_handle,tensorflow/tensorflow/python/saved_model/load.py,57,function,Returns a placeholder as a handle that is not supposed to be accessed. -11481,_WrapperFunction,tensorflow/tensorflow/python/saved_model/load.py,71,class,"A class wraps a concrete function to handle different distributed contexts. - -The reason for wrapping a concrete function is because the _captured_inputs -fields used for in-replica context and cross-replica context are different. -When `load()` is called from within a tf.distribute.strategy scope, the -captured inputs are distributed variables. When using these distributed -variables during calling the function, we need different approaches when it is -in-replica and when it is not in-replica. When it is in replica, naturally we -should use the corresponding component of the distributed variable; when it is -not in-replica, calling the function should mean that it is constructing a -graph that is not actually going to be used. A typical use case is when -constructing a functional model. In this case, return a placeholder with a -control dependency to ensure that is never accessed." -11482,Loader,tensorflow/tensorflow/python/saved_model/load.py,109,class,Helper class to load an object-based SavedModel. -11483,_RestoredResource,tensorflow/tensorflow/python/saved_model/load.py,472,class,Restored SavedResource. -11484,_call_attribute,tensorflow/tensorflow/python/saved_model/load.py,508,function, -11485,load,tensorflow/tensorflow/python/saved_model/load.py,513,function,"Load a SavedModel from `export_dir`. +10628,Loader,tensorflow/tensorflow/python/saved_model/load.py,109,class,Helper class to load an object-based SavedModel. +10629,adjust_debug_info_func_names,tensorflow/tensorflow/python/saved_model/load.py,360,method,Rewrite func names in the debug info by using the concrete func names. +10630,get,tensorflow/tensorflow/python/saved_model/load.py,373,method, +10631,uninitialized_variable_creator,tensorflow/tensorflow/python/saved_model/load.py,438,method,A variable creator that creates uninitialized variables. +10632,load,tensorflow/tensorflow/python/saved_model/load.py,513,function,"Load a SavedModel from `export_dir`. Signatures associated with the SavedModel are available as functions: @@ -102711,32 +110970,20 @@ Returns: Raises: ValueError: If `tags` don't match a MetaGraph in the SavedModel." -11486,load_internal,tensorflow/tensorflow/python/saved_model/load.py,606,function,Loader implementation. -11487,LoadContext,tensorflow/tensorflow/python/saved_model/load_context.py,25,class,A context for loading a model. -11488,load_context,tensorflow/tensorflow/python/saved_model/load_context.py,46,function, -11489,get_load_options,tensorflow/tensorflow/python/saved_model/load_context.py,54,function,Returns whether under a load context. -11490,LoadOptions,tensorflow/tensorflow/python/saved_model/load_options.py,25,class,"Options for loading a SavedModel. +10633,load_internal,tensorflow/tensorflow/python/saved_model/load.py,606,function,Loader implementation. +10634,LoadContext,tensorflow/tensorflow/python/saved_model/load_context.py,25,class,A context for loading a model. +10635,set_load_options,tensorflow/tensorflow/python/saved_model/load_context.py,32,method, +10636,clear_load_options,tensorflow/tensorflow/python/saved_model/load_context.py,35,method, +10637,load_options,tensorflow/tensorflow/python/saved_model/load_context.py,38,method, +10638,load_context,tensorflow/tensorflow/python/saved_model/load_context.py,46,function, +10639,get_load_options,tensorflow/tensorflow/python/saved_model/load_context.py,54,function,Returns whether under a load context. +10640,LoadOptions,tensorflow/tensorflow/python/saved_model/load_options.py,25,class,"Options for loading a SavedModel. This function may be used in the `options` argument in functions that load a SavedModel (`tf.saved_model.load`, `tf.keras.models.load_model`)." -11491,cycle,tensorflow/tensorflow/python/saved_model/load_test.py,68,function, -11492,LoadTest,tensorflow/tensorflow/python/saved_model/load_test.py,88,class, -11493,SingleCycleTests,tensorflow/tensorflow/python/saved_model/load_test.py,1814,class, -11494,_Initializer,tensorflow/tensorflow/python/saved_model/load_v1_in_v2.py,40,class,"Represents an initialization operation restored from a SavedModel. - -Without this object re-export of imported 1.x SavedModels would omit the -original SavedModel's initialization procedure. - -Created when `tf.saved_model.load` loads a TF 1.x-style SavedModel with an -initialization op. This object holds a function that runs the -initialization. It does not require any manual user intervention; -`tf.saved_model.save` will see this object and automatically add it to the -exported SavedModel, and `tf.saved_model.load` runs the initialization -function automatically." -11495,_EagerSavedModelLoader,tensorflow/tensorflow/python/saved_model/load_v1_in_v2.py,67,class,Loads a SavedModel without using Sessions. -11496,load,tensorflow/tensorflow/python/saved_model/load_v1_in_v2.py,260,function,Load a v1-style SavedModel as an object. -11497,LoadTest,tensorflow/tensorflow/python/saved_model/load_v1_in_v2_test.py,57,class, -11498,parse_saved_model_with_debug_info,tensorflow/tensorflow/python/saved_model/loader_impl.py,43,function,"Reads the savedmodel as well as the graph debug info. +10641,cycle,tensorflow/tensorflow/python/saved_model/load_test.py,68,function, +10642,load,tensorflow/tensorflow/python/saved_model/load_v1_in_v2.py,260,function,Load a v1-style SavedModel as an object. +10643,parse_saved_model_with_debug_info,tensorflow/tensorflow/python/saved_model/loader_impl.py,43,function,"Reads the savedmodel as well as the graph debug info. Args: export_dir: Directory containing the SavedModel and GraphDebugInfo files. @@ -102747,7 +110994,7 @@ Returns: Raises: IOError: If the saved model file does not exist, or cannot be successfully parsed. Missing graph debug info file is fine." -11499,parse_saved_model,tensorflow/tensorflow/python/saved_model/loader_impl.py,72,function,"Reads the savedmodel.pb or savedmodel.pbtxt file containing `SavedModel`. +10644,parse_saved_model,tensorflow/tensorflow/python/saved_model/loader_impl.py,72,function,"Reads the savedmodel.pb or savedmodel.pbtxt file containing `SavedModel`. Args: export_dir: String or Pathlike, path to the directory containing the @@ -102758,7 +111005,7 @@ Returns: Raises: IOError: If the file does not exist, or cannot be successfully parsed." -11500,get_asset_tensors,tensorflow/tensorflow/python/saved_model/loader_impl.py,122,function,"Gets the asset tensors, if defined in the meta graph def to load. +10645,get_asset_tensors,tensorflow/tensorflow/python/saved_model/loader_impl.py,122,function,"Gets the asset tensors, if defined in the meta graph def to load. Args: export_dir: Directory where the SavedModel is located. @@ -102769,24 +111016,9 @@ Args: Returns: A dictionary of asset tensors, keyed by the name of the asset tensor. The value in the map corresponds to the absolute path of the asset file." -11501,_get_main_op_tensor,tensorflow/tensorflow/python/saved_model/loader_impl.py,165,function,"Gets the main op tensor, if one exists. - -Args: - meta_graph_def_to_load: The meta graph def from the SavedModel to be loaded. - init_op_key: name of the collection to check; should be one of MAIN_OP_KEY - or the deprecated LEGACY_INIT_OP_KEY - -Returns: - The main op tensor, if it exists and `None` otherwise. - -Raises: - RuntimeError: If the collection def corresponding to the main op key has - other than exactly one tensor." -11502,_get_op_from_collection,tensorflow/tensorflow/python/saved_model/loader_impl.py,194,function, -11503,_get_op_from_signature_def,tensorflow/tensorflow/python/saved_model/loader_impl.py,198,function,Retrieve op stored in the imported meta graph's signature def. -11504,get_init_op,tensorflow/tensorflow/python/saved_model/loader_impl.py,208,function, -11505,get_train_op,tensorflow/tensorflow/python/saved_model/loader_impl.py,215,function, -11506,maybe_saved_model_directory,tensorflow/tensorflow/python/saved_model/loader_impl.py,230,function,"Checks whether the provided export directory could contain a SavedModel. +10646,get_init_op,tensorflow/tensorflow/python/saved_model/loader_impl.py,208,function, +10647,get_train_op,tensorflow/tensorflow/python/saved_model/loader_impl.py,215,function, +10648,maybe_saved_model_directory,tensorflow/tensorflow/python/saved_model/loader_impl.py,230,function,"Checks whether the provided export directory could contain a SavedModel. Note that the method does not load any data by itself. If the method returns `false`, the export directory definitely does not contain a SavedModel. If the @@ -102799,7 +111031,7 @@ Args: Returns: True if the export directory contains SavedModel files, False otherwise." -11507,contains_saved_model,tensorflow/tensorflow/python/saved_model/loader_impl.py,251,function,"Checks whether the provided export directory could contain a SavedModel. +10649,contains_saved_model,tensorflow/tensorflow/python/saved_model/loader_impl.py,251,function,"Checks whether the provided export directory could contain a SavedModel. Note that the method does not load any data by itself. If the method returns `false`, the export directory definitely does not contain a SavedModel. If the @@ -102812,7 +111044,7 @@ Args: Returns: True if the export directory contains SavedModel files, False otherwise." -11508,load,tensorflow/tensorflow/python/saved_model/loader_impl.py,276,function,"Loads the model from a SavedModel as specified by tags. +10650,load,tensorflow/tensorflow/python/saved_model/loader_impl.py,276,function,"Loads the model from a SavedModel as specified by tags. Args: sess: The TensorFlow session to restore the variables. @@ -102833,29 +111065,76 @@ Returns: Raises: RuntimeError: MetaGraphDef associated with the tags cannot be found." -11509,SavedModelLoader,tensorflow/tensorflow/python/saved_model/loader_impl.py,303,class,Load graphs and restore variable values from a `SavedModel`. -11510,_get_export_dir,tensorflow/tensorflow/python/saved_model/loader_test.py,41,function, -11511,build_graph_helper,tensorflow/tensorflow/python/saved_model/loader_test.py,48,function, -11512,SavedModelLoaderTest,tensorflow/tensorflow/python/saved_model/loader_test.py,67,class, -11513,main_op,tensorflow/tensorflow/python/saved_model/main_op_impl.py,34,function,"Returns a main op to init variables and tables. - -Returns the main op including the group of ops that initializes all -variables, initializes local variables and initialize all tables. - -Returns: - The set of ops to be run as part of the main op upon the load operation." -11514,main_op_with_restore,tensorflow/tensorflow/python/saved_model/main_op_impl.py,57,function,"Returns a main op to init variables, tables and restore the graph. - -Returns the main op including the group of ops that initializes all -variables, initialize local variables, initialize all tables and the restore -op name. +10651,SavedModelLoader,tensorflow/tensorflow/python/saved_model/loader_impl.py,303,class,Load graphs and restore variable values from a `SavedModel`. +10652,export_dir,tensorflow/tensorflow/python/saved_model/loader_impl.py,318,method,Directory containing the SavedModel. +10653,variables_path,tensorflow/tensorflow/python/saved_model/loader_impl.py,323,method,Path to variable checkpoint files. +10654,saved_model,tensorflow/tensorflow/python/saved_model/loader_impl.py,328,method,SavedModel object parsed from the export directory. +10655,get_meta_graph_def_from_tags,tensorflow/tensorflow/python/saved_model/loader_impl.py,332,method,"Return MetaGraphDef with the exact specified tags. Args: - restore_op_name: Name of the op to use to restore the graph. + tags: A list or set of string tags that identify the MetaGraphDef. Returns: - The set of ops to be run as part of the main op upon the load operation." -11515,MethodNameUpdater,tensorflow/tensorflow/python/saved_model/method_name_updater.py,37,class,"Updates the method name(s) of the SavedModel stored in the given path. + MetaGraphDef with the same tags. + +Raises: + RuntimeError: if no metagraphs were found with the associated tags." +10656,load_graph,tensorflow/tensorflow/python/saved_model/loader_impl.py,361,method,"Load ops and nodes from SavedModel MetaGraph into graph. + +Args: + graph: tf.Graph object. + tags: a set of string tags identifying a MetaGraphDef. + import_scope: Optional `string` -- if specified, prepend this string + followed by '/' to all loaded tensor names. This scope is applied to + tensor instances loaded into the passed session, but it is *not* written + through to the static `MetaGraphDef` protocol buffer that is returned. + **saver_kwargs: keyword arguments to pass to tf.train.import_meta_graph. + +Returns: + A tuple of + * Saver defined by the MetaGraph, which can be used to restore the + variable values. + * List of `Operation`/`Tensor` objects returned from + `tf.import_graph_def` (may be `None`)." +10657,restore_variables,tensorflow/tensorflow/python/saved_model/loader_impl.py,385,method,"Restore SavedModel variable values into the session. + +Args: + sess: tf.compat.v1.Session to restore variable values. + saver: a tf.compat.v1.train.Saver object. Can be None if there are no + variables in graph. This may be the saver returned by the load_graph() + function, or a default `tf.compat.v1.train.Saver()`. + import_scope: Optional `string` -- if specified, prepend this string + followed by '/' to all loaded tensor names. This scope is applied to + tensor instances loaded into the passed session, but it is *not* written + through to the static `MetaGraphDef` protocol buffer that is returned. + +Raises: + ValueError: if no saver was passed to the saver argument, and there are + variables in the graph." +10658,run_init_ops,tensorflow/tensorflow/python/saved_model/loader_impl.py,415,method,"Run initialization ops defined in the `MetaGraphDef`. + +Args: + sess: tf.compat.v1.Session to restore variable values. + tags: a set of string tags identifying a MetaGraphDef. + import_scope: Optional `string` -- if specified, prepend this string + followed by '/' to all loaded tensor names. This scope is applied to + tensor instances loaded into the passed session, but it is *not* written + through to the static `MetaGraphDef` protocol buffer that is returned." +10659,load,tensorflow/tensorflow/python/saved_model/loader_impl.py,436,method,"Load the MetaGraphDef graph and restore variable values into the session. + +Args: + sess: tf.compat.v1.Session to restore variable values. + tags: a set of string tags identifying a MetaGraphDef. + import_scope: Optional `string` -- if specified, prepend this string + followed by '/' to all loaded tensor names. This scope is applied to + tensor instances loaded into the passed session, but it is *not* written + through to the static `MetaGraphDef` protocol buffer that is returned. + **saver_kwargs: keyword arguments to pass to tf.train.import_meta_graph. + +Returns: + `MetagraphDef` proto of the graph that was loaded." +10660,build_graph_helper,tensorflow/tensorflow/python/saved_model/loader_test.py,48,function, +10661,MethodNameUpdater,tensorflow/tensorflow/python/saved_model/method_name_updater.py,37,class,"Updates the method name(s) of the SavedModel stored in the given path. The `MethodNameUpdater` class provides the functionality to update the method name field in the signature_defs of the given SavedModel. For example, it @@ -102876,40 +111155,65 @@ updater.save(new_export_dir) Note: This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.builder.MethodNameUpdater." -11516,MethodNameUpdaterTest,tensorflow/tensorflow/python/saved_model/method_name_updater_test.py,122,class, -11517,NotEncodableError,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,57,class,Error raised when a coder cannot encode an object. -11518,StructureCoder,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,61,class,Encoder and decoder for nested structures into protos. -11519,_ListCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,130,class,Codec for lists. -11520,_is_tuple,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,153,function, -11521,_is_named_tuple,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,157,function,"Returns True iff `instance` is a `namedtuple`. +10662,replace_method_name,tensorflow/tensorflow/python/saved_model/method_name_updater.py,74,method,"Replaces the method_name in the specified signature_def. + +This will match and replace multiple sig defs iff tags is None (i.e when +multiple `MetaGraph`s have a signature_def with the same key). +If tags is not None, this will only replace a single signature_def in the +`MetaGraph` with matching tags. Args: - instance: An instance of a Python object. + signature_key: Key of the signature_def to be updated. + method_name: new method_name to replace the existing one. + tags: A tag or sequence of tags identifying the `MetaGraph` to update. If + None, all meta graphs will be updated. +Raises: + ValueError: if signature_key or method_name are not defined or + if no metagraphs were found with the associated tags or + if no meta graph has a signature_def that matches signature_key." +10663,save,tensorflow/tensorflow/python/saved_model/method_name_updater.py,119,method,"Saves the updated `SavedModel`. + +Args: + new_export_dir: Path where the updated `SavedModel` will be saved. If + None, the input `SavedModel` will be overriden with the updates. + +Raises: + errors.OpError: If there are errors during the file save operation." +10664,NotEncodableError,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,57,class,Error raised when a coder cannot encode an object. +10665,StructureCoder,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,61,class,Encoder and decoder for nested structures into protos. +10666,register_codec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,67,method, +10667,encode_structure,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,86,method,"Encodes nested structures composed of encodable types into a proto. + +Args: + nested_structure: Structure to encode. Returns: - True if `instance` is a `namedtuple`." -11522,_TupleCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,173,class,Codec for tuples. -11523,_DictCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,196,class,Codec for dicts. -11524,_NamedTupleCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,219,class,"Codec for namedtuples. + Encoded proto. -Encoding and decoding a namedtuple reconstructs a namedtuple with a different -actual Python type, but with the same `typename` and `fields`." -11525,_Float64Codec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,254,class,Codec for floats. -11526,_Int64Codec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,277,class,Codec for Python integers (limited to 64 bit values). -11527,_StringCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,300,class,"Codec for strings. +Raises: + NotEncodableError: For values for which there are no encoders." +10668,can_encode,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,100,method,"Determines whether a nested structure can be encoded into a proto. -See StructuredValue.string_value in proto/struct.proto for more detailed -explanation." -11528,_NoneCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,327,class,Codec for None. -11529,_BoolCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,350,class,Codec for booleans. -11530,_TensorShapeCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,373,class,Codec for `TensorShape`. -11531,_TensorTypeCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,397,class,Codec for `TensorType`. -11532,_TensorSpecCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,420,class,Codec for `TensorSpec`. -11533,_BoundedTensorSpecCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,455,class,Codec for `BoundedTensorSpec`. -11534,_TypeSpecCodec,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,494,class,Codec for `tf.TypeSpec`. -11535,NestedStructureTest,tensorflow/tensorflow/python/saved_model/nested_structure_coder_test.py,36,class, -11536,VersionedTypeRegistration,tensorflow/tensorflow/python/saved_model/revived_types.py,25,class,Holds information about one version of a revived type. -11537,register_revived_type,tensorflow/tensorflow/python/saved_model/revived_types.py,108,function,"Register a type for revived objects. +Args: + nested_structure: Structure to encode. + +Returns: + True if the nested structured can be encoded." +10669,decode_proto,tensorflow/tensorflow/python/saved_model/nested_structure_coder.py,115,method,"Decodes proto representing a nested structure. + +Args: + proto: Proto to decode. + +Returns: + Decoded structure. + +Raises: + NotEncodableError: For values for which there are no encoders." +10670,VersionedTypeRegistration,tensorflow/tensorflow/python/saved_model/revived_types.py,25,class,Holds information about one version of a revived type. +10671,to_proto,tensorflow/tensorflow/python/saved_model/revived_types.py,73,method,Create a SavedUserObject proto. +10672,from_proto,tensorflow/tensorflow/python/saved_model/revived_types.py,85,method,Recreate a trackable object from a SavedUserObject proto. +10673,should_load,tensorflow/tensorflow/python/saved_model/revived_types.py,89,method,Checks if this object should load the SavedUserObject `proto`. +10674,register_revived_type,tensorflow/tensorflow/python/saved_model/revived_types.py,108,function,"Register a type for revived objects. Args: identifier: A unique string identifying this class of objects. @@ -102917,8 +111221,8 @@ Args: trackable object as an argument. If True, `type_registration` may be used to save and restore the object. versions: A list of `VersionedTypeRegistration` objects." -11538,serialize,tensorflow/tensorflow/python/saved_model/revived_types.py,140,function,Create a SavedUserObject from a trackable object. -11539,deserialize,tensorflow/tensorflow/python/saved_model/revived_types.py,150,function,"Create a trackable object from a SavedUserObject proto. +10675,serialize,tensorflow/tensorflow/python/saved_model/revived_types.py,140,function,Create a SavedUserObject from a trackable object. +10676,deserialize,tensorflow/tensorflow/python/saved_model/revived_types.py,150,function,"Create a trackable object from a SavedUserObject proto. Args: proto: A SavedUserObject to deserialize. @@ -102927,130 +111231,9 @@ Returns: A tuple of (trackable, assignment_fn) where assignment_fn has the same signature as setattr and should be used to add dependencies to `trackable` when they are available." -11540,registered_identifiers,tensorflow/tensorflow/python/saved_model/revived_types.py,170,function, -11541,get_setter,tensorflow/tensorflow/python/saved_model/revived_types.py,174,function, -11542,CustomTestClass,tensorflow/tensorflow/python/saved_model/revived_types_test.py,28,class, -11543,RegistrationMatchingTest,tensorflow/tensorflow/python/saved_model/revived_types_test.py,56,class, -11544,_AugmentedGraphView,tensorflow/tensorflow/python/saved_model/save.py,76,class,"An extendable graph which also tracks functions attached to objects. - -Extensions through `add_object` appear in the object graph and any checkpoints -generated from it, even if they are not dependencies of the node they were -attached to in the saving program. For example a `.signatures` attribute is -added to exported SavedModel root objects without modifying the root object -itself. - -Also tracks functions attached to objects in the graph, through the caching -`list_functions` method. Enumerating functions only through this method -ensures that we get a consistent view of functions, even if object attributes -create new functions every time they are accessed." -11545,_SaveableView,tensorflow/tensorflow/python/saved_model/save.py,155,class,"Provides a frozen view over a trackable root. - -This class helps to create a single stable view over an object to save. The -saving code should access properties and functions via this class and not via -the original object as there are cases where an object construct their -trackable attributes and functions dynamically per call and will yield -different objects if invoked more than once. - -Changes to the graph, for example adding objects, must happen in -`checkpoint_view` (an `_AugmentedGraphView`) before the `_SaveableView` is -constructed. Changes after the `_SaveableView` has been constructed will be -ignored." -11546,_tensor_dict_to_tensorinfo,tensorflow/tensorflow/python/saved_model/save.py,364,function, -11547,_map_captures_to_created_tensors,tensorflow/tensorflow/python/saved_model/save.py,371,function,"Maps eager tensors captured by a function to Graph resources for export. - -Args: - original_captures: A dictionary mapping from tensors captured by the - function to interior placeholders for those tensors (inside the function - body). - resource_map: A dictionary mapping from resource tensors owned by the eager - context to resource tensors in the exported graph. - -Returns: - A list of stand-in tensors which belong to the exported graph, corresponding - to the function's captures. - -Raises: - AssertionError: If the function references a resource which is not part of - `resource_map`." -11548,_map_function_arguments_to_created_inputs,tensorflow/tensorflow/python/saved_model/save.py,418,function,"Creates exterior placeholders in the exported graph for function arguments. - -Functions have two types of inputs: tensors captured from the outside (eager) -context, and arguments to the function which we expect to receive from the -user at each call. `_map_captures_to_created_tensors` replaces -captured tensors with stand-ins (typically these are resource dtype tensors -associated with variables). `_map_function_inputs_to_created_inputs` runs over -every argument, creating a new placeholder for each which will belong to the -exported graph rather than the function body. - -Args: - function_arguments: A list of argument placeholders in the function body. - signature_key: The name of the signature being exported, for error messages. - function_name: The name of the function, for error messages. - -Returns: - A tuple of (mapped_inputs, exterior_placeholders) - mapped_inputs: A list with entries corresponding to `function_arguments` - containing all of the inputs of the function gathered from the exported - graph (both captured resources and arguments). - exterior_argument_placeholders: A dictionary mapping from argument names - to placeholders in the exported graph, containing the explicit arguments - to the function which a user is expected to provide. - -Raises: - ValueError: If argument names are not unique." -11549,_call_function_with_mapped_captures,tensorflow/tensorflow/python/saved_model/save.py,487,function,"Calls `function` in the exported graph, using mapped resource captures." -11550,_generate_signatures,tensorflow/tensorflow/python/saved_model/save.py,500,function,"Validates and calls `signature_functions` in the default graph. - -Args: - signature_functions: A dictionary mapping string keys to concrete TensorFlow - functions (e.g. from `signature_serialization.canonicalize_signatures`) - which will be used to generate SignatureDefs. - resource_map: A dictionary mapping from resource tensors in the eager - context to resource tensors in the Graph being exported. This dictionary - is used to re-bind resources captured by functions to tensors which will - exist in the SavedModel. - -Returns: - Each function in the `signature_functions` dictionary is called with - placeholder Tensors, generating a function call operation and output - Tensors. The placeholder Tensors, the function call operation, and the - output Tensors from the function call are part of the default Graph. - - This function then returns a dictionary with the same structure as - `signature_functions`, with the concrete functions replaced by SignatureDefs - implicitly containing information about how to call each function from a - TensorFlow 1.x Session / the C++ Loader API. These SignatureDefs reference - the generated placeholders and Tensor outputs by name. - - The caller is expected to include the default Graph set while calling this - function as a MetaGraph in a SavedModel, including the returned - SignatureDefs as part of that MetaGraph." -11551,_trace_resource_initializers,tensorflow/tensorflow/python/saved_model/save.py,546,function,Create concrete functions from `CapturableResource` objects. -11552,_process_asset,tensorflow/tensorflow/python/saved_model/save.py,581,function,Add `trackable_asset` to `asset_info` and `resource_map`. -11553,_fill_meta_graph_def,tensorflow/tensorflow/python/saved_model/save.py,613,function,"Generates a MetaGraph which calls `signature_functions`. - -Args: - meta_graph_def: The MetaGraphDef proto to fill. - saveable_view: The _SaveableView being exported. - signature_functions: A dictionary mapping signature keys to concrete - functions containing signatures to add to the MetaGraph. - namespace_whitelist: List of strings containing whitelisted op namespaces. - -Returns: - A tuple of (_AssetInfo, Graph) containing the captured assets and - exported Graph generated from tracing the saveable_view." -11554,_verify_ops,tensorflow/tensorflow/python/saved_model/save.py,696,function,Verifies that all namespaced ops in the graph are whitelisted. -11555,_serialize_object_graph,tensorflow/tensorflow/python/saved_model/save.py,722,function,Save a SavedObjectGraph proto for `root`. -11556,_write_object_proto,tensorflow/tensorflow/python/saved_model/save.py,744,function,Saves an object into SavedObject proto. -11557,_export_debug_info,tensorflow/tensorflow/python/saved_model/save.py,785,function,"Exports debug information from a graph. - -Args: - exported_graph: A Graph that has been created by tracing a saveable view. - -Returns: - Corresponding GraphDebugInfo with traces for ops in all functions of the - exported_graph." -11558,save,tensorflow/tensorflow/python/saved_model/save.py,810,function,"Exports the Trackable object `obj` to [SavedModel format](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md). +10677,registered_identifiers,tensorflow/tensorflow/python/saved_model/revived_types.py,170,function, +10678,get_setter,tensorflow/tensorflow/python/saved_model/revived_types.py,174,function, +10679,save,tensorflow/tensorflow/python/saved_model/save.py,810,function,"Exports the Trackable object `obj` to [SavedModel format](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md). Example usage: @@ -103225,7 +111408,7 @@ add new save operations to the default graph each iteration. May not be called from within a function body. @end_compatibility" -11559,export_meta_graph,tensorflow/tensorflow/python/saved_model/save.py,1038,function,"Exports the MetaGraph proto to a file. +10680,export_meta_graph,tensorflow/tensorflow/python/saved_model/save.py,1038,function,"Exports the MetaGraph proto to a file. This function goes through the same procedures saved_model.save goes to produce the given object's MetaGraph, then saves it to the given file. It @@ -103246,14 +111429,15 @@ Args: `tf.saved_model.signature_constants` module. options: Optional, `tf.saved_model.SaveOptions` object that specifies options for saving." -11560,_build_meta_graph_impl,tensorflow/tensorflow/python/saved_model/save.py,1075,function,Creates a MetaGraph containing the resources and functions of an object. -11561,_build_meta_graph,tensorflow/tensorflow/python/saved_model/save.py,1140,function,Creates a MetaGraph under a SaveContext. -11562,SaveContext,tensorflow/tensorflow/python/saved_model/save_context.py,25,class,A context for building a graph of SavedModel. -11563,save_context,tensorflow/tensorflow/python/saved_model/save_context.py,53,function, -11564,in_save_context,tensorflow/tensorflow/python/saved_model/save_context.py,63,function,Returns whether under a save context. -11565,get_save_options,tensorflow/tensorflow/python/saved_model/save_context.py,68,function,Returns the save options if under a save context. -11566,SaveContextTest,tensorflow/tensorflow/python/saved_model/save_context_test.py,28,class, -11567,VariablePolicy,tensorflow/tensorflow/python/saved_model/save_options.py,29,class,"Enum defining options for variable handling when saving. +10681,SaveContext,tensorflow/tensorflow/python/saved_model/save_context.py,25,class,A context for building a graph of SavedModel. +10682,options,tensorflow/tensorflow/python/saved_model/save_context.py,33,method, +10683,enter_save_context,tensorflow/tensorflow/python/saved_model/save_context.py,38,method, +10684,exit_save_context,tensorflow/tensorflow/python/saved_model/save_context.py,42,method, +10685,in_save_context,tensorflow/tensorflow/python/saved_model/save_context.py,46,method, +10686,save_context,tensorflow/tensorflow/python/saved_model/save_context.py,53,function, +10687,in_save_context,tensorflow/tensorflow/python/saved_model/save_context.py,63,function,Returns whether under a save context. +10688,get_save_options,tensorflow/tensorflow/python/saved_model/save_context.py,68,function,Returns the save options if under a save context. +10689,VariablePolicy,tensorflow/tensorflow/python/saved_model/save_options.py,29,class,"Enum defining options for variable handling when saving. NONE No policy applied: Distributed variables are saved as one variable, with no @@ -103289,23 +111473,13 @@ EXPAND_DISTRIBUTED_VARIABLES currently incompatible with this option, so it is not implemented in `saved_model.save` (only the internal `saved_model.export_meta_graph` API supports it for now)." -11568,SaveOptions,tensorflow/tensorflow/python/saved_model/save_options.py,97,class,"Options for saving to SavedModel. +10690,from_obj,tensorflow/tensorflow/python/saved_model/save_options.py,83,method,Tries to convert `obj` to a VariablePolicy instance. +10691,SaveOptions,tensorflow/tensorflow/python/saved_model/save_options.py,97,class,"Options for saving to SavedModel. This function may be used in the `options` argument in functions that save a SavedModel (`tf.saved_model.save`, `tf.keras.models.save_model`)." -11569,_validate_namespace_whitelist,tensorflow/tensorflow/python/saved_model/save_options.py,175,function,Validates namespace whitelist argument. -11570,_run_signature,tensorflow/tensorflow/python/saved_model/save_test.py,62,function, -11571,_import_and_infer,tensorflow/tensorflow/python/saved_model/save_test.py,77,function,Import a SavedModel into a TF 1.x-style graph and run `signature_key`. -11572,SaveTest,tensorflow/tensorflow/python/saved_model/save_test.py,88,class, -11573,VariablePolicyEnumTest,tensorflow/tensorflow/python/saved_model/save_test.py,598,class, -11574,SavingOptionsTest,tensorflow/tensorflow/python/saved_model/save_test.py,638,class, -11575,AssetTests,tensorflow/tensorflow/python/saved_model/save_test.py,751,class, -11576,ExportMetaGraphTests,tensorflow/tensorflow/python/saved_model/save_test.py,843,class, -11577,tearDownModule,tensorflow/tensorflow/python/saved_model/saved_model_test.py,55,function, -11578,SavedModelTestBase,tensorflow/tensorflow/python/saved_model/saved_model_test.py,59,class, -11579,SavedModelTest,tensorflow/tensorflow/python/saved_model/saved_model_test.py,84,class, -11580,SavedModelV1Test,tensorflow/tensorflow/python/saved_model/saved_model_test.py,1342,class, -11581,build_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,39,function,"Utility function to build a SignatureDef protocol buffer. +10692,tearDownModule,tensorflow/tensorflow/python/saved_model/saved_model_test.py,55,function, +10693,build_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,39,function,"Utility function to build a SignatureDef protocol buffer. Args: inputs: Inputs of the SignatureDef defined as a proto map of string to @@ -103316,7 +111490,7 @@ Args: Returns: A SignatureDef protocol buffer constructed based on the supplied arguments." -11582,regression_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,71,function,"Creates regression signature from given examples and predictions. +10694,regression_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,71,function,"Creates regression signature from given examples and predictions. This function produces signatures intended for use with the TensorFlow Serving Regress API (tensorflow_serving/apis/prediction_service.proto), and so @@ -103331,7 +111505,7 @@ Returns: Raises: ValueError: If examples is `None`." -11583,classification_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,119,function,"Creates classification signature from given examples and predictions. +10695,classification_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,119,function,"Creates classification signature from given examples and predictions. This function produces signatures intended for use with the TensorFlow Serving Classify API (tensorflow_serving/apis/prediction_service.proto), and so @@ -103348,7 +111522,7 @@ Returns: Raises: ValueError: If examples is `None`." -11584,predict_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,178,function,"Creates prediction signature from given inputs and outputs. +10696,predict_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,178,function,"Creates prediction signature from given inputs and outputs. This function produces signatures intended for use with the TensorFlow Serving Predict API (tensorflow_serving/apis/prediction_service.proto). This API @@ -103363,32 +111537,10 @@ Returns: Raises: ValueError: If inputs or outputs is `None`." -11585,supervised_train_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,212,function, -11586,supervised_eval_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,219,function, -11587,_supervised_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,226,function,"Creates a signature for training and eval data. - -This function produces signatures that describe the inputs and outputs -of a supervised process, such as training or evaluation, that -results in loss, metrics, and the like. Note that this function only requires -inputs to be not None. - -Args: - method_name: Method name of the SignatureDef as a string. - inputs: dict of string to `Tensor`. - loss: dict of string to `Tensor` representing computed loss. - predictions: dict of string to `Tensor` representing the output predictions. - metrics: dict of string to `Tensor` representing metric ops. - -Returns: - A train- or eval-flavored signature_def. - -Raises: - ValueError: If inputs or outputs is `None`." -11588,is_valid_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,275,function,Determine whether a SignatureDef can be served by TensorFlow Serving. -11589,_is_valid_predict_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,284,function,Determine whether the argument is a servable 'predict' SignatureDef. -11590,_is_valid_regression_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,295,function,Determine whether the argument is a servable 'regress' SignatureDef. -11591,_is_valid_classification_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,317,function,Determine whether the argument is a servable 'classify' SignatureDef. -11592,op_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,350,function,"Creates a signature def with the output pointing to an op. +10697,supervised_train_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,212,function, +10698,supervised_eval_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,219,function, +10699,is_valid_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,275,function,Determine whether a SignatureDef can be served by TensorFlow Serving. +10700,op_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,350,function,"Creates a signature def with the output pointing to an op. Note that op isn't strictly enforced to be an Op object, and may be a Tensor. It is recommended to use the build_signature_def() function for Tensors. @@ -103399,7 +111551,7 @@ Args: Returns: A SignatureDef with a single output pointing to the op." -11593,load_op_from_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,368,function,"Load an Op from a SignatureDef created by op_signature_def(). +10701,load_op_from_signature_def,tensorflow/tensorflow/python/saved_model/signature_def_utils_impl.py,368,function,"Load an Op from a SignatureDef created by op_signature_def(). Args: signature_def: a SignatureDef proto @@ -103412,19 +111564,11 @@ Returns: Raises: NotFoundError: If the op could not be found in the graph." -11594,_make_signature,tensorflow/tensorflow/python/saved_model/signature_def_utils_test.py,48,function, -11595,SignatureDefUtilsTest,tensorflow/tensorflow/python/saved_model/signature_def_utils_test.py,61,class, -11596,_get_signature,tensorflow/tensorflow/python/saved_model/signature_serialization.py,39,function, -11597,_valid_signature,tensorflow/tensorflow/python/saved_model/signature_serialization.py,48,function,Returns whether concrete function can be converted to a signature. -11598,_validate_inputs,tensorflow/tensorflow/python/saved_model/signature_serialization.py,63,function, -11599,find_function_to_export,tensorflow/tensorflow/python/saved_model/signature_serialization.py,71,function,"Function to export, None if no suitable function was found." -11600,canonicalize_signatures,tensorflow/tensorflow/python/saved_model/signature_serialization.py,96,function,Converts `signatures` into a dictionary of concrete functions. -11601,_is_flat,tensorflow/tensorflow/python/saved_model/signature_serialization.py,153,function, -11602,_normalize_outputs,tensorflow/tensorflow/python/saved_model/signature_serialization.py,164,function,Construct an output dictionary from unnormalized function outputs. -11603,_SignatureMap,tensorflow/tensorflow/python/saved_model/signature_serialization.py,200,class,A collection of SavedModel signatures. -11604,create_signature_map,tensorflow/tensorflow/python/saved_model/signature_serialization.py,245,function,Creates an object containing `signatures`. -11605,validate_saveable_view,tensorflow/tensorflow/python/saved_model/signature_serialization.py,265,function,Performs signature-related sanity checks on `saveable_view`. -11606,simple_save,tensorflow/tensorflow/python/saved_model/simple_save.py,35,function,"Convenience function to build a SavedModel suitable for serving. +10702,find_function_to_export,tensorflow/tensorflow/python/saved_model/signature_serialization.py,71,function,"Function to export, None if no suitable function was found." +10703,canonicalize_signatures,tensorflow/tensorflow/python/saved_model/signature_serialization.py,96,function,Converts `signatures` into a dictionary of concrete functions. +10704,create_signature_map,tensorflow/tensorflow/python/saved_model/signature_serialization.py,245,function,Creates an object containing `signatures`. +10705,validate_saveable_view,tensorflow/tensorflow/python/saved_model/signature_serialization.py,265,function,Performs signature-related sanity checks on `saveable_view`. +10706,simple_save,tensorflow/tensorflow/python/saved_model/simple_save.py,35,function,"Convenience function to build a SavedModel suitable for serving. In many common cases, saving models for serving will be as simple as: @@ -103466,8 +111610,7 @@ Args: to the SignatureDef as the outputs. legacy_init_op: Legacy support for op or group of ops to execute after the restore op upon a load." -11607,SimpleSaveTest,tensorflow/tensorflow/python/saved_model/simple_save_test.py,33,class, -11608,build_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,51,function,"Utility function to build TensorInfo proto from a Tensor. +10707,build_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,51,function,"Utility function to build TensorInfo proto from a Tensor. Args: tensor: Tensor or SparseTensor whose name, dtype and shape are used to @@ -103479,9 +111622,8 @@ Returns: Raises: RuntimeError: If eager execution is enabled." -11609,build_tensor_info_internal,tensorflow/tensorflow/python/saved_model/utils_impl.py,70,function,Utility function to build TensorInfo proto from a Tensor. -11610,_build_composite_tensor_info_internal,tensorflow/tensorflow/python/saved_model/utils_impl.py,88,function,Utility function to build TensorInfo proto from a CompositeTensor. -11611,build_tensor_info_from_op,tensorflow/tensorflow/python/saved_model/utils_impl.py,101,function,"Utility function to build TensorInfo proto from an Op. +10708,build_tensor_info_internal,tensorflow/tensorflow/python/saved_model/utils_impl.py,70,function,Utility function to build TensorInfo proto from a Tensor. +10709,build_tensor_info_from_op,tensorflow/tensorflow/python/saved_model/utils_impl.py,101,function,"Utility function to build TensorInfo proto from an Op. Note that this function should be used with caution. It is strictly restricted to TensorFlow internal use-cases only. Please make sure you do need it before @@ -103508,7 +111650,7 @@ Args: Returns: A TensorInfo protocol buffer constructed based on the supplied argument." -11612,get_tensor_from_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,143,function,"Returns the Tensor or CompositeTensor described by a TensorInfo proto. +10710,get_tensor_from_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,143,function,"Returns the Tensor or CompositeTensor described by a TensorInfo proto. Args: tensor_info: A TensorInfo proto describing a Tensor or SparseTensor or @@ -103525,7 +111667,7 @@ Returns: Raises: KeyError: If `tensor_info` does not correspond to a tensor in `graph`. ValueError: If `tensor_info` is malformed." -11613,get_element_from_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,186,function,"Returns the element in the graph described by a TensorInfo proto. +10711,get_element_from_tensor_info,tensorflow/tensorflow/python/saved_model/utils_impl.py,186,function,"Returns the element in the graph described by a TensorInfo proto. Args: tensor_info: A TensorInfo proto describing an Op or Tensor by name. @@ -103539,18 +111681,25 @@ Returns: Raises: KeyError: If `tensor_info` does not correspond to an op or tensor in `graph`" -11614,get_or_create_variables_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,210,function,"Return variables sub-directory, or create one if it doesn't exist." -11615,get_variables_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,218,function,Return variables sub-directory in the SavedModel. -11616,get_variables_path,tensorflow/tensorflow/python/saved_model/utils_impl.py,225,function,"Return the variables path, used as the prefix for checkpoint files." -11617,get_or_create_assets_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,232,function,"Return assets sub-directory, or create one if it doesn't exist." -11618,get_assets_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,242,function,Return path to asset directory in the SavedModel. -11619,get_or_create_debug_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,249,function,"Returns path to the debug sub-directory, creating if it does not exist." -11620,get_debug_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,259,function,Returns path to the debug sub-directory in the SavedModel. -11621,UtilsTest,tensorflow/tensorflow/python/saved_model/utils_test.py,39,class, -11622,ExportOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,32,class,"Represents an output of a model that can be served. +10712,get_or_create_variables_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,210,function,"Return variables sub-directory, or create one if it doesn't exist." +10713,get_variables_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,218,function,Return variables sub-directory in the SavedModel. +10714,get_variables_path,tensorflow/tensorflow/python/saved_model/utils_impl.py,225,function,"Return the variables path, used as the prefix for checkpoint files." +10715,get_or_create_assets_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,232,function,"Return assets sub-directory, or create one if it doesn't exist." +10716,get_assets_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,242,function,Return path to asset directory in the SavedModel. +10717,get_or_create_debug_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,249,function,"Returns path to the debug sub-directory, creating if it does not exist." +10718,get_debug_dir,tensorflow/tensorflow/python/saved_model/utils_impl.py,259,function,Returns path to the debug sub-directory in the SavedModel. +10719,ExportOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,32,class,"Represents an output of a model that can be served. These typically correspond to model heads." -11623,ClassificationOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,102,class,"Represents the output of a classification head. +10720,as_signature_def,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,43,method,"Generate a SignatureDef proto for inclusion in a MetaGraphDef. + +The SignatureDef will specify outputs as described in this ExportOutput, +and will use the provided receiver_tensors as inputs. + +Args: + receiver_tensors: a `Tensor`, or a dict of string to `Tensor`, specifying + input nodes that will be fed." +10721,ClassificationOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,102,class,"Represents the output of a classification head. Either classes or scores or both must be set. @@ -103565,28 +111714,31 @@ in order of class ID. If both classes and scores are set, they are interpreted as zipped, so each score corresponds to the class at the same index. Clients should not depend on the order of the entries." -11624,RegressionOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,170,class,Represents the output of a regression head. -11625,PredictOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,202,class,"Represents the output of a generic prediction head. +10722,scores,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,151,method, +10723,classes,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,155,method, +10724,as_signature_def,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,158,method, +10725,RegressionOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,170,class,Represents the output of a regression head. +10726,value,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,188,method, +10727,as_signature_def,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,191,method, +10728,PredictOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,202,class,"Represents the output of a generic prediction head. A generic prediction need not be either a classification or a regression. Named outputs must be provided as a dict from string to `Tensor`," -11626,_SupervisedOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,235,class,Represents the output of a supervised training or eval process. -11627,TrainOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,386,class,"Represents the output of a supervised training process. +10729,outputs,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,227,method, +10730,as_signature_def,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,230,method, +10731,TrainOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,386,class,"Represents the output of a supervised training process. This class generates the appropriate signature def for exporting training output by type-checking and wrapping loss, predictions, and metrics values." -11628,EvalOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,398,class,"Represents the output of a supervised eval process. +10732,EvalOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output.py,398,class,"Represents the output of a supervised eval process. This class generates the appropriate signature def for exporting eval output by type-checking and wrapping loss, predictions, and metrics values." -11629,ExportOutputTest,tensorflow/tensorflow/python/saved_model/model_utils/export_output_test.py,37,class, -11630,MockSupervisedOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output_test.py,231,class,So that we can test the abstract class methods directly. -11631,SupervisedOutputTest,tensorflow/tensorflow/python/saved_model/model_utils/export_output_test.py,238,class, -11632,ExportTest,tensorflow/tensorflow/python/saved_model/model_utils/export_test.py,37,class, -11633,build_all_signature_defs,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,63,function,"Build `SignatureDef`s for all export outputs. +10733,MockSupervisedOutput,tensorflow/tensorflow/python/saved_model/model_utils/export_output_test.py,231,class,So that we can test the abstract class methods directly. +10734,build_all_signature_defs,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,63,function,"Build `SignatureDef`s for all export outputs. Args: receiver_tensors: a `Tensor`, or a dict of string to `Tensor`, specifying @@ -103611,8 +111763,7 @@ Returns: Raises: ValueError: if export_outputs is not a dict" -11634,_log_signature_report,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,152,function,Log a report of which signatures were produced. -11635,get_timestamped_export_dir,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,193,function,"Builds a path to a new subdirectory within the base directory. +10735,get_timestamped_export_dir,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,193,function,"Builds a path to a new subdirectory within the base directory. Each export is written into a new subdirectory named using the current time. This guarantees monotonically increasing version @@ -103628,7 +111779,7 @@ Returns: Raises: RuntimeError: if repeated attempts fail to obtain a unique timestamped directory name." -11636,get_temp_export_dir,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,230,function,"Builds a directory name based on the argument but starting with 'temp-'. +10736,get_temp_export_dir,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,230,function,"Builds a directory name based on the argument but starting with 'temp-'. This relies on the fact that TensorFlow Serving ignores subdirectories of the base directory that can't be parsed as integers. @@ -103639,7 +111790,7 @@ Args: Returns: A sister directory prefixed with 'temp-', e.g. /foo/bar/temp-." -11637,export_outputs_for_mode,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,250,function,"Util function for constructing a `ExportOutput` dict given a mode. +10737,export_outputs_for_mode,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,250,function,"Util function for constructing a `ExportOutput` dict given a mode. The returned dict can be directly passed to `build_all_signature_defs` helper function as the `export_outputs` argument, used for generating a SignatureDef @@ -103662,7 +111813,7 @@ Returns: Raises: ValueError: if an appropriate ExportOutput cannot be found for the mode." -11638,get_export_outputs,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,294,function,"Validate export_outputs or create default export_outputs. +10738,get_export_outputs,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,294,function,"Validate export_outputs or create default export_outputs. Args: export_outputs: Describes the output signatures to be exported to @@ -103675,36 +111826,24 @@ Returns: Raises: TypeError: if export_outputs is not a dict or its values are not ExportOutput instances." -11639,_maybe_add_default_serving_output,tensorflow/tensorflow/python/saved_model/model_utils/export_utils.py,328,function,"Add a default serving output to the export_outputs if not present. - -Args: - export_outputs: Describes the output signatures to be exported to - `SavedModel` and used during serving. Should be a dict. - -Returns: - export_outputs dict with default serving signature added if necessary - -Raises: - ValueError: if multiple export_outputs were provided without a default - serving key." -11640,KerasModeKeys,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,25,class,"Standard names for model modes. +10739,KerasModeKeys,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,25,class,"Standard names for model modes. The following standard keys are defined: * `TRAIN`: training/fitting mode. * `TEST`: testing/evaluation mode. * `PREDICT`: prediction/inference mode." -11641,EstimatorModeKeys,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,41,class,"Standard names for Estimator model modes. +10740,EstimatorModeKeys,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,41,class,"Standard names for Estimator model modes. The following standard keys are defined: * `TRAIN`: training/fitting mode. * `EVAL`: testing/evaluation mode. * `PREDICT`: predication/inference mode." -11642,is_predict,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,56,function, -11643,is_eval,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,60,function, -11644,is_train,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,64,function, -11645,ModeKeyMap,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,68,class,"Map using ModeKeys as keys. +10741,is_predict,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,56,function, +10742,is_eval,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,60,function, +10743,is_train,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,64,function, +10744,ModeKeyMap,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys.py,68,class,"Map using ModeKeys as keys. This class creates an immutable mapping from modes to values. For example, SavedModel export of Keras and Estimator models use this to map modes to their @@ -103713,8 +111852,7 @@ corresponding MetaGraph tags/SignatureDef keys. Since this class uses modes, rather than strings, as keys, both ""predict"" (Keras's PREDICT ModeKey) and ""infer"" (Estimator's PREDICT ModeKey) map to the same value." -11646,ModeKeyMapTest,tensorflow/tensorflow/python/saved_model/model_utils/mode_keys_test.py,25,class, -11647,get_plugin_asset,tensorflow/tensorflow/python/summary/plugin_asset.py,42,function,"Acquire singleton PluginAsset instance from a graph. +10745,get_plugin_asset,tensorflow/tensorflow/python/summary/plugin_asset.py,42,function,"Acquire singleton PluginAsset instance from a graph. PluginAssets are always singletons, and are stored in tf Graph collections. This way, they can be defined anywhere the graph is being constructed, and @@ -103732,7 +111870,7 @@ Returns: Raises: ValueError: If we have a plugin name collision, or if we unexpectedly find the wrong number of items in a collection." -11648,get_all_plugin_assets,tensorflow/tensorflow/python/summary/plugin_asset.py,84,function,"Retrieve all PluginAssets stored in the graph collection. +10746,get_all_plugin_assets,tensorflow/tensorflow/python/summary/plugin_asset.py,84,function,"Retrieve all PluginAssets stored in the graph collection. Args: graph: Optionally, the graph to get assets from. If unspecified, the default @@ -103744,7 +111882,7 @@ Returns: Raises: ValueError: if we unexpectedly find a collection with the wrong number of PluginAssets." -11649,PluginAsset,tensorflow/tensorflow/python/summary/plugin_asset.py,113,class,"This abstract base class allows TensorBoard to serialize assets to disk. +10747,PluginAsset,tensorflow/tensorflow/python/summary/plugin_asset.py,113,class,"This abstract base class allows TensorBoard to serialize assets to disk. Plugin authors are expected to extend the PluginAsset class, so that it: - has a unique plugin_name @@ -103759,12 +111897,14 @@ LifeCycle of a PluginAsset instance: - When the containing graph is serialized by the tf.compat.v1.summary.FileWriter, the writer calls assets and the PluginAsset instance provides its contents to be written to disk." -11650,_UnnamedPluginAsset,tensorflow/tensorflow/python/summary/plugin_asset_test.py,26,class,"An example asset with a dummy serialize method provided, but no name." -11651,_ExamplePluginAsset,tensorflow/tensorflow/python/summary/plugin_asset_test.py,33,class,Simple example asset. -11652,_OtherExampleAsset,tensorflow/tensorflow/python/summary/plugin_asset_test.py,38,class,Simple example asset. -11653,_ExamplePluginThatWillCauseCollision,tensorflow/tensorflow/python/summary/plugin_asset_test.py,43,class, -11654,PluginAssetTest,tensorflow/tensorflow/python/summary/plugin_asset_test.py,47,class, -11655,scalar,tensorflow/tensorflow/python/summary/summary.py,58,function,"Outputs a `Summary` protocol buffer containing a single scalar value. +10748,assets,tensorflow/tensorflow/python/summary/plugin_asset.py,134,method,"Provide all of the assets contained by the PluginAsset instance. + +The assets method should return a dictionary structured as +{asset_name: asset_contents}. asset_contents is a string. + +This method will be called by the tf.compat.v1.summary.FileWriter when it +is time to write the assets out to disk." +10749,scalar,tensorflow/tensorflow/python/summary/summary.py,58,function,"Outputs a `Summary` protocol buffer containing a single scalar value. The generated Summary has a Tensor.proto containing the input Tensor. @@ -103782,7 +111922,7 @@ Returns: Raises: ValueError: If tensor has the wrong shape or type." -11656,image,tensorflow/tensorflow/python/summary/summary.py,88,function,"Outputs a `Summary` protocol buffer with images. +10750,image,tensorflow/tensorflow/python/summary/summary.py,88,function,"Outputs a `Summary` protocol buffer with images. The summary has up to `max_outputs` summary values containing images. The images are built from `tensor` which must be 4-D with shape `[batch_size, @@ -103825,7 +111965,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -11657,histogram,tensorflow/tensorflow/python/summary/summary.py,144,function,"Outputs a `Summary` protocol buffer with a histogram. +10751,histogram,tensorflow/tensorflow/python/summary/summary.py,144,function,"Outputs a `Summary` protocol buffer with a histogram. Adding a histogram summary makes it possible to visualize your data's distribution in TensorBoard. You can see a detailed explanation of the @@ -103851,7 +111991,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -11658,audio,tensorflow/tensorflow/python/summary/summary.py,185,function,"Outputs a `Summary` protocol buffer with audio. +10752,audio,tensorflow/tensorflow/python/summary/summary.py,185,function,"Outputs a `Summary` protocol buffer with audio. The summary has up to `max_outputs` summary values containing audio. The audio is built from `tensor` which must be 3-D with shape `[batch_size, @@ -103882,7 +112022,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -11659,text,tensorflow/tensorflow/python/summary/summary.py,234,function,"Summarizes textual data. +10753,text,tensorflow/tensorflow/python/summary/summary.py,234,function,"Summarizes textual data. Text data summarized via this plugin will be visible in the Text Dashboard in TensorBoard. The standard TensorBoard Text Dashboard will render markdown @@ -103906,7 +112046,7 @@ Returns: Raises: ValueError: If tensor has the wrong type." -11660,tensor_summary,tensorflow/tensorflow/python/summary/summary.py,275,function,"Outputs a `Summary` protocol buffer with a serialized tensor.proto. +10754,tensor_summary,tensorflow/tensorflow/python/summary/summary.py,275,function,"Outputs a `Summary` protocol buffer with a serialized tensor.proto. Args: name: A name for the generated node. If display_name is not set, it will @@ -103928,7 +112068,7 @@ Args: Returns: A scalar `Tensor` of type `string`. The serialized `Summary` protocol buffer." -11661,merge,tensorflow/tensorflow/python/summary/summary.py,331,function,"Merges summaries. +10755,merge,tensorflow/tensorflow/python/summary/summary.py,331,function,"Merges summaries. This op creates a [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) @@ -103956,7 +112096,7 @@ Raises: Not compatible with eager execution. To write TensorBoard summaries under eager execution, use `tf.contrib.summary` instead. @end_compatibility" -11662,merge_all,tensorflow/tensorflow/python/summary/summary.py,377,function,"Merges all summaries collected in the default graph. +10756,merge_all,tensorflow/tensorflow/python/summary/summary.py,377,function,"Merges all summaries collected in the default graph. Args: key: `GraphKey` used to collect the summaries. Defaults to @@ -103975,7 +112115,7 @@ Raises: Not compatible with eager execution. To write TensorBoard summaries under eager execution, use `tf.contrib.summary` instead. @end_compatibility" -11663,get_summary_description,tensorflow/tensorflow/python/summary/summary.py,410,function,"Given a TensorSummary node_def, retrieve its SummaryDescription. +10757,get_summary_description,tensorflow/tensorflow/python/summary/summary.py,410,function,"Given a TensorSummary node_def, retrieve its SummaryDescription. When a Summary op is instantiated, a SummaryDescription of associated metadata is stored in its NodeDef. This method retrieves the description. @@ -103993,8 +112133,7 @@ Raises: Not compatible with eager execution. To write TensorBoard summaries under eager execution, use `tf.contrib.summary` instead. @end_compatibility" -11664,_SummaryIterator,tensorflow/tensorflow/python/summary/summary_iterator.py,27,class,Yields `Event` protocol buffers from a given path. -11665,summary_iterator,tensorflow/tensorflow/python/summary/summary_iterator.py,44,function,"Returns a iterator for reading `Event` protocol buffers from an event file. +10758,summary_iterator,tensorflow/tensorflow/python/summary/summary_iterator.py,44,function,"Returns a iterator for reading `Event` protocol buffers from an event file. You can use this function to read events written to an event file. It returns a Python iterator that yields `Event` protocol buffers. @@ -104042,19 +112181,53 @@ Args: Returns: A iterator that yields `Event` protocol buffers" -11666,SummaryIteratorTestCase,tensorflow/tensorflow/python/summary/summary_iterator_test.py,31,class, -11667,SummaryTest,tensorflow/tensorflow/python/summary/summary_test.py,40,class, -11668,EventFileWriter,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,35,class,"Writes `Event` protocol buffers to an event file. +10759,EventFileWriter,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,35,class,"Writes `Event` protocol buffers to an event file. The `EventFileWriter` class creates an event file in the specified directory, and asynchronously writes Event protocol buffers to the file. The Event file is encoded using the tfrecord format, which is similar to RecordIO. This class is not thread-safe." -11669,_EventLoggerThread,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,171,class,Thread that logs events. -11670,CloseableQueue,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,235,class,Stripped-down fork of the standard library Queue that is closeable. -11671,QueueClosedError,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,303,class,Raised when CloseableQueue.put() fails because the queue is closed. -11672,EventFileWriterV2,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,29,class,"Writes `Event` protocol buffers to an event file via the graph. +10760,get_logdir,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,98,method,Returns the directory where event file will be written. +10761,reopen,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,102,method,"Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed." +10762,add_event,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,114,method,"Adds an event to the event file. + +Args: + event: An `Event` protocol buffer." +10763,flush,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,139,method,"Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk." +10764,close,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,155,method,"Flushes the event file to disk and close the file. + +Call this method when you do not need the summary writer anymore." +10765,CloseableQueue,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,235,class,Stripped-down fork of the standard library Queue that is closeable. +10766,get,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,256,method,"Remove and return an item from the queue. + +If the queue is empty, blocks until an item is available. + +Returns: + an item from the queue" +10767,put,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,271,method,"Put an item into the queue. + +If the queue is closed, fails immediately. + +If the queue is full, blocks until space is available or until the queue +is closed by a call to close(), at which point this call fails. + +Args: + item: an item to add to the queue + +Raises: + QueueClosedError: if insertion failed because the queue is closed" +10768,close,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,296,method,"Closes the queue, causing any pending or future `put()` calls to fail." +10769,QueueClosedError,tensorflow/tensorflow/python/summary/writer/event_file_writer.py,303,class,Raised when CloseableQueue.put() fails because the queue is closed. +10770,EventFileWriterV2,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,29,class,"Writes `Event` protocol buffers to an event file via the graph. The `EventFileWriterV2` class is backed by the summary file writer in the v2 summary API (currently in tf.contrib.summary), so it uses a shared summary @@ -104063,13 +112236,104 @@ writer resource and graph ops to write events. As with the original EventFileWriter, this class will asynchronously write Event protocol buffers to the backing file. The Event file is encoded using the tfrecord format, which is similar to RecordIO." -11673,FakeSummaryWriter,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,27,class,Fake summary writer. -11674,SummaryToEventTransformer,tensorflow/tensorflow/python/summary/writer/writer.py,42,class,"Abstractly implements the SummaryWriter API. +10771,get_logdir,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,98,method,Returns the directory where event file will be written. +10772,reopen,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,102,method,"Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed." +10773,add_event,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,114,method,"Adds an event to the event file. + +Args: + event: An `Event` protocol buffer." +10774,flush,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,125,method,"Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk." +10775,close,tensorflow/tensorflow/python/summary/writer/event_file_writer_v2.py,133,method,"Flushes the event file to disk and close the file. + +Call this method when you do not need the summary writer anymore." +10776,FakeSummaryWriter,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,27,class,Fake summary writer. +10777,install,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,33,method, +10778,uninstall,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,41,method, +10779,summaries,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,58,method, +10780,assert_summaries,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,61,method,Assert expected items have been added to summary writer. +10781,add_summary,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,98,method,Add summary. +10782,add_graph,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,112,method,Add graph. +10783,add_meta_graph,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,120,method,Add metagraph. +10784,add_session_log,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,127,method, +10785,add_run_metadata,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,131,method, +10786,flush,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,136,method, +10787,reopen,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,139,method, +10788,close,tensorflow/tensorflow/python/summary/writer/fake_summary_writer.py,142,method, +10789,SummaryToEventTransformer,tensorflow/tensorflow/python/summary/writer/writer.py,42,class,"Abstractly implements the SummaryWriter API. This API basically implements a number of endpoints (add_summary, add_session_log, etc). The endpoints all generate an event protobuf, which is passed to the contained event_writer." -11675,FileWriter,tensorflow/tensorflow/python/summary/writer/writer.py,283,class,"Writes `Summary` protocol buffers to event files. +10790,add_summary,tensorflow/tensorflow/python/summary/writer/writer.py,101,method,"Adds a `Summary` protocol buffer to the event file. + +This method wraps the provided summary in an `Event` protocol buffer +and adds it to the event file. + +You can pass the result of evaluating any summary op, using +`tf.Session.run` or +`tf.Tensor.eval`, to this +function. Alternatively, you can pass a `tf.compat.v1.Summary` protocol +buffer that you populate with your own data. The latter is +commonly done to report evaluation results in event files. + +Args: + summary: A `Summary` protocol buffer, optionally serialized as a string. + global_step: Number. Optional global step value to record with the + summary." +10791,add_session_log,tensorflow/tensorflow/python/summary/writer/writer.py,144,method,"Adds a `SessionLog` protocol buffer to the event file. + +This method wraps the provided session in an `Event` protocol buffer +and adds it to the event file. + +Args: + session_log: A `SessionLog` protocol buffer. + global_step: Number. Optional global step value to record with the + summary." +10792,add_graph,tensorflow/tensorflow/python/summary/writer/writer.py,163,method,"Adds a `Graph` to the event file. + +The graph described by the protocol buffer will be displayed by +TensorBoard. Most users pass a graph in the constructor instead. + +Args: + graph: A `Graph` object, such as `sess.graph`. + global_step: Number. Optional global step counter to record with the + graph. + graph_def: DEPRECATED. Use the `graph` parameter instead. + +Raises: + ValueError: If both graph and graph_def are passed to the method." +10793,add_meta_graph,tensorflow/tensorflow/python/summary/writer/writer.py,229,method,"Adds a `MetaGraphDef` to the event file. + +The `MetaGraphDef` allows running the given graph via +`saver.import_meta_graph()`. + +Args: + meta_graph_def: A `MetaGraphDef` object, often as returned by + `saver.export_meta_graph()`. + global_step: Number. Optional global step counter to record with the + graph. + +Raises: + TypeError: If both `meta_graph_def` is not an instance of `MetaGraphDef`." +10794,add_run_metadata,tensorflow/tensorflow/python/summary/writer/writer.py,251,method,"Adds a metadata information for a single session.run() call. + +Args: + run_metadata: A `RunMetadata` protobuf object. + tag: The tag name for this metadata. + global_step: Number. Optional global step counter to record with the + StepStats. + +Raises: + ValueError: If the provided tag was already used for this type of event." +10795,FileWriter,tensorflow/tensorflow/python/summary/writer/writer.py,283,class,"Writes `Summary` protocol buffers to event files. The `FileWriter` class provides a mechanism to create an event file in a given directory and add summaries and events to it. The class updates the @@ -104083,36 +112347,84 @@ to facilitate the use of new summary writing with pre-existing code that expects a `FileWriter` instance. This class is not thread-safe." -11676,FileWriterCache,tensorflow/tensorflow/python/summary/writer/writer_cache.py,29,class,"Cache for file writers. +10796,get_logdir,tensorflow/tensorflow/python/summary/writer/writer.py,381,method,Returns the directory where event file will be written. +10797,add_event,tensorflow/tensorflow/python/summary/writer/writer.py,395,method,"Adds an event to the event file. + +Args: + event: An `Event` protocol buffer." +10798,flush,tensorflow/tensorflow/python/summary/writer/writer.py,404,method,"Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk." +10799,close,tensorflow/tensorflow/python/summary/writer/writer.py,415,method,"Flushes the event file to disk and close the file. + +Call this method when you do not need the summary writer anymore." +10800,reopen,tensorflow/tensorflow/python/summary/writer/writer.py,423,method,"Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed." +10801,FileWriterCache,tensorflow/tensorflow/python/summary/writer/writer_cache.py,29,class,"Cache for file writers. This class caches file writers, one per directory." -11677,FileWriterTestBase,tensorflow/tensorflow/python/summary/writer/writer_test.py,50,class, -11678,FakeWriteError,tensorflow/tensorflow/python/summary/writer/writer_test.py,463,class, -11679,FileWriterTestCase,tensorflow/tensorflow/python/summary/writer/writer_test.py,467,class, -11680,SessionBasedFileWriterTestCase,tensorflow/tensorflow/python/summary/writer/writer_test.py,543,class,Tests for FileWriter behavior when passed a Session argument. -11681,FileWriterCacheTest,tensorflow/tensorflow/python/summary/writer/writer_test.py,689,class,FileWriterCache tests. -11682,SymbolTable,tensorflow/tensorflow/python/tf_program/mlir_gen.py,41,class,Symbol Table for python code. -11683,ProcessType,tensorflow/tensorflow/python/tf_program/mlir_gen.py,87,class,"Visit a node and return processed type Currently only visits annotations and gives their type. +10802,clear,tensorflow/tensorflow/python/summary/writer/writer_cache.py,41,method,Clear cached summary writers. Currently only used for unit tests. +10803,get,tensorflow/tensorflow/python/summary/writer/writer_cache.py,51,method,"Returns the FileWriter for the specified directory. + +Args: + logdir: str, name of the directory. + +Returns: + A `FileWriter`." +10804,FakeWriteError,tensorflow/tensorflow/python/summary/writer/writer_test.py,463,class, +10805,SymbolTable,tensorflow/tensorflow/python/tf_program/mlir_gen.py,41,class,Symbol Table for python code. +10806,enter_scope,tensorflow/tensorflow/python/tf_program/mlir_gen.py,48,method,Enter a new scope - at function level. +10807,insert_symbol,tensorflow/tensorflow/python/tf_program/mlir_gen.py,53,method, +10808,insert_type,tensorflow/tensorflow/python/tf_program/mlir_gen.py,58,method, +10809,exit_scope,tensorflow/tensorflow/python/tf_program/mlir_gen.py,61,method, +10810,lookup,tensorflow/tensorflow/python/tf_program/mlir_gen.py,65,method, +10811,lookup_type,tensorflow/tensorflow/python/tf_program/mlir_gen.py,73,method, +10812,ProcessType,tensorflow/tensorflow/python/tf_program/mlir_gen.py,87,class,"Visit a node and return processed type Currently only visits annotations and gives their type. " -11684,MLIRGen,tensorflow/tensorflow/python/tf_program/mlir_gen.py,115,class,"Visit the AST and generate MLIR code Requires liveness, reading_definitions. +10813,visit_Attribute,tensorflow/tensorflow/python/tf_program/mlir_gen.py,95,method, +10814,visit_Name,tensorflow/tensorflow/python/tf_program/mlir_gen.py,106,method, +10815,MLIRGen,tensorflow/tensorflow/python/tf_program/mlir_gen.py,115,class,"Visit the AST and generate MLIR code Requires liveness, reading_definitions. " -11685,mlir_gen_internal,tensorflow/tensorflow/python/tf_program/mlir_gen.py,417,function,Returns mlir module for unprocessed node `node`. -11686,mlir_gen,tensorflow/tensorflow/python/tf_program/mlir_gen.py,432,function,Parse a function and return TFProgram. -11687,mlir_gen_from_source,tensorflow/tensorflow/python/tf_program/mlir_gen.py,444,function,"Parse a function as either a string or from a supplied file path and return a TFProgram. +10816,visit_block,tensorflow/tensorflow/python/tf_program/mlir_gen.py,125,method, +10817,process_type,tensorflow/tensorflow/python/tf_program/mlir_gen.py,128,method, +10818,visit_Assign,tensorflow/tensorflow/python/tf_program/mlir_gen.py,131,method, +10819,visit_BinOp,tensorflow/tensorflow/python/tf_program/mlir_gen.py,142,method, +10820,visit_BoolOp,tensorflow/tensorflow/python/tf_program/mlir_gen.py,153,method, +10821,visit_Call,tensorflow/tensorflow/python/tf_program/mlir_gen.py,162,method, +10822,visit_Compare,tensorflow/tensorflow/python/tf_program/mlir_gen.py,173,method, +10823,visit_Constant,tensorflow/tensorflow/python/tf_program/mlir_gen.py,199,method, +10824,visit_FunctionDef,tensorflow/tensorflow/python/tf_program/mlir_gen.py,209,method, +10825,visit_If,tensorflow/tensorflow/python/tf_program/mlir_gen.py,237,method, +10826,visit_Name,tensorflow/tensorflow/python/tf_program/mlir_gen.py,287,method, +10827,visit_Return,tensorflow/tensorflow/python/tf_program/mlir_gen.py,292,method, +10828,visit_Tuple,tensorflow/tensorflow/python/tf_program/mlir_gen.py,300,method, +10829,visit_UnaryOp,tensorflow/tensorflow/python/tf_program/mlir_gen.py,303,method, +10830,visit_While,tensorflow/tensorflow/python/tf_program/mlir_gen.py,371,method, +10831,mlir_gen_internal,tensorflow/tensorflow/python/tf_program/mlir_gen.py,417,function,Returns mlir module for unprocessed node `node`. +10832,mlir_gen,tensorflow/tensorflow/python/tf_program/mlir_gen.py,432,function,Parse a function and return TFProgram. +10833,mlir_gen_from_source,tensorflow/tensorflow/python/tf_program/mlir_gen.py,444,function,"Parse a function as either a string or from a supplied file path and return a TFProgram. " -11688,IfOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,59,class,"tfp.if(cond) ({body}, {orelse}) : type If `cond` is true, `body` is +10834,IfOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,59,class,"tfp.if(cond) ({body}, {orelse}) : type If `cond` is true, `body` is executed, otherwise `orelse` is executed." -11689,OrOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,75,class,"tfp.Or(ops...) This is like tf.Any, except that the first dimension is opened +10835,create,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,66,method, +10836,OrOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,75,class,"tfp.Or(ops...) This is like tf.Any, except that the first dimension is opened into `ops`. Returns a tensor of 1-bit integers which is ""Logical OR"" of the coressponding elements in ops..." -11690,AndOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,93,class,"tfp.And(ops...) This is like tf.All, except that the first dimension is opened +10837,create,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,85,method, +10838,AndOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,93,class,"tfp.And(ops...) This is like tf.All, except that the first dimension is opened to `ops`. Returns a tensor of 1-bit integers which is ""Logical AND"" of the coressponding elements in ops..." -11691,WhileOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,111,class,"tfp.While(init-vals, { +10839,create,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,103,method, +10840,WhileOp,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,111,class,"tfp.While(init-vals, { ^bb1(cond-args): cond-region @@ -104124,17 +112436,12 @@ coressponding elements in ops..." As long as `cond-region` returns a ""true""-like value, the body-region is executed and the arguments are replaced by its return values for the next iteration." -11692,TFProgram,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,136,class,Python wrap for a Tensorflow Program (essentially an mlir Module). -11693,MLIRGenTestBase,tensorflow/tensorflow/python/tf_program/tests/mlir_gen_test.py,31,class, -11694,MLIRGenTest,tensorflow/tensorflow/python/tf_program/tests/mlir_gen_test.py,37,class,MLIR Generation Tests for Tensorflow Program -11695,_has_no_variables,tensorflow/tensorflow/python/tools/freeze_graph.py,62,function,"Determines if the graph has any variables. - -Args: - sess: TensorFlow Session. - -Returns: - Bool." -11696,freeze_graph_with_def_protos,tensorflow/tensorflow/python/tools/freeze_graph.py,77,function,"Converts all variables in a graph and checkpoint into constants. +10841,create,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,127,method, +10842,TFProgram,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,136,class,Python wrap for a Tensorflow Program (essentially an mlir Module). +10843,add_function,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,146,method, +10844,get_function_type,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,152,method, +10845,dump,tensorflow/tensorflow/python/tf_program/pywrap_tfd.py,155,method, +10846,freeze_graph_with_def_protos,tensorflow/tensorflow/python/tools/freeze_graph.py,77,function,"Converts all variables in a graph and checkpoint into constants. Args: input_graph_def: A `GraphDef`. @@ -104164,10 +112471,7 @@ Args: Returns: Location of the output_graph_def." -11697,_parse_input_graph_proto,tensorflow/tensorflow/python/tools/freeze_graph.py,243,function,Parses input tensorflow graph into GraphDef proto. -11698,_parse_input_meta_graph_proto,tensorflow/tensorflow/python/tools/freeze_graph.py,257,function,Parses input tensorflow graph into MetaGraphDef proto. -11699,_parse_input_saver_proto,tensorflow/tensorflow/python/tools/freeze_graph.py,272,function,Parses input tensorflow Saver into SaverDef proto. -11700,freeze_graph,tensorflow/tensorflow/python/tools/freeze_graph.py,286,function,"Converts all variables in a graph and checkpoint into constants. +10847,freeze_graph,tensorflow/tensorflow/python/tools/freeze_graph.py,286,function,"Converts all variables in a graph and checkpoint into constants. Args: input_graph: A `GraphDef` file to load. @@ -104197,10 +112501,7 @@ Args: or saver_pb2.SaverDef.V2). Returns: String that is the location of frozen GraphDef." -11701,main,tensorflow/tensorflow/python/tools/freeze_graph.py,364,function, -11702,run_main,tensorflow/tensorflow/python/tools/freeze_graph.py,381,function,Main function of freeze_graph. -11703,FreezeGraphTest,tensorflow/tensorflow/python/tools/freeze_graph_test.py,51,class, -11704,import_to_tensorboard,tensorflow/tensorflow/python/tools/import_pb_to_tensorboard.py,43,function,"View an SavedModel as a graph in Tensorboard. +10848,import_to_tensorboard,tensorflow/tensorflow/python/tools/import_pb_to_tensorboard.py,43,function,"View an SavedModel as a graph in Tensorboard. Args: model_dir: The directory containing the SavedModel to import. @@ -104211,9 +112512,7 @@ Args: Usage: Call this function with your SavedModel location and desired log directory. Launch Tensorboard by pointing it to the log directory. View your imported SavedModel as a graph." -11705,main,tensorflow/tensorflow/python/tools/import_pb_to_tensorboard.py,67,function, -11706,_count_total_params,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,33,function,Count total number of variables. -11707,print_tensors_in_checkpoint_file,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,57,function,"Prints tensors in a checkpoint file. +10849,print_tensors_in_checkpoint_file,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,57,function,"Prints tensors in a checkpoint file. If no `tensor_name` is provided, prints the tensor names and shapes in the checkpoint file. @@ -104226,7 +112525,7 @@ Args: all_tensors: Boolean indicating whether to print all tensors. all_tensor_names: Boolean indicating whether to print all tensor names. count_exclude_pattern: Regex string, pattern to exclude tensors when count." -11708,parse_numpy_printoption,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,115,function,"Sets a single numpy printoption from a string of the form 'x=y'. +10850,parse_numpy_printoption,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,115,function,"Sets a single numpy printoption from a string of the form 'x=y'. See documentation on numpy.set_printoptions() for details about what values x and y can take. x can be any option listed there other than 'formatter'. @@ -104237,9 +112536,8 @@ Args: Raises: argparse.ArgumentTypeError: If the string couldn't be used to set any nump printoption." -11709,main,tensorflow/tensorflow/python/tools/inspect_checkpoint.py,148,function, -11710,get_parent_dir,tensorflow/tensorflow/python/tools/module_util.py,29,function, -11711,get_parent_dir_for_name,tensorflow/tensorflow/python/tools/module_util.py,33,function,"Get parent directory for module with the given name. +10851,get_parent_dir,tensorflow/tensorflow/python/tools/module_util.py,29,function, +10852,get_parent_dir_for_name,tensorflow/tensorflow/python/tools/module_util.py,33,function,"Get parent directory for module with the given name. Args: module_name: Module name for e.g. @@ -104249,10 +112547,8 @@ Returns: Path to the parent directory if module is found and None otherwise. Given example above, it should return: /pathtoestimator/tensorflow_estimator/python/estimator/api/_v1." -11712,main,tensorflow/tensorflow/python/tools/optimize_for_inference.py,74,function, -11713,_parse_placeholder_types,tensorflow/tensorflow/python/tools/optimize_for_inference.py,104,function,Extracts placeholder types from a comma separate list. -11714,parse_args,tensorflow/tensorflow/python/tools/optimize_for_inference.py,110,function,Parses command line arguments. -11715,optimize_for_inference,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,93,function,"Applies a series of inference optimizations on the input graph. +10853,parse_args,tensorflow/tensorflow/python/tools/optimize_for_inference.py,110,function,Parses command line arguments. +10854,optimize_for_inference,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,93,function,"Applies a series of inference optimizations on the input graph. Args: input_graph_def: A GraphDef containing a training model. @@ -104267,7 +112563,7 @@ Args: Returns: An optimized version of the input graph." -11716,ensure_graph_is_valid,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,126,function,"Makes sure that the graph is internally consistent. +10855,ensure_graph_is_valid,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,126,function,"Makes sure that the graph is internally consistent. Checks basic properties of the graph def and raises an exception if there are input references to missing nodes, duplicated names, or other logic errors. @@ -104277,8 +112573,8 @@ Args: Raises: ValueError: If the graph is incorrectly constructed." -11717,node_name_from_input,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,151,function,Strips off ports and other decorations to get the underlying node name. -11718,node_from_map,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,161,function,"Pulls a node def from a dictionary for a given name. +10856,node_name_from_input,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,151,function,Strips off ports and other decorations to get the underlying node name. +10857,node_from_map,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,161,function,"Pulls a node def from a dictionary for a given name. Args: node_map: Dictionary containing an entry indexed by name for every node. @@ -104289,7 +112585,7 @@ Returns: Raises: ValueError: If the node isn't present in the dictionary." -11719,values_from_const,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,180,function,"Extracts the values from a const NodeDef as a numpy ndarray. +10858,values_from_const,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,180,function,"Extracts the values from a const NodeDef as a numpy ndarray. Args: node_def: Const NodeDef that has the values we want to access. @@ -104299,8 +112595,8 @@ Returns: Raises: ValueError: If the node isn't a Const." -11720,scale_after_normalization,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,202,function, -11721,fold_batch_norms,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,208,function,"Removes batch normalization ops by folding them into convolutions. +10859,scale_after_normalization,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,202,function, +10860,fold_batch_norms,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,208,function,"Removes batch normalization ops by folding them into convolutions. Batch normalization during training has multiple dynamic parameters that are updated, but once the graph is finalized these become constants. That means @@ -104321,7 +112617,7 @@ Returns: Raises: ValueError: If the graph is badly formed with duplicate node names." -11722,fuse_resize_and_conv,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,419,function,"Merges preceding resize and mirror pad ops into a specialized convolution. +10861,fuse_resize_and_conv,tensorflow/tensorflow/python/tools/optimize_for_inference_lib.py,419,function,"Merges preceding resize and mirror pad ops into a specialized convolution. There's a common pattern of enlarging the input to a convolution using a resize operation, and also using MirrorPad to extend the boundaries to that @@ -104338,43 +112634,7 @@ Returns: Raises: ValueError: If the graph is badly formed with duplicate node names." -11723,OptimizeForInferenceTest,tensorflow/tensorflow/python/tools/optimize_for_inference_test.py,42,class, -11724,main,tensorflow/tensorflow/python/tools/print_selective_registration_header.py,47,function, -11725,PrintOpFilegroupTest,tensorflow/tensorflow/python/tools/print_selective_registration_header_test.py,82,class, -11726,_shlex_quote,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,68,function, -11727,_sysconfig_module,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,75,function,"Load tf.sysconfig if available and working (i.e., inside a pip package)." -11728,_parse_tensor_name,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,84,function,"Convert a tensor name like 'tensor:0' into a tuple ('tensor', 0)." -11729,_xla_makefile_string,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,101,function,"Returns a Makefile string with variables for using XLA binary object files. - -Attempts to identify the right include header paths when run from either -an installed TensorFlow pip package, or from bazel run. - -Args: - output_prefix: A string containing the output prefix for the XLA AOT - compiled header + object files. - -Returns: - A string containing a filled out `_XLA_MAKEFILE_TEMPLATE`." -11730,_get_variable_nodes_from_graph_def,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,147,function,"Get the list of Variable nodes from `graph_def`. - -Args: - graph_def: An instance of `GraphDef`. This GraphDef *must* - have already been optimized by Grappler. In particular, function - inlining must have already happened. - -Returns: - A dict mapping string names of variables to tuples `(node_def, modified)`, - where `node_def` is the `NodeDef` corresponding to variable, and `modified` - is a python bool describing whether the variable is modified during runtime." -11731,_prune_removed_feed_nodes,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,188,function,"Identify the inputs in the signature no longer in graph_def, prune them. - -Args: - signature_def: A `SignatureDef` instance. - graph_def: A `GraphDef` instance. - -Returns: - A new pruned `SignatureDef`." -11732,aot_compile_cpu_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,212,function,"Compile a `MetaGraphDef` to header+object files in `output_prefix`. +10862,aot_compile_cpu_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,212,function,"Compile a `MetaGraphDef` to header+object files in `output_prefix`. Use XLA AOT (`tfcompile`) to convert the given meta graph and signature into a header + object files. Also create an include makefile @@ -104411,96 +112671,7 @@ Raises: ValueError: If `meta_graph_def.signature_def[signature_def_key]` is missing or has empty outputs. NotImplementedError: If `enable_multithreading is True`." -11733,_optimize_graph,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,382,function,Optimize `meta_graph_def` using grappler. Returns a `GraphDef`. -11734,_replace_input_placeholders_with_default_values,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,401,function,Replace graphdef's `tf.placeholder` input ops with all-zero constants. -11735,_signature_to_tf2xla_config,tensorflow/tensorflow/python/tools/saved_model_aot_compile.py,441,function,"Convert `signature_def` to tf2xla config. Returns a `tf2xla.Config` proto. - -Args: - signature_def: Instance of `SignatureDef`. - variable_nodes_to_feed: List of tuples of form `(node_def, modified)` - corresponding to VarHandleOp, and a boolean `modified` that describes - whether the variable was modified during execution. - -Returns: - An instance of `tf2xla.Config` proto. - -Raises: - RuntimeError: If TensorFlow was not compiled with XLA." -11736,_show_tag_sets,tensorflow/tensorflow/python/tools/saved_model_cli.py,65,function,"Prints the tag-sets stored in SavedModel directory. - -Prints all the tag-sets for MetaGraphs stored in SavedModel directory. - -Args: - saved_model_dir: Directory containing the SavedModel to inspect." -11737,_show_signature_def_map_keys,tensorflow/tensorflow/python/tools/saved_model_cli.py,79,function,"Prints the keys for each SignatureDef in the SignatureDef map. - -Prints the list of SignatureDef keys from the SignatureDef map specified by -the given tag-set and SavedModel directory. - -Args: - saved_model_dir: Directory containing the SavedModel to inspect. - tag_set: Group of tag(s) of the MetaGraphDef to get SignatureDef map from, - in string format, separated by ','. For tag-set contains multiple tags, - all tags must be passed in." -11738,_get_inputs_tensor_info_from_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,98,function,"Gets TensorInfo for all inputs of the SignatureDef. - -Returns a dictionary that maps each input key to its TensorInfo for the given -signature_def_key in the meta_graph_def - -Args: - meta_graph_def: MetaGraphDef protocol buffer with the SignatureDef map to - look up SignatureDef key. - signature_def_key: A SignatureDef key string. - -Returns: - A dictionary that maps input tensor keys to TensorInfos." -11739,_get_outputs_tensor_info_from_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,116,function,"Gets TensorInfos for all outputs of the SignatureDef. - -Returns a dictionary that maps each output key to its TensorInfo for the given -signature_def_key in the meta_graph_def. - -Args: - meta_graph_def: MetaGraphDef protocol buffer with the SignatureDefmap to - look up signature_def_key. - signature_def_key: A SignatureDef key string. - -Returns: - A dictionary that maps output tensor keys to TensorInfos." -11740,_show_inputs_outputs,tensorflow/tensorflow/python/tools/saved_model_cli.py,134,function,"Prints input and output TensorInfos. - -Prints the details of input and output TensorInfos for the SignatureDef mapped -by the given signature_def_key. - -Args: - saved_model_dir: Directory containing the SavedModel to inspect. - tag_set: Group of tag(s) of the MetaGraphDef, in string format, separated by - ','. For tag-set contains multiple tags, all tags must be passed in. - signature_def_key: A SignatureDef key string. - indent: How far (in increments of 2 spaces) to indent each line of output." -11741,_show_defined_functions,tensorflow/tensorflow/python/tools/saved_model_cli.py,173,function,"Prints the callable concrete and polymorphic functions of the Saved Model. - -Args: - saved_model_dir: Directory containing the SavedModel to inspect." -11742,_print_args,tensorflow/tensorflow/python/tools/saved_model_cli.py,219,function,"Formats and prints the argument of the concrete functions defined in the model. - -Args: - arguments: Arguments to format print. - argument_type: Type of arguments. - indent: How far (in increments of 2 spaces) to indent each line of - output." -11743,_print_tensor_info,tensorflow/tensorflow/python/tools/saved_model_cli.py,262,function,"Prints details of the given tensor_info. - -Args: - tensor_info: TensorInfo object to be printed. - indent: How far (in increments of 2 spaces) to indent each line output" -11744,_show_all,tensorflow/tensorflow/python/tools/saved_model_cli.py,287,function,"Prints tag-set, SignatureDef and Inputs/Outputs information in SavedModel. - -Prints all tag-set, SignatureDef and Inputs/Outputs information stored in -SavedModel directory. - -Args: - saved_model_dir: Directory containing the SavedModel to inspect." -11745,get_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,310,function,"DEPRECATED: Use saved_model_utils.get_meta_graph_def instead. +10863,get_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,310,function,"DEPRECATED: Use saved_model_utils.get_meta_graph_def instead. Gets MetaGraphDef from SavedModel. Returns the MetaGraphDef for the given tag-set and SavedModel directory. @@ -104517,7 +112688,7 @@ Raises: Returns: A MetaGraphDef corresponding to the tag-set." -11746,get_signature_def_map,tensorflow/tensorflow/python/tools/saved_model_cli.py,332,function,"Gets SignatureDef map from a MetaGraphDef in a SavedModel. +10864,get_signature_def_map,tensorflow/tensorflow/python/tools/saved_model_cli.py,332,function,"Gets SignatureDef map from a MetaGraphDef in a SavedModel. Returns the SignatureDef map for the given tag-set in the SavedModel directory. @@ -104530,14 +112701,14 @@ Args: Returns: A SignatureDef map that maps from string keys to SignatureDefs." -11747,scan_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,351,function,"Scans meta_graph_def and reports if there are ops on denylist. +10865,scan_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_cli.py,351,function,"Scans meta_graph_def and reports if there are ops on denylist. Print ops if they are on black list, or print success if no denylisted ops found. Args: meta_graph_def: MetaGraphDef protocol buffer." -11748,run_saved_model_with_feed_dict,tensorflow/tensorflow/python/tools/saved_model_cli.py,373,function,"Runs SavedModel and fetch all outputs. +10866,run_saved_model_with_feed_dict,tensorflow/tensorflow/python/tools/saved_model_cli.py,373,function,"Runs SavedModel and fetch all outputs. Runs the input dictionary through the MetaGraphDef within a SavedModel specified by the given tag_set and SignatureDef. Also save the outputs to file @@ -104566,7 +112737,7 @@ Raises: ValueError: When any of the input tensor keys is not valid. RuntimeError: An error when output file already exists and overwrite is not enabled." -11749,preprocess_inputs_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,474,function,"Parses input arg into dictionary that maps input to file/variable tuple. +10867,preprocess_inputs_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,474,function,"Parses input arg into dictionary that maps input to file/variable tuple. Parses input string in the format of, for example, ""input1=filename1[variable_name1],input2=filename2"" into a @@ -104589,7 +112760,7 @@ Returns: Raises: RuntimeError: An error when the given input string is in a bad format." -11750,preprocess_input_exprs_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,521,function,"Parses input arg into dictionary that maps input key to python expression. +10868,preprocess_input_exprs_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,521,function,"Parses input arg into dictionary that maps input key to python expression. Parses input string in the format of 'input_key=' into a dictionary that maps each input_key to its python expression. @@ -104604,7 +112775,7 @@ Returns: Raises: RuntimeError: An error when the given input string is in a bad format." -11751,preprocess_input_examples_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,550,function,"Parses input into dict that maps input keys to lists of tf.Example. +10869,preprocess_input_examples_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,550,function,"Parses input into dict that maps input keys to lists of tf.Example. Parses input string in the format of 'input_key1=[{feature_name: feature_list}];input_key2=[{feature_name:feature_list}];' into a dictionary @@ -104622,8 +112793,7 @@ Returns: Raises: ValueError: An error when the given tf.Example is not a list." -11752,_create_example_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,582,function,Create a serialized tf.example from feature dictionary. -11753,load_inputs_from_input_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,605,function,"Parses input arg strings and create inputs feed_dict. +10870,load_inputs_from_input_arg_string,tensorflow/tensorflow/python/tools/saved_model_cli.py,605,function,"Parses input arg strings and create inputs feed_dict. Parses '--inputs' string for inputs to be loaded from file, and parses '--input_exprs' string for inputs to be evaluated from python expression. @@ -104668,11 +112838,11 @@ Raises: multiple numpy ndarrays, none of which matches the given key. RuntimeError: An error when no key is specified, but the input file contains more than one numpy ndarrays." -11754,show,tensorflow/tensorflow/python/tools/saved_model_cli.py,708,function,"Function triggered by show command. +10871,show,tensorflow/tensorflow/python/tools/saved_model_cli.py,708,function,"Function triggered by show command. Args: args: A namespace parsed from command line." -11755,run,tensorflow/tensorflow/python/tools/saved_model_cli.py,730,function,"Function triggered by run command. +10872,run,tensorflow/tensorflow/python/tools/saved_model_cli.py,730,function,"Function triggered by run command. Args: args: A namespace parsed from command line. @@ -104680,31 +112850,29 @@ Args: Raises: AttributeError: An error when neither --inputs nor --input_exprs is passed to run command." -11756,scan,tensorflow/tensorflow/python/tools/saved_model_cli.py,752,function,"Function triggered by scan command. +10873,scan,tensorflow/tensorflow/python/tools/saved_model_cli.py,752,function,"Function triggered by scan command. Args: args: A namespace parsed from command line." -11757,convert_with_tensorrt,tensorflow/tensorflow/python/tools/saved_model_cli.py,767,function,"Function triggered by 'convert tensorrt' command. +10874,convert_with_tensorrt,tensorflow/tensorflow/python/tools/saved_model_cli.py,767,function,"Function triggered by 'convert tensorrt' command. Args: args: A namespace parsed from command line." -11758,aot_compile_cpu,tensorflow/tensorflow/python/tools/saved_model_cli.py,806,function,"Function triggered by aot_compile_cpu command. +10875,aot_compile_cpu,tensorflow/tensorflow/python/tools/saved_model_cli.py,806,function,"Function triggered by aot_compile_cpu command. Args: args: A namespace parsed from command line." -11759,add_show_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,834,function,Add parser for `show`. -11760,add_run_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,880,function,Add parser for `run`. -11761,add_scan_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,958,function,Add parser for `scan`. -11762,add_convert_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,980,function,Add parser for `convert`. -11763,add_aot_compile_cpu_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,1041,function,Add parser for `aot_compile_cpu`. -11764,create_parser,tensorflow/tensorflow/python/tools/saved_model_cli.py,1149,function,"Creates a parser that parse the command line arguments. +10876,add_show_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,834,function,Add parser for `show`. +10877,add_run_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,880,function,Add parser for `run`. +10878,add_scan_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,958,function,Add parser for `scan`. +10879,add_convert_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,980,function,Add parser for `convert`. +10880,add_aot_compile_cpu_subparser,tensorflow/tensorflow/python/tools/saved_model_cli.py,1041,function,Add parser for `aot_compile_cpu`. +10881,create_parser,tensorflow/tensorflow/python/tools/saved_model_cli.py,1149,function,"Creates a parser that parse the command line arguments. Returns: A namespace parsed from command line arguments." -11765,main,tensorflow/tensorflow/python/tools/saved_model_cli.py,1180,function, -11766,captured_output,tensorflow/tensorflow/python/tools/saved_model_cli_test.py,51,function, -11767,SavedModelCLITestCase,tensorflow/tensorflow/python/tools/saved_model_cli_test.py,61,class, -11768,read_saved_model,tensorflow/tensorflow/python/tools/saved_model_utils.py,31,function,"Reads the saved_model.pb or saved_model.pbtxt file containing `SavedModel`. +10882,captured_output,tensorflow/tensorflow/python/tools/saved_model_cli_test.py,51,function, +10883,read_saved_model,tensorflow/tensorflow/python/tools/saved_model_utils.py,31,function,"Reads the saved_model.pb or saved_model.pbtxt file containing `SavedModel`. Args: saved_model_dir: Directory containing the SavedModel file. @@ -104714,7 +112882,7 @@ Returns: Raises: IOError: If the file does not exist, or cannot be successfully parsed." -11769,get_saved_model_tag_sets,tensorflow/tensorflow/python/tools/saved_model_utils.py,79,function,"Retrieves all the tag-sets available in the SavedModel. +10884,get_saved_model_tag_sets,tensorflow/tensorflow/python/tools/saved_model_utils.py,79,function,"Retrieves all the tag-sets available in the SavedModel. Args: saved_model_dir: Directory containing the SavedModel. @@ -104722,7 +112890,7 @@ Args: Returns: List of all tag-sets in the SavedModel, where a tag-set is represented as a list of strings." -11770,get_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_utils.py,96,function,"Gets MetaGraphDef from SavedModel. +10885,get_meta_graph_def,tensorflow/tensorflow/python/tools/saved_model_utils.py,96,function,"Gets MetaGraphDef from SavedModel. Returns the MetaGraphDef for the given tag-set and SavedModel directory. @@ -104739,12 +112907,9 @@ Raises: Returns: A MetaGraphDef corresponding to the tag-set." -11771,tearDownModule,tensorflow/tensorflow/python/tools/saved_model_utils_test.py,33,function, -11772,SavedModelUtilTest,tensorflow/tensorflow/python/tools/saved_model_utils_test.py,37,class, -11773,_get_ops_from_ops_list,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,48,function,Gets the ops and kernels needed from the ops list file. -11774,_get_ops_from_graphdef,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,61,function,Gets the ops and kernels needed from the tensorflow model. -11775,get_ops_and_kernels,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,79,function,Gets the ops and kernels needed from the model files. -11776,get_header_from_ops_and_kernels,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,110,function,"Returns a header for use with tensorflow SELECTIVE_REGISTRATION. +10886,tearDownModule,tensorflow/tensorflow/python/tools/saved_model_utils_test.py,33,function, +10887,get_ops_and_kernels,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,79,function,Gets the ops and kernels needed from the model files. +10888,get_header_from_ops_and_kernels,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,110,function,"Returns a header for use with tensorflow SELECTIVE_REGISTRATION. Args: ops_and_kernels: a set of (op_name, kernel_class_name) pairs to include. @@ -104753,7 +112918,7 @@ Args: Returns: the string of the header that should be written as ops_to_register.h." -11777,get_header,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,194,function,"Computes a header for use with tensorflow SELECTIVE_REGISTRATION. +10889,get_header,tensorflow/tensorflow/python/tools/selective_registration_header_lib.py,194,function,"Computes a header for use with tensorflow SELECTIVE_REGISTRATION. Args: graphs: a list of paths to GraphDef files to include. @@ -104766,8 +112931,7 @@ Args: Returns: the string of the header that should be written as ops_to_register.h." -11778,main,tensorflow/tensorflow/python/tools/strip_unused.py,54,function, -11779,strip_unused,tensorflow/tensorflow/python/tools/strip_unused_lib.py,32,function,"Removes unused nodes from a GraphDef. +10890,strip_unused,tensorflow/tensorflow/python/tools/strip_unused_lib.py,32,function,"Removes unused nodes from a GraphDef. Args: input_graph_def: A graph with nodes we want to prune. @@ -104783,10 +112947,9 @@ Raises: ValueError: If any element in `input_node_names` refers to a tensor instead of an operation. KeyError: If any element in `input_node_names` is not found in the graph." -11780,strip_unused_from_files,tensorflow/tensorflow/python/tools/strip_unused_lib.py,92,function,Removes unused nodes from a graph file. -11781,StripUnusedTest,tensorflow/tensorflow/python/tools/strip_unused_test.py,36,class, -11782,SymbolExposedTwiceError,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,73,class,Raised when different symbols are exported with the same name. -11783,get_canonical_import,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,78,function,"Obtain one single import from a set of possible sources of a symbol. +10891,strip_unused_from_files,tensorflow/tensorflow/python/tools/strip_unused_lib.py,92,function,Removes unused nodes from a graph file. +10892,SymbolExposedTwiceError,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,73,class,Raised when different symbols are exported with the same name. +10893,get_canonical_import,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,78,function,"Obtain one single import from a set of possible sources of a symbol. One symbol might come from multiple places as it is being imported and reexported. To simplify API changes, we always use the same import for the @@ -104800,8 +112963,7 @@ Args: Returns: A module name to import" -11784,_ModuleInitCodeBuilder,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,105,class,Builds a map from module name to imports included in that module. -11785,add_nested_compat_imports,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,316,function,"Adds compat.vN.compat.vK modules to module builder. +10894,add_nested_compat_imports,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,316,function,"Adds compat.vN.compat.vK modules to module builder. To avoid circular imports, we want to add __init__.py files under compat.vN.compat.vK and under compat.vN.compat.vK.compat. For all other @@ -104812,23 +112974,7 @@ Args: compat_api_versions: Supported compatibility versions. output_package: Base output python package where generated API will be added." -11786,_get_name_and_module,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,374,function,"Split full_name into module and short name. - -Args: - full_name: Full name of symbol that includes module. - -Returns: - Full module name and short symbol name." -11787,_join_modules,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,387,function,"Concatenate 2 module components. - -Args: - module1: First module to join. - module2: Second module to join. - -Returns: - Given two modules aaa.bbb and ccc.ddd, returns a joined - module aaa.bbb.ccc.ddd." -11788,add_imports_for_symbol,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,405,function,"Add imports for the given symbol to `module_code_builder`. +10895,add_imports_for_symbol,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,405,function,"Add imports for the given symbol to `module_code_builder`. Args: module_code_builder: `_ModuleInitCodeBuilder` instance. @@ -104838,7 +112984,7 @@ Args: api_name: API name. Currently, must be either `tensorflow` or `estimator`. api_version: API version. output_module_prefix: Prefix to prepend to destination module." -11789,get_api_init_text,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,450,function,"Get a map from destination module to __init__.py code for that module. +10896,get_api_init_text,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,450,function,"Get a map from destination module to __init__.py code for that module. Args: packages: Base python packages containing python with target tf_export @@ -104859,7 +113005,7 @@ Returns: key: (string) destination module (for e.g. tf or tf.consts). value: (string) text that should be in __init__.py files for corresponding modules." -11790,get_module,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,522,function,"Get module that corresponds to path relative to relative_to_dir. +10897,get_module,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,522,function,"Get module that corresponds to path relative to relative_to_dir. Args: dir_path: Path to directory. @@ -104867,7 +113013,7 @@ Args: Returns: Name of module that corresponds to the given directory." -11791,get_module_docstring,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,538,function,"Get docstring for the given module. +10898,get_module_docstring,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,538,function,"Get docstring for the given module. This method looks for docstring in the following order: 1. Checks if module has a docstring specified in doc_srcs. @@ -104886,7 +113032,7 @@ Args: Returns: One-line docstring to describe the module." -11792,create_api_files,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,586,function,"Creates __init__.py files for the Python API. +10899,create_api_files,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,586,function,"Creates __init__.py files for the Python API. Args: output_files: List of __init__.py file paths to create. @@ -104909,86 +113055,32 @@ Args: Raises: ValueError: if output_files list is missing a required file." -11793,main,tensorflow/tensorflow/python/tools/api/generator/create_python_api.py,695,function, -11794,test_op,tensorflow/tensorflow/python/tools/api/generator/create_python_api_test.py,30,function, -11795,deprecated_test_op,tensorflow/tensorflow/python/tools/api/generator/create_python_api_test.py,35,function, -11796,TestClass,tensorflow/tensorflow/python/tools/api/generator/create_python_api_test.py,40,class, -11797,CreatePythonApiTest,tensorflow/tensorflow/python/tools/api/generator/create_python_api_test.py,48,class, -11798,DocSource,tensorflow/tensorflow/python/tools/api/generator/doc_srcs.py,23,class,"Specifies docstring source for a module. +10900,DocSource,tensorflow/tensorflow/python/tools/api/generator/doc_srcs.py,23,class,"Specifies docstring source for a module. Only one of docstring or docstring_module_name should be set. * If docstring is set, then we will use this docstring when for the module. * If docstring_module_name is set, then we will copy the docstring from docstring source module." -11799,get_doc_sources,tensorflow/tensorflow/python/tools/api/generator/doc_srcs.py,86,function,"Get a map from module to a DocSource object. +10901,get_doc_sources,tensorflow/tensorflow/python/tools/api/generator/doc_srcs.py,86,function,"Get a map from module to a DocSource object. Args: api_name: API you want to generate (e.g. `tensorflow` or `estimator`). Returns: Map from module name to DocSource object." -11800,DocSrcsTest,tensorflow/tensorflow/python/tools/api/generator/doc_srcs_test.py,32,class, -11801,_get_module_from_symbol,tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py,33,function, -11802,_get_modules,tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py,39,function,"Get list of TF API modules. - -Args: - package: We only look at modules that contain package in the name. - attr_name: Attribute set on TF symbols that contains API names. - constants_attr_name: Attribute set on TF modules that contains - API constant names. - -Returns: - Set of TensorFlow API modules." -11803,_get_files_set,tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py,78,function,"Get set of file paths from the given file. - -Args: - path: Path to file. File at `path` is expected to contain a list of paths - where entire list starts with `start_tag` and ends with `end_tag`. List - must be comma-separated and each path entry must be surrounded by double - quotes. - start_tag: String that indicates start of path list. - end_tag: String that indicates end of path list. - -Returns: - List of string paths." -11804,_module_to_paths,tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py,102,function,"Get all API __init__.py file paths for the given module. - -Args: - module: Module to get file paths for. - -Returns: - List of paths for the given module. For e.g. module foo.bar - requires 'foo/__init__.py' and 'foo/bar/__init__.py'." -11805,OutputInitFilesTest,tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py,125,class,Test that verifies files that list paths for TensorFlow API. -11806,AsyncCheckpointSaverHook,tensorflow/tensorflow/python/tpu/async_checkpoint.py,39,class,Saves checkpoints every N steps or seconds. -11807,input_fn,tensorflow/tensorflow/python/tpu/async_checkpoint_test.py,56,function,Return a dataset of source and target sequences for training. -11808,model_fn,tensorflow/tensorflow/python/tpu/async_checkpoint_test.py,65,function, -11809,AsyncCheckpointingTest,tensorflow/tensorflow/python/tpu/async_checkpoint_test.py,97,class, -11810,_get_custom_getter,tensorflow/tensorflow/python/tpu/bfloat16.py,29,function,"Returns a custom getter that this class's methods must be called under. - -All methods of this class must be called under a variable scope that was -passed this custom getter. Example: - -```python -network = ConvNetBuilder(...) -with tf.compat.v1.variable_scope('cg', - custom_getter=network.get_custom_getter()): - network.conv(...) - # Call more methods of network here -``` - -Currently, this custom getter only does anything if self.use_tf_layers is -True. In that case, it causes variables to be stored as dtype -self.variable_type, then casted to the requested dtype, instead of directly -storing the variable as the requested dtype." -11811,bfloat16_scope,tensorflow/tensorflow/python/tpu/bfloat16.py,73,function,"Scope class for bfloat16 variables so that the model uses custom getter. +10902,AsyncCheckpointSaverHook,tensorflow/tensorflow/python/tpu/async_checkpoint.py,39,class,Saves checkpoints every N steps or seconds. +10903,begin,tensorflow/tensorflow/python/tpu/async_checkpoint.py,92,method, +10904,after_create_session,tensorflow/tensorflow/python/tpu/async_checkpoint.py,101,method, +10905,before_run,tensorflow/tensorflow/python/tpu/async_checkpoint.py,125,method, +10906,after_run,tensorflow/tensorflow/python/tpu/async_checkpoint.py,128,method, +10907,end,tensorflow/tensorflow/python/tpu/async_checkpoint.py,136,method, +10908,input_fn,tensorflow/tensorflow/python/tpu/async_checkpoint_test.py,56,function,Return a dataset of source and target sequences for training. +10909,model_fn,tensorflow/tensorflow/python/tpu/async_checkpoint_test.py,65,function, +10910,bfloat16_scope,tensorflow/tensorflow/python/tpu/bfloat16.py,73,function,"Scope class for bfloat16 variables so that the model uses custom getter. This enables variables to be read as bfloat16 type when using get_variable." -11812,BFloat16ScopeTest,tensorflow/tensorflow/python/tpu/bfloat16_test.py,32,class, -11813,_TextLineDataset,tensorflow/tensorflow/python/tpu/datasets.py,31,function, -11814,_TFRecordDataset,tensorflow/tensorflow/python/tpu/datasets.py,37,function, -11815,StreamingFilesDataset,tensorflow/tensorflow/python/tpu/datasets.py,50,function,"StreamingFilesDataset constructs a dataset to stream from workers (GCE VM). +10911,StreamingFilesDataset,tensorflow/tensorflow/python/tpu/datasets.py,50,function,"StreamingFilesDataset constructs a dataset to stream from workers (GCE VM). Because Cloud TPUs are allocated over the network, a Cloud TPU cannot read files local to your GCE VM. In order to train using files stored on your local @@ -105033,86 +113125,37 @@ Returns: Raises: ValueError: if any argument is not of the expected type." -11816,DatasetsTest,tensorflow/tensorflow/python/tpu/datasets_test.py,41,class, -11817,_compute_task_and_cores_to_replicas,tensorflow/tensorflow/python/tpu/device_assignment.py,34,function,Computes a nested dict which maps task and logical core to replicas. -11818,DeviceAssignment,tensorflow/tensorflow/python/tpu/device_assignment.py,60,class,"Mapping from logical cores in a computation to the physical TPU topology. +10912,DeviceAssignment,tensorflow/tensorflow/python/tpu/device_assignment.py,60,class,"Mapping from logical cores in a computation to the physical TPU topology. Prefer to use the `DeviceAssignment.build()` helper to construct a `DeviceAssignment`; it is easier if less flexible than constructing a `DeviceAssignment` directly." -11819,_open_ring_2d,tensorflow/tensorflow/python/tpu/device_assignment.py,179,function,"Ring-order of a X by Y mesh, with a fixed Z coordinate. - -For example, in a 4x4 mesh, this returns the following order. - 0 -- 1 -- 2 -- 3 - | | | | - 15-- 6 -- 5 -- 4 - | | | | - 14-- 7 -- 8 -- 9 - | | | | - 13-- 12-- 11-- 10 - -Note that chip 0 is not included in the output. - -Args: - x_size: An integer represents the mesh size in the x-dimension. Must be - larger than 1. - y_size: An integer represents the mesh size in the y-dimension. Must be - larger than 1. - z_coord: An integer represents the z-coordinate to use for the chips in the - ring. +10913,topology,tensorflow/tensorflow/python/tpu/device_assignment.py,106,method,A `Topology` that describes the TPU topology. +10914,num_cores_per_replica,tensorflow/tensorflow/python/tpu/device_assignment.py,111,method,The number of cores per replica. +10915,num_replicas,tensorflow/tensorflow/python/tpu/device_assignment.py,116,method,The number of replicas of the computation. +10916,core_assignment,tensorflow/tensorflow/python/tpu/device_assignment.py,121,method,"The logical to physical core mapping. Returns: - A list of (x,y,z) triples in ring order." -11820,_ring_3d,tensorflow/tensorflow/python/tpu/device_assignment.py,215,function,"Ring-order of a X by Y by Z mesh. - -Constructs the 3d ring from 2d rings that are stacked in the Z dimension and -joined in one corner. - -z == 0: - 0 -- 1 -- 2 -- 3 - | | | | - 15 - 6 -- 5 -- 4 - | | | | - 14 - 7 -- 8 -- 9 - | | | | - 13 - 12 - 11 - 10 -z == 1: - 63 - 30 - 29 - 28 - | | | | - 16 - 25 - 26 - 27 - | | | | - 17 - 24 - 23 - 22 - | | | | - 18 - 19 - 20 - 21 -z == 2: - 62 - 31 - 32 - 33 - | | | | - 45 - 36 - 35 - 34 - | | | | - 44 - 37 - 38 - 39 - | | | | - 43 - 42 - 41 - 40 -z == 3: - 61 - 60 - 59 - 58 - | | | | - 46 - 55 - 56 - 57 - | | | | - 47 - 54 - 53 - 52 - | | | | - 48 - 49 - 50 - 51 + An integer numpy array of rank 3, with shape + `[num_replicas, num_cores_per_replica, topology_rank]`. Maps + (replica, logical core) pairs to physical topology coordinates." +10917,coordinates,tensorflow/tensorflow/python/tpu/device_assignment.py,131,method,Returns the physical topology coordinates of a logical core. +10918,lookup_replicas,tensorflow/tensorflow/python/tpu/device_assignment.py,135,method,"Lookup replica ids by task number and logical core. Args: - x_size: An integer represents the mesh size in the x-dimension. Must be - larger than 1. - y_size: An integer represents the mesh size in the y-dimension. Must be - larger than 1. - z_size: An integer represents the mesh size in the z-dimension. Must be - larger than 1. For example, in a 4x4x4 mesh, this returns the following - order. - + task_id: TensorFlow task number. + logical_core: An integer, identifying a logical core. Returns: - A list of (x,y,z) triples in ring order." -11821,device_assignment,tensorflow/tensorflow/python/tpu/device_assignment.py,316,function,"Computes a device_assignment of a computation across a TPU topology. + A sorted list of the replicas that are attached to that task and + logical_core. +Raises: + ValueError: If no replica exists in the task which contains the logical + core." +10919,tpu_ordinal,tensorflow/tensorflow/python/tpu/device_assignment.py,155,method,Returns the ordinal of the TPU device assigned to a logical core. +10920,host_device,tensorflow/tensorflow/python/tpu/device_assignment.py,160,method,Returns the CPU device attached to a logical core. +10921,tpu_device,tensorflow/tensorflow/python/tpu/device_assignment.py,165,method,Returns the name of the TPU device assigned to a logical core. +10922,build,tensorflow/tensorflow/python/tpu/device_assignment.py,171,method, +10923,device_assignment,tensorflow/tensorflow/python/tpu/device_assignment.py,316,function,"Computes a device_assignment of a computation across a TPU topology. Attempts to choose a compact grid of cores for locality. @@ -105147,7 +113190,7 @@ Raises: ValueError: If `computation_shape` or `computation_stride` are not 1D int32 numpy arrays with shape [3] where all values are positive. ValueError: If computation's replicas cannot fit into the TPU topology." -11822,embedding_column,tensorflow/tensorflow/python/tpu/feature_column.py,55,function,"TPU embedding_column for `tf.feature_column.embedding_column`. +10924,embedding_column,tensorflow/tensorflow/python/tpu/feature_column.py,55,function,"TPU embedding_column for `tf.feature_column.embedding_column`. Note that the interface for TPU embedding_column is different from the non-TPU version. The following args available for the non-TPU version are NOT @@ -105193,7 +113236,7 @@ Raises: ValueError: if `dimension` not > 0. ValueError: if `initializer` is specified but not callable. TypeError: if categorical_column is not a supported type." -11823,shared_embedding_columns,tensorflow/tensorflow/python/tpu/feature_column.py,161,function,"List of dense columns that convert from sparse, categorical input. +10925,shared_embedding_columns,tensorflow/tensorflow/python/tpu/feature_column.py,161,function,"List of dense columns that convert from sparse, categorical input. Note that the interface for TPU embedding_column is different from the non-TPU version. The following args available for the non-TPU version are NOT @@ -105248,19 +113291,14 @@ Raises: as `categorical_columns`. ValueError: if `max_sequence_lengths` is positive for a non sequence column or 0 for a sequence column." -11824,_TPUBaseEmbeddingColumn,tensorflow/tensorflow/python/tpu/feature_column.py,294,class,Base class for TPU Embedding Column. -11825,_TPUEmbeddingColumn,tensorflow/tensorflow/python/tpu/feature_column.py,361,class,Core Embedding Column. -11826,_TPUSharedEmbeddingColumn,tensorflow/tensorflow/python/tpu/feature_column.py,494,class,Core Shared Embedding Column. -11827,_record_variable_scope_and_name,tensorflow/tensorflow/python/tpu/feature_column.py,628,function,Add embedding variable name and scope to collection. -11828,_is_running_on_cpu,tensorflow/tensorflow/python/tpu/feature_column.py,661,function,Returns True if the current context is CPU model. -11829,get_sequence_length_feature_key_name_from_feature_key_name,tensorflow/tensorflow/python/tpu/feature_column.py,666,function,"Gets the name of the sequence length feature from that of the base feature. +10926,get_sequence_length_feature_key_name_from_feature_key_name,tensorflow/tensorflow/python/tpu/feature_column.py,666,function,"Gets the name of the sequence length feature from that of the base feature. Args: feature_name: The feature key of a sequence column. Returns: A string which is the feature key for the associated feature length column." -11830,split_sequence_columns,tensorflow/tensorflow/python/tpu/feature_column.py,678,function,"Split a list of _TPUEmbeddingColumn into sequence and non-sequence columns. +10927,split_sequence_columns,tensorflow/tensorflow/python/tpu/feature_column.py,678,function,"Split a list of _TPUEmbeddingColumn into sequence and non-sequence columns. For use in a TPUEstimator model_fn function. E.g. @@ -105279,11 +113317,8 @@ Args: Returns: Two lists of _TPUEmbeddingColumns, the first is the sequence columns and the second is the non-sequence columns." -11831,_initialized_session,tensorflow/tensorflow/python/tpu/feature_column_test.py,37,function, -11832,EmbeddingColumnTest,tensorflow/tensorflow/python/tpu/feature_column_test.py,44,class, -11833,SharedEmbeddingColumnTest,tensorflow/tensorflow/python/tpu/feature_column_test.py,168,class, -11834,EmbeddingDevice,tensorflow/tensorflow/python/tpu/feature_column_v2.py,48,class, -11835,embedding_column_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,55,function,"TPU version of `tf.compat.v1.feature_column.embedding_column`. +10928,EmbeddingDevice,tensorflow/tensorflow/python/tpu/feature_column_v2.py,48,class, +10929,embedding_column_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,55,function,"TPU version of `tf.compat.v1.feature_column.embedding_column`. Note that the interface for `tf.tpu.experimental.embedding_column` is different from that of `tf.compat.v1.feature_column.embedding_column`: The @@ -105365,7 +113400,7 @@ Returns: Raises: ValueError: if `dimension` not > 0. ValueError: if `initializer` is specified but not callable." -11836,shared_embedding_columns_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,211,function,"TPU version of `tf.compat.v1.feature_column.shared_embedding_columns`. +10930,shared_embedding_columns_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,211,function,"TPU version of `tf.compat.v1.feature_column.shared_embedding_columns`. Note that the interface for `tf.tpu.experimental.shared_embedding_columns` is different from that of `tf.compat.v1.feature_column.shared_embedding_columns`: @@ -105459,9 +113494,7 @@ Raises: as `categorical_columns`. ValueError: if `max_sequence_lengths` is positive for a non sequence column or 0 for a sequence column." -11837,_TPUEmbeddingColumnV2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,420,class,Core Embedding Column. -11838,_TPUSharedEmbeddingColumnV2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,604,class,Core Shared Embedding Column. -11839,split_sequence_columns_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,742,function,"Split a list of _TPUEmbeddingColumn into sequence and non-sequence columns. +10931,split_sequence_columns_v2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,742,function,"Split a list of _TPUEmbeddingColumn into sequence and non-sequence columns. For use in a TPUEstimator model_fn function. E.g. @@ -105480,7 +113513,7 @@ Args: Returns: Two lists of _TPUEmbeddingColumns, the first is the sequence columns and the second is the non-sequence columns." -11840,sparse_embedding_aggregate_slice,tensorflow/tensorflow/python/tpu/feature_column_v2.py,778,function,"Uses XLA's dynamic slice operations to perform embedding lookups. +10932,sparse_embedding_aggregate_slice,tensorflow/tensorflow/python/tpu/feature_column_v2.py,778,function,"Uses XLA's dynamic slice operations to perform embedding lookups. From third_party/cloud_tpu/models/movielens/tpu_embedding.py @@ -105498,7 +113531,7 @@ Returns: Raises: ValueError: Combiner is not supported." -11841,pad_sparse_embedding_lookup_indices,tensorflow/tensorflow/python/tpu/feature_column_v2.py,832,function,"Creates statically-sized Tensors containing indices and weights. +10933,pad_sparse_embedding_lookup_indices,tensorflow/tensorflow/python/tpu/feature_column_v2.py,832,function,"Creates statically-sized Tensors containing indices and weights. From third_party/cloud_tpu/models/movielens/tpu_embedding.py @@ -105517,29 +113550,27 @@ Returns: a mask the same size as the returned padded values in which 0s indicate padded locations and 1s (or values from sparse_weights) indicate actual values)" -11842,_check_invalid_cases,tensorflow/tensorflow/python/tpu/feature_column_v2.py,870,function,Checks for invalid embedding_lookup_device configurations. -11843,_TPUDeviceSpecificEmbeddingColumnV2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,884,class,TPUEmbeddingColumn which allows serving on TensorCore. -11844,_TPUSharedDeviceSpecificEmbeddingColumnV2,tensorflow/tensorflow/python/tpu/feature_column_v2.py,1011,class,TPUSharedEmbeddingColumnV2 which allows serving on TensorCore. -11845,_initialized_session,tensorflow/tensorflow/python/tpu/feature_column_v2_test.py,40,function, -11846,EmbeddingColumnTestV2,tensorflow/tensorflow/python/tpu/feature_column_v2_test.py,47,class, -11847,SharedEmbeddingColumnTestV2,tensorflow/tensorflow/python/tpu/feature_column_v2_test.py,197,class, -11848,DeviceSpecificEmbeddingColumnTestV2,tensorflow/tensorflow/python/tpu/feature_column_v2_test.py,375,class, -11849,CloudTPUPreemptedHook,tensorflow/tensorflow/python/tpu/preempted_hook.py,31,class,"The SessionRunHook for preemptible Cloud TPUs. +10934,CloudTPUPreemptedHook,tensorflow/tensorflow/python/tpu/preempted_hook.py,31,class,"The SessionRunHook for preemptible Cloud TPUs. This is an implementation of SessionRunHook for the pre-emptible Google Cloud TPU service. It attempts to close the session if the TPU is preempted, and exits the coordinator process if the session cannot be closed." -11850,_TPUPollingThread,tensorflow/tensorflow/python/tpu/preempted_hook.py,51,class,"A thread that polls the state of a TPU node. +10935,after_create_session,tensorflow/tensorflow/python/tpu/preempted_hook.py,42,method, +10936,end,tensorflow/tensorflow/python/tpu/preempted_hook.py,47,method, +10937,CoordinatorResetError,tensorflow/tensorflow/python/tpu/session_support.py,41,class,Raised when the monitored session should reset. +10938,WorkerHeartbeatManager,tensorflow/tensorflow/python/tpu/session_support.py,56,class,Manages the status/heartbeat monitor for a set of workers. +10939,from_devices,tensorflow/tensorflow/python/tpu/session_support.py,77,method,Construct a heartbeat manager for the given devices. +10940,num_workers,tensorflow/tensorflow/python/tpu/session_support.py,94,method, +10941,configure,tensorflow/tensorflow/python/tpu/session_support.py,97,method,"Configure heartbeat manager for all devices. -When the node transitions into a TERMINAL state (PREEMPTED, TERMINATED) -that's considered as not recoverable by the underlying infrastructure, -it attempts to close the session, and exits the entire process if the -session.close() stucks." -11851,CoordinatorResetError,tensorflow/tensorflow/python/tpu/session_support.py,41,class,Raised when the monitored session should reset. -11852,_clone_session,tensorflow/tensorflow/python/tpu/session_support.py,49,function, -11853,WorkerHeartbeatManager,tensorflow/tensorflow/python/tpu/session_support.py,56,class,Manages the status/heartbeat monitor for a set of workers. -11854,all_worker_devices,tensorflow/tensorflow/python/tpu/session_support.py,163,function,Return a list of devices for each worker in the system. -11855,WatchdogManager,tensorflow/tensorflow/python/tpu/session_support.py,178,class,"Configures worker watchdog timer and handles periodic pings. +Args: + message: `event_pb2.WorkerHeartbeatRequest` +Returns: `None`" +10942,ping,tensorflow/tensorflow/python/tpu/session_support.py,109,method,"Ping all workers, returning the parsed status results." +10943,lame_workers,tensorflow/tensorflow/python/tpu/session_support.py,126,method,"Ping all workers, returning manager containing lame workers (or None)." +10944,shutdown,tensorflow/tensorflow/python/tpu/session_support.py,148,method,Shutdown all workers after `shutdown_timeout_secs`. +10945,all_worker_devices,tensorflow/tensorflow/python/tpu/session_support.py,163,function,Return a list of devices for each worker in the system. +10946,WatchdogManager,tensorflow/tensorflow/python/tpu/session_support.py,178,class,"Configures worker watchdog timer and handles periodic pings. Usage: # Ping workers every minute, shutting down workers if they haven't received @@ -105554,9 +113585,12 @@ Usage: # Or setup globally; watchdog will remain active until program exit. watchdog_manager.configure_and_run()" -11856,start_worker_watchdog,tensorflow/tensorflow/python/tpu/session_support.py,287,function,Start global worker watchdog to shutdown workers on coordinator exit. -11857,stop_worker_watchdog,tensorflow/tensorflow/python/tpu/session_support.py,301,function,Stop global worker watchdog. -11858,GracefulShutdownHook,tensorflow/tensorflow/python/tpu/session_support.py,309,class,"Session hook that watches for shutdown events. +10947,configure_and_run,tensorflow/tensorflow/python/tpu/session_support.py,252,method, +10948,stop,tensorflow/tensorflow/python/tpu/session_support.py,261,method, +10949,run,tensorflow/tensorflow/python/tpu/session_support.py,273,method, +10950,start_worker_watchdog,tensorflow/tensorflow/python/tpu/session_support.py,287,function,Start global worker watchdog to shutdown workers on coordinator exit. +10951,stop_worker_watchdog,tensorflow/tensorflow/python/tpu/session_support.py,301,function,Stop global worker watchdog. +10952,GracefulShutdownHook,tensorflow/tensorflow/python/tpu/session_support.py,309,class,"Session hook that watches for shutdown events. If a shutdown is indicated, `saver.save(checkpoint_prefix)` is executed, and a SystemShutdown exception is raised to terminate the main session. If `saver` @@ -105568,19 +113602,22 @@ after checkpointing. The function is called with (`run_context`, If `heartbeat_group` is not specified, it will default to all CPU workers in the system." -11859,ResetComputation,tensorflow/tensorflow/python/tpu/session_support.py,409,class,"Hook to reset a TPUEstimator computation loop. +10953,after_create_session,tensorflow/tensorflow/python/tpu/session_support.py,335,method, +10954,saver,tensorflow/tensorflow/python/tpu/session_support.py,363,method, +10955,after_run,tensorflow/tensorflow/python/tpu/session_support.py,383,method, +10956,ResetComputation,tensorflow/tensorflow/python/tpu/session_support.py,409,class,"Hook to reset a TPUEstimator computation loop. This hook shuts down all workers and resets the monitored session loop by throwing a CoordinatorResetError." -11860,ShutdownLameWorkers,tensorflow/tensorflow/python/tpu/session_support.py,427,class,"Shutdown lamed workers. +10957,ShutdownLameWorkers,tensorflow/tensorflow/python/tpu/session_support.py,427,class,"Shutdown lamed workers. Processing will continue normally (typically by waiting for the down workers to be restarted)." -11861,ShutdownAllWorkers,tensorflow/tensorflow/python/tpu/session_support.py,441,class,"Shutdown all workers. +10958,ShutdownAllWorkers,tensorflow/tensorflow/python/tpu/session_support.py,441,class,"Shutdown all workers. Processing will continue normally (typically by waiting for the down workers to be restarted)." -11862,set_parameters,tensorflow/tensorflow/python/tpu/tensor_tracer.py,106,function,"Enables tensor tracer and sets its parameters. +10959,set_parameters,tensorflow/tensorflow/python/tpu/tensor_tracer.py,106,function,"Enables tensor tracer and sets its parameters. Example usage: tensor_tracer_parameters = {'trace_dir': '/usr/tmp/trace_dir', @@ -105685,14 +113722,14 @@ Args: - use_fingerprint_subdirectory: The trace directory will be chosen as using the fingerprint of the trace metadata under the provided trace_dir." -11863,op_priority,tensorflow/tensorflow/python/tpu/tensor_tracer.py,220,function,"Returns the priority of the op. +10960,op_priority,tensorflow/tensorflow/python/tpu/tensor_tracer.py,220,function,"Returns the priority of the op. If the priority of the op is k, it will be traced if trace_level>=k. Args: op_type: String name of the operation type. Returns: Integer value corresponding the priority of the op." -11864,read_tensor_tracer_event_file,tensorflow/tensorflow/python/tpu/tensor_tracer.py,263,function,"Reads the event file written by tensor tracer. +10961,read_tensor_tracer_event_file,tensorflow/tensorflow/python/tpu/tensor_tracer.py,263,function,"Reads the event file written by tensor tracer. This can be used to read the full tensors written into binary event files by by TensorTracer with trace_mode=full_tensor_summary. @@ -105710,7 +113747,7 @@ Returns: {step_number: {tensor_name: tensor_content}} Raises: ValueError: If an unexpected trace is found." -11865,trace_tensor,tensorflow/tensorflow/python/tpu/tensor_tracer.py,307,function,"Programmatic interface to trace a tensor with Tensor Tracer. +10962,trace_tensor,tensorflow/tensorflow/python/tpu/tensor_tracer.py,307,function,"Programmatic interface to trace a tensor with Tensor Tracer. Tensor Tracer, by default, traces all tensors in the execution. This function can be used to limit traced tensors. If this function is called for a subset @@ -105730,7 +113767,7 @@ Args: Returns: The provided tensor." -11866,keras_layer_tracepoint,tensorflow/tensorflow/python/tpu/tensor_tracer.py,337,function,"An interface for adding the tensor outputs of a keras layer. +10963,keras_layer_tracepoint,tensorflow/tensorflow/python/tpu/tensor_tracer.py,337,function,"An interface for adding the tensor outputs of a keras layer. Encapsulates trace_tensor. @@ -105742,8 +113779,7 @@ Args: Returns: The provided layer." -11867,_trace_files_need_precreated,tensorflow/tensorflow/python/tpu/tensor_tracer.py,368,function,Return True if trace files must be pre-created by users. -11868,TensorTracer,tensorflow/tensorflow/python/tpu/tensor_tracer.py,386,class,"A software construct for tracing tensor values in a TF graph. +10964,TensorTracer,tensorflow/tensorflow/python/tpu/tensor_tracer.py,386,class,"A software construct for tracing tensor values in a TF graph. This utility is disabled by default. It is hooked into tpu.rewrite, so it can easily be enabled on TPUs by setting the TENSOR_TRACER_FLAGS env variable as @@ -105776,15 +113812,143 @@ By passing options via the env variable, users can change: full tensor values) (2) which Ops to be traced (via op.name or op.type) (3) output trace file path." -11869,TTParameters,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,103,class,A class that handles the parameters of Tensor Tracer. -11870,report_proto_path,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,58,function,"Returns the path where report proto should be written. +10965,is_enabled,tensorflow/tensorflow/python/tpu/tensor_tracer.py,426,method,Returns True if TensorTracer is enabled. +10966,check_device_type,tensorflow/tensorflow/python/tpu/tensor_tracer.py,431,method,Checks if the given device type is valid. +10967,check_trace_mode,tensorflow/tensorflow/python/tpu/tensor_tracer.py,438,method,"Checks if the given trace mode work on the given device type. + +Args: + device_type: Device type, TPU, GPU, CPU. + trace_mode: Tensor tracer trace mode. +Raises: + ValueError: If the given trace mode is not supported for the device." +10968,loop_cond_op,tensorflow/tensorflow/python/tpu/tensor_tracer.py,453,method, +10969,while_loop_op,tensorflow/tensorflow/python/tpu/tensor_tracer.py,457,method,"Returns true if op is one of the special ops of in a while loop. + +Args: + op: A tf.Operation. + +Returns: + True if the given op is one of [Switch, Merge, Enter, Exit, + NextIteration, LoopCond], which are all building blocks for TF while + loops." +10970,control_flow_op,tensorflow/tensorflow/python/tpu/tensor_tracer.py,476,method,"Returns true if op is one of the special ops of in a while loop. + +Args: + op: A tf.Operation. + +Returns: + True if the given op is one of [Switch, Merge, Enter, Exit, + NextIteration, LoopCond], which are all building blocks for TF while + loops." +10971,unsafe_op,tensorflow/tensorflow/python/tpu/tensor_tracer.py,491,method,Returns True if this op is not safe to be traced. +10972,device_mismatch,tensorflow/tensorflow/python/tpu/tensor_tracer.py,501,method, +10973,unsafe_scalar_trace,tensorflow/tensorflow/python/tpu/tensor_tracer.py,509,method,Return true if scalar output tensor from Op is not safe to be traced. +10974,reason,tensorflow/tensorflow/python/tpu/tensor_tracer.py,535,method,Returns reason why the Op at op_idx is traced or not. +10975,report_proto,tensorflow/tensorflow/python/tpu/tensor_tracer.py,555,method,"Getter for tensor_tracer.proto object for summary and full_tensor_summary modes. + +Returns: + A tensor_tracer.proto object. +Raises: + ValueError if called before tracing happens, or when trace mode is not + summary or full_tensor_summary." +10976,report_proto_path,tensorflow/tensorflow/python/tpu/tensor_tracer.py,571,method,"Getter for path where tensor_tracer.proto object should be written. + +Returns: + A string path." +10977,merge_caches_on_tpu,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1564,method,"Merges the given caches on tpu. + +Args: + local_tpu_cache_tensor: A local tensor that needs to be merged + by concanting data from other tpu cores. +Returns: + A merged tf.Tensor. +Raises: + RuntimeError: if there is no aggregate function defined for a signature." +10978,aggregate_global_cache,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1588,method,"Merges the given caches on tpu. + +Args: + global_tt_summary_cache: The global tensor tracer summary cache tensor + with shape (num_cores, num_traced_tensors, num_traced_signatures). First + dimension corresponds to core_id, where global_tpu_cache_tensor[i] + correspond to the local cache from core-i. +Returns: + An aggregated tf.Tensor. +Raises: + RuntimeError: if there is no aggregate function defined for a signature." +10979,host_call_deps_and_fn,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1723,method, +10980,get_traced_op_names,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1726,method,Returns the set of traced op names. +10981,trace_tpu,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1936,method,"Traces the tensors generated by TPU Ops in a TF graph. + +Args: + graph: the graph of Ops executed on the TPU. + tensor_fetches: a (list,tuple,or a single object) of tensor fetches + returned by model_fn given to session.run. Function must be provided + with as least one tensor to fetch. + op_fetches: A list of op fetches returned by model_fn given to + session.run. op_fetches and tensor_fetches are used to determine the + nodes that will be executed. Can be None. + num_replicas: number of replicas used on the TPU. + num_replicas_per_host: number of replicas per TPU host. + num_hosts: total number of TPU hosts. + +Returns: + tensor_fetches: an exact copy of tensor_fetches that has additional + dependencies. +Raises: + RuntimeError: If num_replicas_per_host > 8. + RuntimeError: If tensor_fetches is None or empty." +10982,trace_cpu,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1995,method,"Traces the tensors generated by CPU Ops in a TF graph. + +Args: + graph: the graph of Ops executed on the CPU. + tensor_fetches: a (list,tuple,or a single object) of tensor fetches + returned by model_fn given to session.run. Function must be provided + with as least one tensor to fetch. + op_fetches: A list of op fetches returned by model_fn given to + session.run. op_fetches and tensor_fetches are used to determine the + nodes that will be executed. Can be None. + +Returns: + tensor_fetches: an exact copy of tensor_fetches that has additional + dependencies. +Raises: + RuntimeError: If tensor_fetches is None or empty." +10983,tpu_wrap_trace_fn,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1852,method,Wraps the trace_fn with outside compilation if on TPUs. +10984,conditional_trace_fn,tensorflow/tensorflow/python/tpu/tensor_tracer.py,1861,method,Creates a cond op that traces the out_tensor if predicate is satisfied. +10985,TTParameters,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,103,class,A class that handles the parameters of Tensor Tracer. +10986,is_brief_mode,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,217,method, +10987,match_next_flag,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,236,method,"Returns the match for the next TensorTracer flag. + +Args: + flags: a string that contains the flags. + pos: where in flags to start the search. + +Returns: + A pair where the first element is the regular-expression + match found and the second element indicates if the match + has a value." +10988,get_signature_to_agg_fn_map,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,322,method,Returns a map that contains the aggregate function for each signature. +10989,get_flag_value,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,392,method,"Returns the value of a TensorTracer flags. + +Args: + wanted_flag_name: the name of the flag we are looking for. + +Returns: + A pair where the first element indicates if the flag is + found and the second element is the value of the flag. + +Raises: + RuntimeError: If supposedly deadcode is reached." +10990,is_flag_on,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,438,method,Returns True if the given flag is on. +10991,is_enabled,tensorflow/tensorflow/python/tpu/tensor_tracer_flags.py,451,method,Returns True if TensorTracer is enabled. +10992,report_proto_path,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,58,function,"Returns the path where report proto should be written. Args: trace_dir: String denoting the trace directory. Returns: A string denoting the path to the report proto." -11871,topological_sort,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,70,function,"Performs topological sort on the given graph. +10993,topological_sort,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,70,function,"Performs topological sort on the given graph. Args: g: the graph. @@ -105794,21 +113958,72 @@ Returns: sort succeeded (True if there is no cycle found; False if a cycle is found) and the second element is either the sorted list of nodes or the cycle of nodes found." -11872,TensorTracerConfig,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,136,class,Tensor Tracer config object. -11873,TensorTraceOrder,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,147,class,Class that is responsible from storing the trace-id of the tensors. -11874,sort_tensors_and_ops,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,178,function,Returns a wrapper that has consistent tensor and op orders. -11875,OpenReportFile,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,203,class,Context manager for writing report file. -11876,proto_fingerprint,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,223,function, -11877,TTReportHandle,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,229,class,Utility class responsible from creating a tensor tracer report. -11878,_tpu_device_name,tensorflow/tensorflow/python/tpu/topology.py,28,function,Returns the device name for the TPU `device` on `task` of `job`. -11879,_tpu_host_device_name,tensorflow/tensorflow/python/tpu/topology.py,36,function,Returns the device name for the CPU device on `task` of `job`. -11880,Topology,tensorflow/tensorflow/python/tpu/topology.py,45,class,"Describes a set of TPU devices. +10994,TensorTracerConfig,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,136,class,Tensor Tracer config object. +10995,TensorTraceOrder,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,147,class,Class that is responsible from storing the trace-id of the tensors. +10996,sort_tensors_and_ops,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,178,function,Returns a wrapper that has consistent tensor and op orders. +10997,OpenReportFile,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,203,class,Context manager for writing report file. +10998,proto_fingerprint,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,223,function, +10999,TTReportHandle,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,229,class,Utility class responsible from creating a tensor tracer report. +11000,instrument,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,236,method, +11001,instrument_op,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,239,method, +11002,instrument_tensor,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,242,method, +11003,create_report_proto,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,245,method,"Creates and returns a proto that stores tensor tracer configuration. + +Args: + tt_config: TensorTracerConfig object holding information about the run + environment (device, # cores, # hosts), and tensor tracer version + information. + tt_parameters: TTParameters objects storing the user provided parameters + for tensor tracer. + tensor_trace_order: TensorTraceOrder object storing a topological order of + the graph. + tensor_trace_points: Progromatically added trace_points/checkpoints. + collected_signature_types: The signature types collected, e,g, norm, + max, min, mean... +Returns: + TensorTracerReport proto." +11004,write_report_proto,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,307,method,Writes the given report proto under trace_dir. +11005,create_report,tensorflow/tensorflow/python/tpu/tensor_tracer_report.py,314,method,Creates a report file and writes the trace information. +11006,Topology,tensorflow/tensorflow/python/tpu/topology.py,45,class,"Describes a set of TPU devices. Represents both the shape of the physical mesh, and the mapping between TensorFlow TPU devices to physical mesh coordinates." -11881,TopologyTest,tensorflow/tensorflow/python/tpu/topology_test.py,26,class, -11882,_tpu_system_device_name,tensorflow/tensorflow/python/tpu/tpu.py,90,function,Returns the device name for the TPU_SYSTEM device of `job`. -11883,initialize_system,tensorflow/tensorflow/python/tpu/tpu.py,99,function,"Initializes a distributed TPU system for use with TensorFlow. +11007,mesh_shape,tensorflow/tensorflow/python/tpu/topology.py,150,method,A rank 1 int32 array describing the shape of the TPU topology. +11008,mesh_rank,tensorflow/tensorflow/python/tpu/topology.py,155,method,Returns the number of dimensions in the mesh. +11009,device_coordinates,tensorflow/tensorflow/python/tpu/topology.py,160,method,"Describes the mapping from TPU devices to topology coordinates. + +Returns: + A rank 3 int32 array with shape `[tasks, devices, axis]`. + `tasks` is the number of tasks in the TPU cluster, `devices` is the number + of TPU devices per task, and `axis` is the number of axes in the TPU + cluster topology. Each entry gives the `axis`-th coordinate in the + topology of a task/device pair. TPU topologies are 4-dimensional, with + dimensions `(x, y, z, core number)`." +11010,missing_devices,tensorflow/tensorflow/python/tpu/topology.py,174,method,Array of indices of missing devices. +11011,task_ordinal_at_coordinates,tensorflow/tensorflow/python/tpu/topology.py,178,method,"Returns the TensorFlow task number attached to `device_coordinates`. + +Args: + device_coordinates: An integer sequence describing a device's physical + coordinates in the TPU fabric. + +Returns: + Returns the TensorFlow task number that contains the TPU device with those + physical coordinates." +11012,tpu_device_ordinal_at_coordinates,tensorflow/tensorflow/python/tpu/topology.py,191,method,"Returns the TensorFlow device number at `device_coordinates`. + +Args: + device_coordinates: An integer sequence describing a device's physical + coordinates in the TPU fabric. + +Returns: + Returns the TensorFlow device number within the task corresponding to + attached to the device with those physical coordinates." +11013,cpu_device_name_at_coordinates,tensorflow/tensorflow/python/tpu/topology.py,204,method,Returns the CPU device attached to a logical core. +11014,tpu_device_name_at_coordinates,tensorflow/tensorflow/python/tpu/topology.py,209,method,Returns the name of the TPU device assigned to a logical core. +11015,num_tasks,tensorflow/tensorflow/python/tpu/topology.py,216,method,Returns the number of TensorFlow tasks in the TPU slice. +11016,num_tpus_per_task,tensorflow/tensorflow/python/tpu/topology.py,221,method,Returns the number of TPU devices per task in the TPU slice. +11017,serialized,tensorflow/tensorflow/python/tpu/topology.py,225,method,Returns the serialized form of the topology. +11018,initialize_system,tensorflow/tensorflow/python/tpu/tpu.py,99,function,"Initializes a distributed TPU system for use with TensorFlow. Args: embedding_config: If not None, a `TPUEmbeddingConfiguration` proto @@ -105823,7 +114038,7 @@ Args: Returns: A serialized `TopologyProto` that describes the TPU system. Note: the topology must be evaluated using `Session.run` before it can be used." -11884,initialize_system_for_tpu_embedding,tensorflow/tensorflow/python/tpu/tpu.py,137,function,"Initializes a distributed TPU Embedding system for use with TensorFlow. +11019,initialize_system_for_tpu_embedding,tensorflow/tensorflow/python/tpu/tpu.py,137,function,"Initializes a distributed TPU Embedding system for use with TensorFlow. The following two are equivalent: 1. initialize_system() with embedding_config. @@ -105842,25 +114057,23 @@ Args: Returns: A no-op." -11885,shutdown_system,tensorflow/tensorflow/python/tpu/tpu.py,164,function,"Shuts down a running a distributed TPU system. +11020,shutdown_system,tensorflow/tensorflow/python/tpu/tpu.py,164,function,"Shuts down a running a distributed TPU system. Args: job: The job (the XXX in TensorFlow device specification /job:XXX) that contains the TPU devices that will be shutdown. If job=None it is assumed there is only one job in the TensorFlow flock, and an error will be returned if this assumption does not hold." -11886,core,tensorflow/tensorflow/python/tpu/tpu.py,179,function,"Returns the device name for a core in a replicated TPU computation. +11021,core,tensorflow/tensorflow/python/tpu/tpu.py,179,function,"Returns the device name for a core in a replicated TPU computation. Args: num: the virtual core number within each replica to which operators should be assigned. Returns: A device name, suitable for passing to `tf.device()`." -11887,_enclosing_tpu_context_and_graph,tensorflow/tensorflow/python/tpu/tpu.py,191,function,Returns the TPUReplicateContext and its associated graph. -11888,is_tpu_strategy,tensorflow/tensorflow/python/tpu/tpu.py,208,function, -11889,_enclosing_tpu_device_assignment,tensorflow/tensorflow/python/tpu/tpu.py,214,function, -11890,tpu_replicated_input_resolver,tensorflow/tensorflow/python/tpu/tpu.py,224,function,Replaces TPUReplicatedInput outputs with its inputs in resource_inputs. -11891,TPUReplicateContext,tensorflow/tensorflow/python/tpu/tpu.py,256,class,"A `ControlFlowContext` for nodes inside a TPU computation. +11022,is_tpu_strategy,tensorflow/tensorflow/python/tpu/tpu.py,208,function, +11023,tpu_replicated_input_resolver,tensorflow/tensorflow/python/tpu/tpu.py,224,function,Replaces TPUReplicatedInput outputs with its inputs in resource_inputs. +11024,TPUReplicateContext,tensorflow/tensorflow/python/tpu/tpu.py,256,class,"A `ControlFlowContext` for nodes inside a TPU computation. The primary role of `TPUReplicateContext` is to mark operators inside a tpu.replicate() computation with the attribute ""_tpu_replicate=XYZ"", where XYZ @@ -105872,11 +114085,42 @@ with Tensorflow constructs like ResourceVariables. For example, if a `ResourceVariable` implementation can use `with ops.control_dependencies(None)` to build the variable's definition outside the replicated computation." -11892,OutsideCompilationV2Context,tensorflow/tensorflow/python/tpu/tpu.py,652,class,"The context for outside compilation in Tensorflow 2.0. +11025,get_replicated_var_handle,tensorflow/tensorflow/python/tpu/tpu.py,301,method,"Returns a variable handle for replicated TPU variable 'var'. + +This is a method used by an experimental replicated variable implementation +and is not intended as a public API. + +Args: + name: The common name of the variable. + vars_: The replicated TPU variables. + is_mirrored: Whether the variables are mirrored, which guarantees the + values in each replica are always the same. + is_packed: Whether the replicated variables are packed into one variable. + +Returns: + The handle of the TPU replicated input node." +11026,report_unsupported_operations,tensorflow/tensorflow/python/tpu/tpu.py,368,method, +11027,EnterGradientColocation,tensorflow/tensorflow/python/tpu/tpu.py,378,method, +11028,ExitGradientColocation,tensorflow/tensorflow/python/tpu/tpu.py,417,method, +11029,Enter,tensorflow/tensorflow/python/tpu/tpu.py,489,method, +11030,HostComputeCore,tensorflow/tensorflow/python/tpu/tpu.py,499,method, +11031,AddOp,tensorflow/tensorflow/python/tpu/tpu.py,526,method, +11032,AddValue,tensorflow/tensorflow/python/tpu/tpu.py,605,method,Add `val` to the current context and its outer context recursively. +11033,AddInnerOp,tensorflow/tensorflow/python/tpu/tpu.py,622,method, +11034,grad_state,tensorflow/tensorflow/python/tpu/tpu.py,628,method, +11035,back_prop,tensorflow/tensorflow/python/tpu/tpu.py,636,method,"Forwards to the enclosing while context, if any." +11036,GetControlPivot,tensorflow/tensorflow/python/tpu/tpu.py,642,method, +11037,RequiresUniqueFunctionRetracing,tensorflow/tensorflow/python/tpu/tpu.py,645,method, +11038,type,tensorflow/tensorflow/python/tpu/tpu.py,447,method, +11039,device,tensorflow/tensorflow/python/tpu/tpu.py,451,method, +11040,OutsideCompilationV2Context,tensorflow/tensorflow/python/tpu/tpu.py,652,class,"The context for outside compilation in Tensorflow 2.0. Every op added in this context will be assigned an _xla_outside_compilation attribute." -11893,outside_compilation,tensorflow/tensorflow/python/tpu/tpu.py,684,function,"Builds part of a computation outside any current TPU replicate scope. +11041,AddOp,tensorflow/tensorflow/python/tpu/tpu.py,663,method, +11042,AddInnerOp,tensorflow/tensorflow/python/tpu/tpu.py,671,method, +11043,to_control_flow_context_def,tensorflow/tensorflow/python/tpu/tpu.py,679,method, +11044,outside_compilation,tensorflow/tensorflow/python/tpu/tpu.py,684,function,"Builds part of a computation outside any current TPU replicate scope. `tf.tpu.outside_compilation()` is used to run ops in `computation` on CPU instead of running on TPU. For example, users can run ops that are not @@ -105938,14 +114182,14 @@ Args: Returns: The Tensors returned by computation." -11894,PaddingSpec,tensorflow/tensorflow/python/tpu/tpu.py,806,class,Represents the type of padding policies for tpu.replicate. -11895,XLAOptions,tensorflow/tensorflow/python/tpu/tpu.py,816,class,"XLA compilation options. +11045,PaddingSpec,tensorflow/tensorflow/python/tpu/tpu.py,806,class,Represents the type of padding policies for tpu.replicate. +11046,XLAOptions,tensorflow/tensorflow/python/tpu/tpu.py,816,class,"XLA compilation options. Attributes: use_spmd_for_xla_partitioning: Boolean. Whether to use XLA's SPMD partitioner instead of MPMD partitioner when compiler partitioning is requested." -11896,replicate,tensorflow/tensorflow/python/tpu/tpu.py,833,function,"Builds a graph operator that runs a replicated TPU computation. +11047,replicate,tensorflow/tensorflow/python/tpu/tpu.py,833,function,"Builds a graph operator that runs a replicated TPU computation. Example for the basic usage that `inputs` has static shape: @@ -106031,59 +114275,7 @@ Raises: given in `maximum_shapes`. ValueError: If the structure of inputs per replica does not match the structure of `maximum_shapes`." -11897,_ceil_to_pow_of_n,tensorflow/tensorflow/python/tpu/tpu.py,939,function,Ceil input `x` to power of `n`. -11898,_pad_all_input,tensorflow/tensorflow/python/tpu/tpu.py,949,function,"Pad all input tensors given padded_shapes. - -The real shape tensors will be concatenated with the padded original inputs. - -Args: - inputs: The original inputs. - padded_shapes: A list of padded shapes for each input. If an entry is None, - no padding is performed. - padding_spec: An enum specified by `tpu.PaddingSpec`. This describes the - padding policy when the `inputs` to `tf.tpu.replicate` is dynamic. - One usage is to enable automatic bucketizing on the inputs by setting the - value to `tpu.PaddingSpec.POWER_OF_TWO`, which can help to reduce the - recompilation in the XLA side. - -Returns: - The padded inputs and a PaddingMap list which maps the padded input - dimension to the real shape argument index." -11899,_flatten_and_filter_composite,tensorflow/tensorflow/python/tpu/tpu.py,1076,function,"For an input, replaced the input by a tuple if the input is composite. - -If `maybe_composite` is not composite, return the parameter -`non_composite_output` otherwise return a tuple which consists of the value of -the parameter `composite_output` the same number of times as there are -components of the composite tensor. - -This is useful for computing a mask when flattening nested data with -`expand_composites=True`. For example - -```python -nest.flatten(data, expand_composites=True) -``` - -and - -```python -nest.flatten(nest.map( - data, lambda x: _flatten_and_filter_composite(x, False, True))) -``` - -will have the same length and second will be True if the tensor in the first -is derived from a expanding a composite tensor. - -Args: - maybe_composite: A value to test for being a composite tensor. - non_composite_output: The value to return when `maybe_composite` is not a - composite. - composite_output: the value to fill the output tuple with if - `maybe_composite` is a composite. - -Returns: - `non_composite_output` or a tuple with multiple copies of - `composite_output`." -11900,split_compile_and_replicate,tensorflow/tensorflow/python/tpu/tpu.py,1121,function,"Builds graph operators that runs compilation and replicated computation. +11048,split_compile_and_replicate,tensorflow/tensorflow/python/tpu/tpu.py,1121,function,"Builds graph operators that runs compilation and replicated computation. This is a lower level interface than replicate that returns a separate compile and execute output tensor. In the generated graph the compile op feeds into @@ -106138,26 +114330,7 @@ Raises: given in `maximum_shapes`. ValueError: If the structure of inputs per replica does not match the structure of `maximum_shapes`." -11901,_postprocess_flat_outputs,tensorflow/tensorflow/python/tpu/tpu.py,1485,function,"Validates non-flat outputs, add backs device assignments and other attrs. - -Args: - outputs: Output from `computation` inside `tpu.rewrite`. - -Returns: - - Tensors extracted from outputs. - - Operations extracted from outputs. - - A pack template for use with nest.pack_sequence_as to pack the tensors." -11902,_postprocess_non_flat_outputs,tensorflow/tensorflow/python/tpu/tpu.py,1561,function,"Validates non-flat outputs, add backs device assignments and other attrs. - -Args: - outputs: Output from `computation` inside `tpu.rewrite`. - -Returns: - - Tensors extracted from outputs. - - An empty Operations list because Operations are not allowed in non-flat - outputs. - - A pack template for use with nest.pack_sequence_as to pack the tensors." -11903,split_compile_and_shard,tensorflow/tensorflow/python/tpu/tpu.py,1609,function,"Shards `computation` for parallel execution. +11049,split_compile_and_shard,tensorflow/tensorflow/python/tpu/tpu.py,1609,function,"Shards `computation` for parallel execution. `inputs` must be a list of Tensors or None (equivalent to an empty list), each of which has a corresponding split axis (from `input_shard_axes`). Each input @@ -106214,7 +114387,7 @@ Raises: ValueError: If num_shards <= 0 ValueError: If len(input_shard_axes) != len(inputs) ValueError: If len(output_shard_axes) != len(outputs from `computation`)" -11904,shard,tensorflow/tensorflow/python/tpu/tpu.py,1764,function,"Shards `computation` for parallel execution. +11050,shard,tensorflow/tensorflow/python/tpu/tpu.py,1764,function,"Shards `computation` for parallel execution. `inputs` must be a list of Tensors or None (equivalent to an empty list), each of which has a corresponding split axis (from `input_shard_axes`). Each input @@ -106274,7 +114447,7 @@ Raises: ValueError: If num_shards <= 0 ValueError: If len(input_shard_axes) != len(inputs) ValueError: If len(output_shard_axes) != len(outputs from `computation`)" -11905,batch_parallel,tensorflow/tensorflow/python/tpu/tpu.py,1849,function,"Shards `computation` along the batch dimension for parallel execution. +11051,batch_parallel,tensorflow/tensorflow/python/tpu/tpu.py,1849,function,"Shards `computation` along the batch dimension for parallel execution. Convenience wrapper around shard(). @@ -106316,7 +114489,7 @@ Returns: A list of output tensors. Raises: ValueError: If `num_shards <= 0`" -11906,rewrite,tensorflow/tensorflow/python/tpu/tpu.py,1910,function,"Rewrites `computation` for execution on a TPU system. +11052,rewrite,tensorflow/tensorflow/python/tpu/tpu.py,1910,function,"Rewrites `computation` for execution on a TPU system. Args: computation: A Python function that builds a computation to apply to the @@ -106354,13 +114527,8 @@ Returns: 3) Operation-only outputs: a NoOp would be returned which control-depends on computation. TODO(b/121383831): Investigate into removing these special cases." -11907,under_tpu_inference_context,tensorflow/tensorflow/python/tpu/tpu.py,1980,function,Check if it is currently under `_TPUInferenceContext`. -11908,_TPUInferenceContext,tensorflow/tensorflow/python/tpu/tpu.py,1997,class,"A `ControlFlowContext` for nodes inside a TPU inference computation. - -The primary role of `_TPUInferenceContext` is to indicate the mode of -operation and possibly sanity check operators inside a -tpu.rewrite_for_inference() computation." -11909,validate_inference_rewrite_for_variables,tensorflow/tensorflow/python/tpu/tpu.py,2037,function,"Validates whether rewrite_for_inference() 'worked' for variables. +11053,under_tpu_inference_context,tensorflow/tensorflow/python/tpu/tpu.py,1980,function,Check if it is currently under `_TPUInferenceContext`. +11054,validate_inference_rewrite_for_variables,tensorflow/tensorflow/python/tpu/tpu.py,2037,function,"Validates whether rewrite_for_inference() 'worked' for variables. The rewrite_for_inference() method is supposed to append GuaranteeConstOps after ReadVariableOps, but this mechanism works only if you are using @@ -106379,7 +114547,7 @@ Args: graph: The graph which needs to be validated. Raises: RuntimeError: if validation failed." -11910,rewrite_for_inference,tensorflow/tensorflow/python/tpu/tpu.py,2066,function,"Rewrites `computation` for inference on a TPU system. +11055,rewrite_for_inference,tensorflow/tensorflow/python/tpu/tpu.py,2066,function,"Rewrites `computation` for inference on a TPU system. Other than 'rewriting' the computation to run on a TPU, if using variables in your computation, it moves the ReadVariableOps outside the TPU @@ -106405,7 +114573,7 @@ Args: name: The name of the operator. Returns: A list of output tensors." -11911,prune_unconnected_ops_from_xla,tensorflow/tensorflow/python/tpu/tpu.py,2135,function,"Prunes unconnected ops as listed in _UNCONNECTED_OPS_TO_PRUNE. +11056,prune_unconnected_ops_from_xla,tensorflow/tensorflow/python/tpu/tpu.py,2135,function,"Prunes unconnected ops as listed in _UNCONNECTED_OPS_TO_PRUNE. Args: prune_graph: A tensorflow graph from which we wish to prune unconnected ops @@ -106414,11 +114582,13 @@ Args: construction rewiring (for instance TF-Hub). While they never execute, they will cause XLA compile to fail so we strip them from XLA compile by removing the tpu_replicate attribute." -11912,TableConfig,tensorflow/tensorflow/python/tpu/tpu_embedding.py,51,class,Embedding table configuration. -11913,FeatureConfig,tensorflow/tensorflow/python/tpu/tpu_embedding.py,144,class,Feature configuration. -11914,EnqueueData,tensorflow/tensorflow/python/tpu/tpu_embedding.py,179,class,Data to be enqueued through generate_enqueue_ops(). -11915,RaggedEnqueueData,tensorflow/tensorflow/python/tpu/tpu_embedding.py,221,class,RaggedTensor Data to be enqueued through generate_enqueue_ops(). -11916,get_enqueue_datas_list_from_sparse_tensors_list,tensorflow/tensorflow/python/tpu/tpu_embedding.py,263,function,"Convenient function for generate_enqueue_ops(). +11057,TableConfig,tensorflow/tensorflow/python/tpu/tpu_embedding.py,51,class,Embedding table configuration. +11058,FeatureConfig,tensorflow/tensorflow/python/tpu/tpu_embedding.py,144,class,Feature configuration. +11059,EnqueueData,tensorflow/tensorflow/python/tpu/tpu_embedding.py,179,class,Data to be enqueued through generate_enqueue_ops(). +11060,from_sparse_tensor,tensorflow/tensorflow/python/tpu/tpu_embedding.py,214,method, +11061,RaggedEnqueueData,tensorflow/tensorflow/python/tpu/tpu_embedding.py,221,class,RaggedTensor Data to be enqueued through generate_enqueue_ops(). +11062,from_ragged_tensor,tensorflow/tensorflow/python/tpu/tpu_embedding.py,256,method, +11063,get_enqueue_datas_list_from_sparse_tensors_list,tensorflow/tensorflow/python/tpu/tpu_embedding.py,263,function,"Convenient function for generate_enqueue_ops(). Args: sp_tensors_list: a list of dictionary mapping from string of feature names @@ -106430,7 +114600,7 @@ Returns: of feature names to EnqueueData. Each dictionary is for one TPU core. Dictionaries for the same host should be contiguous on the list." -11917,get_enqueue_datas_list_from_ragged_tensors_list,tensorflow/tensorflow/python/tpu/tpu_embedding.py,287,function,"Convenient function for generate_enqueue_ops(). +11064,get_enqueue_datas_list_from_ragged_tensors_list,tensorflow/tensorflow/python/tpu/tpu_embedding.py,287,function,"Convenient function for generate_enqueue_ops(). Args: rg_tensors_list: a list of dictionary mapping from string of feature names @@ -106442,8 +114612,7 @@ Returns: of feature names to RaggedEnqueueData. Each dictionary is for one TPU core. Dictionaries for the same host should be contiguous on the list." -11918,_OptimizationParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,348,class,Parameters common to all optimizations. -11919,AdagradParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,364,class,"Optimization parameters for Adagrad with TPU embeddings. +11065,AdagradParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,364,class,"Optimization parameters for Adagrad with TPU embeddings. Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. @@ -106458,13 +114627,13 @@ estimator = tf.estimator.tpu.TPUEstimator( optimization_parameters=tf.tpu.experimental.AdagradParameters(0.1), ...)) ```" -11920,ProximalAdagradParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,416,class,"Optimization parameters for ProximalAdagrad with TPU embeddings. +11066,ProximalAdagradParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,416,class,"Optimization parameters for ProximalAdagrad with TPU embeddings. Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` for more details." -11921,AdamParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,474,class,"Optimization parameters for Adam with TPU embeddings. +11067,AdamParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,474,class,"Optimization parameters for Adam with TPU embeddings. Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. @@ -106479,7 +114648,7 @@ estimator = tf.estimator.tpu.TPUEstimator( optimization_parameters=tf.tpu.experimental.AdamParameters(0.1), ...)) ```" -11922,FtrlParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,551,class,"Optimization parameters for Ftrl with TPU embeddings. +11068,FtrlParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,551,class,"Optimization parameters for Ftrl with TPU embeddings. Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. @@ -106494,7 +114663,7 @@ estimator = tf.estimator.tpu.TPUEstimator( optimization_parameters=tf.tpu.experimental.FtrlParameters(0.1), ...)) ```" -11923,ProximalYogiParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,633,class,"Optimization parameters for Proximal Yogi with TPU embeddings. +11069,ProximalYogiParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,633,class,"Optimization parameters for Proximal Yogi with TPU embeddings. Implements the Yogi optimizer as described in [Adaptive Methods for Nonconvex Optimization](https://papers.nips.cc/paper/8186-adaptive-methods-for-nonconvex-optimization). @@ -106503,7 +114672,7 @@ Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` for more details." -11924,StochasticGradientDescentParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,711,class,"Optimization parameters for stochastic gradient descent for TPU embeddings. +11070,StochasticGradientDescentParameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,711,class,"Optimization parameters for stochastic gradient descent for TPU embeddings. Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the `optimization_parameters` argument to set the optimizer and its parameters. @@ -106518,7 +114687,7 @@ estimator = tf.estimator.tpu.TPUEstimator( optimization_parameters=( tf.tpu.experimental.StochasticGradientDescentParameters(0.1)))) ```" -11925,TPUEmbedding,tensorflow/tensorflow/python/tpu/tpu_embedding.py,757,class,"API for using TPU for embedding. +11071,TPUEmbedding,tensorflow/tensorflow/python/tpu/tpu_embedding.py,757,class,"API for using TPU for embedding. Example: ``` @@ -106614,32 +114783,113 @@ Example with weight decay: ... init_tpu_op = tf.compat.v1.tpu.initialize_system( ... embedding_config=tpu_embedding.config_proto) ... tf.compat.v1.Session().run(init_tpu_op)" -11926,_validate_table_to_config_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1559,function,Validate `table_to_config_dict`. -11927,_validate_feature_to_config_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1567,function,Validate `feature_to_config_dict`. -11928,_validate_batch_size,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1587,function, -11929,_validate_optimization_parameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1594,function,"Validate global optimization_parameters and per table optimizers. +11072,hosts,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1011,method,"A list of device names for CPU hosts. -If global optimizer is `None`, all table optimizers should be non `None`. +Returns: + A list of device names for CPU hosts." +11073,num_cores_per_host,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1022,method,"Number of TPU cores on a CPU host. + +Returns: + Number of TPU cores on a CPU host." +11074,num_cores,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1031,method,"Total number of TPU cores on all hosts. + +Returns: + Total number of TPU cores on all hosts." +11075,batch_size_per_core,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1040,method,"Batch size for each TPU core. + +The sparse tensors in `sparse_features_list` to `generate_enqueue_ops` + must have batch dimension equal to this. + +Returns: + Batch size for each TPU core." +11076,config_proto,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1052,method,"Create embedding config proto for `tpu.initialize_system()`. + +Returns: + an `TPUEmbeddingConfiguration` proto describing the desired + configuration of the hardware embedding lookup tables, which + is passed to `tpu.initialize_system()`." +11077,table_to_config_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1063,method, +11078,feature_to_config_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1067,method, +11079,table_to_features_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1071,method, +11080,optimization_parameters,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1075,method, +11081,create_variables_and_ops,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1141,method,"Create embedding and slot variables, with ops to load and retrieve them. + +N.B.: the retrieve embedding variables (including slot variables) ops are +returned as lambda fn, as the call side might want to impose control +dependencies between the TPU computation and retrieving actions. For +example, the following code snippet ensures the TPU computation finishes +first, and then we pull the variables back from TPU to CPU. + +``` +updates_ops = [] +with ops.control_dependencies([loss]): + for op_fn in retrieve_parameters_op_fns: + update_ops.append(op_fn()) +``` Args: - optimization_parameters: global optimizer provided in `TPUEmbedding` - constructor. - table_to_config_dict: A dictionary mapping from string of table name to - `TableConfig`." -11930,_OptimizerHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1625,class,Interface class for handling optimizer specific logic. -11931,_AdagradHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1645,class,Handles Adagrad specific logic. -11932,_ProximalAdagradHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1717,class,Handles ProximalAdagrad specific logic. -11933,_AdamHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1794,class,Handles Adam specific logic. -11934,_FtrlHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1889,class,Handles Ftrl specific logic. -11935,_ProximalYogiHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1987,class,Handles Proximal Yogi specific logic. -11936,_StochasticGradientDescentHandler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2083,class,Handles stochastic gradient descent specific logic. -11937,_get_optimization_handler,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2146,function,Gets the optimization handler given the parameter type. -11938,_create_ordered_dict,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2163,function,Create an OrderedDict from Dict. -11939,_create_combiners,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2168,function,"Create a per feature list of combiners, ordered by table." -11940,_create_table_to_features_and_num_features_dicts,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2177,function,Create mapping from table to a list of its features. -11941,_create_device_fn,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2203,function,Create device_fn() to use with _create_partitioned_variables(). -11942,_create_partitioned_variables,tensorflow/tensorflow/python/tpu/tpu_embedding.py,2227,function,Creates PartitionedVariables based on `num_hosts` for `table`. -11943,get_gradients_through_compute_gradients,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,32,function,"Compute gradients to send to TPU embedding. + embedding_variable_name_by_table: A dictionary mapping from string of + table name to string of embedding variable name. If `None`, + defaults from `get_default_slot_variable_names()` will be used. + slot_variable_names_by_table: A dictionary mapping from string of table + name to `AdamSlotVariableNames`, `AdagradSlotVariableNames` etc. If + `None`, defaults from `get_default_slot_variable_names()` will be used. + +Returns: + `tpu_embedding.VariablesAndOps` with: + A dictionary mapping from string of table name to embedding variables, + A dictionary mapping from string of table name to AdagradSlotVariable, + AdamSlotVariables etc with slot variables, + A function which returns a list of ops to load embedding and slot + variables from CPU to TPU. + A function which returns a list of ops to retrieve embedding and slot + variables from TPU to CPU." +11082,generate_enqueue_ops,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1248,method,"Generate enqueue ops. + +Args: + enqueue_datas_list: a list of dictionary mapping from string + of feature names to EnqueueData. Each dictionary is for one + TPU core. Dictionaries for the same host should be contiguous + on the list. + mode_override: A string input that overrides the mode specified in the + TPUEmbeddingConfiguration. Supported values are {'unspecified', + 'inference', 'training', 'backward_pass_only'}. When set to + 'unspecified', the mode set in TPUEmbeddingConfiguration is used, + otherwise mode_override is used (optional). + ragged: If True, creates RaggedTensor enqueue ops rather than + SparseTensor. + +Returns: + Ops to enqueue to TPU for embedding." +11083,get_activations,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1469,method,"Get activations for features. + +This should be called within `computation` that is passed to + `tpu.replicate` and friends. + +Returns: + A dictionary mapping from `String` of feature name to `Tensor` + of activation." +11084,generate_send_gradients_op,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1503,method,"Send gradient to TPU embedding. + +Args: + feature_to_gradient_dict: dict mapping feature names to gradient wrt + activations. + step: the current global step, used for dynamic learning rate. + +Returns: + SendTPUEmbeddingGradients Op. + +Raises: + RuntimeError: If `mode` is not `TRAINING`." +11085,load_ops,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1222,method,"Calls and returns the load ops for each embedding table. + +Returns: + A list of ops to load embedding and slot variables from CPU to TPU." +11086,retrieve_ops,tensorflow/tensorflow/python/tpu/tpu_embedding.py,1233,method,"Calls and returns the retrieve ops for each embedding table. + +Returns: + A list of ops to retrieve embedding and slot variables from TPU to CPU." +11087,get_gradients_through_compute_gradients,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,32,function,"Compute gradients to send to TPU embedding. Args: optimizer: a subclass of optimizer.Optimizer, usually CrossShardOptimizer. @@ -106650,7 +114900,7 @@ Args: Returns: An OrderedDict mapping from feature name Strings to Tensors of gradients of the loss wrt the activations of the features." -11944,create_dummy_table_variables,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,53,function,"Create dummy embedding table variables. +11088,create_dummy_table_variables,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,53,function,"Create dummy embedding table variables. The sole purpose of these dummy variables are to trigger gradient calculation wrt them so that the gradients wrt activation can be captured @@ -106666,7 +114916,7 @@ Returns: Raises: RuntimeError: if collection to store gradients already exists and is not empty." -11945,hook_dummy_table_variables_to_activations,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,103,function,"Have activations depend on dummy table variables for gradient intercept. +11089,hook_dummy_table_variables_to_activations,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,103,function,"Have activations depend on dummy table variables for gradient intercept. Args: tpu_embedding: TPUEmbedding, activations and dummy_table_variables are from @@ -106678,7 +114928,7 @@ Args: Returns: An OrderedDict of feature name String to activation tensors, which can be used just as the activations input." -11946,get_gradients_through_dummy_table_variables,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,129,function,"Get gradients wrt the activations of each feature. +11090,get_gradients_through_dummy_table_variables,tensorflow/tensorflow/python/tpu/tpu_embedding_gradient.py,129,function,"Get gradients wrt the activations of each feature. Args: tpu_embedding: TPUEmbedding, create dummy table variable to be used with @@ -106689,9 +114939,8 @@ Returns: Raises: ValueError: if some gradients are not defined." -11947,TPUShardedVariable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,62,class,A ShardedVariable class for TPU. -11948,_add_key_attr,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,82,function, -11949,TPUEmbedding,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,87,class,"The TPUEmbedding mid level API. +11091,TPUShardedVariable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,62,class,A ShardedVariable class for TPU. +11092,TPUEmbedding,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,87,class,"The TPUEmbedding mid level API. NOTE: When instantiated under a TPUStrategy, this class can only be created once per call to `tf.tpu.experimental.initialize_tpu_system`. If you wish to @@ -106831,18 +115080,205 @@ tables = embedding.embedding_tables You can now use table in functions like `tf.nn.embedding_lookup` to perform your embedding lookup and pass to your model." -11950,TPUEmbeddingSaveable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1203,class,Save/Restore hook to Retrieve/Load TPUEmbedding variables. -11951,_ragged_embedding_lookup_with_reduce,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1220,function,"Compute a ragged lookup followed by a reduce on axis 1. +11093,embedding_tables,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,353,method,"Returns a dict of embedding tables, keyed by `TableConfig`. -Args: - table: The embedding table. - ragged: A RaggedTensor of ids to look up. - weights: A RaggedTensor of weights (or None). - combiner: One of ""mean"", ""sum"", ""sqrtn"". +This property only works when the `TPUEmbedding` object is created under a +non-TPU strategy. This is intended to be used to for CPU based lookup when +creating a serving checkpoint. Returns: - A Tensor." -11952,cpu_embedding_lookup,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1245,function,"Uses CPU embedding lookup for embedding ids in features. + A dict of embedding tables, keyed by `TableConfig`. + +Raises: + RuntimeError: If object was created under a `TPUStrategy`." +11094,apply_gradients,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,506,method,"Applies the gradient update to the embedding tables. + +If a gradient of `None` is passed in any position of the nested structure, +then an gradient update with a zero gradient is applied for that feature. +For optimizers like SGD or Adagrad, this is the same as applying no update +at all. For lazy Adam and other sparsely applied optimizers with decay, +ensure you understand the effect of applying a zero gradient. + +```python +strategy = tf.distribute.TPUStrategy(...) +with strategy.scope(): + embedding = tf.tpu.experimental.embedding.TPUEmbedding(...) + +distributed_dataset = ( + strategy.experimental_distribute_datasets_from_function( + dataset_fn=..., + options=tf.distribute.InputOptions( + experimental_prefetch_to_device=False)) +dataset_iterator = iter(distributed_dataset) + +@tf.function +def training_step(): + def tpu_step(tpu_features): + with tf.GradientTape() as tape: + activations = embedding.dequeue() + tape.watch(activations) + + loss = ... # some computation involving activations + + embedding_gradients = tape.gradient(loss, activations) + embedding.apply_gradients(embedding_gradients) + + embedding_features, tpu_features = next(dataset_iterator) + embedding.enqueue(embedding_features, training=True) + strategy.run(tpu_step, args=(embedding_features, )) + +training_step() +``` + +Args: + gradients: A nested structure of gradients, with structure matching the + `feature_config` passed to this object. + name: A name for the underlying op. + +Raises: + RuntimeError: If called when object wasn't created under a `TPUStrategy`. + ValueError: If a non-`tf.Tensor` non-`None` gradient is passed in, or a + `tf.Tensor` of the incorrect shape is passed in. Also if + the size of any sequence in `gradients` does not match corresponding + sequence in `feature_config`. + TypeError: If the type of any sequence in `gradients` does not match + corresponding sequence in `feature_config`." +11095,dequeue,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,595,method,"Get the embedding results. + +Returns a nested structure of `tf.Tensor` objects, matching the structure of +the `feature_config` argument to the `TPUEmbedding` class. The output shape +of the tensors is `(batch_size, dim)`, where `batch_size` is the per core +batch size, `dim` is the dimension of the corresponding `TableConfig`. If +the feature's corresponding `FeatureConfig` has `max_sequence_length` +greater than 0, the output will be a sequence of shape +`(batch_size, max_sequence_length, dim)` instead. + +```python +strategy = tf.distribute.TPUStrategy(...) +with strategy.scope(): + embedding = tf.tpu.experimental.embedding.TPUEmbedding(...) + +distributed_dataset = ( + strategy.experimental_distribute_datasets_from_function( + dataset_fn=..., + options=tf.distribute.InputOptions( + experimental_prefetch_to_device=False)) +dataset_iterator = iter(distributed_dataset) + +@tf.function +def training_step(): + def tpu_step(tpu_features): + with tf.GradientTape() as tape: + activations = embedding.dequeue() + tape.watch(activations) + + loss = ... # some computation involving activations + + embedding_gradients = tape.gradient(loss, activations) + embedding.apply_gradients(embedding_gradients) + + embedding_features, tpu_features = next(dataset_iterator) + embedding.enqueue(embedding_features, training=True) + strategy.run(tpu_step, args=(embedding_features, )) + +training_step() +``` + +Args: + name: A name for the underlying op. + +Returns: + A nested structure of tensors, with the same structure as `feature_config` +passed to this instance of the `TPUEmbedding` object. + +Raises: + RuntimeError: If called when object wasn't created under a `TPUStrategy`." +11096,enqueue,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1051,method,"Enqueues id tensors for embedding lookup. + +This function enqueues a structure of features to be looked up in the +embedding tables. We expect that the batch size of each of the tensors in +features matches the per core batch size. This will automatically happen if +your input dataset is batched to the global batch size and you use +`tf.distribute.TPUStrategy`'s `experimental_distribute_dataset` +or if you use `experimental_distribute_datasets_from_function` and batch +to the per core batch size computed by the context passed to your input +function. + +```python +strategy = tf.distribute.TPUStrategy(...) +with strategy.scope(): + embedding = tf.tpu.experimental.embedding.TPUEmbedding(...) + +distributed_dataset = ( + strategy.experimental_distribute_datasets_from_function( + dataset_fn=..., + options=tf.distribute.InputOptions( + experimental_prefetch_to_device=False)) +dataset_iterator = iter(distributed_dataset) + +@tf.function +def training_step(): + def tpu_step(tpu_features): + with tf.GradientTape() as tape: + activations = embedding.dequeue() + tape.watch(activations) + + loss = ... # some computation involving activations + + embedding_gradients = tape.gradient(loss, activations) + embedding.apply_gradients(embedding_gradients) + + embedding_features, tpu_features = next(dataset_iterator) + embedding.enqueue(embedding_features, training=True) + strategy.run(tpu_step, args=(embedding_features,)) + +training_step() +``` + +NOTE: You should specify `training=True` when using +`embedding.apply_gradients` as above and `training=False` when not using +`embedding.apply_gradients` (e.g. for frozen embeddings or when doing +evaluation). + +Args: + features: A nested structure of `tf.Tensor`s, `tf.SparseTensor`s or + `tf.RaggedTensor`s, with the same structure as `feature_config`. Inputs + will be downcast to `tf.int32`. Only one type out of `tf.SparseTensor` + or `tf.RaggedTensor` is supported per call. + weights: If not `None`, a nested structure of `tf.Tensor`s, + `tf.SparseTensor`s or `tf.RaggedTensor`s, matching the above, except + that the tensors should be of float type (and they will be downcast to + `tf.float32`). For `tf.SparseTensor`s we assume the `indices` are the + same for the parallel entries from `features` and similarly for + `tf.RaggedTensor`s we assume the row_splits are the same. + training: Defaults to `True`. If `False`, enqueue the batch as inference + batch (forward pass only). Do not call `apply_gradients` when this is + `False` as this may lead to a deadlock. + name: A name for the underlying op. + +Raises: + ValueError: When called inside a strategy.run call and input is not + directly taken from the args of the `strategy.run` call. Also if + the size of any sequence in `features` does not match corresponding + sequence in `feature_config`. Similarly for `weights`, if not `None`. + RuntimeError: When called inside a strategy.run call and inside XLA + control flow. + TypeError: If the type of any sequence in `features` does not match + corresponding sequence in `feature_config`. Similarly for `weights`, if + not `None`." +11097,create_variables,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,713,method,Create all variables. +11098,select_fn,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,764,method, +11099,factory,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,823,method, +11100,check_device,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1028,method, +11101,getter,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,717,method, +11102,variable_creator,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,723,method, +11103,slot_creator,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,738,method, +11104,generate_enqueue_ops,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1148,method,Generate enqueue ops for outside compilation. +11105,load_config,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,338,method, +11106,TPUEmbeddingSaveable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1203,class,Save/Restore hook to Retrieve/Load TPUEmbedding variables. +11107,before_save,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1211,method, +11108,after_restore,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1215,method, +11109,cpu_embedding_lookup,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1245,function,"Uses CPU embedding lookup for embedding ids in features. Args: inputs: a nested structure of Tensors, SparseTensors or RaggedTensors. @@ -106854,14 +115290,14 @@ Args: Returns: A nested structure of Tensors with the same structure as inputs." -11953,get_list_of_hosts,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1302,function,"Returns a sorted list of CPU devices for the remote jobs. +11110,get_list_of_hosts,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1302,function,"Returns a sorted list of CPU devices for the remote jobs. Args: strategy: A TPUStrategy object. Returns: A sort list of device strings." -11954,extract_variable_info,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1321,function,"Extracts the variable creation attributes from the kwargs. +11111,extract_variable_info,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1321,function,"Extracts the variable creation attributes from the kwargs. Args: kwargs: a dict of keyword arguments that were passed to a variable creator @@ -106869,46 +115305,25 @@ Args: Returns: A tuple of variable name, initialization function, shape, and dtype." -11955,make_sharded_variable_creator,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1355,function,"Makes a sharded variable creator given a list of hosts. +11112,make_sharded_variable_creator,tensorflow/tensorflow/python/tpu/tpu_embedding_v2.py,1355,function,"Makes a sharded variable creator given a list of hosts. Args: hosts: a list of tensorflow devices on which to shard the tensors. Returns: A variable creator function." -11956,TPUEmbeddingCorrectness,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,58,class, -11957,_compute_gradients_wrt_embedding_table,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,544,function,"Compute gradients wrt embedding_table. - -Args: - batch_size: `int`, batch size. - gradient_wrt_activation: `np.array` with shape `batch_size` by - embedding `dimension`. - embedding_table: `np.array` with shape `vocabulary_size` by embedding - `dimension`. - feature_indices: `indices` as used to construct `SparseTensor`. - feature_values: `values` as used to construct `SparseTensor`. - combiner: `String`, 'mean' or 'sum'. - max_sequence_length: If non-zero, a sequence feature with the given length. - -Returns: - Gradients wrt `embedding_table`, an `np.array`s with shape - `batch_size` by `vocabulary_size` by - embedding `dimension`. - -Raises: - ValueError: if `combiner` is not one of 'mean' or 'sum'." -11958,_unpack,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,593,function, -11959,_get_total_loss_tensor,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,599,function, -11960,_compute_loss,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,610,function, -11961,_get_variable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,624,function, -11962,CPUEmbeddingTest,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_cpu_test.py,35,class, -11963,TPUEmbeddingCheckpointTest,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_test.py,69,class, -11964,TPUEmbeddingTest,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_test.py,316,class, -11965,_unpack,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_test.py,1216,function, -11966,_get_tmpdir,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_test.py,1222,function, -11967,_get_variable,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_test.py,1227,function, -11968,_Optimizer,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,33,class,"Base class for all optimizers, with common parameters." -11969,SGD,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,125,class,"Optimization parameters for stochastic gradient descent for TPU embeddings. +11113,TPUEmbeddingCorrectness,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,58,class, +11114,setUp,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,60,method, +11115,tearDown,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,127,method, +11116,input_fn,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,255,method, +11117,select_replica,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,423,method, +11118,embedding_and_set_gradients,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,487,method, +11119,embedding_only,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,497,method, +11120,step,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,173,method,Create and run computation that returns the embedding activations. +11121,step,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,442,method, +11122,tpu_fn,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,488,method, +11123,tpu_fn,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_correctness_test.py,498,method, +11124,SGD,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,125,class,"Optimization parameters for stochastic gradient descent for TPU embeddings. Pass this to `tf.tpu.experimental.embedding.TPUEmbedding` via the `optimizer` argument to set the global optimizer and its parameters: @@ -106951,7 +115366,7 @@ that has a learning rate of 0.1. See 'tensorflow/core/protobuf/tpu/optimization_parameters.proto' for a complete description of these parameters and their impacts on the optimizer algorithm." -11970,Adagrad,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,212,class,"Optimization parameters for Adagrad with TPU embeddings. +11125,Adagrad,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,212,class,"Optimization parameters for Adagrad with TPU embeddings. Pass this to `tf.tpu.experimental.embedding.TPUEmbedding` via the `optimizer` argument to set the global optimizer and its parameters: @@ -106994,7 +115409,7 @@ that has a learning rate of 0.1. See 'tensorflow/core/protobuf/tpu/optimization_parameters.proto' for a complete description of these parameters and their impacts on the optimizer algorithm." -11971,Adam,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,315,class,"Optimization parameters for Adam with TPU embeddings. +11126,Adam,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,315,class,"Optimization parameters for Adam with TPU embeddings. Pass this to `tf.tpu.experimental.embedding.TPUEmbedding` via the `optimizer` argument to set the global optimizer and its parameters: @@ -107041,7 +115456,7 @@ that has a learning rate of 0.1. See 'tensorflow/core/protobuf/tpu/optimization_parameters.proto' for a complete description of these parameters and their impacts on the optimizer algorithm." -11972,TableConfig,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,455,class,"Configuration data for one embedding table. +11127,TableConfig,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,455,class,"Configuration data for one embedding table. This class holds the configuration data for a single embedding table. It is used as the `table` parameter of a @@ -107073,7 +115488,7 @@ embedding = tf.tpu.experimental.embedding.TPUEmbedding( The above configuration has 2 tables, and three features. The first two features will be looked up in the first table and the third feature will be looked up in the second table." -11973,FeatureConfig,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,548,class,"Configuration data for one embedding feature. +11128,FeatureConfig,tensorflow/tensorflow/python/tpu/tpu_embedding_v2_utils.py,548,class,"Configuration data for one embedding feature. This class holds the configuration data for a single embedding feature. The main use is to assign features to `tf.tpu.experimental.embedding.TableConfig`s @@ -107110,7 +115525,7 @@ When feeding features into `embedding.enqueue` they can be `tf.Tensor`s, `max_sequence_length` is greater than 0, the feature is embedded as a sequence and padded up to the given length. The shape of the output for this feature will be `(batch_size, max_sequence_length, dim)`." -11974,partition_or_replicate_on_host,tensorflow/tensorflow/python/tpu/tpu_feed.py,40,function,"Partitions or replicates the input tensor. +11129,partition_or_replicate_on_host,tensorflow/tensorflow/python/tpu/tpu_feed.py,40,function,"Partitions or replicates the input tensor. The ops inside this function are placed on the host side. @@ -107120,17 +115535,7 @@ Args: Returns: An iterator of `Tensor`s or a list of partitioned tensors." -11975,_tag_sharding_attribute_for_dequeued_tensor,tensorflow/tensorflow/python/tpu/tpu_feed.py,86,function,"Tags appropriate XLA sharding attribute to the dequeued tensor. - -The sharding attribute of the dequeued tensor will be a tuple. - -Args: - tensor: The dequeued tensor on TPU. - dims: A list of integer describes how the tensor is partitioned. - -Returns: - The same tensor with the xla_sharding attribute." -11976,tag_sharding_attribute_for_dequeued_tensors,tensorflow/tensorflow/python/tpu/tpu_feed.py,110,function,"Tags appropriate XLA sharding attribute to the dequeued tensors. +11130,tag_sharding_attribute_for_dequeued_tensors,tensorflow/tensorflow/python/tpu/tpu_feed.py,110,function,"Tags appropriate XLA sharding attribute to the dequeued tensors. Args: dequeues: A list of dequeued tensors on TPU. @@ -107138,37 +115543,385 @@ Args: Returns: The same dequeues with appropriate xla_sharding attribute." -11977,InfeedQueue,tensorflow/tensorflow/python/tpu/tpu_feed.py,125,class,"A helper object to build a device infeed queue. +11131,InfeedQueue,tensorflow/tensorflow/python/tpu/tpu_feed.py,125,class,"A helper object to build a device infeed queue. The InfeedQueue builds the host-side and device-side Ops to enqueue and dequeue elements, respectively, and ensures that their types and shapes match." -11978,_PartitionedInfeedQueue,tensorflow/tensorflow/python/tpu/tpu_feed.py,733,class,"A helper object to build a device infeed queue with input partition. +11132,number_of_tuple_elements,tensorflow/tensorflow/python/tpu/tpu_feed.py,212,method,Returns the number of InfeedQueue tuple elements. +11133,tuple_types,tensorflow/tensorflow/python/tpu/tpu_feed.py,217,method,Returns the types of the InfeedQueue tuple elements. +11134,set_tuple_types,tensorflow/tensorflow/python/tpu/tpu_feed.py,221,method,"Sets the type of each element of the queue. + +tuple_types must be a list of length +self.number_of_tuple_elements, and each element must be +convertible to a dtype. Args: - number_of_tuple_elements: the number of Tensors fed atomically through the - queue, must be present unless it can be inferred from other arguments. - device_assignment: A TPU `DeviceAssignment` which is used to place all the - partitions to different TPU infeed queues. - host_id: The id of the host machine. - input_partition_dims: A nested list/tuple of integers. Each inner - list/tuple describes how to partition the corresponding input tensor. - tuple_types: If not None, a list of types of the elements of the queue. - tuple_shapes: If not None, a list of shapes of the elements of the queue. - name: The name of the queue." -11979,TpuContext,tensorflow/tensorflow/python/tpu/tpu_function.py,26,class,A context object holding state about the TPU computation being built. -11980,tpu_shard_context,tensorflow/tensorflow/python/tpu/tpu_function.py,47,function, -11981,get_tpu_context,tensorflow/tensorflow/python/tpu/tpu_function.py,57,function, -11982,on_device_training_loop,tensorflow/tensorflow/python/tpu/tpu_function.py,64,function, -11983,InfeedTest,tensorflow/tensorflow/python/tpu/tpu_infeed_test.py,29,class, -11984,CrossShardOptimizer,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,33,class,An optimizer that averages gradients across TPU shards. -11985,get_tpu_cluster_resolver,tensorflow/tensorflow/python/tpu/tpu_outside_compilation_test.py,48,function, -11986,get_tpu_strategy,tensorflow/tensorflow/python/tpu/tpu_outside_compilation_test.py,57,function, -11987,TpuOutsideCompilationTest,tensorflow/tensorflow/python/tpu/tpu_outside_compilation_test.py,64,class, -11988,ShardingPolicy,tensorflow/tensorflow/python/tpu/tpu_sharding.py,31,class,"An object use to hold the sharding policy for a Tensor. + tuple_types: the types of each queue element. + +Raises: + ValueError: if tuple_types is not of length + self.number_of_tuple_elements. + TypeError: if an element of tuple_types cannot be converted to a + dtype." +11135,tuple_shapes,tensorflow/tensorflow/python/tpu/tpu_feed.py,256,method,Returns the shapes of the InfeedQueue tuple elements. +11136,set_tuple_shapes,tensorflow/tensorflow/python/tpu/tpu_feed.py,260,method,"Sets the shape of each element of the queue. + +tuple_shapes must be a list of length +self.number_of_tuple_elements, and each element must be +convertible to a TensorShape. + +Args: + tuple_shapes: the shapes of each queue element. + +Raises: + ValueError: if tuple_shapes is not of length + self.number_of_tuple_elements. + TypeError: if an element of tuple_shapes cannot be converted to + a TensorShape." +11137,sharding_policies,tensorflow/tensorflow/python/tpu/tpu_feed.py,298,method,Returns the sharding policies of the InfeedQueue tuple elements. +11138,shard_dimensions,tensorflow/tensorflow/python/tpu/tpu_feed.py,303,method,"Gets the shard dimension of each tuple element. + +Returns: + A list of length number_of_tuple_elements, where each list entry + is the shard dimension of that tuple element or None if the + shard dimension has not been set." +11139,set_shard_dimensions,tensorflow/tensorflow/python/tpu/tpu_feed.py,314,method,"Sets the shard_dimension of each element of the queue. + +shard_dimensions must be a list of length +self.number_of_tuple_elements, and each element must be +convertible to a Dimension compatible with self.tuple_shapes. + +Args: + shard_dimensions: the dimensions of each queue element. + +Raises: + ValueError: if shard_dimensions is not of length + self.number_of_tuple_elements; or an element of + shard_dimensions cannot be converted to a Dimension; or an + element of shard_dimensions is a Dimension that is out of + range for the corresponding tuple element shape." +11140,number_of_shards,tensorflow/tensorflow/python/tpu/tpu_feed.py,340,method,"Gets the number of shards to use for the InfeedQueue. + +Returns: + Number of shards or None if the number of shards has not been set." +11141,set_number_of_shards,tensorflow/tensorflow/python/tpu/tpu_feed.py,349,method,"Sets the number of shards to use for the InfeedQueue. + +Args: + number_of_shards: number of ways to shard the InfeedQueue. + +Raises: + ValueError: if number_of_shards is not > 0; or the policies have + been frozen and number_of_shards was already set to something + else." +11142,set_configuration_from_input_tensors,tensorflow/tensorflow/python/tpu/tpu_feed.py,364,method,"Sets the shapes and types of the queue tuple elements. + +input_tensors is a list of Tensors whose types and shapes are used +to set the queue configuration. + +Args: + input_tensors: list of Tensors of the same types and shapes as + the desired queue Tuple. + +Raises: + ValueError: if input_tensors is not a list of length + self.number_of_tuple_elements" +11143,set_configuration_from_sharded_input_tensors,tensorflow/tensorflow/python/tpu/tpu_feed.py,384,method,"Sets the shapes and types of the queue tuple elements. + +input_tensors is a list of lists of Tensors whose types and shapes are used +to set the queue configuration. The length of the outer list is the number +of shards required, and each inner list is the tuple of Tensors to use to +determine the types and shapes of the corresponding shard. This method +depends on the shard dimension, and calling it freezes the shard policy. + +Args: + input_tensors: list of lists of Tensors. The outer list length corresponds + to the desired number of shards, and each inner list is the size + and shape of the desired configuration of the corresponding shard. + +Raises: + ValueError: if any inner list is not a list of length + self.number_of_tuple_elements; or the inner lists do not combine to + form a consistent unsharded shape. + TypeError: if the types of the Tensors in the inner lists do not match." +11144,freeze,tensorflow/tensorflow/python/tpu/tpu_feed.py,434,method,"Freezes the InfeedQueue so it can no longer be modified. + +The configuration is implicitly frozen before any host-side or +device-side Ops are generated. The configuration cannot be frozen +until the types and shapes of the tuple elements have been set. + +Raises: + ValueError: if the types or shapes of the tuple elements have not been + set." +11145,generate_dequeue_op,tensorflow/tensorflow/python/tpu/tpu_feed.py,460,method,"Generates the device-side Op to dequeue a tuple from the queue. + +Implicitly freezes the queue configuration if it is not already +frozen, which will raise errors if the shapes and types have not +been fully specified. + +Args: + tpu_device: The TPU device ordinal where the infeed instruction should be + placed. If None, no explicit placement will be performed, and it is up + to the user to call this API from within a proper TPU device scope. + The XLA code will fail if the TPU dequeue instruction is not bound to + any device. + +Returns: + A list of Outputs corresponding to a shard of infeed dequeued + into XLA, suitable for use within a replicated block. + +Raises: + ValueError: if the types or shapes of the tuple elements have not been + set; or if a dequeue op has already been generated." +11146,generate_enqueue_ops,tensorflow/tensorflow/python/tpu/tpu_feed.py,552,method,"Generates the host-side Ops to enqueue the shards of a tuple. + +sharded_inputs is a list, one for each shard, of lists of +Tensors. sharded_inputs[i] is the tuple of Tensors to use to feed +shard i of the queue. Returns the host-side Ops that must be run to +enqueue the sharded tuple. The Op for shard i is colocated with the inputs +for shard i. + +Implicitly freezes the queue configuration if it is not already +frozen. If the configuration has already been frozen, and is not +compatible with the types and shapes of sharded_inputs, an error +will be raised. + +Args: + sharded_inputs: a list of lists of Tensors. The length of the outer list + determines the number of shards. Each inner list indicates the types + and shapes of the tuples in the corresponding shard. + tpu_ordinal_function: if not None, a function that takes the + shard index as input and returns the ordinal of the TPU device + the shard's infeed should be placed on. tpu_ordinal_function must be + set if the inputs are placed on CPU devices. + placement_function: if not None, a function that takes the shard index as + input and returns the host device where the enqueue op should be placed + on. + +Returns: + A list of host-side Ops, one for each shard, that when executed together + will enqueue a full-size element of infeed. + +Raises: + ValueError: if the queue configuration has previously been frozen and the + shapes of the elements of sharded_inputs are not compatible with the + frozen configuration; or if the shapes of the elements of sharded_inputs + don't form a consistent unsharded tuple; or if the elements of a tuple + have different device constraints. + TypeError: if the queue configuration has previously been frozen and the + types of the elements of sharded_inputs are not compatible with the + frozen configuration; or if the types of the elements of sharded_inputs + don't form a consistent unsharded tuple." +11147,split_inputs_and_generate_enqueue_ops,tensorflow/tensorflow/python/tpu/tpu_feed.py,625,method,"POORLY-PERFORMING ON MULTI-HOST SYSTEMS. + +Generates the host-side Ops to enqueue a tuple. + +This method performs poorly because it takes an entire input on a single +host, splits it, and distributes it to all of the cores. It is present only +to simplify tutorial examples. + +inputs is a list of Tensors to use to feed the queue. Each input is split +into self.number_of_shards shards. Returns an Op for each shard to enqueue +the shard. The Op for shard i is placed on device placement_function(i). + +Implicitly freezes the queue configuration if it is not already +frozen. If the configuration has already been frozen, and is not +compatible with the types and shapes of inputs, an error +will be raised. + +Args: + inputs: a list of Tensors which indicates the types and shapes of the + queue tuple. + device_assignment: if not `None`, a TPU `DeviceAssignment`. If + device_assignment is not `None`, but `placement_function` and + `ordinal_function` are None, then `device_assignment` will be used to + place infeeds on the first k TPU shards, where k is the number of shards + in the queue. If all three are `None`, then default placement and + ordinal functions are used. + placement_function: if not None, a function that takes the shard + index as input and returns a device string indicating which + device the shard's infeed should be placed on. If placement_function + and tpu_ordinal_function are None, inputs are sharded round-robin + across the devices in the system. + tpu_ordinal_function: if not None, a function that takes the + shard index as input and returns the ordinal of the TPU device + the shard's infeed should be placed on. If placement_function + and tpu_ordinal_function are None, inputs are sharded round-robin + across the devices in the system. + +Returns: + A list of host-side Ops, one for each shard, that when executed together + will enqueue a full-size element of infeed. + +Raises: + ValueError: if the queue configuration has previously been frozen and the + shapes of the elements of inputs are not compatible with the frozen + configuration. + TypeError: if the queue configuration has previously been frozen and the + types of the elements of inputs are not compatible with the frozen + configuration." +11148,split_fn,tensorflow/tensorflow/python/tpu/tpu_feed.py,706,method, +11149,TpuContext,tensorflow/tensorflow/python/tpu/tpu_function.py,26,class,A context object holding state about the TPU computation being built. +11150,number_of_shards,tensorflow/tensorflow/python/tpu/tpu_function.py,34,method, +11151,set_number_of_shards,tensorflow/tensorflow/python/tpu/tpu_function.py,37,method, +11152,tpu_shard_context,tensorflow/tensorflow/python/tpu/tpu_function.py,47,function, +11153,get_tpu_context,tensorflow/tensorflow/python/tpu/tpu_function.py,57,function, +11154,on_device_training_loop,tensorflow/tensorflow/python/tpu/tpu_function.py,64,function, +11155,CrossShardOptimizer,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,33,class,An optimizer that averages gradients across TPU shards. +11156,compute_gradients,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,111,method,"Compute gradients of ""loss"" for the variables in ""var_list"". + +This simply wraps `compute_gradients()` from the real optimizer. The +gradients will be aggregated in `apply_gradients()` so that user can +modify the gradients like clipping with per replica global norm if needed. +The global norm with aggregated gradients can be bad as one replica's huge +gradients can hurt the gradients from other replicas. + +When the CrossShardOptimizer is constructed with +`reduction == losses.Reduction.MEAN` (default), this function scales the +loss by `1.0 / num_shards` before computing the gradients. Assuming the +optimizer uses the default implementation of `compute_gradients()`, the +gradients of the scaled loss are scaled by `1.0 / num_shards` compared to +the gradients of the original loss. This scaling factor is important because +`apply_gradients()` sums gradients across shards, rather than averaging +them. However, the scaling factor must be taken into account when clipping +the norm of the gradients or performing other postprocessing. + +Args: + loss: A Tensor containing the value to minimize. + var_list: Optional list or tuple of `tf.Variable` to update to minimize + `loss`. Defaults to the list of variables collected in the graph + under the key `GraphKey.TRAINABLE_VARIABLES`. + **kwargs: Keyword arguments for compute_gradients(). + +Returns: + A list of (gradient, variable) pairs. + +Raises: + ValueError: If not within a tpu_shard_context or group_assignment is + invalid." +11157,apply_gradients,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,163,method,"Apply gradients to variables. + +Calls tpu_ops.cross_replica_sum() to sum gradient contributions across +replicas, and then applies the real optimizer. + +Args: + grads_and_vars: List of (gradient, variable) pairs as returned by + compute_gradients(). + global_step: Optional Variable to increment by one after the + variables have been updated. + name: Optional name for the returned operation. Default to the + name passed to the Optimizer constructor. + +Returns: + An `Operation` that applies the gradients. If `global_step` was not None, + that operation also increments `global_step`. + +Raises: + ValueError: If the grads_and_vars is malformed." +11158,get_slot,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,194,method,"Return a slot named ""name"" created for ""var"" by the Optimizer. + +This simply wraps the get_slot() from the actual optimizer. + +Args: + *args: Arguments for get_slot(). + **kwargs: Keyword arguments for get_slot(). + +Returns: + The `Variable` for the slot if it was created, `None` otherwise." +11159,get_slot_names,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,208,method,"Return a list of the names of slots created by the `Optimizer`. + +This simply wraps the get_slot_names() from the actual optimizer. + +Args: + *args: Arguments for get_slot(). + **kwargs: Keyword arguments for get_slot(). + +Returns: + A list of strings." +11160,variables,tensorflow/tensorflow/python/tpu/tpu_optimizer.py,222,method,Forwarding the variables from the underlying optimizer. +11161,get_tpu_cluster_resolver,tensorflow/tensorflow/python/tpu/tpu_outside_compilation_test.py,48,function, +11162,get_tpu_strategy,tensorflow/tensorflow/python/tpu/tpu_outside_compilation_test.py,57,function, +11163,ShardingPolicy,tensorflow/tensorflow/python/tpu/tpu_sharding.py,31,class,"An object use to hold the sharding policy for a Tensor. " -11989,ShardingTest,tensorflow/tensorflow/python/tpu/tpu_sharding_test.py,28,class, -11990,initialize_tpu_system,tensorflow/tensorflow/python/tpu/tpu_strategy_util.py,41,function,"Initialize the TPU devices. +11164,freeze,tensorflow/tensorflow/python/tpu/tpu_sharding.py,54,method,"Prevents further modification to the sharding policy. + +Any values that have not been set when freeze is called are set to +defaults. If the ShardingPolicy is already frozen, this is a NoOp." +11165,number_of_shards,tensorflow/tensorflow/python/tpu/tpu_sharding.py,65,method,Returns the number of shards in the policy or None if unspecified. +11166,set_number_of_shards,tensorflow/tensorflow/python/tpu/tpu_sharding.py,69,method,"Sets the number of shards for the current policy. + +If the policy has been frozen then number_of_shards must match the +existing setting. + +Args: + number_of_shards: The number of shards to use in the policy. + +Raises: + ValueError: If the policy has been frozen and number_of_shards + differs from the frozen value; or number_of_shards <= 0." +11167,shard_dimension,tensorflow/tensorflow/python/tpu/tpu_sharding.py,96,method,Returns the shard dimension of the policy or None if unspecified. +11168,set_shard_dimension,tensorflow/tensorflow/python/tpu/tpu_sharding.py,100,method,"Sets the shard dimension for the current policy. + +If the policy has been frozen then shard_dimension must match the +existing setting. + +Args: + shard_dimension: The shard dimension to use in the policy. + +Raises: + ValueError: If the policy has been frozen and shard_dimension + differs from the frozen value, or shard_dimension can't be + interpreted as a Dimension." +11169,merge,tensorflow/tensorflow/python/tpu/tpu_sharding.py,122,method,"Merges the policy of another policy into the current policy. + +Args: + other: The policy to merge into this one. + +Raises: + ValueError: If this policy has been frozen and the merge conflicts with + the frozen policy." +11170,get_sharded_shape,tensorflow/tensorflow/python/tpu/tpu_sharding.py,137,method,"Returns the shape of a shard of a full Tensor. + +When given the shape of a 'full-size' Tensor, returns the shape of +the sub-Tensor after it has been sharded. Freezes the policy if it +has not yet been frozen. + +Args: + shape: The shape of the full-size Tensor to be sharded. + shard_index: The index of the shard whose shape should be returned. + shard_index can be None for sharding policies that use the same + shape for every shard. + +Returns: + The shape of the sharded version of the Tensor. + +Raises: + ValueError: If shard_index is None when shards are of different + shapes; or shard_index is not None and + !(0<=shard_index, we send replica a's input to replica b. Each replica id must only appear once in the source column. Also it must @@ -107395,10 +116123,7 @@ Args: Returns: A `Tensor` which is permuted." -12032,_collective_permute_grad,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,140,function, -12033,_cross_replica_sum_grad,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,149,function, -12034,_embedding_activations_grad,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,166,function,Saves the gradient of embedding activations ops in a graph collection. -12035,infeed_dequeue,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,196,function,"A placeholder op for a value that will be fed into the computation. +11208,infeed_dequeue,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,196,function,"A placeholder op for a value that will be fed into the computation. Args: dtype: A `tf.DType`. The type of elements in the tensor. @@ -107411,7 +116136,7 @@ Returns: Raises: TypeError: If 'dtype` is not a supported infeed type." -12036,infeed_dequeue_tuple,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,221,function,"A placeholder op for values fed into the TPU simultaneously as a tuple. +11209,infeed_dequeue_tuple,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,221,function,"A placeholder op for values fed into the TPU simultaneously as a tuple. Args: dtypes: A list of `tf.DType`s that has length `>= 1`. @@ -107426,7 +116151,7 @@ Returns: Raises: TypeError: If a type in 'dtypes` is not a supported infeed type." -12037,send_tpu_embedding_gradients,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,248,function,"A placeholder op for feeding per-sample gradients to the embedding layer. +11210,send_tpu_embedding_gradients,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,248,function,"A placeholder op for feeding per-sample gradients to the embedding layer. Args: inputs: A TensorList of gradients with which to update embedding tables. @@ -107447,7 +116172,7 @@ Args: Returns: A SendTPUEmbeddingGradients operation." -12038,enqueue_tpu_embedding_integer_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,285,function,"A placeholder op for enqueueing embedding IDs to the TPU. +11211,enqueue_tpu_embedding_integer_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,285,function,"A placeholder op for enqueueing embedding IDs to the TPU. Args: batch: A list of 1D tensors, one for each embedding table, containing the @@ -107463,7 +116188,7 @@ Args: Returns: An EnqueueTPUEmbeddingIntegerBatch operation." -12039,enqueue_tpu_embedding_sparse_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,320,function,"A placeholder op for enqueueing embedding IDs to the TPU. +11212,enqueue_tpu_embedding_sparse_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,320,function,"A placeholder op for enqueueing embedding IDs to the TPU. Args: sample_indices: A list of rank 1 Tensors specifying the training example @@ -107495,7 +116220,7 @@ Args: Returns: An EnqueueTPUEmbeddingSparseBatch operation." -12040,enqueue_tpu_embedding_sparse_tensor_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,377,function,"A placeholder op for enqueueing embedding IDs to the TPU. +11213,enqueue_tpu_embedding_sparse_tensor_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,377,function,"A placeholder op for enqueueing embedding IDs to the TPU. Args: sample_indices: A list of rank 2 Tensors specifying the training example @@ -107539,7 +116264,7 @@ Args: Returns: An EnqueueTPUEmbeddingSparseTensorBatch operation." -12041,enqueue_tpu_embedding_ragged_tensor_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,450,function,"A placeholder op for enqueueing embedding IDs to the TPU. +11214,enqueue_tpu_embedding_ragged_tensor_batch,tensorflow/tensorflow/python/tpu/ops/tpu_ops.py,450,function,"A placeholder op for enqueueing embedding IDs to the TPU. Args: sample_splits: A list of rank 1 Tensors specifying the break points for @@ -107583,7 +116308,7 @@ Args: Returns: An EnqueueTPUEmbeddingRaggedTensorBatch operation." -12042,get_workers_list,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,85,function,"Returns a comma separated list of TPU worker IP addresses. +11215,get_workers_list,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,85,function,"Returns a comma separated list of TPU worker IP addresses. Gets cluster_spec from cluster_resolver. Use the worker's task indices to obtain and return a list of ip addresses. @@ -107597,7 +116322,7 @@ Returns: Raises: UnavailableError: cluster_resolver doesn't contain a valid cluster_spec." -12043,monitoring_helper,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,115,function,"Helper function to print monitoring results. +11216,monitoring_helper,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,115,function,"Helper function to print monitoring results. Helper function to print monitoring results for num_queries times. @@ -107607,33 +116332,37 @@ Args: monitoring_level: An integer between 1 and 2. Level 2 is more verbose than level 1 and shows more metrics. num_queries: Number of monitoring samples to collect." -12044,run_main,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,135,function, -12045,main,tensorflow/tensorflow/python/tpu/profiler/capture_tpu_profile.py,139,function, -12046,ProfileAnalysisStub,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,28,class,"////////////////////////////////////////////////////////////////////////////// +11217,ProfileAnalysisStub,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,28,class,"////////////////////////////////////////////////////////////////////////////// ProfileAnalysis service provide entry point for profiling TPU and for serving profiled data to Tensorboard through GRPC //////////////////////////////////////////////////////////////////////////////" -12047,ProfileAnalysisServicer,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,65,class,"////////////////////////////////////////////////////////////////////////////// +11218,ProfileAnalysisServicer,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,65,class,"////////////////////////////////////////////////////////////////////////////// ProfileAnalysis service provide entry point for profiling TPU and for serving profiled data to Tensorboard through GRPC //////////////////////////////////////////////////////////////////////////////" -12048,add_ProfileAnalysisServicer_to_server,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,96,function, -12049,AdadeltaOptimizer,tensorflow/tensorflow/python/training/adadelta.py,29,class,"Optimizer that implements the Adadelta algorithm. +11219,NewSession,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,73,method,"Starts a profiling session, blocks until it completes. + +TPUProfileAnalysis service delegate this to TPUProfiler service. +Populate the profiled data in repository, then return status to caller." +11220,EnumSessions,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,83,method,Enumerate existing sessions and return available profile tools. +11221,GetSessionToolData,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,89,method,Retrieve specific tool's data for specific session. +11222,add_ProfileAnalysisServicer_to_server,tensorflow/tensorflow/python/tpu/profiler/profiler_analysis_pb2_grpc.py,96,function, +11223,AdadeltaOptimizer,tensorflow/tensorflow/python/training/adadelta.py,29,class,"Optimizer that implements the Adadelta algorithm. References: ADADELTA - An Adaptive Learning Rate Method: [Zeiler, 2012](http://arxiv.org/abs/1212.5701) ([pdf](http://arxiv.org/pdf/1212.5701v1.pdf))" -12050,AdadeltaOptimizerTest,tensorflow/tensorflow/python/training/adadelta_test.py,35,class, -12051,AdagradOptimizer,tensorflow/tensorflow/python/training/adagrad.py,32,class,"Optimizer that implements the Adagrad algorithm. +11224,AdagradOptimizer,tensorflow/tensorflow/python/training/adagrad.py,32,class,"Optimizer that implements the Adagrad algorithm. References: Adaptive Subgradient Methods for Online Learning and Stochastic Optimization :[Duchi et al., 2011](http://jmlr.org/papers/v12/duchi11a.html) ([pdf](http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf))" -12052,AdagradDAOptimizer,tensorflow/tensorflow/python/training/adagrad_da.py,30,class,"Adagrad Dual Averaging algorithm for sparse linear models. +11225,init,tensorflow/tensorflow/python/training/adagrad.py,84,method, +11226,AdagradDAOptimizer,tensorflow/tensorflow/python/training/adagrad_da.py,30,class,"Adagrad Dual Averaging algorithm for sparse linear models. This optimizer takes care of regularization of unseen features in a mini batch by updating them when they are seen with a closed form update rule that is @@ -107648,17 +116377,14 @@ References: Adaptive Subgradient Methods for Online Learning and Stochastic Optimization :[Duchi et al., 2011](http://jmlr.org/papers/v12/duchi11a.html) ([pdf](http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf))" -12053,AdagradDAOptimizerTest,tensorflow/tensorflow/python/training/adagrad_da_test.py,35,class, -12054,AdagradOptimizerTest,tensorflow/tensorflow/python/training/adagrad_test.py,37,class, -12055,AdamOptimizer,tensorflow/tensorflow/python/training/adam.py,32,class,"Optimizer that implements the Adam algorithm. +11227,AdamOptimizer,tensorflow/tensorflow/python/training/adam.py,32,class,"Optimizer that implements the Adam algorithm. References: Adam - A Method for Stochastic Optimization: [Kingma et al., 2015](https://arxiv.org/abs/1412.6980) ([pdf](https://arxiv.org/pdf/1412.6980.pdf))" -12056,adam_update_numpy,tensorflow/tensorflow/python/training/adam_test.py,37,function, -12057,AdamOptimizerTest,tensorflow/tensorflow/python/training/adam_test.py,55,class, -12058,basic_train_loop,tensorflow/tensorflow/python/training/basic_loops.py,25,function,"Basic loop to train a model. +11228,adam_update_numpy,tensorflow/tensorflow/python/training/adam_test.py,37,function, +11229,basic_train_loop,tensorflow/tensorflow/python/training/basic_loops.py,25,function,"Basic loop to train a model. Calls `train_step_fn` in a loop to train a model. The function is called as: @@ -107678,17 +116404,27 @@ Args: kwargs: Optional keyword arguments passed to `train_step_fn`. master: Master to use to create the training session. Defaults to `""""` which causes the session to be created in the local process." -12059,_test_dir,tensorflow/tensorflow/python/training/basic_loops_test.py,31,function, -12060,BasicTrainLoopTest,tensorflow/tensorflow/python/training/basic_loops_test.py,38,class, -12061,_HookTimer,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,54,class,"Base timer for determining when Hooks should trigger. - -Should not be instantiated directly." -12062,SecondOrStepTimer,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,91,class,"Timer that triggers at most once every N seconds or once every N steps. +11230,SecondOrStepTimer,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,91,class,"Timer that triggers at most once every N seconds or once every N steps. This symbol is also exported to v2 in tf.estimator namespace. See https://github.com/tensorflow/estimator/blob/master/tensorflow_estimator/python/estimator/hooks/basic_session_run_hooks.py" -12063,NeverTriggerTimer,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,158,class,Timer that never triggers. -12064,LoggingTensorHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,174,class,"Prints the given tensors every N local steps, every N seconds, or at end. +11231,reset,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,110,method, +11232,should_trigger_for_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,114,method,"Return true if the timer should trigger for the specified step. + +Args: + step: Training step to trigger on. + +Returns: + True if the difference between the current time and the time of the last + trigger exceeds `every_secs`, or if the difference between the current + step and the last triggered step exceeds `every_steps`. False otherwise." +11233,update_last_triggered_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,141,method, +11234,last_triggered_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,154,method, +11235,NeverTriggerTimer,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,158,class,Timer that never triggers. +11236,should_trigger_for_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,161,method, +11237,update_last_triggered_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,165,method, +11238,last_triggered_step,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,169,method, +11239,LoggingTensorHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,174,class,"Prints the given tensors every N local steps, every N seconds, or at end. The tensors will be printed to the log, with `INFO` severity. If you are not seeing the logs, you might want to add the following line after your imports: @@ -107699,7 +116435,11 @@ seeing the logs, you might want to add the following line after your imports: Note that if `at_end` is True, `tensors` should not include any tensor whose evaluation produces a side effect such as consuming additional inputs." -12065,get_or_create_steps_per_run_variable,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,278,function,"Gets or creates the steps_per_run variable. +11240,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,233,method, +11241,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,242,method, +11242,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,265,method, +11243,end,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,272,method, +11244,get_or_create_steps_per_run_variable,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,278,function,"Gets or creates the steps_per_run variable. In Estimator, the user provided computation, the model_fn, is wrapped inside a tf.while_loop for peak performance. The iterations of the loop are @@ -107725,9 +116465,12 @@ Returns: Raises: RuntimeError: If multi steps_per_run variables were found." -12066,_MultiStepStopAtStepHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,325,class,Hook that requests stop at a specified step. -12067,StopAtStepHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,390,class,Hook that requests stop at a specified step. -12068,CheckpointSaverListener,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,446,class,"Interface for listeners that take action before or after checkpoint save. +11245,StopAtStepHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,390,class,Hook that requests stop at a specified step. +11246,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,419,method, +11247,after_create_session,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,424,method, +11248,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,429,method, +11249,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,432,method, +11250,CheckpointSaverListener,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,446,class,"Interface for listeners that take action before or after checkpoint save. `CheckpointSaverListener` triggers only in steps when `CheckpointSaverHook` is triggered, and provides callbacks at the following points: @@ -107777,54 +116520,61 @@ A `CheckpointSaverListener` can request training to be stopped, by returning True in `after_save`. Please note that, in replicated distributed training setting, only `chief` should use this behavior. Otherwise each worker will do their own evaluation, which may be wasteful of resources." -12069,CheckpointSaverHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,513,class,Saves checkpoints every N steps or seconds. -12070,StepCounterHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,660,class,Hook that counts steps per second. -12071,NanLossDuringTrainingError,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,740,class, -12072,NanTensorHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,747,class,"Monitors the loss tensor and stops training if loss is NaN. +11251,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,499,method, +11252,before_save,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,502,method, +11253,after_save,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,505,method, +11254,end,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,508,method, +11255,CheckpointSaverHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,513,class,Saves checkpoints every N steps or seconds. +11256,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,562,method, +11257,after_create_session,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,571,method, +11258,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,590,method, +11259,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,593,method, +11260,end,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,604,method, +11261,StepCounterHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,660,class,Hook that counts steps per second. +11262,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,683,method, +11263,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,692,method, +11264,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,704,method, +11265,NanLossDuringTrainingError,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,740,class, +11266,NanTensorHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,747,class,"Monitors the loss tensor and stops training if loss is NaN. Can either fail with exception or just stop training." -12073,SummarySaverHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,779,class,Saves summaries every N steps. -12074,GlobalStepWaiterHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,888,class,"Delays execution until global step reaches `wait_until_step`. +11267,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,763,method, +11268,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,766,method, +11269,SummarySaverHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,779,class,Saves summaries every N steps. +11270,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,821,method, +11271,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,830,method, +11272,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,841,method, +11273,end,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,863,method, +11274,GlobalStepWaiterHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,888,class,"Delays execution until global step reaches `wait_until_step`. This hook delays execution until global step reaches to `wait_until_step`. It is used to gradually start workers in distributed settings. One example usage would be setting `wait_until_step=int(K*log(task_id+1))` assuming that task_id=0 is the chief." -12075,FinalOpsHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,937,class,A hook which evaluates `Tensors` at the end of a session. -12076,FeedFnHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,981,class,Runs `feed_fn` and sets the `feed_dict` accordingly. -12077,ProfilerHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,999,class,"Captures CPU/GPU profiling information every N steps or seconds. +11275,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,905,method, +11276,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,912,method, +11277,FinalOpsHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,937,class,A hook which evaluates `Tensors` at the end of a session. +11278,final_ops_values,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,954,method, +11279,end,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,957,method, +11280,FeedFnHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,981,class,Runs `feed_fn` and sets the `feed_dict` accordingly. +11281,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,993,method, +11282,ProfilerHook,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,999,class,"Captures CPU/GPU profiling information every N steps or seconds. This produces files called ""timeline-.json"", which are in Chrome Trace format. For more information see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md" -12078,_as_graph_element,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,1083,function,Retrieves Graph element. -12079,MockCheckpointSaverListener,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,59,class, -12080,SecondOrStepTimerTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,92,class, -12081,StopAtStepTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,144,class, -12082,LoggingTensorHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,218,class, -12083,CheckpointSaverHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,386,class, -12084,CheckpointSaverHookMultiStepTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,822,class, -12085,ResourceCheckpointSaverHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,915,class, -12086,StepCounterHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,958,class, -12087,SummarySaverHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1166,class, -12088,GlobalStepWaiterHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1331,class, -12089,FinalOpsHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1383,class, -12090,ResourceSummarySaverHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1447,class, -12091,FeedFnHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1496,class, -12092,ProfilerHookTest,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,1509,class, -12093,_evaluate,tensorflow/tensorflow/python/training/checkpoint_management.py,43,function,Returns the numpy value of a tensor. -12094,_GetCheckpointFilename,tensorflow/tensorflow/python/training/checkpoint_management.py,50,function,"Returns a filename for storing the CheckpointState. - -Args: - save_dir: The directory for saving and restoring checkpoints. - latest_filename: Name of the file in 'save_dir' that is used - to store the CheckpointState. - -Returns: - The path of the file that contains the CheckpointState proto." -12095,generate_checkpoint_state_proto,tensorflow/tensorflow/python/training/checkpoint_management.py,67,function,"Generates a checkpoint state proto. +11283,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,1040,method, +11284,before_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,1046,method, +11285,after_run,tensorflow/tensorflow/python/training/basic_session_run_hooks.py,1057,method, +11286,MockCheckpointSaverListener,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,59,class, +11287,begin,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,69,method, +11288,before_save,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,72,method, +11289,after_save,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,75,method, +11290,end,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,80,method, +11291,get_counts,tensorflow/tensorflow/python/training/basic_session_run_hooks_test.py,83,method, +11292,generate_checkpoint_state_proto,tensorflow/tensorflow/python/training/checkpoint_management.py,67,function,"Generates a checkpoint state proto. Args: save_dir: Directory where the model was saved. @@ -107847,7 +116597,7 @@ Returns: Raises: ValueError: If `all_model_checkpoint_timestamps` was provided but its length does not match `all_model_checkpoint_paths`." -12096,update_checkpoint_state,tensorflow/tensorflow/python/training/checkpoint_management.py,136,function,"Updates the content of the 'checkpoint' file. +11293,update_checkpoint_state,tensorflow/tensorflow/python/training/checkpoint_management.py,136,function,"Updates the content of the 'checkpoint' file. This updates the checkpoint file containing a CheckpointState proto. @@ -107871,7 +116621,7 @@ Args: Raises: RuntimeError: If any of the model checkpoint paths conflict with the file containing CheckpointSate." -12097,update_checkpoint_state_internal,tensorflow/tensorflow/python/training/checkpoint_management.py,177,function,"Updates the content of the 'checkpoint' file. +11294,update_checkpoint_state_internal,tensorflow/tensorflow/python/training/checkpoint_management.py,177,function,"Updates the content of the 'checkpoint' file. This updates the checkpoint file containing a CheckpointState proto. @@ -107898,7 +116648,7 @@ Args: Raises: RuntimeError: If any of the model checkpoint paths conflict with the file containing CheckpointSate." -12098,get_checkpoint_state,tensorflow/tensorflow/python/training/checkpoint_management.py,252,function,"Returns CheckpointState proto from the ""checkpoint"" file. +11295,get_checkpoint_state,tensorflow/tensorflow/python/training/checkpoint_management.py,252,function,"Returns CheckpointState proto from the ""checkpoint"" file. If the ""checkpoint"" file contains a valid CheckpointState proto, returns it. @@ -107914,39 +116664,7 @@ Returns: Raises: ValueError: if the checkpoint read doesn't have model_checkpoint_path set." -12099,_prefix_to_checkpoint_path,tensorflow/tensorflow/python/training/checkpoint_management.py,308,function,"Returns the pathname of a checkpoint file, given the checkpoint prefix. - -For V1 checkpoint, simply returns the prefix itself (the data file). For V2, -returns the pathname to the index file. - -Args: - prefix: a string, the prefix of a checkpoint. - format_version: the checkpoint format version that corresponds to the - prefix. -Returns: - The pathname of a checkpoint file, taking into account the checkpoint - format version." -12100,latest_checkpoint,tensorflow/tensorflow/python/training/checkpoint_management.py,328,function,"Finds the filename of latest saved checkpoint file. - -Gets the checkpoint state given the provided checkpoint_dir and looks for a -corresponding TensorFlow 2 (preferred) or TensorFlow 1.x checkpoint path. -The latest_filename argument is only applicable if you are saving checkpoint -using `v1.train.Saver.save` - - -See the [Training Checkpoints -Guide](https://www.tensorflow.org/guide/checkpoint) for more details and -examples.` - -Args: - checkpoint_dir: Directory where the variables were saved. - latest_filename: Optional name for the protocol buffer file that - contains the list of most recent checkpoint filenames. - See the corresponding argument to `v1.train.Saver.save`. - -Returns: - The full path to the latest checkpoint or `None` if no checkpoint was found." -12101,checkpoint_exists_internal,tensorflow/tensorflow/python/training/checkpoint_management.py,367,function,"Checks whether a V1 or V2 checkpoint exists with the specified prefix. +11296,checkpoint_exists_internal,tensorflow/tensorflow/python/training/checkpoint_management.py,367,function,"Checks whether a V1 or V2 checkpoint exists with the specified prefix. This is an internal function to check if a checkpoint exists, since it takes into account the naming difference between V1 and V2 formats. @@ -107958,7 +116676,7 @@ Args: V1/V2. Returns: A bool, true if a checkpoint referred to by `checkpoint_prefix` exists." -12102,checkpoint_exists,tensorflow/tensorflow/python/training/checkpoint_management.py,395,function,"Checks whether a V1 or V2 checkpoint exists with the specified prefix. +11297,checkpoint_exists,tensorflow/tensorflow/python/training/checkpoint_management.py,395,function,"Checks whether a V1 or V2 checkpoint exists with the specified prefix. This is the recommended way to check if a checkpoint exists, since it takes into account the naming difference between V1 and V2 formats. @@ -107971,7 +116689,7 @@ Args: Returns: A bool, true if a checkpoint referred to by `checkpoint_prefix` exists." -12103,get_checkpoint_mtimes,tensorflow/tensorflow/python/training/checkpoint_management.py,417,function,"Returns the mtimes (modification timestamps) of the checkpoints. +11298,get_checkpoint_mtimes,tensorflow/tensorflow/python/training/checkpoint_management.py,417,function,"Returns the mtimes (modification timestamps) of the checkpoints. Globs for the checkpoints pointed to by `checkpoint_prefixes`. If the files exist, collect their mtime. Both V2 and V1 checkpoints are considered, in @@ -107990,7 +116708,7 @@ Args: sharded/non-sharded or V1/V2. Returns: A list of mtimes (in microseconds) of the found checkpoints." -12104,remove_checkpoint,tensorflow/tensorflow/python/training/checkpoint_management.py,463,function,"Removes a checkpoint given by `checkpoint_prefix`. +11299,remove_checkpoint,tensorflow/tensorflow/python/training/checkpoint_management.py,463,function,"Removes a checkpoint given by `checkpoint_prefix`. Args: checkpoint_prefix: The prefix of a V1 or V2 checkpoint. Typically the result @@ -107999,8 +116717,7 @@ Args: checkpoint_format_version: `SaverDef.CheckpointFormatVersion`, defaults to `SaverDef.V2`. meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'." -12105,_delete_file_if_exists,tensorflow/tensorflow/python/training/checkpoint_management.py,487,function,Deletes files matching `filespec`. -12106,meta_graph_filename,tensorflow/tensorflow/python/training/checkpoint_management.py,493,function,"Returns the meta graph filename. +11300,meta_graph_filename,tensorflow/tensorflow/python/training/checkpoint_management.py,493,function,"Returns the meta graph filename. Args: checkpoint_filename: Name of the checkpoint file. @@ -108008,7 +116725,7 @@ Args: Returns: MetaGraph file name." -12107,CheckpointManager,tensorflow/tensorflow/python/training/checkpoint_management.py,513,class,"Manages multiple checkpoints by keeping some and deleting unneeded ones. +11301,CheckpointManager,tensorflow/tensorflow/python/training/checkpoint_management.py,513,class,"Manages multiple checkpoints by keeping some and deleting unneeded ones. Example usage: @@ -108026,236 +116743,52 @@ while True: `CheckpointManager` preserves its own state across instantiations (see the `__init__` documentation for details). Only one should be active in a particular directory at a time." -12108,LatestCheckpointWithRelativePaths,tensorflow/tensorflow/python/training/checkpoint_management_test.py,44,class, -12109,CheckpointStateTest,tensorflow/tensorflow/python/training/checkpoint_management_test.py,150,class, -12110,SaverUtilsTest,tensorflow/tensorflow/python/training/checkpoint_management_test.py,266,class, -12111,CheckpointManagerTest,tensorflow/tensorflow/python/training/checkpoint_management_test.py,325,class, -12112,_load_and_remap_matrix,tensorflow/tensorflow/python/training/checkpoint_ops.py,33,function,"Loads a 2-D (matrix) `Tensor` from checkpoint. +11302,directory,tensorflow/tensorflow/python/training/checkpoint_management.py,667,method, +11303,checkpoint_interval,tensorflow/tensorflow/python/training/checkpoint_management.py,671,method, +11304,checkpoints,tensorflow/tensorflow/python/training/checkpoint_management.py,689,method,"A list of managed checkpoints. -Generates 1D-remappings for rows and columns using the -`GenerateVocabRemapping` op, and initializes any anticipated values with the -provided initializer. Then, uses the `LoadAndRemapMatrix` op to create a -matrix that loads existing values from the checkpoint, while filling out -""missing"" values with the newly initialized values. See -contrib/framework/ops/checkpoint_ops.cc for more information on the wrapped -functionality (LoadAndRemapMatrix). This wrapper can be used to perform only -row remapping or only col remapping. If only row remapping is desired, -{new,old}_col_vocab_file should be `None`, and vice versa for column -remapping. - -NOTE: This only supports div-partitioning the vocabulary on the 1st dimension -(row axis) via `new_row_vocab_offset`. - -Args: - ckpt_path: Path to the TensorFlow checkpoint (version 2, `TensorBundle`) - from which the old matrix `Tensor` will be loaded. - old_tensor_name: Name of the 2-D `Tensor` to load from checkpoint. - new_row_vocab_offset: A 0-indexed integer representing what line to - start reading at in the new row vocabulary. Used for partitioned - variables. - num_rows_to_load: Number of rows to load for the new vocabulary (note: to - support variable partitioning and partial loading, this does not need to - be the same as the number of entries in `new_row_vocab_file`). - new_col_vocab_size: Number of columns to load - should be the same as the - number of entries in `new_col_vocab_file`, since we don't support - partitioning along the column axis. - initializer: Callable initializer function that accepts a 1-D tensor as the - arg to specify the shape of the returned tensor. Used to initialize - missing values. - old_row_vocab_size: The number of entries to consider in the old vocabulary. - With the default value of -1, the entire old row vocabulary file will be - used. Otherwise, only the first `old_row_vocab_size` entries will be - considered for remapping.Must be smaller than the length of - `old_row_vocab_file`. NOTE: we do not provide an equivalent - `old_col_vocab_size` for classes. - old_row_vocab_file: A scalar `Tensor` of type `string` containing the - path to the old row vocabulary file. Can be None, which represents no - remapping on the row axis. - new_row_vocab_file: A scalar `Tensor` of type `string` containing the path - to the new row vocabulary file. Can be None, which represents no remapping - on the row axis - in which case, `new_row_vocab_offset` and - `num_rows_to_load` work under the assumption that the new row vocab is the - same as the old row vocab. - old_col_vocab_file: A scalar `Tensor` of type `string` containing the - path to the old column vocabulary file. Can be None, which represents no - remapping on the column axis. - new_col_vocab_file: A scalar `Tensor` of type `string` containing the path - to the new column vocabulary file. Can be None, which represents no - remapping on the column axis - in which case, `new_col_vocab_size` works - under the assumption that the new col vocab is the same as the old col - vocab. - num_row_oov_buckets: `int` specifying the number of out-of-vocabulary rows - to append. Must be >= 0. - num_col_oov_buckets: `int` specifying the number of out-of-vocabulary - columns to append. Must be >= 0. - max_rows_in_memory: `int` specifying the maximum number of rows to load from - the checkpoint at once. If less than or equal to 0, the entire matrix will - be loaded into memory. Setting this arg trades increased disk reads for - lower memory usage. +Note that checkpoints saved due to `keep_checkpoint_every_n_hours` will not +show up in this list (to avoid ever-growing filename lists). Returns: - A Tensor of shape `[num_rows_to_load + num_row_oov_buckets, - new_col_vocab_size + num_col_oov_buckets]`, with values loaded from the - specified tensor in the checkpoint, and any missing or OOV values - initialized with the given `initializer`. - -Raises: - ValueError: If `num_row_oov_buckets` or `num_col_oov_buckets` < 0. - ValueError: If either `old_row_vocab_file` or `new_row_vocab_file` is - provided, while the other is not. Same for `old_col_vocab_file` and - `new_col_vocab_file`. - ValueError: If neither row vocabs or col vocabs are provided." -12113,_load_and_remap_matrix_initializer,tensorflow/tensorflow/python/training/checkpoint_ops.py,206,function,"Returns a var initializer for loading and remapping a 2-D (matrix) tensor. - -The returned initializer loads a 2-D (matrix) `Tensor` with name -`old_tensor_name` from the checkpoint at `ckpt_path`. It will reorder the -rows/columns according to the specified vocab files and append additional -out-of-vocabulary rows/columns according to the number of OOV buckets. - -The format of the file at the `{old,new}_{row,col}_vocab_file` path should be -a text file, with each line containing a single entity within the vocabulary. -Let the function `line_of(f, ""x"")` return the 0-indexed line number of the -entity ""x"" in file f, and the function `entity_at(f, i)` return the entity at -line i of file f. Then, row i of the new output matrix will be taken from row -`line_of(old_row_vocab_file, entity_at(new_row_vocab_file, i))` of the old -matrix. If any entity in `new_row_vocab_file` is not found in -`old_row_vocab_file`, that row is considered a ""missing"" row, and its values -will be initialized using the `initializer` arg. The same logic also applies -for the columns. - -For example, assuming that: - -* `old_row_vocab_file` contains ""mercury\nvenus\nmars"" -* `new_row_vocab_file` contains ""venus\njupiter\nmercury"" -* `old_col_vocab_file` contains ""good\nbetter\nbest"" -* `new_col_vocab_file` contains ""good\nbest\nfantastic"" -* `initializer` returns the natural numbers `[1, 2, 3, 4, ...]` -* `w(i, j)` represents the value from row i, column j of the old matrix - -Then the new output matrix will look like: - -`[[w(1, 0), w(1, 2), 1], - [2, 3, 4], - [w(0, 0), w(0, 2), 5]]` - -If we further specify that: - -* `num_row_oov_buckets` == 2 -* `num_col_oov_buckets` == 1 - -Then the new output matrix will look like: - -`[[w(1, 0), w(1, 2), 1, 12], - [2, 3, 4, 13], - [w(0, 0), w(0, 2), 5, 14], - [6, 7, 8, 15], - [9, 10, 11, 16]]` - -If `{old,new}_row_vocab_file` are None, we assume that the old and new row -vocab files are the same, and no row remapping is done. If -`{old,new}_col_vocab_file` are None, we assume that the old and new column -vocab files are the same, and no column remapping is done. - -The returned initializer only supports div-partitioning along the row axis. It -does not support partitioning along the column axis (as this is not common in -practice) or mod-partitioning. - -NOTE: When this is used to warm-start variables, client code should use -`tf.lookup.index_table_from_tensor()` like -contrib/layers/python/layers/feature_column.py does, as opposed to -`tf.feature_to_id()` - in order to ensure the underlying lookup tables are the -same. + A list of filenames, sorted from oldest to newest." +11305,checkpoint,tensorflow/tensorflow/python/training/checkpoint_management.py,746,method,Returns the `tf.train.Checkpoint` object. +11306,save,tensorflow/tensorflow/python/training/checkpoint_management.py,750,method,"Creates a new checkpoint and manages it. Args: - ckpt_path: Path to the TensorFlow checkpoint (version 2, `TensorBundle`) - from which the old matrix `Tensor` will be loaded. - old_tensor_name: Name of the 2-D `Tensor` to load from checkpoint. - new_row_vocab_size: `int` specifying the number of entries in - `new_row_vocab_file`. If no row remapping is needed (no row vocab - provided), this should be equal to the number of rows to load from the old - matrix (which can theoretically be smaller than the number of rows in the - old matrix). - new_col_vocab_size: `int` specifying the number of entries in - `new_col_vocab_file`. If no column remapping is needed (no column vocab - provided), this should be equal to the number of columns in the old - matrix. - old_row_vocab_size: The number of entries to consider in the old vocabulary. - With the default value of -1, the entire old row vocabulary file will be - used. Otherwise, only the first `old_row_vocab_size` entries will be - considered for remapping.Must be smaller than the length of - `old_row_vocab_file`. NOTE: we do not provide an equivalent - `old_col_vocab_size` for classes. - old_row_vocab_file: A scalar `Tensor` of type `string` containing the - path to the old row vocabulary file. Can be None, which represents no - remapping on the row axis. - new_row_vocab_file: A scalar `Tensor` of type `string` containing the path - to the new row vocabulary file. Can be None, which represents no remapping - on the row axis. - old_col_vocab_file: A scalar `Tensor` of type `string` containing the - path to the old column vocabulary file. Can be None, which represents no - remapping on the column axis. - new_col_vocab_file: A scalar `Tensor` of type `string` containing the path - to the new column vocabulary file. Can be None, which represents no - remapping on the column axis. - num_row_oov_buckets: `int` specifying the number of out-of-vocabulary rows - to append. Must be >= 0. - num_col_oov_buckets: `int` specifying the number of out-of-vocabulary - columns to append. Must be >= 0. - initializer: Initializer function to initialize missing values. Accepts a - 1-D tensor as the arg to specify the shape of the returned tensor. If - `None`, defaults to using `zeros_initializer()`. - max_rows_in_memory: `int` specifying the maximum number of rows to load from - the checkpoint at once. If less than or equal to 0, the entire matrix will - be loaded into memory. Setting this arg trades increased disk reads for - lower memory usage. + checkpoint_number: An optional integer, or an integer-dtype `Variable` or + `Tensor`, used to number the checkpoint. If `None` (default), + checkpoints are numbered using `checkpoint.save_counter`. Even if + `checkpoint_number` is provided, `save_counter` is still incremented. A + user-provided `checkpoint_number` is not incremented even if it is a + `Variable`. + check_interval: An optional boolean. The argument is only effective when + `checkpoint_interval` is passed into the manager. If `True`, the manager + will only save the checkpoint if the interval between checkpoints is + larger than `checkpoint_interval`. Otherwise it will always save the + checkpoint unless a checkpoint has already been saved for the current + step. Returns: - A variable initializer function that should be used to initialize a - (potentially partitioned) `Variable` whose complete shape is - `[new_row_vocab_size + num_row_oov_buckets, new_col_vocab_size + - num_col_oov_buckets]`. + The path to the new checkpoint. It is also recorded in the `checkpoints` + and `latest_checkpoint` properties. `None` if no checkpoint is saved." +11307,restore_or_initialize,tensorflow/tensorflow/python/training/checkpoint_management.py,826,method,"Restore items in `checkpoint` from the latest checkpoint file. -Raises: - TypeError: If `initializer` is specified but not callable." -12114,_load_embedding_initializer,tensorflow/tensorflow/python/training/checkpoint_ops.py,419,function,"Returns a variable initializer for loading pre-trained embeddings. +This method will first try to restore from the most recent checkpoint in +`directory`. If no checkpoints exist in `directory`, and `init_fn` is +specified, this method will call `init_fn` to do customized +initialization. This can be used to support initialization from pretrained +models. -Wrapper around `load_and_remap_matrix_initializer()` specialized for loading -embedding weights and remapping according to the provided vocab files. See -docs for `load_and_remap_matrix_initializer()` for more details. - -NOTE: Only for use with div-partitioned variables / vocabularies. - -Args: - ckpt_path: Path to the TensorFlow checkpoint (version 2, `TensorBundle`) - from which the old matrix `Tensor` will be loaded. - embedding_tensor_name: Name of the 2-D `Tensor` to load from checkpoint. - new_vocab_size: Number of entries in the new vocab. - embedding_dim: `int` specifying the dimension of the embedding vectors from - the checkpoint. Must match the number of columns in the old embedding - matrix. - old_vocab_file: A scalar `Tensor` of type `string` containing the - path to the old vocabulary file. - new_vocab_file: A scalar `Tensor` of type `string` containing the - path to the new vocabulary file. - old_vocab_size: The number of entries to consider in the old vocabulary. - With the default value of -1, the entire old row vocabulary file will be - used. Otherwise, only the first `old_vocab_size` entries will be - considered for remapping.Must be smaller than the length of - `old_row_vocab_file`. - num_oov_buckets: `int` specifying the number of out-of-vocabulary - buckets to use. Must be >= 0. - initializer: Initializer function that accepts a 1-D tensor as the arg to - specify the shape of the returned tensor. If `None`, defaults to using - `truncated_normal_initializer()`. - max_rows_in_memory: `int` specifying the maximum number of rows to load from - the checkpoint at once. If less than or equal to 0, the entire matrix will - be loaded into memory. Setting this arg trades increased disk reads for - lower memory usage. +Note that unlike `tf.train.Checkpoint.restore()`, this method doesn't return +a load status object that users can run assertions on +(e.g. assert_consumed()). Thus to run assertions, users should directly use +`tf.train.Checkpoint.restore()` method. Returns: - A variable initializer function." -12115,LoadAndRemapWrappersTest,tensorflow/tensorflow/python/training/checkpoint_ops_test.py,40,class,Tests for the functionality of the Python wrappers. -12116,load_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,46,function,"Returns `CheckpointReader` for checkpoint found in `ckpt_dir_or_file`. + The restored checkpoint path if the lastest checkpoint is found and + restored. Otherwise None." +11308,load_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,46,function,"Returns `CheckpointReader` for checkpoint found in `ckpt_dir_or_file`. If `ckpt_dir_or_file` resolves to a directory with multiple checkpoints, reader for the latest checkpoint is returned. @@ -108270,7 +116803,7 @@ Returns: Raises: ValueError: If `ckpt_dir_or_file` resolves to a directory with no checkpoints." -12117,load_variable,tensorflow/tensorflow/python/training/checkpoint_utils.py,71,function,"Returns the tensor value of the given variable in the checkpoint. +11309,load_variable,tensorflow/tensorflow/python/training/checkpoint_utils.py,71,function,"Returns the tensor value of the given variable in the checkpoint. Args: ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint. @@ -108278,7 +116811,7 @@ Args: Returns: A numpy `ndarray` with a copy of the value of this variable." -12118,list_variables,tensorflow/tensorflow/python/training/checkpoint_utils.py,89,function,"Lists the checkpoint keys and shapes of variables in a checkpoint. +11310,list_variables,tensorflow/tensorflow/python/training/checkpoint_utils.py,89,function,"Lists the checkpoint keys and shapes of variables in a checkpoint. Checkpoint keys are paths in a checkpoint graph. @@ -108299,7 +116832,7 @@ Args: Returns: List of tuples `(key, shape)`." -12119,wait_for_new_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,121,function,"Waits until a new checkpoint file is found. +11311,wait_for_new_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,121,function,"Waits until a new checkpoint file is found. Args: checkpoint_dir: The directory in which checkpoints are saved. @@ -108312,7 +116845,7 @@ Args: Returns: a new checkpoint path, or None if the timeout was reached." -12120,checkpoints_iterator,tensorflow/tensorflow/python/training/checkpoint_utils.py,153,function,"Continuously yield new checkpoint files as they appear. +11312,checkpoints_iterator,tensorflow/tensorflow/python/training/checkpoint_utils.py,153,function,"Continuously yield new checkpoint files as they appear. The iterator only checks for new checkpoints when control flow has been reverted to it. This means it can miss checkpoints if your code takes longer @@ -108349,7 +116882,7 @@ Args: Yields: String paths to latest checkpoint files as they arrive." -12121,init_from_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,219,function,"Replaces `tf.Variable` initializers so they load from a checkpoint file. +11313,init_from_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,219,function,"Replaces `tf.Variable` initializers so they load from a checkpoint file. Values are not loaded immediately, but when the initializer is run (typically by running a `tf.compat.v1.global_variables_initializer` op). @@ -108428,40 +116961,7 @@ Args: Raises: ValueError: If missing variables in current graph, or if missing checkpoints or tensors in checkpoints." -12122,_init_from_checkpoint,tensorflow/tensorflow/python/training/checkpoint_utils.py,309,function,See `init_from_checkpoint` for documentation. -12123,_get_checkpoint_filename,tensorflow/tensorflow/python/training/checkpoint_utils.py,396,function,Returns checkpoint filename given directory or specific checkpoint file. -12124,_set_checkpoint_initializer,tensorflow/tensorflow/python/training/checkpoint_utils.py,403,function,"Overrides given variable's initialization op. - -Sets variable initializer to assign op that initializes variable from tensor's -value in the checkpoint. - -Args: - variable: `tf.Variable` object. - ckpt_file: string, full path of the checkpoint. - tensor_name: Name of the tensor to load from the checkpoint. - slice_spec: Slice specification for loading partitioned tensors. - name: Name of the operation." -12125,_set_variable_or_list_initializer,tensorflow/tensorflow/python/training/checkpoint_utils.py,445,function,"Overrides initialization op of given variable or list of variables. - -Calls `_set_checkpoint_initializer` for each variable in the given list of -variables. - -Args: - variable_or_list: `tf.Variable` object or a list of `tf.Variable` objects. - ckpt_file: string, full path of the checkpoint. - tensor_name: Name of the tensor to load from the checkpoint. - -Raises: - ValueError: if all objects in `variable_or_list` are not partitions of the - same large variable." -12126,_is_variable,tensorflow/tensorflow/python/training/checkpoint_utils.py,476,function, -12127,_collect_partitioned_variable,tensorflow/tensorflow/python/training/checkpoint_utils.py,481,function,Returns list of `tf.Variable` that comprise the partitioned variable. -12128,_create_checkpoints,tensorflow/tensorflow/python/training/checkpoint_utils_test.py,44,function, -12129,_create_partition_checkpoints,tensorflow/tensorflow/python/training/checkpoint_utils_test.py,63,function, -12130,CheckpointsTest,tensorflow/tensorflow/python/training/checkpoint_utils_test.py,84,class, -12131,CheckpointIteratorTest,tensorflow/tensorflow/python/training/checkpoint_utils_test.py,400,class, -12132,WaitForNewCheckpointTest,tensorflow/tensorflow/python/training/checkpoint_utils_test.py,474,class, -12133,Coordinator,tensorflow/tensorflow/python/training/coordinator.py,34,class,"A coordinator for threads. +11314,Coordinator,tensorflow/tensorflow/python/training/coordinator.py,34,class,"A coordinator for threads. This class implements a simple mechanism to coordinate the termination of a set of threads. @@ -108554,7 +117054,95 @@ except RuntimeError: except Exception: ...exception that was passed to coord.request_stop() ```" -12134,LooperThread,tensorflow/tensorflow/python/training/coordinator.py,412,class,"A thread that runs code repeatedly, optionally on a timer. +11315,request_stop,tensorflow/tensorflow/python/training/coordinator.py,187,method,"Request that the threads stop. + +After this is called, calls to `should_stop()` will return `True`. + +Note: If an exception is being passed in, in must be in the context of +handling the exception (i.e. `try: ... except Exception as ex: ...`) and not +a newly created one. + +Args: + ex: Optional `Exception`, or Python `exc_info` tuple as returned by + `sys.exc_info()`. If this is the first call to `request_stop()` the + corresponding exception is recorded and re-raised from `join()`." +11316,clear_stop,tensorflow/tensorflow/python/training/coordinator.py,246,method,"Clears the stop flag. + +After this is called, calls to `should_stop()` will return `False`." +11317,should_stop,tensorflow/tensorflow/python/training/coordinator.py,257,method,"Check if stop was requested. + +Returns: + True if a stop was requested." +11318,stop_on_exception,tensorflow/tensorflow/python/training/coordinator.py,266,method,"Context manager to request stop when an Exception is raised. + +Code that uses a coordinator must catch exceptions and pass +them to the `request_stop()` method to stop the other threads +managed by the coordinator. + +This context handler simplifies the exception handling. +Use it as follows: + +```python +with coord.stop_on_exception(): + # Any exception raised in the body of the with + # clause is reported to the coordinator before terminating + # the execution of the body. + ...body... +``` + +This is completely equivalent to the slightly longer code: + +```python +try: + ...body... +except: + coord.request_stop(sys.exc_info()) +``` + +Yields: + nothing." +11319,wait_for_stop,tensorflow/tensorflow/python/training/coordinator.py,301,method,"Wait till the Coordinator is told to stop. + +Args: + timeout: Float. Sleep for up to that many seconds waiting for + should_stop() to become True. + +Returns: + True if the Coordinator is told stop, False if the timeout expired." +11320,register_thread,tensorflow/tensorflow/python/training/coordinator.py,313,method,"Register a thread to join. + +Args: + thread: A Python thread to join." +11321,join,tensorflow/tensorflow/python/training/coordinator.py,322,method,"Wait for threads to terminate. + +This call blocks until a set of threads have terminated. The set of thread +is the union of the threads passed in the `threads` argument and the list +of threads that registered with the coordinator by calling +`Coordinator.register_thread()`. + +After the threads stop, if an `exc_info` was passed to `request_stop`, that +exception is re-raised. + +Grace period handling: When `request_stop()` is called, threads are given +'stop_grace_period_secs' seconds to terminate. If any of them is still +alive after that period expires, a `RuntimeError` is raised. Note that if +an `exc_info` was passed to `request_stop()` then it is raised instead of +that `RuntimeError`. + +Args: + threads: List of `threading.Threads`. The started threads to join in + addition to the registered threads. + stop_grace_period_secs: Number of seconds given to threads to stop after + `request_stop()` has been called. + ignore_live_threads: If `False`, raises an error if any of the threads are + still alive after `stop_grace_period_secs`. + +Raises: + RuntimeError: If any thread is still alive after `request_stop()` + is called and the grace period expires." +11322,joined,tensorflow/tensorflow/python/training/coordinator.py,400,method, +11323,raise_requested_exception,tensorflow/tensorflow/python/training/coordinator.py,403,method,"If an exception has been passed to `request_stop`, this raises it." +11324,LooperThread,tensorflow/tensorflow/python/training/coordinator.py,412,class,"A thread that runs code repeatedly, optionally on a timer. This thread class is intended to be used with a `Coordinator`. It repeatedly runs code specified either as `target` and `args` or by the `run_loop()` @@ -108568,23 +117156,32 @@ coordinator and the thread terminates. The coordinator will then request all the other threads it coordinates to stop. You typically pass looper threads to the supervisor `Join()` method." -12135,StopOnEvent,tensorflow/tensorflow/python/training/coordinator_test.py,30,function, -12136,RaiseOnEvent,tensorflow/tensorflow/python/training/coordinator_test.py,36,function, -12137,RaiseOnEventUsingContextHandler,tensorflow/tensorflow/python/training/coordinator_test.py,50,function, -12138,SleepABit,tensorflow/tensorflow/python/training/coordinator_test.py,58,function, -12139,WaitForThreadsToRegister,tensorflow/tensorflow/python/training/coordinator_test.py,64,function, -12140,CoordinatorTest,tensorflow/tensorflow/python/training/coordinator_test.py,72,class, -12141,_StopAt0,tensorflow/tensorflow/python/training/coordinator_test.py,337,function, -12142,LooperTest,tensorflow/tensorflow/python/training/coordinator_test.py,344,class, -12143,_RoundRobinStrategy,tensorflow/tensorflow/python/training/device_setter.py,40,class,"Returns the next ps task index for placement in round-robin order. +11325,loop,tensorflow/tensorflow/python/training/coordinator.py,460,method,"Start a LooperThread that calls a function periodically. -This class is not to be used directly by users. See instead -`replica_device_setter()` below." -12144,_ReplicaDeviceChooser,tensorflow/tensorflow/python/training/device_setter.py,71,class,"Class to choose devices for Ops in a replicated training setup. +If `timer_interval_secs` is None the thread calls `target(args)` +repeatedly. Otherwise `target(args)` is called every `timer_interval_secs` +seconds. The thread terminates when a stop of the coordinator is +requested. -This class is not to be used directly by users. See instead -`replica_device_setter()` below." -12145,replica_device_setter,tensorflow/tensorflow/python/training/device_setter.py,137,function,"Return a `device function` to use when building a Graph for replicas. +Args: + coord: A Coordinator. + timer_interval_secs: Number. Time boundaries at which to call `target`. + target: A callable object. + args: Optional arguments to pass to `target` when calling it. + kwargs: Optional keyword arguments to pass to `target` when calling it. + +Returns: + The started thread." +11326,run,tensorflow/tensorflow/python/training/coordinator.py,483,method, +11327,start_loop,tensorflow/tensorflow/python/training/coordinator.py,498,method,Called when the thread starts. +11328,stop_loop,tensorflow/tensorflow/python/training/coordinator.py,502,method,Called when the thread stops. +11329,run_loop,tensorflow/tensorflow/python/training/coordinator.py,506,method,Called at 'timer_interval_secs' boundaries. +11330,StopOnEvent,tensorflow/tensorflow/python/training/coordinator_test.py,30,function, +11331,RaiseOnEvent,tensorflow/tensorflow/python/training/coordinator_test.py,36,function, +11332,RaiseOnEventUsingContextHandler,tensorflow/tensorflow/python/training/coordinator_test.py,50,function, +11333,SleepABit,tensorflow/tensorflow/python/training/coordinator_test.py,58,function, +11334,WaitForThreadsToRegister,tensorflow/tensorflow/python/training/coordinator_test.py,64,function, +11335,replica_device_setter,tensorflow/tensorflow/python/training/device_setter.py,137,function,"Return a `device function` to use when building a Graph for replicas. Device Functions are used in `with tf.device(device_function):` statement to automatically assign devices to `Operation` objects as they are constructed, @@ -108641,72 +117238,9 @@ Returns: Raises: TypeError if `cluster` is not a dictionary or `ClusterDef` protocol buffer, or if `ps_strategy` is provided but not a callable." -12146,DeviceSetterTest,tensorflow/tensorflow/python/training/device_setter_test.py,30,class, -12147,_get_or_create_eval_step,tensorflow/tensorflow/python/training/evaluation.py,37,function,"Gets or creates the eval step `Tensor`. - -Returns: - A `Tensor` representing a counter for the evaluation step. - -Raises: - ValueError: If multiple `Tensors` have been added to the - `tf.GraphKeys.EVAL_STEP` collection." -12148,_get_latest_eval_step_value,tensorflow/tensorflow/python/training/evaluation.py,64,function,"Gets the eval step `Tensor` value after running `update_ops`. - -Args: - update_ops: A list of `Tensors` or a dictionary of names to `Tensors`, which - are run before reading the eval step value. - -Returns: - A `Tensor` representing the value for the evaluation step." -12149,_MultiStepStopAfterNEvalsHook,tensorflow/tensorflow/python/training/evaluation.py,81,class,Run hook used by the evaluation routines to run the `eval_ops` N times. -12150,_StopAfterNEvalsHook,tensorflow/tensorflow/python/training/evaluation.py,133,class,Run hook used by the evaluation routines to run the `eval_ops` N times. -12151,_evaluate_once,tensorflow/tensorflow/python/training/evaluation.py,172,function,"Evaluates the model at the given checkpoint path. - -During a single evaluation, the `eval_ops` is run until the session is -interrupted or requested to finish. This is typically requested via a -`tf.contrib.training.StopAfterNEvalsHook` which results in `eval_ops` running -the requested number of times. - -Optionally, a user can pass in `final_ops`, a single `Tensor`, a list of -`Tensors` or a dictionary from names to `Tensors`. The `final_ops` is -evaluated a single time after `eval_ops` has finished running and the fetched -values of `final_ops` are returned. If `final_ops` is left as `None`, then -`None` is returned. - -One may also consider using a `tf.contrib.training.SummaryAtEndHook` to record -summaries after the `eval_ops` have run. If `eval_ops` is `None`, the -summaries run immediately after the model checkpoint has been restored. - -Note that `evaluate_once` creates a local variable used to track the number of -evaluations run via `tf.contrib.training.get_or_create_eval_step`. -Consequently, if a custom local init op is provided via a `scaffold`, the -caller should ensure that the local init op also initializes the eval step. - -Args: - checkpoint_path: The path to a checkpoint to use for evaluation. - master: The BNS address of the TensorFlow master. - scaffold: An tf.compat.v1.train.Scaffold instance for initializing variables - and restoring variables. Note that `scaffold.init_fn` is used by the - function to restore the checkpoint. If you supply a custom init_fn, then - it must also take care of restoring the model from its checkpoint. - eval_ops: A single `Tensor`, a list of `Tensors` or a dictionary of names to - `Tensors`, which is run until the session is requested to stop, commonly - done by a `tf.contrib.training.StopAfterNEvalsHook`. - feed_dict: The feed dictionary to use when executing the `eval_ops`. - final_ops: A single `Tensor`, a list of `Tensors` or a dictionary of names - to `Tensors`. - final_ops_feed_dict: A feed dictionary to use when evaluating `final_ops`. - hooks: List of `tf.estimator.SessionRunHook` callbacks which are run inside - the evaluation loop. - config: An instance of `tf.compat.v1.ConfigProto` that will be used to - configure the `Session`. If left as `None`, the default will be used. - -Returns: - The fetched values of `final_ops` or `None` if `final_ops` is `None`." -12152,logistic_classifier,tensorflow/tensorflow/python/training/evaluation_test.py,47,function, -12153,local_variable,tensorflow/tensorflow/python/training/evaluation_test.py,51,function, -12154,EvaluateOnceTest,tensorflow/tensorflow/python/training/evaluation_test.py,60,class, -12155,FtrlOptimizer,tensorflow/tensorflow/python/training/ftrl.py,29,class,"Optimizer that implements the FTRL algorithm. +11336,logistic_classifier,tensorflow/tensorflow/python/training/evaluation_test.py,47,function, +11337,local_variable,tensorflow/tensorflow/python/training/evaluation_test.py,51,function, +11338,FtrlOptimizer,tensorflow/tensorflow/python/training/ftrl.py,29,class,"Optimizer that implements the FTRL algorithm. This version has support for both online L2 (McMahan et al., 2013) and shrinkage-type L2, which is the addition of an L2 penalty @@ -108716,11 +117250,9 @@ References: Ad-click prediction: [McMahan et al., 2013](https://dl.acm.org/citation.cfm?id=2488200) ([pdf](https://dl.acm.org/ft_gateway.cfm?id=2488200&ftid=1388399&dwn=1&CFID=32233078&CFTOKEN=d60fe57a294c056a-CB75C374-F915-E7A6-1573FBBC7BF7D526))" -12156,FtrlOptimizerTest,tensorflow/tensorflow/python/training/ftrl_test.py,36,class, -12157,GradientDescentOptimizer,tensorflow/tensorflow/python/training/gradient_descent.py,30,class,"Optimizer that implements the gradient descent algorithm. +11339,GradientDescentOptimizer,tensorflow/tensorflow/python/training/gradient_descent.py,30,class,"Optimizer that implements the gradient descent algorithm. " -12158,GradientDescentOptimizerTest,tensorflow/tensorflow/python/training/gradient_descent_test.py,36,class, -12159,match_filenames_once,tensorflow/tensorflow/python/training/input.py,62,function,"Save the list of files matching pattern, so it is only computed once. +11340,match_filenames_once,tensorflow/tensorflow/python/training/input.py,62,function,"Save the list of files matching pattern, so it is only computed once. NOTE: The order of the files returned is deterministic. @@ -108730,7 +117262,7 @@ Args: Returns: A variable that is initialized to the list of files matching the pattern(s)." -12160,limit_epochs,tensorflow/tensorflow/python/training/input.py,85,function,"Returns tensor `num_epochs` times and then raises an `OutOfRange` error. +11341,limit_epochs,tensorflow/tensorflow/python/training/input.py,85,function,"Returns tensor `num_epochs` times and then raises an `OutOfRange` error. Note: creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. @@ -108746,7 +117278,7 @@ Returns: Raises: ValueError: if `num_epochs` is invalid." -12161,input_producer,tensorflow/tensorflow/python/training/input.py,123,function,"Output the rows of `input_tensor` to a queue for an input pipeline. +11342,input_producer,tensorflow/tensorflow/python/training/input.py,123,function,"Output the rows of `input_tensor` to a queue for an input pipeline. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. @@ -108786,7 +117318,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12162,string_input_producer,tensorflow/tensorflow/python/training/input.py,211,function,"Output strings (e.g. filenames) to a queue for an input pipeline. +11343,string_input_producer,tensorflow/tensorflow/python/training/input.py,211,function,"Output strings (e.g. filenames) to a queue for an input pipeline. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. @@ -108822,7 +117354,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12163,range_input_producer,tensorflow/tensorflow/python/training/input.py,285,function,"Produces the integers from 0 to limit-1 in a queue. +11344,range_input_producer,tensorflow/tensorflow/python/training/input.py,285,function,"Produces the integers from 0 to limit-1 in a queue. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. @@ -108849,7 +117381,7 @@ Returns: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12164,slice_input_producer,tensorflow/tensorflow/python/training/input.py,328,function,"Produces a slice of each `Tensor` in `tensor_list`. +11345,slice_input_producer,tensorflow/tensorflow/python/training/input.py,328,function,"Produces a slice of each `Tensor` in `tensor_list`. Implemented using a Queue -- a `QueueRunner` for the Queue is added to the current `Graph`'s `QUEUE_RUNNER` collection. @@ -108881,70 +117413,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12165,_flatten,tensorflow/tensorflow/python/training/input.py,382,function, -12166,_SparseMetaData,tensorflow/tensorflow/python/training/input.py,386,class,"Store information about the Tensor: Is it sparse?, map_op, and rank." -12167,_as_tensor_list,tensorflow/tensorflow/python/training/input.py,445,function, -12168,_as_tensor_list_list,tensorflow/tensorflow/python/training/input.py,452,function, -12169,_as_original_type,tensorflow/tensorflow/python/training/input.py,466,function, -12170,_store_sparse_tensors,tensorflow/tensorflow/python/training/input.py,478,function,"Store SparseTensors for feeding into batch, etc. - -If `shared_map_ops` is provided, the underlying `SparseTensorsMap` objects -are reused (shared). This argument is useful for, e.g., `batch_join` -where multiple enqueue operations write to the same Queue component, -and another (dequeue) thread reads from that same location and must then -restore the associated `SparseTensor` objects. In this case, the sparse -restore must have a single `SparseTensorMap` from which to read out the -handles; so a single `SparseTensorMap` must be shared for storing -across the multiple enqueue operations. This sharing is performed by -calling `_store_sparse_tensors` the first time with `shared_map_ops=None`, -and then in subsequent times with this value set to the list of `Operation` -objects created in the first call. - -Args: - tensor_list: List of `Tensor` and `SparseTensor` objects. - enqueue_many: Python `Boolean`. - keep_input: Must be a scalar bool Tensor (not a Python bool). If False, - don't store. - shared_map_ops: (optional) List of `Operation` objects from a previous - call to `_store_sparse_tensors`. If not `None`, the op types should be - one of `AddSparseToTensorsMap` or `AddManySparseToTensorsMap` in the - locations corresponding to `SparseTensors` in `tensor_list`. - -Returns: - A tuple `(stored_list, sparse_info_list)` where `stored_list` is a list - of `Tensor` objects (same length as `tensor_list`) and `sparse_info_list` - is a list of the same length of `_SparseMetaData` objects." -12171,_store_sparse_tensors_join,tensorflow/tensorflow/python/training/input.py,580,function,"Store SparseTensors for feeding into batch_join, etc." -12172,_restore_sparse_tensors,tensorflow/tensorflow/python/training/input.py,600,function,"Restore SparseTensors after dequeue in batch, batch_join, etc." -12173,_validate,tensorflow/tensorflow/python/training/input.py,630,function, -12174,_validate_join,tensorflow/tensorflow/python/training/input.py,637,function, -12175,_validate_keep_input,tensorflow/tensorflow/python/training/input.py,645,function,Validate `keep_input` argument to conditional batching functions. -12176,_dtypes,tensorflow/tensorflow/python/training/input.py,659,function, -12177,_merge_shapes,tensorflow/tensorflow/python/training/input.py,670,function, -12178,_shapes,tensorflow/tensorflow/python/training/input.py,681,function,"Calculate and merge the shapes of incoming tensors. - -Args: - tensor_list_list: List of tensor lists. - shapes: List of shape tuples corresponding to tensors within the lists. - enqueue_many: Boolean describing whether shapes will be enqueued as - batches or individual entries. - -Returns: - A list of shapes aggregating shape inference info from `tensor_list_list`, - or returning `shapes` if it is not `None`. - -Raises: - ValueError: If any of the inferred shapes in `tensor_list_list` lack a - well defined rank." -12179,_select_which_to_enqueue,tensorflow/tensorflow/python/training/input.py,712,function,Select which examples to enqueue based on vector `keep_input`. -12180,_enqueue_join,tensorflow/tensorflow/python/training/input.py,721,function,Enqueue `tensor_list_list` in `queue`. -12181,_enqueue,tensorflow/tensorflow/python/training/input.py,738,function,Enqueue `tensor_list` in `queue`. -12182,_which_queue,tensorflow/tensorflow/python/training/input.py,755,function, -12183,_batch,tensorflow/tensorflow/python/training/input.py,760,function,Helper function for `batch` and `maybe_batch`. -12184,_batch_join,tensorflow/tensorflow/python/training/input.py,800,function,Helper function for `batch_join` and `maybe_batch_join`. -12185,_shuffle_batch,tensorflow/tensorflow/python/training/input.py,835,function,Helper function for `shuffle_batch` and `maybe_shuffle_batch`. -12186,_shuffle_batch_join,tensorflow/tensorflow/python/training/input.py,879,function,Helper function for `shuffle_batch_join` and `maybe_shuffle_batch_join`. -12187,batch,tensorflow/tensorflow/python/training/input.py,929,function,"Creates batches of tensors in `tensors`. +11346,batch,tensorflow/tensorflow/python/training/input.py,929,function,"Creates batches of tensors in `tensors`. The argument `tensors` can be a list or a dictionary of tensors. The value returned by the function will be of the same type @@ -109020,7 +117489,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12188,maybe_batch,tensorflow/tensorflow/python/training/input.py,1028,function,"Conditionally creates batches of tensors based on `keep_input`. +11347,maybe_batch,tensorflow/tensorflow/python/training/input.py,1028,function,"Conditionally creates batches of tensors based on `keep_input`. See docstring in `batch` for more details. @@ -109054,7 +117523,7 @@ Returns: Raises: ValueError: If the `shapes` are not specified, and cannot be inferred from the elements of `tensors`." -12189,batch_join,tensorflow/tensorflow/python/training/input.py,1085,function,"Runs a list of tensors to fill a queue to create batches of examples. +11348,batch_join,tensorflow/tensorflow/python/training/input.py,1085,function,"Runs a list of tensors to fill a queue to create batches of examples. The `tensors_list` argument is a list of tuples of tensors, or a list of dictionaries of tensors. Each element in the list is treated similarly @@ -109142,7 +117611,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12190,maybe_batch_join,tensorflow/tensorflow/python/training/input.py,1195,function,"Runs a list of tensors to conditionally fill a queue to create batches. +11349,maybe_batch_join,tensorflow/tensorflow/python/training/input.py,1195,function,"Runs a list of tensors to conditionally fill a queue to create batches. See docstring in `batch_join` for more details. @@ -109176,7 +117645,7 @@ Returns: Raises: ValueError: If the `shapes` are not specified, and cannot be inferred from the elements of `tensor_list_list`." -12191,shuffle_batch,tensorflow/tensorflow/python/training/input.py,1251,function,"Creates batches by randomly shuffling tensors. +11350,shuffle_batch,tensorflow/tensorflow/python/training/input.py,1251,function,"Creates batches by randomly shuffling tensors. This function adds the following to the current `Graph`: @@ -109256,7 +117725,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12192,maybe_shuffle_batch,tensorflow/tensorflow/python/training/input.py,1355,function,"Creates batches by randomly shuffling conditionally-enqueued tensors. +11351,maybe_shuffle_batch,tensorflow/tensorflow/python/training/input.py,1355,function,"Creates batches by randomly shuffling conditionally-enqueued tensors. See docstring in `shuffle_batch` for more details. @@ -109294,7 +117763,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12193,shuffle_batch_join,tensorflow/tensorflow/python/training/input.py,1419,function,"Create batches by randomly shuffling tensors. +11352,shuffle_batch_join,tensorflow/tensorflow/python/training/input.py,1419,function,"Create batches by randomly shuffling tensors. The `tensors_list` argument is a list of tuples of tensors, or a list of dictionaries of tensors. Each element in the list is treated similarly @@ -109368,7 +117837,7 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12194,maybe_shuffle_batch_join,tensorflow/tensorflow/python/training/input.py,1517,function,"Create batches by randomly shuffling conditionally-enqueued tensors. +11353,maybe_shuffle_batch_join,tensorflow/tensorflow/python/training/input.py,1517,function,"Create batches by randomly shuffling conditionally-enqueued tensors. See docstring in `shuffle_batch_join` for more details. @@ -109407,21 +117876,11 @@ Raises: Input pipelines based on Queues are not supported when eager execution is enabled. Please use the `tf.data` API to ingest data under eager execution. @end_compatibility" -12195,MatchFilenamesOnceTest,tensorflow/tensorflow/python/training/input_test.py,46,class, -12196,LimitEpochsTest,tensorflow/tensorflow/python/training/input_test.py,73,class, -12197,InputProducerTest,tensorflow/tensorflow/python/training/input_test.py,95,class, -12198,StringInputProducerTest,tensorflow/tensorflow/python/training/input_test.py,153,class, -12199,RangeInputProducerTest,tensorflow/tensorflow/python/training/input_test.py,269,class, -12200,SliceInputProducerTest,tensorflow/tensorflow/python/training/input_test.py,341,class, -12201,DictHelperTest,tensorflow/tensorflow/python/training/input_test.py,425,class, -12202,BatchTest,tensorflow/tensorflow/python/training/input_test.py,449,class, -12203,BatchJoinTest,tensorflow/tensorflow/python/training/input_test.py,1000,class, -12204,ShuffleBatchTest,tensorflow/tensorflow/python/training/input_test.py,1624,class, -12205,ShuffleBatchJoinTest,tensorflow/tensorflow/python/training/input_test.py,2044,class, -12206,CreateLocalClusterTest,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,36,class, -12207,CreateLocalClusterBenchmark,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,60,class, -12208,PartitionedVariablesBenchmark,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,80,class, -12209,MomentumOptimizer,tensorflow/tensorflow/python/training/momentum.py,29,class,"Optimizer that implements the Momentum algorithm. +11354,CreateLocalClusterBenchmark,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,60,class, +11355,benchmarkCreateLocalCluster,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,62,method, +11356,PartitionedVariablesBenchmark,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,80,class, +11357,benchmark_create_1000_partitions_with_100_parameter_servers,tensorflow/tensorflow/python/training/localhost_cluster_performance_test.py,82,method, +11358,MomentumOptimizer,tensorflow/tensorflow/python/training/momentum.py,29,class,"Optimizer that implements the Momentum algorithm. Computes (if `use_nesterov = False`): @@ -109435,8 +117894,7 @@ and applied regardless of a gradient's value, whereas the sparse version (when the gradient is an `IndexedSlices`, typically because of `tf.gather` or an embedding) only updates variable slices and corresponding `accumulation` terms when that part of the variable was used in the forward pass." -12210,MomentumOptimizerTest,tensorflow/tensorflow/python/training/momentum_test.py,38,class, -12211,Scaffold,tensorflow/tensorflow/python/training/monitored_session.py,59,class,"Structure to create or gather pieces commonly needed to train a model. +11359,Scaffold,tensorflow/tensorflow/python/training/monitored_session.py,59,class,"Structure to create or gather pieces commonly needed to train a model. When you build a model for training you usually need ops to initialize variables, a `Saver` to checkpoint them, an op to collect summaries for @@ -109480,8 +117938,31 @@ You can also pass the following additional pieces to the constructor: * `init_fn`: A callable to run after the init op to perform additional initializations. The callable will be called as `init_fn(scaffold, session)`." -12212,_create_monitored_session_with_worker_context,tensorflow/tensorflow/python/training/monitored_session.py,321,function, -12213,MonitoredTrainingSession,tensorflow/tensorflow/python/training/monitored_session.py,434,function,"Creates a `MonitoredSession` for training. +11360,finalize,tensorflow/tensorflow/python/training/monitored_session.py,190,method,Creates operations if needed and finalizes the graph. +11361,init_fn,tensorflow/tensorflow/python/training/monitored_session.py,250,method, +11362,init_op,tensorflow/tensorflow/python/training/monitored_session.py,254,method, +11363,ready_op,tensorflow/tensorflow/python/training/monitored_session.py,258,method, +11364,ready_for_local_init_op,tensorflow/tensorflow/python/training/monitored_session.py,262,method, +11365,local_init_op,tensorflow/tensorflow/python/training/monitored_session.py,266,method, +11366,local_init_feed_dict,tensorflow/tensorflow/python/training/monitored_session.py,270,method, +11367,summary_op,tensorflow/tensorflow/python/training/monitored_session.py,274,method, +11368,saver,tensorflow/tensorflow/python/training/monitored_session.py,278,method, +11369,init_feed_dict,tensorflow/tensorflow/python/training/monitored_session.py,282,method, +11370,get_or_default,tensorflow/tensorflow/python/training/monitored_session.py,286,method,Get from cache or create a default operation. +11371,default_local_init_op,tensorflow/tensorflow/python/training/monitored_session.py,303,method,"Returns an op that groups the default local init ops. + +This op is used during session initialization when a Scaffold is +initialized without specifying the local_init_op arg. It includes +`tf.compat.v1.local_variables_initializer`, +`tf.compat.v1.tables_initializer`, and also +initializes local session resources. + +Returns: + The default Scaffold local init op." +11372,default_init_op,tensorflow/tensorflow/python/training/monitored_session.py,194,method, +11373,default_ready_op,tensorflow/tensorflow/python/training/monitored_session.py,203,method, +11374,default_ready_for_local_init_op,tensorflow/tensorflow/python/training/monitored_session.py,214,method, +11375,MonitoredTrainingSession,tensorflow/tensorflow/python/training/monitored_session.py,434,function,"Creates a `MonitoredSession` for training. For a chief, this utility sets proper session initializer/restorer. It also creates hooks related to checkpoint and summary saving. For workers, this @@ -109541,11 +118022,13 @@ Args: Returns: A `MonitoredSession` object." -12214,SessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,609,class,A factory for tf.Session. -12215,ChiefSessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,619,class,Creates a tf.compat.v1.Session for a chief. -12216,WorkerSessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,673,class,Creates a tf.compat.v1.Session for a worker. -12217,_MonitoredSession,tensorflow/tensorflow/python/training/monitored_session.py,715,class,See `MonitoredSession` or `SingularMonitoredSession`. -12218,MonitoredSession,tensorflow/tensorflow/python/training/monitored_session.py,954,class,"Session-like object that handles initialization, recovery and hooks. +11376,SessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,609,class,A factory for tf.Session. +11377,create_session,tensorflow/tensorflow/python/training/monitored_session.py,613,method, +11378,ChiefSessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,619,class,Creates a tf.compat.v1.Session for a chief. +11379,create_session,tensorflow/tensorflow/python/training/monitored_session.py,659,method, +11380,WorkerSessionCreator,tensorflow/tensorflow/python/training/monitored_session.py,673,class,Creates a tf.compat.v1.Session for a worker. +11381,create_session,tensorflow/tensorflow/python/training/monitored_session.py,709,method, +11382,MonitoredSession,tensorflow/tensorflow/python/training/monitored_session.py,954,class,"Session-like object that handles initialization, recovery and hooks. Example usage: @@ -109618,7 +118101,7 @@ Args: Returns: A MonitoredSession object." -12219,SingularMonitoredSession,tensorflow/tensorflow/python/training/monitored_session.py,1042,class,"Session-like object that handles initialization, restoring, and hooks. +11383,SingularMonitoredSession,tensorflow/tensorflow/python/training/monitored_session.py,1042,class,"Session-like object that handles initialization, restoring, and hooks. Please note that this utility is not recommended for distributed settings. For distributed settings, please use `tf.compat.v1.train.MonitoredSession`. @@ -109668,79 +118151,37 @@ Exit: At the `close()`, the hooked session does following things in order: * closes the queue runners and the session * suppresses `OutOfRange` error which indicates that all inputs have been processed if the `SingularMonitoredSession` is used as a context." -12220,_WrappedSession,tensorflow/tensorflow/python/training/monitored_session.py,1135,class,"Wrapper around a `tf.compat.v1.Session`. - -This wrapper is used as a base class for various session wrappers -that provide additional functionality such as monitoring, coordination, -and recovery. - -In addition to the methods exported by `SessionInterface` the wrapper -provides a method to check for stop and never raises exceptions from -calls to `close()`." -12221,_RecoverableSession,tensorflow/tensorflow/python/training/monitored_session.py,1210,class,"A wrapped session that recreates a session upon certain kinds of errors. - -The constructor is passed a SessionCreator object, not a session. - -Calls to `run()` are delegated to the wrapped session. If a call raises the -exception `tf.errors.AbortedError` or `tf.errors.UnavailableError`, the -wrapped session is closed, and a new one is created by calling the factory -again." -12222,_CoordinatedSession,tensorflow/tensorflow/python/training/monitored_session.py,1319,class,"A wrapped session that works with a `tf.Coordinator`. - -Calls to `run()` are delegated to the wrapped session. If a call -raises an exception, the exception is reported to the coordinator. - -In addition, after each call to `run()` this session ask the coordinator if -the session should stop. In that case it will will join all the threads -registered with the coordinator before returning. - -If the coordinator was requested to stop with an exception, that exception -will be re-raised from the call to `run()`." -12223,_HookedSession,tensorflow/tensorflow/python/training/monitored_session.py,1387,class,"A _WrappedSession that calls hooks during calls to run(). - -The list of hooks to call is passed in the constructor. Before each call -to `run()` the session calls the `before_run()` method of the hooks, which -can return additional ops or tensors to run. These are added to the arguments -of the call to `run()`. - -When the `run()` call finishes, the session calls the `after_run()` methods of -the hooks, passing the values returned by the `run()` call corresponding to -the ops and tensors that each hook requested. - -If any call to the hooks, requests stop via run_context the session will be -marked as needing to stop and its `should_stop()` method will now return -`True`." -12224,latest_summaries,tensorflow/tensorflow/python/training/monitored_session_test.py,57,function,Parse summary events from latest event file in base_dir. -12225,ScaffoldTest,tensorflow/tensorflow/python/training/monitored_session_test.py,64,class,Scaffold tests. -12226,_test_dir,tensorflow/tensorflow/python/training/monitored_session_test.py,238,function,"Create an empty dir to use for tests. - -Args: - temp_dir: Tmp directory path. - test_name: Name of the test. - -Returns: - Absolute path to the test directory." -12227,FakeHook,tensorflow/tensorflow/python/training/monitored_session_test.py,257,class, -12228,MonitoredTrainingSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,287,class,Tests MonitoredTrainingSession. -12229,MockExtended,tensorflow/tensorflow/python/training/monitored_session_test.py,433,class, -12230,MockStrategy,tensorflow/tensorflow/python/training/monitored_session_test.py,443,class, -12231,MonitoredTrainingSessionWithDistributeCoordinatorTest,tensorflow/tensorflow/python/training/monitored_session_test.py,454,class,Test distribute coordinator controls summary saving and checkpointing. -12232,StopAtNSession,tensorflow/tensorflow/python/training/monitored_session_test.py,564,class,A wrapped session that stops at the N-th call to _check_stop. -12233,WrappedSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,578,class,_WrappedSession tests. -12234,busy_wait_for_coord_stop,tensorflow/tensorflow/python/training/monitored_session_test.py,636,function, -12235,CoordinatedSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,641,class,_CoordinatedSession tests. -12236,AbortAtNSession,tensorflow/tensorflow/python/training/monitored_session_test.py,770,class,A mock session that aborts at the N-th run call. -12237,StopCoordinatorWithException,tensorflow/tensorflow/python/training/monitored_session_test.py,787,class,With this hook Coordinator throws an exception after N-runs. -12238,FailTrainingAfterCoordinatorStopped,tensorflow/tensorflow/python/training/monitored_session_test.py,832,class,With this hook training encounters an exception after N-runs. -12239,CountingSessionCreator,tensorflow/tensorflow/python/training/monitored_session_test.py,861,class,A creator that counts the number of created sessions. -12240,RecoverableSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,880,class,_RecoverableSession tests. -12241,FakeSession,tensorflow/tensorflow/python/training/monitored_session_test.py,1252,class, -12242,HookedSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,1264,class,Tests of _HookedSession. -12243,RaiseOnceAtCountN,tensorflow/tensorflow/python/training/monitored_session_test.py,1419,class,Hook that raises an Exception at step N. -12244,RunOptionsMetadataHook,tensorflow/tensorflow/python/training/monitored_session_test.py,1436,class,A hook that observes & optionally modifies RunOptions and RunMetadata. -12245,MonitoredSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,1467,class,MonitoredSession tests. -12246,SingularMonitoredSessionTest,tensorflow/tensorflow/python/training/monitored_session_test.py,2221,class,Tests SingularMonitoredSession. -12247,assign_moving_average,tensorflow/tensorflow/python/training/moving_averages.py,36,function,"Compute the moving average of a variable. +11384,raw_session,tensorflow/tensorflow/python/training/monitored_session.py,1130,method,Returns underlying `TensorFlow.Session` object. +11385,FakeHook,tensorflow/tensorflow/python/training/monitored_session_test.py,257,class, +11386,begin,tensorflow/tensorflow/python/training/monitored_session_test.py,266,method, +11387,after_create_session,tensorflow/tensorflow/python/training/monitored_session_test.py,269,method, +11388,before_run,tensorflow/tensorflow/python/training/monitored_session_test.py,272,method, +11389,after_run,tensorflow/tensorflow/python/training/monitored_session_test.py,277,method, +11390,end,tensorflow/tensorflow/python/training/monitored_session_test.py,283,method, +11391,MockExtended,tensorflow/tensorflow/python/training/monitored_session_test.py,433,class, +11392,MockStrategy,tensorflow/tensorflow/python/training/monitored_session_test.py,443,class, +11393,StopAtNSession,tensorflow/tensorflow/python/training/monitored_session_test.py,564,class,A wrapped session that stops at the N-th call to _check_stop. +11394,busy_wait_for_coord_stop,tensorflow/tensorflow/python/training/monitored_session_test.py,636,function, +11395,AbortAtNSession,tensorflow/tensorflow/python/training/monitored_session_test.py,770,class,A mock session that aborts at the N-th run call. +11396,close,tensorflow/tensorflow/python/training/monitored_session_test.py,777,method, +11397,run,tensorflow/tensorflow/python/training/monitored_session_test.py,780,method, +11398,StopCoordinatorWithException,tensorflow/tensorflow/python/training/monitored_session_test.py,787,class,With this hook Coordinator throws an exception after N-runs. +11399,after_create_session,tensorflow/tensorflow/python/training/monitored_session_test.py,809,method, +11400,after_run,tensorflow/tensorflow/python/training/monitored_session_test.py,821,method, +11401,FailTrainingAfterCoordinatorStopped,tensorflow/tensorflow/python/training/monitored_session_test.py,832,class,With this hook training encounters an exception after N-runs. +11402,after_create_session,tensorflow/tensorflow/python/training/monitored_session_test.py,839,method, +11403,after_run,tensorflow/tensorflow/python/training/monitored_session_test.py,844,method, +11404,CountingSessionCreator,tensorflow/tensorflow/python/training/monitored_session_test.py,861,class,A creator that counts the number of created sessions. +11405,number_of_sessions_created,tensorflow/tensorflow/python/training/monitored_session_test.py,872,method, +11406,create_session,tensorflow/tensorflow/python/training/monitored_session_test.py,875,method, +11407,FakeSession,tensorflow/tensorflow/python/training/monitored_session_test.py,1252,class, +11408,run,tensorflow/tensorflow/python/training/monitored_session_test.py,1258,method, +11409,RaiseOnceAtCountN,tensorflow/tensorflow/python/training/monitored_session_test.py,1419,class,Hook that raises an Exception at step N. +11410,before_run,tensorflow/tensorflow/python/training/monitored_session_test.py,1427,method, +11411,RunOptionsMetadataHook,tensorflow/tensorflow/python/training/monitored_session_test.py,1436,class,A hook that observes & optionally modifies RunOptions and RunMetadata. +11412,before_run,tensorflow/tensorflow/python/training/monitored_session_test.py,1451,method, +11413,after_run,tensorflow/tensorflow/python/training/monitored_session_test.py,1462,method, +11414,assign_moving_average,tensorflow/tensorflow/python/training/moving_averages.py,36,function,"Compute the moving average of a variable. The moving average of 'variable' updated with 'value' is: variable * decay + value * (1 - decay) @@ -109789,7 +118230,7 @@ References: Adam - A Method for Stochastic Optimization: [Kingma et al., 2015](https://arxiv.org/abs/1412.6980) ([pdf](https://arxiv.org/pdf/1412.6980.pdf))" -12248,weighted_moving_average,tensorflow/tensorflow/python/training/moving_averages.py,117,function,"Compute the weighted moving average of `value`. +11415,weighted_moving_average,tensorflow/tensorflow/python/training/moving_averages.py,117,function,"Compute the weighted moving average of `value`. Conceptually, the weighted moving average is: `moving_average(value * weight) / moving_average(weight)`, @@ -109813,44 +118254,7 @@ Args: Returns: An Operation that updates and returns the weighted moving average." -12249,_update,tensorflow/tensorflow/python/training/moving_averages.py,181,function,Applies updates depending on the context. -12250,_zero_debias,tensorflow/tensorflow/python/training/moving_averages.py,195,function,"Compute the delta required for a debiased Variable. - -All exponential moving averages initialized with Tensors are initialized to 0, -and therefore are biased to 0. Variables initialized to 0 and used as EMAs are -similarly biased. This function creates the debias updated amount according to -a scale factor, as in (Kingma et al., 2015). - -To demonstrate the bias the results from 0-initialization, take an EMA that -was initialized to `0` with decay `b`. After `t` timesteps of seeing the -constant `c`, the variable have the following value: - -``` - EMA = 0*b^(t) + c*(1 - b)*b^(t-1) + c*(1 - b)*b^(t-2) + ... - = c*(1 - b^t) -``` - -To have the true value `c`, we would divide by the scale factor `1 - b^t`. - -In order to perform debiasing, we use two shadow variables. One keeps track of -the biased estimate, and the other keeps track of the number of updates that -have occurred. - -Args: - strategy: `Strategy` used to create and update variables. - unbiased_var: A Variable representing the current value of the unbiased EMA. - value: A Tensor representing the most recent value. - decay: A Tensor representing `1-decay` for the EMA. - -Returns: - The amount that the unbiased variable should be updated. Computing this - tensor will also update the shadow variables appropriately. - -References: - Adam - A Method for Stochastic Optimization: - [Kingma et al., 2015](https://arxiv.org/abs/1412.6980) - ([pdf](https://arxiv.org/pdf/1412.6980.pdf))" -12251,ExponentialMovingAverage,tensorflow/tensorflow/python/training/moving_averages.py,285,class,"Maintains moving averages of variables by employing an exponential decay. +11416,ExponentialMovingAverage,tensorflow/tensorflow/python/training/moving_averages.py,285,class,"Maintains moving averages of variables by employing an exponential decay. When training a model, it is often beneficial to maintain moving averages of the trained parameters. Evaluations that use averaged parameters sometimes @@ -109928,32 +118332,95 @@ var1}) saver.restore(...checkpoint filename...) # var0 and var1 now hold the moving average values ```" -12252,MovingAveragesTest,tensorflow/tensorflow/python/training/moving_averages_test.py,35,class, -12253,_Repeat,tensorflow/tensorflow/python/training/moving_averages_test.py,159,function, -12254,ExponentialMovingAverageTest,tensorflow/tensorflow/python/training/moving_averages_test.py,165,class, -12255,get_filtered_grad_fn,tensorflow/tensorflow/python/training/optimizer.py,48,function, -12256,_deduplicate_indexed_slices,tensorflow/tensorflow/python/training/optimizer.py,64,function,"Sums `values` associated with any non-unique `indices`. +11417,name,tensorflow/tensorflow/python/training/moving_averages.py,399,method,The name of this ExponentialMovingAverage object. +11418,apply,tensorflow/tensorflow/python/training/moving_averages.py,403,method,"Maintains moving averages of variables. + +`var_list` must be a list of `Variable` or `Tensor` objects. This method +creates shadow variables for all elements of `var_list`. Shadow variables +for `Variable` objects are initialized to the variable's initial value. +They will be added to the `GraphKeys.MOVING_AVERAGE_VARIABLES` collection. +For `Tensor` objects, the shadow variables are initialized to 0 and zero +debiased (see docstring in `assign_moving_average` for more details). + +shadow variables are created with `trainable=False` and added to the +`GraphKeys.ALL_VARIABLES` collection. They will be returned by calls to +`tf.compat.v1.global_variables()`. + +Returns an op that updates all shadow variables from the current value of +their associated variables. + +Note that `apply()` can be called multiple times. When eager execution is +enabled each call to apply will update the variables once, so this needs to +be called in a loop. Args: - values: A `Tensor` with rank >= 1. - indices: A one-dimensional integer `Tensor`, indexing into the first - dimension of `values` (as in an IndexedSlices object). -Returns: - A tuple of (`summed_values`, `unique_indices`) where `unique_indices` is a - de-duplicated version of `indices` and `summed_values` contains the sum of - `values` slices associated with each unique index." -12257,_var_key,tensorflow/tensorflow/python/training/optimizer.py,83,function, -12258,_OptimizableVariable,tensorflow/tensorflow/python/training/optimizer.py,91,class,Interface for abstracting over variables in the optimizers. -12259,_RefVariableProcessor,tensorflow/tensorflow/python/training/optimizer.py,105,class,Processor for Variable. -12260,_DenseReadResourceVariableProcessor,tensorflow/tensorflow/python/training/optimizer.py,135,class,Processor for dense ResourceVariables. -12261,_DenseResourceVariableProcessor,tensorflow/tensorflow/python/training/optimizer.py,154,class,Processor for dense ResourceVariables. -12262,_TensorProcessor,tensorflow/tensorflow/python/training/optimizer.py,179,class,"Processor for ordinary Tensors. + var_list: A list of Variable or Tensor objects. The variables and Tensors + must be of types bfloat16, float16, float32, or float64. -Even though a Tensor can't really be updated, sometimes it is useful to -compute the gradients with respect to a Tensor using the optimizer. Updating -the Tensor is, of course, unsupported." -12263,_get_processor,tensorflow/tensorflow/python/training/optimizer.py,197,function,The processor of v. -12264,Optimizer,tensorflow/tensorflow/python/training/optimizer.py,217,class,"Base class for optimizers. +Returns: + An Operation that updates the moving averages. + +Raises: + TypeError: If the arguments are not an allowed type." +11419,average,tensorflow/tensorflow/python/training/moving_averages.py,489,method,"Returns the `Variable` holding the average of `var`. + +Args: + var: A `Variable` object. + +Returns: + A `Variable` object or `None` if the moving average of `var` + is not maintained." +11420,average_name,tensorflow/tensorflow/python/training/moving_averages.py,501,method,"Returns the name of the `Variable` holding the average for `var`. + +The typical scenario for `ExponentialMovingAverage` is to compute moving +averages of variables during training, and restore the variables from the +computed moving averages during evaluations. + +To restore variables, you have to know the name of the shadow variables. +That name and the original variable can then be passed to a `Saver()` object +to restore the variable from the moving average value with: + `saver = tf.compat.v1.train.Saver({ema.average_name(var): var})` + +`average_name()` can be called whether or not `apply()` has been called. + +Args: + var: A `Variable` object. + +Returns: + A string: The name of the variable that will be used or was used + by the `ExponentialMovingAverage class` to hold the moving average of + `var`." +11421,variables_to_restore,tensorflow/tensorflow/python/training/moving_averages.py,528,method,"Returns a map of names to `Variables` to restore. + +If a variable has a moving average, use the moving average variable name as +the restore name; otherwise, use the variable name. + +For example, + +```python + variables_to_restore = ema.variables_to_restore() + saver = tf.compat.v1.train.Saver(variables_to_restore) +``` + +Below is an example of such mapping: + +``` + conv/batchnorm/gamma/ExponentialMovingAverage: conv/batchnorm/gamma, + conv_4/conv2d_params/ExponentialMovingAverage: conv_4/conv2d_params, + global_step: global_step +``` + +Args: + moving_avg_variables: a list of variables that require to use of the + moving average variable name to be restored. If None, it will default to + variables.moving_average_variables() + variables.trainable_variables() + +Returns: + A map from restore_names to variables. The restore_name is either the + original or the moving average version of the variable name, depending + on whether the variable name is in the `moving_avg_variables`." +11422,get_filtered_grad_fn,tensorflow/tensorflow/python/training/optimizer.py,48,function, +11423,Optimizer,tensorflow/tensorflow/python/training/optimizer.py,217,class,"Base class for optimizers. This class defines the API to add Ops to train a model. You never use this class directly, but instead instantiate one of its subclasses such as @@ -110037,8 +118504,135 @@ you can ask the optimizer for the variable it created to hold the slot value. This can be useful if you want to log debug a training algorithm, report stats about the slots, etc." -12265,OptimizerTest,tensorflow/tensorflow/python/training/optimizer_test.py,35,class, -12266,ProximalAdagradOptimizer,tensorflow/tensorflow/python/training/proximal_adagrad.py,30,class,"Optimizer that implements the Proximal Adagrad algorithm. +11424,get_name,tensorflow/tensorflow/python/training/optimizer.py,352,method, +11425,minimize,tensorflow/tensorflow/python/training/optimizer.py,355,method,"Add operations to minimize `loss` by updating `var_list`. + +This method simply combines calls `compute_gradients()` and +`apply_gradients()`. If you want to process the gradient before applying +them call `compute_gradients()` and `apply_gradients()` explicitly instead +of using this function. + +Args: + loss: A `Tensor` containing the value to minimize. + global_step: Optional `Variable` to increment by one after the + variables have been updated. + var_list: Optional list or tuple of `Variable` objects to update to + minimize `loss`. Defaults to the list of variables collected in + the graph under the key `GraphKeys.TRAINABLE_VARIABLES`. + gate_gradients: How to gate the computation of gradients. Can be + `GATE_NONE`, `GATE_OP`, or `GATE_GRAPH`. + aggregation_method: Specifies the method used to combine gradient terms. + Valid values are defined in the class `AggregationMethod`. + colocate_gradients_with_ops: If True, try colocating gradients with + the corresponding op. + name: Optional name for the returned operation. + grad_loss: Optional. A `Tensor` holding the gradient computed for `loss`. + +Returns: + An Operation that updates the variables in `var_list`. If `global_step` + was not `None`, that operation also increments `global_step`. + +Raises: + ValueError: If some of the variables are not `Variable` objects. + +@compatibility(eager) +When eager execution is enabled, `loss` should be a Python function that +takes no arguments and computes the value to be minimized. Minimization (and +gradient computation) is done with respect to the elements of `var_list` if +not None, else with respect to any trainable variables created during the +execution of the `loss` function. `gate_gradients`, `aggregation_method`, +`colocate_gradients_with_ops` and `grad_loss` are ignored when eager +execution is enabled. +@end_compatibility" +11426,compute_gradients,tensorflow/tensorflow/python/training/optimizer.py,415,method,"Compute gradients of `loss` for the variables in `var_list`. + +This is the first part of `minimize()`. It returns a list +of (gradient, variable) pairs where ""gradient"" is the gradient +for ""variable"". Note that ""gradient"" can be a `Tensor`, an +`IndexedSlices`, or `None` if there is no gradient for the +given variable. + +Args: + loss: A Tensor containing the value to minimize or a callable taking + no arguments which returns the value to minimize. When eager execution + is enabled it must be a callable. + var_list: Optional list or tuple of `tf.Variable` to update to minimize + `loss`. Defaults to the list of variables collected in the graph + under the key `GraphKeys.TRAINABLE_VARIABLES`. + gate_gradients: How to gate the computation of gradients. Can be + `GATE_NONE`, `GATE_OP`, or `GATE_GRAPH`. + aggregation_method: Specifies the method used to combine gradient terms. + Valid values are defined in the class `AggregationMethod`. + colocate_gradients_with_ops: If True, try colocating gradients with + the corresponding op. + grad_loss: Optional. A `Tensor` holding the gradient computed for `loss`. + +Returns: + A list of (gradient, variable) pairs. Variable is always present, but + gradient can be `None`. + +Raises: + TypeError: If `var_list` contains anything else than `Variable` objects. + ValueError: If some arguments are invalid. + RuntimeError: If called with eager execution enabled and `loss` is + not callable. + +@compatibility(eager) +When eager execution is enabled, `gate_gradients`, `aggregation_method`, +and `colocate_gradients_with_ops` are ignored. +@end_compatibility" +11427,apply_gradients,tensorflow/tensorflow/python/training/optimizer.py,531,method,"Apply gradients to variables. + +This is the second part of `minimize()`. It returns an `Operation` that +applies gradients. + +Args: + grads_and_vars: List of (gradient, variable) pairs as returned by + `compute_gradients()`. + global_step: Optional `Variable` to increment by one after the + variables have been updated. + name: Optional name for the returned operation. Default to the + name passed to the `Optimizer` constructor. + +Returns: + An `Operation` that applies the specified gradients. If `global_step` + was not None, that operation also increments `global_step`. + +Raises: + TypeError: If `grads_and_vars` is malformed. + ValueError: If none of the variables have gradients. + RuntimeError: If you should use `_distributed_apply()` instead." +11428,get_slot,tensorflow/tensorflow/python/training/optimizer.py,737,method,"Return a slot named `name` created for `var` by the Optimizer. + +Some `Optimizer` subclasses use additional variables. For example +`Momentum` and `Adagrad` use variables to accumulate updates. This method +gives access to these `Variable` objects if for some reason you need them. + +Use `get_slot_names()` to get the list of slot names created by the +`Optimizer`. + +Args: + var: A variable passed to `minimize()` or `apply_gradients()`. + name: A string. + +Returns: + The `Variable` for the slot if it was created, `None` otherwise." +11429,get_slot_names,tensorflow/tensorflow/python/training/optimizer.py,775,method,"Return a list of the names of slots created by the `Optimizer`. + +See `get_slot()`. + +Returns: + A list of strings." +11430,variables,tensorflow/tensorflow/python/training/optimizer.py,785,method,"A list of variables which encode the current state of `Optimizer`. + +Includes slot variables and additional global variables created by the +optimizer in the current default graph. + +Returns: + A list of variables." +11431,update,tensorflow/tensorflow/python/training/optimizer.py,676,method,Apply gradients to a replica variable. +11432,finish,tensorflow/tensorflow/python/training/optimizer.py,714,method, +11433,ProximalAdagradOptimizer,tensorflow/tensorflow/python/training/proximal_adagrad.py,30,class,"Optimizer that implements the Proximal Adagrad algorithm. References: Adaptive Subgradient Methods for Online Learning and Stochastic Optimization: @@ -110047,26 +118641,24 @@ References: Efficient Learning using Forward-Backward Splitting: [Duchi et al., 2009](http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting) ([pdf](http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting.pdf))" -12267,ProximalAdagradOptimizerTest,tensorflow/tensorflow/python/training/proximal_adagrad_test.py,35,class, -12268,ProximalGradientDescentOptimizer,tensorflow/tensorflow/python/training/proximal_gradient_descent.py,31,class,"Optimizer that implements the proximal gradient descent algorithm. +11434,ProximalGradientDescentOptimizer,tensorflow/tensorflow/python/training/proximal_gradient_descent.py,31,class,"Optimizer that implements the proximal gradient descent algorithm. References: Efficient Learning using Forward-Backward Splitting: [Duchi et al., 2009](http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting) ([pdf](http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting.pdf))" -12269,ProximalGradientDescentOptimizerTest,tensorflow/tensorflow/python/training/proximal_gradient_descent_test.py,35,class, -12270,error_translator,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,27,function,Translate the tensor_slice_reader.cc errors. -12271,get_variable_to_dtype_map,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,51,function, -12272,has_tensor,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,60,function, -12273,get_tensor,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,66,function,Get the tensor from the Checkpoint object. -12274,NewCheckpointReader,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,85,function,"A function that returns a CheckPointReader. +11435,error_translator,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,27,function,Translate the tensor_slice_reader.cc errors. +11436,get_variable_to_dtype_map,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,51,function, +11437,has_tensor,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,60,function, +11438,get_tensor,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,66,function,Get the tensor from the Checkpoint object. +11439,NewCheckpointReader,tensorflow/tensorflow/python/training/py_checkpoint_reader.py,85,function,"A function that returns a CheckPointReader. Args: filepattern: The filename. Returns: A CheckpointReader object." -12275,do_quantize_training_on_graphdef,tensorflow/tensorflow/python/training/quantize_training.py,31,function,"A general quantization scheme is being developed in `tf.contrib.quantize`. +11440,do_quantize_training_on_graphdef,tensorflow/tensorflow/python/training/quantize_training.py,31,function,"A general quantization scheme is being developed in `tf.contrib.quantize`. Consider using that instead, though since it is in the tf.contrib namespace, it is not subject to backward compatibility guarantees. @@ -110077,8 +118669,7 @@ Args: Returns: The graph with quantize training done." -12276,PywrapQuantizeTrainingTest,tensorflow/tensorflow/python/training/quantize_training_test.py,35,class, -12277,QueueRunner,tensorflow/tensorflow/python/training/queue_runner_impl.py,38,class,"Holds a list of enqueue operations for a queue, each to be run in a thread. +11441,QueueRunner,tensorflow/tensorflow/python/training/queue_runner_impl.py,38,class,"Holds a list of enqueue operations for a queue, each to be run in a thread. Queues are a convenient TensorFlow mechanism to compute tensors asynchronously using multiple threads. For example in the canonical 'Input @@ -110097,7 +118688,60 @@ The `QueueRunner`, combined with the `Coordinator`, helps handle these issues. QueueRunners are not compatible with eager execution. Instead, please use `tf.data` to get data into your model. @end_compatibility" -12278,add_queue_runner,tensorflow/tensorflow/python/training/queue_runner_impl.py,396,function,"Adds a `QueueRunner` to a collection in the graph. +11442,queue,tensorflow/tensorflow/python/training/queue_runner_impl.py,195,method, +11443,enqueue_ops,tensorflow/tensorflow/python/training/queue_runner_impl.py,199,method, +11444,close_op,tensorflow/tensorflow/python/training/queue_runner_impl.py,203,method, +11445,cancel_op,tensorflow/tensorflow/python/training/queue_runner_impl.py,207,method, +11446,queue_closed_exception_types,tensorflow/tensorflow/python/training/queue_runner_impl.py,211,method, +11447,exceptions_raised,tensorflow/tensorflow/python/training/queue_runner_impl.py,215,method,"Exceptions raised but not handled by the `QueueRunner` threads. + +Exceptions raised in queue runner threads are handled in one of two ways +depending on whether or not a `Coordinator` was passed to +`create_threads()`: + +* With a `Coordinator`, exceptions are reported to the coordinator and + forgotten by the `QueueRunner`. +* Without a `Coordinator`, exceptions are captured by the `QueueRunner` and + made available in this `exceptions_raised` property. + +Returns: + A list of Python `Exception` objects. The list is empty if no exception + was captured. (No exceptions are captured when using a Coordinator.)" +11448,name,tensorflow/tensorflow/python/training/queue_runner_impl.py,234,method,The string name of the underlying Queue. +11449,create_threads,tensorflow/tensorflow/python/training/queue_runner_impl.py,301,method,"Create threads to run the enqueue ops for the given session. + +This method requires a session in which the graph was launched. It creates +a list of threads, optionally starting them. There is one thread for each +op passed in `enqueue_ops`. + +The `coord` argument is an optional coordinator that the threads will use +to terminate together and report exceptions. If a coordinator is given, +this method starts an additional thread to close the queue when the +coordinator requests a stop. + +If previously created threads for the given session are still running, no +new threads will be created. + +Args: + sess: A `Session`. + coord: Optional `Coordinator` object for reporting errors and checking + stop conditions. + daemon: Boolean. If `True` make the threads daemon threads. + start: Boolean. If `True` starts the threads. If `False` the + caller must call the `start()` method of the returned threads. + +Returns: + A list of threads." +11450,to_proto,tensorflow/tensorflow/python/training/queue_runner_impl.py,358,method,"Converts this `QueueRunner` to a `QueueRunnerDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `QueueRunnerDef` protocol buffer, or `None` if the `Variable` is not in + the specified name scope." +11451,from_proto,tensorflow/tensorflow/python/training/queue_runner_impl.py,388,method,Returns a `QueueRunner` object created from `queue_runner_def`. +11452,add_queue_runner,tensorflow/tensorflow/python/training/queue_runner_impl.py,396,function,"Adds a `QueueRunner` to a collection in the graph. When building a complex model that uses many queues it is often difficult to gather all the queue runners that need to be run. This convenience function @@ -110110,7 +118754,7 @@ Args: qr: A `QueueRunner`. collection: A `GraphKey` specifying the graph collection to add the queue runner to. Defaults to `GraphKeys.QUEUE_RUNNERS`." -12279,start_queue_runners,tensorflow/tensorflow/python/training/queue_runner_impl.py,417,function,"Starts all queue runners collected in the graph. +11453,start_queue_runners,tensorflow/tensorflow/python/training/queue_runner_impl.py,417,function,"Starts all queue runners collected in the graph. This is a companion method to `add_queue_runner()`. It just starts threads for all queue runners collected in the graph. It returns @@ -110141,8 +118785,7 @@ Raises: Not compatible with eager execution. To ingest data under eager execution, use the `tf.data` API instead. @end_compatibility" -12280,QueueRunnerTest,tensorflow/tensorflow/python/training/queue_runner_test.py,43,class, -12281,RMSPropOptimizer,tensorflow/tensorflow/python/training/rmsprop.py,54,class,"Optimizer that implements the RMSProp algorithm (Tielemans et al. +11454,RMSPropOptimizer,tensorflow/tensorflow/python/training/rmsprop.py,54,class,"Optimizer that implements the RMSProp algorithm (Tielemans et al. 2012). @@ -110150,22 +118793,96 @@ References: Coursera slide 29: Hinton, 2012 ([pdf](http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf))" -12282,RMSPropOptimizerTest,tensorflow/tensorflow/python/training/rmsprop_test.py,59,class, -12283,BaseSaverBuilder,tensorflow/tensorflow/python/training/saver.py,70,class,"Base class for Savers. +11455,BaseSaverBuilder,tensorflow/tensorflow/python/training/saver.py,70,class,"Base class for Savers. Can be extended to create different Ops." -12284,BulkSaverBuilder,tensorflow/tensorflow/python/training/saver.py,567,class,SaverBuilder with support for bulk restoring multiple saveables. -12285,_get_saver_or_default,tensorflow/tensorflow/python/training/saver.py,586,function,"Returns the saver from SAVERS collection, or creates a default one. +11456,save_op,tensorflow/tensorflow/python/training/saver.py,86,method,"Create an Op to save 'saveables'. -This method is used by other members of the training module, such as -`Scaffold`, or `CheckpointSaverHook`. +This is intended to be overridden by subclasses that want to generate +different Ops. + +Args: + filename_tensor: String Tensor. + saveables: A list of BaseSaverBuilder.SaveableObject objects. Returns: - `Saver`. + An Operation that save the variables. Raises: - RuntimeError: If the SAVERS collection already has more than one items." -12286,Saver,tensorflow/tensorflow/python/training/saver.py,614,class,"Saves and restores variables. + RuntimeError: (implementation detail) if ""self._write_version"" is an + unexpected value." +11457,bulk_restore,tensorflow/tensorflow/python/training/saver.py,126,method,"Restore all tensors contained in saveables. + +By default, this issues separate calls to `restore_op` for each saveable. +Subclasses may override to load multiple saveables in a single call. + +Args: + filename_tensor: String Tensor. + saveables: List of BaseSaverBuilder.SaveableObject objects. + preferred_shard: Int. Shard to open first when loading a sharded file. + restore_sequentially: Unused. Bool. If true, each restore is sequential. + +Returns: + A list of Tensors resulting from reading 'saveable' from + 'filename'." +11458,restore_op,tensorflow/tensorflow/python/training/saver.py,157,method,"Create ops to restore 'saveable'. + +This is intended to be overridden by subclasses that want to generate +different Ops. + +Args: + filename_tensor: String Tensor. + saveable: A BaseSaverBuilder.SaveableObject object. + preferred_shard: Int. Shard to open first when loading a sharded file. + +Returns: + A list of Tensors resulting from reading 'saveable' from + 'filename'." +11459,sharded_filename,tensorflow/tensorflow/python/training/saver.py,183,method,"Append sharding information to a filename. + +Args: + filename_tensor: A string tensor. + shard: Integer. The shard for the filename. + num_shards: An int Tensor for the number of shards. + +Returns: + A string tensor." +11460,build,tensorflow/tensorflow/python/training/saver.py,419,method,"Builds save/restore graph nodes or runs save/restore in eager mode. + +Args: + names_to_saveables: A dictionary mapping name to a Variable or + SaveableObject. Each name will be associated with the corresponding + variable in the checkpoint. + reshape: If True, allow restoring parameters from a checkpoint that where + the parameters have a different shape. This is only needed when you try + to restore from a Dist-Belief checkpoint, and only some times. + sharded: If True, shard the checkpoints, one per device that has Variable + nodes. + max_to_keep: Maximum number of checkpoints to keep. As new checkpoints + are created, old ones are deleted. If None or 0, no checkpoints are + deleted from the filesystem but only the last one is kept in the + `checkpoint` file. Presently the number is only roughly enforced. For + example in case of restarts more than max_to_keep checkpoints may be + kept. + keep_checkpoint_every_n_hours: How often checkpoints should be kept. + Defaults to 10,000 hours. + name: String. Optional name to use as a prefix when adding operations. + restore_sequentially: A Bool, which if true, causes restore of different + variables to happen sequentially within each device. + filename: If known at graph construction time, filename used for variable + loading/saving. If None, then the default name ""model"" will be used. + +Returns: + A SaverDef proto. + +Raises: + TypeError: If 'names_to_saveables' is not a dictionary mapping string + keys to variable Tensors. + ValueError: If any of the keys or values in 'names_to_saveables' is not + unique." +11461,BulkSaverBuilder,tensorflow/tensorflow/python/training/saver.py,567,class,SaverBuilder with support for bulk restoring multiple saveables. +11462,bulk_restore,tensorflow/tensorflow/python/training/saver.py,570,method, +11463,Saver,tensorflow/tensorflow/python/training/saver.py,614,class,"Saves and restores variables. See [Variables](https://tensorflow.org/guide/variables) for an overview of variables, saving and restoring. @@ -110237,7 +118954,141 @@ to the most recent checkpoint. That protocol buffer is stored in a file named If you create several savers, you can specify a different filename for the protocol buffer file in the call to `save()`." -12287,import_meta_graph,tensorflow/tensorflow/python/training/saver.py,1351,function,"Recreates a Graph saved in a `MetaGraphDef` proto. +11464,build,tensorflow/tensorflow/python/training/saver.py,845,method, +11465,as_saver_def,tensorflow/tensorflow/python/training/saver.py,975,method,"Generates a `SaverDef` representation of this saver. + +Returns: + A `SaverDef` proto." +11466,to_proto,tensorflow/tensorflow/python/training/saver.py,983,method,"Converts this `Saver` to a `SaverDef` protocol buffer. + +Args: + export_scope: Optional `string`. Name scope to remove. + +Returns: + A `SaverDef` protocol buffer." +11467,from_proto,tensorflow/tensorflow/python/training/saver.py,1011,method,"Returns a `Saver` object created from `saver_def`. + +Args: + saver_def: a `SaverDef` protocol buffer. + import_scope: Optional `string`. Name scope to use. + +Returns: + A `Saver` built from saver_def." +11468,last_checkpoints,tensorflow/tensorflow/python/training/saver.py,1024,method,"List of not-yet-deleted checkpoint filenames. + +You can pass any of the returned values to `restore()`. + +Returns: + A list of checkpoint filenames, sorted from oldest to newest." +11469,set_last_checkpoints,tensorflow/tensorflow/python/training/saver.py,1034,method,"DEPRECATED: Use set_last_checkpoints_with_time. + +Sets the list of old checkpoint filenames. + +Args: + last_checkpoints: A list of checkpoint filenames. + +Raises: + AssertionError: If last_checkpoints is not a list." +11470,set_last_checkpoints_with_time,tensorflow/tensorflow/python/training/saver.py,1051,method,"Sets the list of old checkpoint filenames and timestamps. + +Args: + last_checkpoints_with_time: A list of tuples of checkpoint filenames and + timestamps. + +Raises: + AssertionError: If last_checkpoints_with_time is not a list." +11471,recover_last_checkpoints,tensorflow/tensorflow/python/training/saver.py,1064,method,"Recovers the internal saver state after a crash. + +This method is useful for recovering the ""self._last_checkpoints"" state. + +Globs for the checkpoints pointed to by `checkpoint_paths`. If the files +exist, use their mtime as the checkpoint timestamp. + +Args: + checkpoint_paths: a list of checkpoint paths." +11472,save,tensorflow/tensorflow/python/training/saver.py,1082,method,"Saves variables. + +This method runs the ops added by the constructor for saving variables. +It requires a session in which the graph was launched. The variables to +save must also have been initialized. + +The method returns the path prefix of the newly created checkpoint files. +This string can be passed directly to a call to `restore()`. + +Args: + sess: A Session to use to save the variables. + save_path: String. Prefix of filenames created for the checkpoint. + global_step: If provided the global step number is appended to `save_path` + to create the checkpoint filenames. The optional argument can be a + `Tensor`, a `Tensor` name or an integer. + latest_filename: Optional name for the protocol buffer file that will + contains the list of most recent checkpoints. That file, kept in the + same directory as the checkpoint files, is automatically managed by the + saver to keep track of recent checkpoints. Defaults to 'checkpoint'. + meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'. + write_meta_graph: `Boolean` indicating whether or not to write the meta + graph file. + write_state: `Boolean` indicating whether or not to write the + `CheckpointStateProto`. + strip_default_attrs: Boolean. If `True`, default-valued attributes will be + removed from the NodeDefs. For a detailed guide, see + [Stripping Default-Valued + Attributes](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md#stripping-default-valued-attributes). + save_debug_info: If `True`, save the GraphDebugInfo to a separate file, + which in the same directory of save_path and with `_debug` added before + the file extension. This is only enabled when `write_meta_graph` is + `True` + +Returns: + A string: path prefix used for the checkpoint files. If the saver is + sharded, this string ends with: '-?????-of-nnnnn' where 'nnnnn' + is the number of shards created. + If the saver is empty, returns None. + +Raises: + TypeError: If `sess` is not a `Session`. + ValueError: If `latest_filename` contains path components, or if it + collides with `save_path`. + RuntimeError: If save and restore ops weren't built." +11473,export_meta_graph,tensorflow/tensorflow/python/training/saver.py,1219,method,"Writes `MetaGraphDef` to save_path/filename. + +Args: + filename: Optional meta_graph filename including the path. + collection_list: List of string keys to collect. + as_text: If `True`, writes the meta_graph as an ASCII proto. + export_scope: Optional `string`. Name scope to remove. + clear_devices: Whether or not to clear the device field for an `Operation` + or `Tensor` during export. + clear_extraneous_savers: Remove any Saver-related information from the + graph (both Save/Restore ops and SaverDefs) that are not associated with + this Saver. + strip_default_attrs: Boolean. If `True`, default-valued attributes will be + removed from the NodeDefs. For a detailed guide, see + [Stripping Default-Valued + Attributes](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md#stripping-default-valued-attributes). + save_debug_info: If `True`, save the GraphDebugInfo to a separate file, + which in the same directory of filename and with `_debug` added before + the file extension. + +Returns: + A `MetaGraphDef` proto." +11474,restore,tensorflow/tensorflow/python/training/saver.py,1265,method,"Restores previously saved variables. + +This method runs the ops added by the constructor for restoring variables. +It requires a session in which the graph was launched. The variables to +restore do not have to have been initialized, as restoring is itself a way +to initialize variables. + +The `save_path` argument is typically a value previously returned from a +`save()` call, or a call to `latest_checkpoint()`. + +Args: + sess: A `Session` to use to restore the parameters. None in eager mode. + save_path: Path where parameters were previously saved. + +Raises: + ValueError: If save_path is None or not a valid checkpoint." +11475,import_meta_graph,tensorflow/tensorflow/python/training/saver.py,1351,function,"Recreates a Graph saved in a `MetaGraphDef` proto. This function takes a `MetaGraphDef` protocol buffer as input. If the argument is a file containing a `MetaGraphDef` protocol buffer , @@ -110341,9 +119192,7 @@ Raises: Exporting/importing meta graphs is not supported. No graph exists when eager execution is enabled. @end_compatibility" -12288,_import_meta_graph_with_return_elements,tensorflow/tensorflow/python/training/saver.py,1465,function,"Import MetaGraph, and return both a saver and returned elements." -12289,_create_saver_from_imported_meta_graph,tensorflow/tensorflow/python/training/saver.py,1493,function,Return a saver for restoring variable values to an imported MetaGraph. -12290,export_meta_graph,tensorflow/tensorflow/python/training/saver.py,1518,function,"Returns `MetaGraphDef` proto. +11476,export_meta_graph,tensorflow/tensorflow/python/training/saver.py,1518,function,"Returns `MetaGraphDef` proto. Optionally writes it to filename. @@ -110389,15 +119238,14 @@ Raises: Exporting/importing meta graphs is not supported unless both `graph_def` and `graph` are provided. No graph exists when eager execution is enabled. @end_compatibility" -12291,_wrap_restore_error_with_msg,tensorflow/tensorflow/python/training/saver.py,1602,function, -12292,object_graph_key_mapping,tensorflow/tensorflow/python/training/saver.py,1617,function,"Return name to key mappings from the checkpoint. +11477,object_graph_key_mapping,tensorflow/tensorflow/python/training/saver.py,1617,function,"Return name to key mappings from the checkpoint. Args: checkpoint_path: string, path to object-based checkpoint Returns: Dictionary mapping tensor names to checkpoint keys." -12293,saver_from_object_based_checkpoint,tensorflow/tensorflow/python/training/saver.py,1637,function,"Return a `Saver` which reads from an object-based checkpoint. +11478,saver_from_object_based_checkpoint,tensorflow/tensorflow/python/training/saver.py,1637,function,"Return a `Saver` which reads from an object-based checkpoint. This function validates that all variables in the variables list are remapped in the object-based checkpoint (or `names_to_keys` dict if provided). A @@ -110433,52 +119281,19 @@ Raises: NotFoundError: If one of the variables in `var_list` can not be found in the checkpoint. This could mean the checkpoint or `names_to_keys` mapping is missing the variable." -12294,SaverLargePartitionedVariableTest,tensorflow/tensorflow/python/training/saver_large_partitioned_variable_test.py,34,class, -12295,SaverLargeVariableTest,tensorflow/tensorflow/python/training/saver_large_variable_test.py,34,class, -12296,SaverTest,tensorflow/tensorflow/python/training/saver_test.py,78,class, -12297,SaveRestoreShardedTest,tensorflow/tensorflow/python/training/saver_test.py,852,class, -12298,SaveRestoreShardedTestV2,tensorflow/tensorflow/python/training/saver_test.py,1107,class, -12299,MaxToKeepTest,tensorflow/tensorflow/python/training/saver_test.py,1241,class, -12300,RecoverLastCheckpointsTest,tensorflow/tensorflow/python/training/saver_test.py,1607,class, -12301,KeepCheckpointEveryNHoursTest,tensorflow/tensorflow/python/training/saver_test.py,1668,class, -12302,SaveRestoreWithVariableNameMap,tensorflow/tensorflow/python/training/saver_test.py,1727,class, -12303,MetaGraphTest,tensorflow/tensorflow/python/training/saver_test.py,1803,class, -12304,CheckpointReaderTest,tensorflow/tensorflow/python/training/saver_test.py,2585,class, -12305,CheckpointReaderForV2Test,tensorflow/tensorflow/python/training/saver_test.py,2637,class, -12306,WriteGraphTest,tensorflow/tensorflow/python/training/saver_test.py,2641,class, -12307,ScopedGraphTest,tensorflow/tensorflow/python/training/saver_test.py,2670,class, -12308,_OwnsAVariableSimple,tensorflow/tensorflow/python/training/saver_test.py,2977,class,A Trackable object which can be saved using a tf.train.Saver. -12309,_MirroringSaveable,tensorflow/tensorflow/python/training/saver_test.py,2993,class, -12310,_OwnsMirroredVariables,tensorflow/tensorflow/python/training/saver_test.py,3010,class,A Trackable object which returns a more complex SaveableObject. -12311,TrackableCompatibilityTests,tensorflow/tensorflow/python/training/saver_test.py,3033,class, -12312,CheckpointedOp,tensorflow/tensorflow/python/training/saver_test_utils.py,28,class,"Op with a custom checkpointing implementation. +11479,SaveRestoreWithVariableNameMap,tensorflow/tensorflow/python/training/saver_test.py,1727,class, +11480,CheckpointedOp,tensorflow/tensorflow/python/training/saver_test_utils.py,28,class,"Op with a custom checkpointing implementation. Defined as part of the test because the MutableHashTable Python code is currently in contrib." -12313,_make_server_def,tensorflow/tensorflow/python/training/server_lib.py,31,function,"Creates a `tf.train.ServerDef` protocol buffer. - -Args: - server_or_cluster_def: A `tf.train.ServerDef` or `tf.train.ClusterDef` - protocol buffer, or a `tf.train.ClusterSpec` object, describing the server - to be defined and/or the cluster of which it is a member. - job_name: (Optional.) Specifies the name of the job of which the server is a - member. Defaults to the value in `server_or_cluster_def`, if specified. - task_index: (Optional.) Specifies the task index of the server in its job. - Defaults to the value in `server_or_cluster_def`, if specified. Otherwise - defaults to 0 if the server's job has only one task. - protocol: (Optional.) Specifies the protocol to be used by the server. - Acceptable values include `""grpc"", ""grpc+verbs""`. Defaults to the value in - `server_or_cluster_def`, if specified. Otherwise defaults to `""grpc""`. - config: (Options.) A `tf.compat.v1.ConfigProto` that specifies default - configuration options for all sessions that run on this server. - -Returns: - A `tf.train.ServerDef`. - -Raises: - TypeError: If the arguments do not have the appropriate type. - ValueError: If an argument is not specified and cannot be inferred." -12314,Server,tensorflow/tensorflow/python/training/server_lib.py,100,class,"An in-process TensorFlow server, for use in distributed training. +11481,name,tensorflow/tensorflow/python/training/saver_test_utils.py,49,method, +11482,saveable,tensorflow/tensorflow/python/training/saver_test_utils.py,53,method, +11483,insert,tensorflow/tensorflow/python/training/saver_test_utils.py,59,method, +11484,lookup,tensorflow/tensorflow/python/training/saver_test_utils.py,62,method, +11485,keys,tensorflow/tensorflow/python/training/saver_test_utils.py,65,method, +11486,values,tensorflow/tensorflow/python/training/saver_test_utils.py,68,method, +11487,restore,tensorflow/tensorflow/python/training/saver_test_utils.py,88,method, +11488,Server,tensorflow/tensorflow/python/training/server_lib.py,100,class,"An in-process TensorFlow server, for use in distributed training. A `tf.distribute.Server` instance encapsulates a set of devices and a `tf.compat.v1.Session` target that @@ -110486,7 +119301,53 @@ can participate in distributed training. A server belongs to a cluster (specified by a `tf.train.ClusterSpec`), and corresponds to a particular task in a named job. The server can communicate with any other server in the same cluster." -12315,ClusterSpec,tensorflow/tensorflow/python/training/server_lib.py,247,class,"Represents a cluster as a set of ""tasks"", organized into ""jobs"". +11489,start,tensorflow/tensorflow/python/training/server_lib.py,171,method,"Starts this server. + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + starting the TensorFlow server." +11490,join,tensorflow/tensorflow/python/training/server_lib.py,180,method,"Blocks until the server has shut down. + +This method currently blocks forever. + +Raises: + tf.errors.OpError: Or one of its subclasses if an error occurs while + joining the TensorFlow server." +11491,server_def,tensorflow/tensorflow/python/training/server_lib.py,192,method,"Returns the `tf.train.ServerDef` for this server. + +Returns: + A `tf.train.ServerDef` protocol buffer that describes the configuration + of this server." +11492,target,tensorflow/tensorflow/python/training/server_lib.py,202,method,"Returns the target for a `tf.compat.v1.Session` to connect to this server. + +To create a +`tf.compat.v1.Session` that +connects to this server, use the following snippet: + +```python +server = tf.distribute.Server(...) +with tf.compat.v1.Session(server.target): + # ... +``` + +Returns: + A string containing a session target for this server." +11493,create_local_server,tensorflow/tensorflow/python/training/server_lib.py,221,method,"Creates a new single-process cluster running on the local host. + +This method is a convenience wrapper for creating a +`tf.distribute.Server` with a `tf.train.ServerDef` that specifies a +single-process cluster containing a single task in a job called +`""local""`. + +Args: + config: (Options.) A `tf.compat.v1.ConfigProto` that specifies default + configuration options for all sessions that run on this server. + start: (Optional.) Boolean, indicating whether to start the server after + creating it. Defaults to `True`. + +Returns: + A local `tf.distribute.Server`." +11494,ClusterSpec,tensorflow/tensorflow/python/training/server_lib.py,247,class,"Represents a cluster as a set of ""tasks"", organized into ""jobs"". A `tf.train.ClusterSpec` represents the set of processes that participate in a distributed TensorFlow computation. Every @@ -110514,7 +119375,73 @@ cluster = tf.train.ClusterSpec({""worker"": {1: ""worker1.example.com:2222""}, ""ps"": [""ps0.example.com:2222"", ""ps1.example.com:2222""]}) ```" -12316,ClusterDeviceFilters,tensorflow/tensorflow/python/training/server_lib.py,500,class,"Represent a collection of device filters for the remote workers in cluster. +11495,as_dict,tensorflow/tensorflow/python/training/server_lib.py,341,method,"Returns a dictionary from job names to their tasks. + +For each job, if the task index space is dense, the corresponding +value will be a list of network addresses; otherwise it will be a +dictionary mapping (sparse) task indices to the corresponding +addresses. + +Returns: + A dictionary mapping job names to lists or dictionaries + describing the tasks in those jobs." +11496,as_cluster_def,tensorflow/tensorflow/python/training/server_lib.py,368,method,Returns a `tf.train.ClusterDef` protocol buffer based on this cluster. +11497,jobs,tensorflow/tensorflow/python/training/server_lib.py,373,method,"Returns a list of job names in this cluster. + +Returns: + A list of strings, corresponding to the names of jobs in this cluster." +11498,num_tasks,tensorflow/tensorflow/python/training/server_lib.py,381,method,"Returns the number of tasks defined in the given job. + +Args: + job_name: The string name of a job in this cluster. + +Returns: + The number of tasks defined in the given job. + +Raises: + ValueError: If `job_name` does not name a job in this cluster." +11499,task_indices,tensorflow/tensorflow/python/training/server_lib.py,399,method,"Returns a list of valid task indices in the given job. + +Args: + job_name: The string name of a job in this cluster. + +Returns: + A list of valid task indices in the given job. + +Raises: + ValueError: If `job_name` does not name a job in this cluster, + or no task with index `task_index` is defined in that job." +11500,task_address,tensorflow/tensorflow/python/training/server_lib.py,418,method,"Returns the address of the given task in the given job. + +Args: + job_name: The string name of a job in this cluster. + task_index: A non-negative integer. + +Returns: + The address of the given task in the given job. + +Raises: + ValueError: If `job_name` does not name a job in this cluster, + or no task with index `task_index` is defined in that job." +11501,job_tasks,tensorflow/tensorflow/python/training/server_lib.py,442,method,"Returns a mapping from task ID to address in the given job. + +NOTE: For backwards compatibility, this method returns a list. If +the given job was defined with a sparse set of task indices, the +length of this list may not reflect the number of tasks defined in +this job. Use the `tf.train.ClusterSpec.num_tasks` method +to find the number of tasks defined in a particular job. + +Args: + job_name: The string name of a job in this cluster. + +Returns: + A list of task addresses, where the index in the list + corresponds to the task index of each task. The list may contain + `None` if the job was defined with a sparse set of task indices. + +Raises: + ValueError: If `job_name` does not name a job in this cluster." +11502,ClusterDeviceFilters,tensorflow/tensorflow/python/training/server_lib.py,500,class,"Represent a collection of device filters for the remote workers in cluster. NOTE: this is an experimental API and subject to changes. @@ -110539,22 +119466,8 @@ tf.config.experimental_connect_to_cluster(cluster_def, The device filters can be partically specified. For remote tasks that do not have device filters specified, all devices will be visible to them." -12317,MultipleContainersTest,tensorflow/tensorflow/python/training/server_lib_multiple_containers_test.py,30,class, -12318,SameVariablesClearContainerTest,tensorflow/tensorflow/python/training/server_lib_same_variables_clear_container_test.py,29,class, -12319,SameVariablesClearTest,tensorflow/tensorflow/python/training/server_lib_same_variables_clear_test.py,30,class, -12320,SameVariablesNoClearTest,tensorflow/tensorflow/python/training/server_lib_same_variables_no_clear_test.py,30,class, -12321,SparseJobTest,tensorflow/tensorflow/python/training/server_lib_sparse_job_test.py,29,class, -12322,GrpcServerTest,tensorflow/tensorflow/python/training/server_lib_test.py,42,class, -12323,ServerDefTest,tensorflow/tensorflow/python/training/server_lib_test.py,335,class, -12324,ClusterSpecTest,tensorflow/tensorflow/python/training/server_lib_test.py,423,class, -12325,_maybe_name,tensorflow/tensorflow/python/training/session_manager.py,33,function,"Returns object name if it has one, or a message otherwise. - -This is useful for names that apper in error messages. -Args: - obj: Object to get the name of. -Returns: - name, ""None"", or a ""no name"" message." -12326,SessionManager,tensorflow/tensorflow/python/training/session_manager.py,51,class,"Training helper that restores from checkpoint and creates session. +11503,set_device_filters,tensorflow/tensorflow/python/training/server_lib.py,537,method,Set the device filters for given job name and task id. +11504,SessionManager,tensorflow/tensorflow/python/training/session_manager.py,51,class,"Training helper that restores from checkpoint and creates session. This class is a small wrapper that takes care of session creation and checkpoint recovery. It also provides functions that to facilitate @@ -110594,23 +119507,165 @@ with tf.Graph().as_default(): ``` `wait_for_session()` waits for a model to be initialized by other processes." -12327,_ready,tensorflow/tensorflow/python/training/session_manager.py,515,function,"Checks if the model is ready or not, as determined by op. +11505,prepare_session,tensorflow/tensorflow/python/training/session_manager.py,229,method,"Creates a `Session`. Makes sure the model is ready to be used. + +Creates a `Session` on 'master'. If a `saver` object is passed in, and +`checkpoint_dir` points to a directory containing valid checkpoint +files, then it will try to recover the model from checkpoint. If +no checkpoint files are available, and `wait_for_checkpoint` is +`True`, then the process would check every `recovery_wait_secs`, +up to `max_wait_secs`, for recovery to succeed. + +If the model cannot be recovered successfully then it is initialized by +running the `init_op` and calling `init_fn` if they are provided. +The `local_init_op` is also run after init_op and init_fn, regardless of +whether the model was recovered successfully, but only if +`ready_for_local_init_op` passes. + +If the model is recovered from a checkpoint it is assumed that all +global variables have been initialized, in particular neither `init_op` +nor `init_fn` will be executed. + +It is an error if the model cannot be recovered and no `init_op` +or `init_fn` or `local_init_op` are passed. Args: - op: An op, either _ready_op or _ready_for_local_init_op, which defines the - readiness of the model. - sess: A `Session`. - msg: A message to log to warning if not ready + master: `String` representation of the TensorFlow master to use. + init_op: Optional `Operation` used to initialize the model. + saver: A `Saver` object used to restore a model. + checkpoint_dir: Path to the checkpoint files. The latest checkpoint in the + dir will be used to restore. + checkpoint_filename_with_path: Full file name path to the checkpoint file. + wait_for_checkpoint: Whether to wait for checkpoint to become available. + max_wait_secs: Maximum time to wait for checkpoints to become available. + config: Optional `ConfigProto` proto used to configure the session. + init_feed_dict: Optional dictionary that maps `Tensor` objects to feed + values. This feed dictionary is passed to the session `run()` call when + running the init op. + init_fn: Optional callable used to initialize the model. Called after the + optional `init_op` is called. The callable must accept one argument, + the session being initialized. Returns: - A tuple (is_ready, msg), where is_ready is True if ready and False - otherwise, and msg is `None` if the model is ready, a `String` with the - reason why it is not ready otherwise." -12328,_CountDownTimer,tensorflow/tensorflow/python/training/session_manager.py,554,class, -12329,SessionManagerTest,tensorflow/tensorflow/python/training/session_manager_test.py,41,class, -12330,ObsoleteSessionManagerTest,tensorflow/tensorflow/python/training/session_manager_test.py,677,class, -12331,SessionRunHook,tensorflow/tensorflow/python/training/session_run_hook.py,98,class,Hook to extend calls to MonitoredSession.run(). -12332,SessionRunArgs,tensorflow/tensorflow/python/training/session_run_hook.py,190,class,"Represents arguments to be added to a `Session.run()` call. + A `Session` object that can be used to drive the model. + +Raises: + RuntimeError: If the model cannot be initialized or recovered. + ValueError: If both checkpoint_dir and checkpoint_filename_with_path are + set." +11506,recover_session,tensorflow/tensorflow/python/training/session_manager.py,321,method,"Creates a `Session`, recovering if possible. + +Creates a new session on 'master'. If the session is not initialized +and can be recovered from a checkpoint, recover it. + +Args: + master: `String` representation of the TensorFlow master to use. + saver: A `Saver` object used to restore a model. + checkpoint_dir: Path to the checkpoint files. The latest checkpoint in the + dir will be used to restore. + checkpoint_filename_with_path: Full file name path to the checkpoint file. + wait_for_checkpoint: Whether to wait for checkpoint to become available. + max_wait_secs: Maximum time to wait for checkpoints to become available. + config: Optional `ConfigProto` proto used to configure the session. + +Returns: + A pair (sess, initialized) where 'initialized' is `True` if + the session could be recovered and initialized, `False` otherwise. + +Raises: + ValueError: If both checkpoint_dir and checkpoint_filename_with_path are + set." +11507,wait_for_session,tensorflow/tensorflow/python/training/session_manager.py,385,method,"Creates a new `Session` and waits for model to be ready. + +Creates a new `Session` on 'master'. Waits for the model to be +initialized or recovered from a checkpoint. It's expected that +another thread or process will make the model ready, and that this +is intended to be used by threads/processes that participate in a +distributed training configuration where a different thread/process +is responsible for initializing or recovering the model being trained. + +NB: The amount of time this method waits for the session is bounded +by max_wait_secs. By default, this function will wait indefinitely. + +Args: + master: `String` representation of the TensorFlow master to use. + config: Optional ConfigProto proto used to configure the session. + max_wait_secs: Maximum time to wait for the session to become available. + +Returns: + A `Session`. May be None if the operation exceeds the timeout + specified by config.operation_timeout_in_ms. + +Raises: + tf.DeadlineExceededError: if the session is not available after + max_wait_secs." +11508,SessionRunHook,tensorflow/tensorflow/python/training/session_run_hook.py,98,class,Hook to extend calls to MonitoredSession.run(). +11509,begin,tensorflow/tensorflow/python/training/session_run_hook.py,101,method,"Called once before using the session. + +When called, the default graph is the one that will be launched in the +session. The hook can modify the graph by adding new operations to it. +After the `begin()` call the graph will be finalized and the other callbacks +can not modify the graph anymore. Second call of `begin()` on the same +graph, should not change the graph." +11510,after_create_session,tensorflow/tensorflow/python/training/session_run_hook.py,112,method,"Called when new TensorFlow session is created. + +This is called to signal the hooks that a new session has been created. This +has two essential differences with the situation in which `begin` is called: + +* When this is called, the graph is finalized and ops can no longer be added + to the graph. +* This method will also be called as a result of recovering a wrapped + session, not only at the beginning of the overall session. + +Args: + session: A TensorFlow Session that has been created. + coord: A Coordinator object which keeps track of all threads." +11511,before_run,tensorflow/tensorflow/python/training/session_run_hook.py,129,method,"Called before each call to run(). + +You can return from this call a `SessionRunArgs` object indicating ops or +tensors to add to the upcoming `run()` call. These ops/tensors will be run +together with the ops/tensors originally passed to the original run() call. +The run args you return can also contain feeds to be added to the run() +call. + +The `run_context` argument is a `SessionRunContext` that provides +information about the upcoming `run()` call: the originally requested +op/tensors, the TensorFlow Session. + +At this point graph is finalized and you can not add ops. + +Args: + run_context: A `SessionRunContext` object. + +Returns: + None or a `SessionRunArgs` object." +11512,after_run,tensorflow/tensorflow/python/training/session_run_hook.py,152,method,"Called after each call to run(). + +The `run_values` argument contains results of requested ops/tensors by +`before_run()`. + +The `run_context` argument is the same one send to `before_run` call. +`run_context.request_stop()` can be called to stop the iteration. + +If `session.run()` raises any exceptions then `after_run()` is not called. + +Args: + run_context: A `SessionRunContext` object. + run_values: A SessionRunValues object." +11513,end,tensorflow/tensorflow/python/training/session_run_hook.py,171,method,"Called at the end of session. + +The `session` argument can be used in case the hook wants to run final ops, +such as saving a last checkpoint. + +If `session.run()` raises exception other than OutOfRangeError or +StopIteration then `end()` is not called. +Note the difference between `end()` and `after_run()` behavior when +`session.run()` raises OutOfRangeError or StopIteration. In that case +`end()` is called but `after_run()` is not called. + +Args: + session: A TensorFlow Session that will be soon closed." +11514,SessionRunArgs,tensorflow/tensorflow/python/training/session_run_hook.py,190,class,"Represents arguments to be added to a `Session.run()` call. Args: fetches: Exactly like the 'fetches' argument to Session.Run(). @@ -110625,13 +119680,30 @@ Args: feed_dict: Exactly like the `feed_dict` argument to `Session.Run()` options: Exactly like the `options` argument to `Session.run()`, i.e., a config_pb2.RunOptions proto." -12333,SessionRunContext,tensorflow/tensorflow/python/training/session_run_hook.py,215,class,"Provides information about the `session.run()` call being made. +11515,SessionRunContext,tensorflow/tensorflow/python/training/session_run_hook.py,215,class,"Provides information about the `session.run()` call being made. Provides information about original request to `Session.Run()` function. SessionRunHook objects can stop the loop by calling `request_stop()` of `run_context`. In the future we may use this object to add more information about run without changing the Hook API." -12334,SessionRunValues,tensorflow/tensorflow/python/training/session_run_hook.py,267,class,"Contains the results of `Session.run()`. +11516,original_args,tensorflow/tensorflow/python/training/session_run_hook.py,231,method,"A `SessionRunArgs` object holding the original arguments of `run()`. + +If user called `MonitoredSession.run(fetches=a, feed_dict=b)`, then this +field is equal to SessionRunArgs(a, b). + +Returns: + A `SessionRunArgs` object" +11517,session,tensorflow/tensorflow/python/training/session_run_hook.py,243,method,A TensorFlow session object which will execute the `run`. +11518,stop_requested,tensorflow/tensorflow/python/training/session_run_hook.py,248,method,"Returns whether a stop is requested or not. + +If true, `MonitoredSession` stops iterations. +Returns: + A `bool`" +11519,request_stop,tensorflow/tensorflow/python/training/session_run_hook.py,257,method,"Sets stop requested field. + +Hooks can use this function to request stop of iterations. +`MonitoredSession` checks whether this is called or not." +11520,SessionRunValues,tensorflow/tensorflow/python/training/session_run_hook.py,267,class,"Contains the results of `Session.run()`. In the future we may use this object to add more information about result of run without changing the Hook API. @@ -110648,8 +119720,7 @@ Args: => results = {'step': nparray(int), 'summ': nparray(string)} options: `RunOptions` from the `Session.run()` call. run_metadata: `RunMetadata` from the `Session.run()` call." -12335,_create_slot_var,tensorflow/tensorflow/python/training/slot_creator.py,50,function,Helper function for creating a slot variable. -12336,create_slot,tensorflow/tensorflow/python/training/slot_creator.py,104,function,"Create a slot initialized to the given value. +11521,create_slot,tensorflow/tensorflow/python/training/slot_creator.py,104,function,"Create a slot initialized to the given value. The type of the slot is determined by the given value. @@ -110662,7 +119733,7 @@ Args: Returns: A `Variable` object." -12337,create_slot_with_initializer,tensorflow/tensorflow/python/training/slot_creator.py,138,function,"Creates a slot initialized using an `Initializer`. +11522,create_slot_with_initializer,tensorflow/tensorflow/python/training/slot_creator.py,138,function,"Creates a slot initialized using an `Initializer`. The type of the slot is determined by the given value. @@ -110677,7 +119748,7 @@ Args: Returns: A `Variable` object." -12338,create_zeros_slot,tensorflow/tensorflow/python/training/slot_creator.py,177,function,"Create a slot initialized to 0 with same shape as the primary object. +11523,create_zeros_slot,tensorflow/tensorflow/python/training/slot_creator.py,177,function,"Create a slot initialized to 0 with same shape as the primary object. Args: primary: The primary `Variable` or `Tensor`. @@ -110688,9 +119759,8 @@ Args: Returns: A `Variable` object." -12339,SlotCreatorTest,tensorflow/tensorflow/python/training/slot_creator_test.py,33,class, -12340,SummaryWriter,tensorflow/tensorflow/python/training/summary_io.py,29,class, -12341,Supervisor,tensorflow/tensorflow/python/training/supervisor.py,44,class,"A training helper that checkpoints models and computes summaries. +11524,SummaryWriter,tensorflow/tensorflow/python/training/summary_io.py,29,class, +11525,Supervisor,tensorflow/tensorflow/python/training/supervisor.py,44,class,"A training helper that checkpoints models and computes summaries. This class is deprecated. Please use `tf.compat.v1.train.MonitoredTrainingSession` instead. @@ -110845,18 +119915,256 @@ with sv.managed_session(FLAGS.master) as sess: initialization needs, see how to specify a `local_init_op` when creating the supervisor. You can also use the `SessionManager` directly to create a session and check if it could be initialized automatically." -12342,SVSummaryThread,tensorflow/tensorflow/python/training/supervisor.py,1028,class,A thread to save summaries on a timer. -12343,SVStepCounterThread,tensorflow/tensorflow/python/training/supervisor.py,1054,class,Threads to count steps and measure their duration. -12344,SVTimerCheckpointThread,tensorflow/tensorflow/python/training/supervisor.py,1102,class,A thread to checkpoint on a timer. -12345,_summary_iterator,tensorflow/tensorflow/python/training/supervisor_test.py,56,function,"Reads events from test_dir/events. - -Args: - test_dir: Name of the test directory. +11526,is_chief,tensorflow/tensorflow/python/training/supervisor.py,503,method,"Return True if this is a chief supervisor. Returns: - A summary_iterator" -12346,SupervisorTest,tensorflow/tensorflow/python/training/supervisor_test.py,69,class, -12347,SyncReplicasOptimizer,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,45,class,"Class to synchronize, aggregate gradients and pass them to the optimizer. + A bool." +11527,session_manager,tensorflow/tensorflow/python/training/supervisor.py,512,method,"Return the SessionManager used by the Supervisor. + +Returns: + A SessionManager object." +11528,coord,tensorflow/tensorflow/python/training/supervisor.py,521,method,"Return the Coordinator used by the Supervisor. + +The Coordinator can be useful if you want to run multiple threads +during your training. + +Returns: + A Coordinator object." +11529,init_op,tensorflow/tensorflow/python/training/supervisor.py,533,method,"Return the Init Op used by the supervisor. + +Returns: + An Op or `None`." +11530,init_feed_dict,tensorflow/tensorflow/python/training/supervisor.py,542,method,"Return the feed dictionary used when evaluating the `init_op`. + +Returns: + A feed dictionary or `None`." +11531,ready_op,tensorflow/tensorflow/python/training/supervisor.py,551,method,"Return the Ready Op used by the supervisor. + +Returns: + An Op or `None`." +11532,ready_for_local_init_op,tensorflow/tensorflow/python/training/supervisor.py,560,method, +11533,summary_writer,tensorflow/tensorflow/python/training/supervisor.py,564,method,"Return the SummaryWriter used by the chief supervisor. + +Returns: + A SummaryWriter." +11534,summary_op,tensorflow/tensorflow/python/training/supervisor.py,573,method,"Return the Summary Tensor used by the chief supervisor. + +Returns: + A string Tensor for the summary or `None`." +11535,save_summaries_secs,tensorflow/tensorflow/python/training/supervisor.py,582,method,"Return the delay between summary computations. + +Returns: + A timestamp." +11536,global_step,tensorflow/tensorflow/python/training/supervisor.py,591,method,"Return the global_step Tensor used by the supervisor. + +Returns: + An integer Tensor for the global_step." +11537,saver,tensorflow/tensorflow/python/training/supervisor.py,600,method,"Return the Saver used by the supervisor. + +Returns: + A Saver object." +11538,save_model_secs,tensorflow/tensorflow/python/training/supervisor.py,609,method,"Return the delay between checkpoints. + +Returns: + A timestamp." +11539,save_path,tensorflow/tensorflow/python/training/supervisor.py,618,method,"Return the save path used by the supervisor. + +Returns: + A string." +11540,start_standard_services,tensorflow/tensorflow/python/training/supervisor.py,638,method,"Start the standard services for 'sess'. + +This starts services in the background. The services started depend +on the parameters to the constructor and may include: + + - A Summary thread computing summaries every save_summaries_secs. + - A Checkpoint thread saving the model every save_model_secs. + - A StepCounter thread measure step time. + +Args: + sess: A Session. + +Returns: + A list of threads that are running the standard services. You can use + the Supervisor's Coordinator to join these threads with: + sv.coord.Join() + +Raises: + RuntimeError: If called with a non-chief Supervisor. + ValueError: If not `logdir` was passed to the constructor as the + services need a log directory." +11541,prepare_or_wait_for_session,tensorflow/tensorflow/python/training/supervisor.py,690,method,"Make sure the model is ready to be used. + +Create a session on 'master', recovering or initializing the model as +needed, or wait for a session to be ready. If running as the chief +and `start_standard_service` is set to True, also call the session +manager to start the standard services. + +Args: + master: name of the TensorFlow master to use. See the + `tf.compat.v1.Session` constructor for how this is interpreted. + config: Optional ConfigProto proto used to configure the session, which is + passed as-is to create the session. + wait_for_checkpoint: Whether we should wait for the availability of a + checkpoint before creating Session. Defaults to False. + max_wait_secs: Maximum time to wait for the session to become available. + start_standard_services: Whether to start the standard services and the + queue runners. + +Returns: + A Session object that can be used to drive the model." +11542,start_queue_runners,tensorflow/tensorflow/python/training/supervisor.py,747,method,"Start threads for `QueueRunners`. + +Note that the queue runners collected in the graph key `QUEUE_RUNNERS` +are already started automatically when you create a session with the +supervisor, so unless you have non-collected queue runners to start +you do not need to call this explicitly. + +Args: + sess: A `Session`. + queue_runners: A list of `QueueRunners`. If not specified, we'll use the + list of queue runners gathered in the graph under the key + `GraphKeys.QUEUE_RUNNERS`. + +Returns: + The list of threads started for the `QueueRunners`. + +Raises: + RuntimeError: If called with eager execution enabled. + +@compatibility(eager) +Queues are not compatible with eager execution. To ingest data when eager +execution is enabled, use the `tf.data` API. +@end_compatibility" +11543,loop,tensorflow/tensorflow/python/training/supervisor.py,782,method,"Start a LooperThread that calls a function periodically. + +If `timer_interval_secs` is None the thread calls `target(*args, **kwargs)` +repeatedly. Otherwise it calls it every `timer_interval_secs` +seconds. The thread terminates when a stop is requested. + +The started thread is added to the list of threads managed by the supervisor +so it does not need to be passed to the `stop()` method. + +Args: + timer_interval_secs: Number. Time boundaries at which to call `target`. + target: A callable object. + args: Optional arguments to pass to `target` when calling it. + kwargs: Optional keyword arguments to pass to `target` when calling it. + +Returns: + The started thread." +11544,stop,tensorflow/tensorflow/python/training/supervisor.py,810,method,"Stop the services and the coordinator. + +This does not close the session. + +Args: + threads: Optional list of threads to join with the coordinator. If + `None`, defaults to the threads running the standard services, the + threads started for `QueueRunners`, and the threads started by the + `loop()` method. To wait on additional threads, pass the list in this + parameter. + close_summary_writer: Whether to close the `summary_writer`. Defaults to + `True` if the summary writer was created by the supervisor, `False` + otherwise. + ignore_live_threads: If `True` ignores threads that remain running after a + grace period when joining threads via the coordinator, instead of + raising a RuntimeError." +11545,request_stop,tensorflow/tensorflow/python/training/supervisor.py,849,method,"Request that the coordinator stop the threads. + +See `Coordinator.request_stop()`. + +Args: + ex: Optional `Exception`, or Python `exc_info` tuple as returned by + `sys.exc_info()`. If this is the first call to `request_stop()` the + corresponding exception is recorded and re-raised from `join()`." +11546,should_stop,tensorflow/tensorflow/python/training/supervisor.py,861,method,"Check if the coordinator was told to stop. + +See `Coordinator.should_stop()`. + +Returns: + True if the coordinator was told to stop, False otherwise." +11547,stop_on_exception,tensorflow/tensorflow/python/training/supervisor.py,871,method,"Context handler to stop the supervisor when an exception is raised. + +See `Coordinator.stop_on_exception()`. + +Returns: + A context handler." +11548,wait_for_stop,tensorflow/tensorflow/python/training/supervisor.py,881,method,Block waiting for the coordinator to stop. +11549,summary_computed,tensorflow/tensorflow/python/training/supervisor.py,885,method,"Indicate that a summary was computed. + +Args: + sess: A `Session` object. + summary: A Summary proto, or a string holding a serialized summary proto. + global_step: Int. global step this summary is associated with. If `None`, + it will try to fetch the current step. + +Raises: + TypeError: if 'summary' is not a Summary proto or a string. + RuntimeError: if the Supervisor was created without a `logdir`." +11550,managed_session,tensorflow/tensorflow/python/training/supervisor.py,936,method,"Returns a context manager for a managed session. + +This context manager creates and automatically recovers a session. It +optionally starts the standard services that handle checkpoints and +summaries. It monitors exceptions raised from the `with` block or from the +services and stops the supervisor as needed. + +The context manager is typically used as follows: + +```python +def train(): + sv = tf.compat.v1.train.Supervisor(...) + with sv.managed_session() as sess: + for step in xrange(..): + if sv.should_stop(): + break + sess.run() + ...do other things needed at each training step... +``` + +An exception raised from the `with` block or one of the service threads is +raised again when the block exits. This is done after stopping all threads +and closing the session. For example, an `AbortedError` exception, raised +in case of preemption of one of the workers in a distributed model, is +raised again when the block exits. + +If you want to retry the training loop in case of preemption you can do it +as follows: + +```python +def main(...): + while True + try: + train() + except tf.errors.Aborted: + pass +``` + +As a special case, exceptions used for control flow, such as +`OutOfRangeError` which reports that input queues are exhausted, are not +raised again from the `with` block: they indicate a clean termination of +the training loop and are considered normal termination. + +Args: + master: name of the TensorFlow master to use. See the + `tf.compat.v1.Session` constructor for how this is interpreted. + config: Optional `ConfigProto` proto used to configure the session. Passed + as-is to create the session. + start_standard_services: Whether to start the standard services, such as + checkpoint, summary and step counter. + close_summary_writer: Whether to close the summary writer when closing the + session. Defaults to True. + +Returns: + A context manager that yields a `Session` restored from the latest + checkpoint or initialized from scratch if not checkpoint exists. The + session is closed when the `with` block exits." +11551,SVSummaryThread,tensorflow/tensorflow/python/training/supervisor.py,1028,class,A thread to save summaries on a timer. +11552,run_loop,tensorflow/tensorflow/python/training/supervisor.py,1042,method, +11553,SVStepCounterThread,tensorflow/tensorflow/python/training/supervisor.py,1054,class,Threads to count steps and measure their duration. +11554,start_loop,tensorflow/tensorflow/python/training/supervisor.py,1075,method, +11555,run_loop,tensorflow/tensorflow/python/training/supervisor.py,1079,method, +11556,SVTimerCheckpointThread,tensorflow/tensorflow/python/training/supervisor.py,1102,class,A thread to checkpoint on a timer. +11557,run_loop,tensorflow/tensorflow/python/training/supervisor.py,1116,method, +11558,SyncReplicasOptimizer,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,45,class,"Class to synchronize, aggregate gradients and pass them to the optimizer. This class is deprecated. For synchronous training, please use [Distribution Strategies](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/distribute). @@ -110955,14 +120263,104 @@ sync_replicas_hook while calling the fit. my_estimator = DNNClassifier(..., optimizer=opt) my_estimator.fit(..., hooks=[sync_replicas_hook]) ```" -12348,_SyncReplicasOptimizerHook,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,465,class,A SessionRunHook handles ops related to SyncReplicasOptimizer. -12349,get_workers,tensorflow/tensorflow/python/training/sync_replicas_optimizer_test.py,35,function, -12350,SyncReplicasOptimizerTest,tensorflow/tensorflow/python/training/sync_replicas_optimizer_test.py,87,class, -12351,SyncReplicasOptimizerHookTest,tensorflow/tensorflow/python/training/sync_replicas_optimizer_test.py,262,class, -12352,get_verbosity,tensorflow/tensorflow/python/training/tensorboard_logging.py,78,function, -12353,set_verbosity,tensorflow/tensorflow/python/training/tensorboard_logging.py,82,function, -12354,_check_verbosity,tensorflow/tensorflow/python/training/tensorboard_logging.py,88,function, -12355,set_summary_writer,tensorflow/tensorflow/python/training/tensorboard_logging.py,94,function,"Sets the summary writer that events will be logged to. +11559,compute_gradients,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,207,method,"Compute gradients of ""loss"" for the variables in ""var_list"". + +This simply wraps the compute_gradients() from the real optimizer. The +gradients will be aggregated in the apply_gradients() so that user can +modify the gradients like clipping with per replica global norm if needed. +The global norm with aggregated gradients can be bad as one replica's huge +gradients can hurt the gradients from other replicas. + +Args: + *args: Arguments for compute_gradients(). + **kwargs: Keyword arguments for compute_gradients(). + +Returns: + A list of (gradient, variable) pairs." +11560,apply_gradients,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,225,method,"Apply gradients to variables. + +This contains most of the synchronization implementation and also wraps the +apply_gradients() from the real optimizer. + +Args: + grads_and_vars: List of (gradient, variable) pairs as returned by + compute_gradients(). + global_step: Optional Variable to increment by one after the + variables have been updated. + name: Optional name for the returned operation. Default to the + name passed to the Optimizer constructor. + +Returns: + train_op: The op to dequeue a token so the replicas can exit this batch + and start the next one. This is executed by each replica. + +Raises: + ValueError: If the grads_and_vars is empty. + ValueError: If global step is not provided, the staleness cannot be + checked." +11561,get_chief_queue_runner,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,360,method,"Returns the QueueRunner for the chief to execute. + +This includes the operations to synchronize replicas: aggregate gradients, +apply to variables, increment global step, insert tokens to token queue. + +Note that this can only be called after calling apply_gradients() which +actually generates this queuerunner. + +Returns: + A `QueueRunner` for chief to execute. + +Raises: + ValueError: If this is called before apply_gradients()." +11562,get_slot,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,380,method,"Return a slot named ""name"" created for ""var"" by the Optimizer. + +This simply wraps the get_slot() from the actual optimizer. + +Args: + *args: Arguments for get_slot(). + **kwargs: Keyword arguments for get_slot(). + +Returns: + The `Variable` for the slot if it was created, `None` otherwise." +11563,variables,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,394,method,"Fetches a list of optimizer variables in the default graph. + +This wraps `variables()` from the actual optimizer. It does not include +the `SyncReplicasOptimizer`'s local step. + +Returns: + A list of variables." +11564,get_slot_names,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,405,method,"Return a list of the names of slots created by the `Optimizer`. + +This simply wraps the get_slot_names() from the actual optimizer. + +Args: + *args: Arguments for get_slot(). + **kwargs: Keyword arguments for get_slot(). + +Returns: + A list of strings." +11565,get_init_tokens_op,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,419,method,"Returns the op to fill the sync_token_queue with the tokens. + +This is supposed to be executed in the beginning of the chief/sync thread +so that even if the total_num_replicas is less than replicas_to_aggregate, +the model can still proceed as the replicas can compute multiple steps per +variable update. Make sure: +`num_tokens >= replicas_to_aggregate - total_num_replicas`. + +Args: + num_tokens: Number of tokens to add to the queue. + +Returns: + An op for the chief/sync replica to fill the token queue. + +Raises: + ValueError: If this is called before apply_gradients(). + ValueError: If num_tokens are smaller than replicas_to_aggregate - + total_num_replicas." +11566,make_session_run_hook,tensorflow/tensorflow/python/training/sync_replicas_optimizer.py,460,method,Creates a hook to handle SyncReplicasHook ops such as initialization. +11567,get_workers,tensorflow/tensorflow/python/training/sync_replicas_optimizer_test.py,35,function, +11568,get_verbosity,tensorflow/tensorflow/python/training/tensorboard_logging.py,78,function, +11569,set_verbosity,tensorflow/tensorflow/python/training/tensorboard_logging.py,82,function, +11570,set_summary_writer,tensorflow/tensorflow/python/training/tensorboard_logging.py,94,function,"Sets the summary writer that events will be logged to. Calling any logging methods inside this module without calling this method will fail. If you don't want to log, call `set_summary_writer(None)`. @@ -110971,11 +120369,7 @@ Args: summary_writer: Either a SummaryWriter or None. None will cause messages not to be logged to any SummaryWriter, but they will still be passed to the platform logging module." -12356,_clear_summary_writer,tensorflow/tensorflow/python/training/tensorboard_logging.py,109,function,"Makes all subsequent log invocations error. - -This is only used for testing. If you want to disable TensorBoard logging, -call `set_summary_writer(None)` instead." -12357,log,tensorflow/tensorflow/python/training/tensorboard_logging.py,119,function,"Conditionally logs `message % args` at the level `level`. +11571,log,tensorflow/tensorflow/python/training/tensorboard_logging.py,119,function,"Conditionally logs `message % args` at the level `level`. Note that tensorboard_logging verbosity and logging verbosity are separate; the message will always be passed through to the logging module regardless of @@ -110990,14 +120384,12 @@ Args: Raises: ValueError: If `level` is not a valid logging level. RuntimeError: If the `SummaryWriter` to use has not been set." -12358,debug,tensorflow/tensorflow/python/training/tensorboard_logging.py,152,function, -12359,info,tensorflow/tensorflow/python/training/tensorboard_logging.py,156,function, -12360,warn,tensorflow/tensorflow/python/training/tensorboard_logging.py,160,function, -12361,error,tensorflow/tensorflow/python/training/tensorboard_logging.py,164,function, -12362,fatal,tensorflow/tensorflow/python/training/tensorboard_logging.py,168,function, -12363,EventLoggingTest,tensorflow/tensorflow/python/training/tensorboard_logging_test.py,37,class, -12364,TrainingOpsTest,tensorflow/tensorflow/python/training/training_ops_test.py,36,class, -12365,global_step,tensorflow/tensorflow/python/training/training_util.py,41,function,"Small helper to get the global step. +11572,debug,tensorflow/tensorflow/python/training/tensorboard_logging.py,152,function, +11573,info,tensorflow/tensorflow/python/training/tensorboard_logging.py,156,function, +11574,warn,tensorflow/tensorflow/python/training/tensorboard_logging.py,160,function, +11575,error,tensorflow/tensorflow/python/training/tensorboard_logging.py,164,function, +11576,fatal,tensorflow/tensorflow/python/training/tensorboard_logging.py,168,function, +11577,global_step,tensorflow/tensorflow/python/training/training_util.py,41,function,"Small helper to get the global step. ```python # Create a variable to hold the global_step. @@ -111020,7 +120412,7 @@ Args: Returns: The global step value." -12366,get_global_step,tensorflow/tensorflow/python/training/training_util.py,72,function,"Get the global step tensor. +11578,get_global_step,tensorflow/tensorflow/python/training/training_util.py,72,function,"Get the global step tensor. The global step tensor must be an integer variable. We first try to find it in the collection `GLOBAL_STEP`, or by name `global_step:0`. @@ -111034,7 +120426,7 @@ Returns: Raises: TypeError: If the global step tensor has a non-integer type, or if it is not a `Variable`." -12367,create_global_step,tensorflow/tensorflow/python/training/training_util.py,107,function,"Create global step tensor in graph. +11579,create_global_step,tensorflow/tensorflow/python/training/training_util.py,107,function,"Create global step tensor in graph. Args: graph: The graph in which to create the global step tensor. If missing, use @@ -111045,7 +120437,7 @@ Returns: Raises: ValueError: if global step tensor is already defined." -12368,get_or_create_global_step,tensorflow/tensorflow/python/training/training_util.py,148,function,"Returns and create (if necessary) the global step tensor. +11580,get_or_create_global_step,tensorflow/tensorflow/python/training/training_util.py,148,function,"Returns and create (if necessary) the global step tensor. Args: graph: The graph in which to create the global step tensor. If missing, use @@ -111053,33 +120445,11 @@ Args: Returns: The global step tensor." -12369,assert_global_step,tensorflow/tensorflow/python/training/training_util.py,166,function,"Asserts `global_step_tensor` is a scalar int `Variable` or `Tensor`. +11581,assert_global_step,tensorflow/tensorflow/python/training/training_util.py,166,function,"Asserts `global_step_tensor` is a scalar int `Variable` or `Tensor`. Args: global_step_tensor: `Tensor` to test." -12370,_get_global_step_read,tensorflow/tensorflow/python/training/training_util.py,188,function,"Gets global step read tensor in graph. - -Args: - graph: The graph in which to create the global step read tensor. If missing, - use default graph. - -Returns: - Global step read tensor. - -Raises: - RuntimeError: if multiple items found in collection GLOBAL_STEP_READ_KEY." -12371,_get_or_create_global_step_read,tensorflow/tensorflow/python/training/training_util.py,212,function,"Gets or creates global step read tensor in graph. - -Args: - graph: The graph in which to create the global step read tensor. If missing, - use default graph. - -Returns: - Global step read tensor if there is global_step_tensor else return None." -12372,_increment_global_step,tensorflow/tensorflow/python/training/training_util.py,242,function, -12373,GlobalStepTest,tensorflow/tensorflow/python/training/training_util_test.py,29,class, -12374,GlobalStepReadTest,tensorflow/tensorflow/python/training/training_util_test.py,96,class, -12375,VocabInfo,tensorflow/tensorflow/python/training/warm_starting_util.py,39,class,"Vocabulary information for warm-starting. +11582,VocabInfo,tensorflow/tensorflow/python/training/warm_starting_util.py,39,class,"Vocabulary information for warm-starting. See `tf.estimator.WarmStartSettings` for examples of using VocabInfo to warm-start. @@ -111143,104 +120513,7 @@ Returns: #Currently, only axis=0 and axis=1 are supported. ``` " -12376,_infer_var_name,tensorflow/tensorflow/python/training/warm_starting_util.py,138,function,"Returns name of the `var`. - -Args: - var: A list. The list can contain either of the following: - (i) A single `Variable` - (ii) A single `ResourceVariable` - (iii) Multiple `Variable` objects which must be slices of the same larger - variable. - (iv) A single `PartitionedVariable` - -Returns: - Name of the `var`" -12377,_get_var_info,tensorflow/tensorflow/python/training/warm_starting_util.py,159,function,"Helper method for standarizing Variable and naming. - -Args: - var: Current graph's variable that needs to be warm-started (initialized). - Can be either of the following: (i) `Variable` (ii) `ResourceVariable` - (iii) list of `Variable`: The list must contain slices of the same larger - variable. (iv) `PartitionedVariable` - prev_tensor_name: Name of the tensor to lookup in provided `prev_ckpt`. If - None, we lookup tensor with same name as given `var`. - -Returns: - A tuple of the Tensor name and var." -12378,_warm_start_var_with_vocab,tensorflow/tensorflow/python/training/warm_starting_util.py,195,function,"Warm-starts given variable from `prev_tensor_name` tensor in `prev_ckpt`. - -Use this method when the `var` is backed by vocabulary. This method stitches -the given `var` such that values corresponding to individual features in the -vocabulary remain consistent irrespective of changing order of the features -between old and new vocabularies. - -Args: - var: Current graph's variable that needs to be warm-started (initialized). - Can be either of the following: - (i) `Variable` - (ii) `ResourceVariable` - (iii) list of `Variable`: The list must contain slices of the same larger - variable. - (iv) `PartitionedVariable` - current_vocab_path: Path to the vocab file used for the given `var`. - current_vocab_size: An `int` specifying the number of entries in the current - vocab. - prev_ckpt: A string specifying the directory with checkpoint file(s) or path - to checkpoint. The given checkpoint must have tensor with name - `prev_tensor_name` (if not None) or tensor with name same as given `var`. - prev_vocab_path: Path to the vocab file used for the tensor in `prev_ckpt`. - previous_vocab_size: If provided, will constrain previous vocab to the first - `previous_vocab_size` entries. -1 means use the entire previous vocab. - current_oov_buckets: An `int` specifying the number of out-of-vocabulary - buckets used for given `var`. - prev_tensor_name: Name of the tensor to lookup in provided `prev_ckpt`. If - None, we lookup tensor with same name as given `var`. - initializer: Variable initializer to be used for missing entries. If None, - missing entries will be zero-initialized. - axis: Axis of the variable that the provided vocabulary corresponds to. - -Raises: - ValueError: If required args are not provided." -12379,_get_grouped_variables,tensorflow/tensorflow/python/training/warm_starting_util.py,317,function,"Collects and groups (possibly partitioned) variables into a dictionary. - -The variables can be provided explicitly through vars_to_warm_start, or they -are retrieved from collections (see below). - -Args: - vars_to_warm_start: One of the following: - - - A regular expression (string) that captures which variables to - warm-start (see tf.compat.v1.get_collection). This expression will - only consider variables in the TRAINABLE_VARIABLES collection. - - A list of strings, each representing a full variable name to warm-start. - These will consider variables in GLOBAL_VARIABLES collection. - - A list of Variables to warm-start. - - `None`, in which case all variables in TRAINABLE_VARIABLES will be used. -Returns: - A dictionary mapping variable names (strings) to lists of Variables. -Raises: - ValueError: If vars_to_warm_start is not a string, `None`, a list of - `Variables`, or a list of strings." -12380,_get_object_checkpoint_renames,tensorflow/tensorflow/python/training/warm_starting_util.py,373,function,"Returns a dictionary mapping variable names to checkpoint keys. - -The warm-starting utility expects variable names to match with the variable -names in the checkpoint. For object-based checkpoints, the variable names -and names in the checkpoint are different. Thus, for object-based checkpoints, -this function is used to obtain the map from variable names to checkpoint -keys. - -Args: - path: path to checkpoint directory or file. - variable_names: list of variable names to load from the checkpoint. - -Returns: - If the checkpoint is object-based, this function returns a map from variable - names to their corresponding checkpoint keys. - If the checkpoint is name-based, this returns an empty dict. - -Raises: - ValueError: If the object-based checkpoint is missing variables." -12381,warm_start,tensorflow/tensorflow/python/training/warm_starting_util.py,413,function,"Warm-starts a model using the given settings. +11583,warm_start,tensorflow/tensorflow/python/training/warm_starting_util.py,413,function,"Warm-starts a model using the given settings. If you are using a tf.estimator.Estimator, this will automatically be called during training. @@ -111285,8 +120558,7 @@ Raises: configuration for variable names that are not used. This is to ensure a stronger check for variable configuration than relying on users to examine the logs." -12382,WarmStartingUtilTest,tensorflow/tensorflow/python/training/warm_starting_util_test.py,45,class, -12383,LossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,43,class,"Base class for all loss scales. +11584,LossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,43,class,"Base class for all loss scales. This is an abstract base class, so you cannot instantiate it directly. Instead, use one of its concrete subclasses: @@ -111321,23 +120593,47 @@ Optimizers use instances of this class to scale loss and gradients. In most functions that accept a LossScale, you can also pass an int (such as 8) to create a `FixedLossScale` or the string `""dynamic""` to create a dynamic loss scale." -12384,FixedLossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,204,class,"Loss scale with a fixed value. +11585,update,tensorflow/tensorflow/python/training/experimental/loss_scale.py,91,method,"Updates the value of the loss scale. + +The loss scale will be potentially updated, based on the value of `grads`. +The tensor returned by calling this class is only updated when this function +is evaluated. + +In eager mode, this directly updates the loss scale, so that calling +`__call__` will return the newly updated loss scale. In graph mode, +this returns an op that, when evaluated, updates the loss scale. + +This function also returns a `should_apply_gradients` bool. If False, +gradients should not be applied to the variables that step, as nonfinite +gradients were found, and the loss scale has been be updated to reduce the +chance of finding nonfinite gradients in the next step. Some loss scale +classes will always return True, as they cannot adjust themselves in +response to nonfinite gradients. + +When a DistributionStrategy is used, this function may only be called in a +cross-replica context. + +Args: + grads: A nested structure of unscaled gradients, each which is the + gradient of the loss with respect to a weight. The gradients should have + already been divided by the loss scale being before passed to this + function. 'None' gradients are accepted, and are ignored. + +Returns: + update_op: In eager mode, None. In graph mode, an op to update the loss + scale. + should_apply_gradients: Either a bool or a scalar boolean tensor. If + False, the caller should skip applying `grads` to the variables this + step." +11586,get_config,tensorflow/tensorflow/python/training/experimental/loss_scale.py,191,method,Returns the config of this loss scale. +11587,from_config,tensorflow/tensorflow/python/training/experimental/loss_scale.py,196,method,Creates the LossScale from its config. +11588,FixedLossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,204,class,"Loss scale with a fixed value. The loss scale is not updated for the lifetime of instances of this class. A given instance of this class always returns the same number when called." -12385,_is_all_finite,tensorflow/tensorflow/python/training/experimental/loss_scale.py,251,function,Returns a scalar boolean tensor indicating if all gradients are finite. -12386,_op_in_graph_mode,tensorflow/tensorflow/python/training/experimental/loss_scale.py,259,function,"Returns the tensor's op in graph mode, or the tensor in eager mode. - -This is useful because sometimes an op is needed in graph mode instead of a -tensor. In eager mode, there are no ops. - -Args: - tensor: A tensor. - -Returns: - The tensor's op in graph mode. The tensor in eager mode." -12387,_assign_if_finite,tensorflow/tensorflow/python/training/experimental/loss_scale.py,276,function,Assigns a value to a variable if the value is finite. -12388,DynamicLossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,286,class,"Loss scale that dynamically adjusts itself. +11589,update,tensorflow/tensorflow/python/training/experimental/loss_scale.py,240,method, +11590,get_config,tensorflow/tensorflow/python/training/experimental/loss_scale.py,247,method, +11591,DynamicLossScale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,286,class,"Loss scale that dynamically adjusts itself. Dynamic loss scaling works by adjusting the loss scale as training progresses. The goal is to keep the loss scale as high as possible without overflowing the @@ -111350,8 +120646,17 @@ factor. However, if a NaN or Inf gradient is found, the gradients for that step are not applied, and the loss scale is decreased by the factor. This process tends to keep the loss scale as high as possible without gradients overflowing." -12389,get,tensorflow/tensorflow/python/training/experimental/loss_scale.py,417,function,Get a loss scale object. -12390,MixedPrecisionLossScaleOptimizer,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,31,class,"An optimizer that applies loss scaling. +11592,initial_loss_scale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,335,method, +11593,increment_period,tensorflow/tensorflow/python/training/experimental/loss_scale.py,339,method, +11594,multiplier,tensorflow/tensorflow/python/training/experimental/loss_scale.py,343,method, +11595,update,tensorflow/tensorflow/python/training/experimental/loss_scale.py,349,method,Updates loss scale based on if gradients are finite in current step. +11596,get_config,tensorflow/tensorflow/python/training/experimental/loss_scale.py,409,method, +11597,update_if_finite_grads,tensorflow/tensorflow/python/training/experimental/loss_scale.py,370,method,Update assuming the gradients are finite. +11598,update_if_not_finite_grads,tensorflow/tensorflow/python/training/experimental/loss_scale.py,384,method,Update assuming the gradients are nonfinite. +11599,get_is_finite,tensorflow/tensorflow/python/training/experimental/loss_scale.py,355,method, +11600,incr_loss_scale,tensorflow/tensorflow/python/training/experimental/loss_scale.py,373,method, +11601,get,tensorflow/tensorflow/python/training/experimental/loss_scale.py,417,function,Get a loss scale object. +11602,MixedPrecisionLossScaleOptimizer,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,31,class,"An optimizer that applies loss scaling. Loss scaling is a process that multiplies the loss by a multiplier called the loss scale, and divides each gradient by the same multiplier. The pseudocode @@ -111377,9 +120682,58 @@ performance. This optimizer wraps another optimizer and applies loss scaling to it via a `LossScale`. Loss scaling is applied whenever gradients are computed, such as through `minimize()`." -12391,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,47,function, -12392,get_gradients,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,63,function, -12393,create_identity_with_grad_check_fn,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,69,function,"Returns a function that asserts it's gradient has a certain value. +11603,compute_gradients,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,80,method,"Compute gradients of `loss` for the variables in `var_list`. + +This adjusts the dynamic range of the gradient evaluation by scaling up +the `loss` value. The gradient values are then scaled back down by the +reciprocal of the loss scale. This is useful in reduced precision training +where small gradient values would otherwise underflow the representable +range. + +Args: + loss: A Tensor containing the value to minimize or a callable taking no + arguments which returns the value to minimize. When eager execution is + enabled it must be a callable. + var_list: Optional list or tuple of `tf.Variable` to update to minimize + `loss`. Defaults to the list of variables collected in the graph under + the key `GraphKeys.TRAINABLE_VARIABLES`. + gate_gradients: How to gate the computation of gradients. Can be + `GATE_NONE`, `GATE_OP`, or `GATE_GRAPH`. + aggregation_method: Specifies the method used to combine gradient terms. + Valid values are defined in the class `AggregationMethod`. + colocate_gradients_with_ops: If True, try colocating gradients with the + corresponding op. + grad_loss: Optional. A `Tensor` holding the gradient computed for `loss`. + +Returns: + A list of (gradient, variable) pairs. Variable is always present, but + gradient can be `None`." +11604,apply_gradients,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,152,method,"Apply gradients to variables. + +This is the second part of `minimize()`. It returns an `Operation` that +conditionally applies gradients if all gradient values are finite. +Otherwise no update is performed (nor is `global_step` incremented). + +Args: + grads_and_vars: List of (gradient, variable) pairs as returned by + `compute_gradients()`. + global_step: Optional `Variable` to increment by one after the variables + have been updated. + name: Optional name for the returned operation. Default to the name + passed to the `Optimizer` constructor. + +Returns: + An `Operation` that conditionally applies the specified gradients. If + `global_step` was not None, that operation also increments `global_step`. + +Raises: + RuntimeError: If you should use `_distributed_apply()` instead." +11605,variables,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,247,method,Returns the variables of the Optimizer. +11606,apply_fn,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,215,method, +11607,new_loss,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer.py,131,method, +11608,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,47,function, +11609,get_gradients,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,63,function, +11610,create_identity_with_grad_check_fn,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,69,function,"Returns a function that asserts it's gradient has a certain value. This serves as a hook to assert intermediate gradients have a certain value. This returns an identity function. The identity's gradient function is also @@ -111394,21 +120748,8 @@ Args: Returns: An identity function whose gradient function asserts the gradient has a certain value." -12394,MixedPrecisionLossScaleOptimizerTest,tensorflow/tensorflow/python/training/experimental/loss_scale_optimizer_test.py,113,class, -12395,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scale_test.py,45,function, -12396,FixedLossScaleTest,tensorflow/tensorflow/python/training/experimental/loss_scale_test.py,61,class, -12397,_get_example_iter,tensorflow/tensorflow/python/training/experimental/loss_scale_test.py,101,function, -12398,DynamicLossScaleTest,tensorflow/tensorflow/python/training/experimental/loss_scale_test.py,106,class, -12399,_convert_to_per_replicas,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,32,function,"Converts tensors and DistributedVariables to PerReplica values. - -Args: - distribution: The distribution strategy in effect. - values: A list of tensors, variables, DistributedValues, or anything else - that can be converted to a PerReplcia value - -Returns: - `values`, but each element has been converted to a PerReplica value." -12400,LossScaleGradientTape,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,50,class,"A gradient tape that scales losses and unscales resulting gradients. +11611,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scale_test.py,45,function, +11612,LossScaleGradientTape,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,50,class,"A gradient tape that scales losses and unscales resulting gradients. Operates as a normal gradient tape, but takes in a `tf.mixed_precision.experimental.LossScale` object. Losses are scaled up by @@ -111447,35 +120788,40 @@ WARNING: Computing second-order (or higher) gradients with a None instead of the gradient tensors. This only occurs when you nest multiple gradient tapes under each other; if you do not nest them, this issue will not occur." -12401,_compute_gradients_until_finite,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,204,function,"Compute gradients and update the loss scale until the gradients are finite. +11613,gradient,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,127,method,"Computes the gradient using operations recorded in context of this tape. -This must be called in a cross-replica context. - -This is a function instead of a method of LossScaleGradientTape, as the `self` -parameter would be meaningless. There is one LossScaleGradientTape per -replica, but this function is called once total (not per replica), so there -cannot be a singular `self` parameter. +Uses the `LossScale` object provided in the constructor to scale `target` +and then to unscale the resulting gradients. Args: - distribution: The distribution strategy in effect. - loss_scale_gradient_tapes: A PerReplica value of LossScaleGradientTapes. - Contains the LossScaleGradientTape of each replica. - loss_scale: The loss scale to use to scale the loss and unscale the - gradient. target: a list or nested structure of Tensors or Variables to be differentiated. sources: a list or nested structure of Tensors or Variables. `target` will be differentiated against elements in `sources`. - output_gradients: Passed to GradientTape.gradient - unconnected_gradients: Pass to GradientTape.gradient. + output_gradients: a list of gradients, one for each element of target. + Defaults to None. + unconnected_gradients: a value which can either hold 'none' or 'zero' and + alters the value which will be returned if the target and sources are + unconnected. The possible values and effects are detailed in + 'UnconnectedGradients' and it defaults to 'none'. Returns: - The gradients of `target` with respect to `sources`." -12402,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape_test.py,44,function, -12403,LossScaleGradientTapeTest,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape_test.py,51,class, -12404,_register_wrapper_optimizer_cls,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,37,function, -12405,_wrap_optimizer,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,41,function,Wraps an optimizer with a LossScaleOptimizer. -12406,enable_mixed_precision_graph_rewrite,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,65,function,"Enable mixed precision via a graph rewrite. + a list or nested structure of Tensors (or IndexedSlices, or None), + one for each element in `sources`. Returned structure is the same as + the structure of `sources`. If non-finite gradients are encountered + after dynamic scaling, the loss scale will be updated and the gradients + recomputed until either finite gradients are encountered or the loss scale + becomes 1. + +Raises: + RuntimeError: if called inside the context of the tape, or if called more + than once on a non-persistent tape. + ValueError: if the target is a variable or if unconnected gradients is + called with an unknown value." +11614,jacobian,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,183,method, +11615,batch_jacobian,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape.py,193,method, +11616,create_mirrored_strategy,tensorflow/tensorflow/python/training/experimental/loss_scaling_gradient_tape_test.py,44,function, +11617,enable_mixed_precision_graph_rewrite,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,65,function,"Enable mixed precision via a graph rewrite. Mixed precision is the use of both float32 and float16 data types when training a model to improve performance. This is achieved via a graph rewrite @@ -111613,7 +120959,7 @@ Args: Returns: A version of `opt` that will use loss scaling to prevent underflow." -12407,enable_mixed_precision_graph_rewrite_v1,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,210,function,"Enable mixed precision via a graph rewrite. +11618,enable_mixed_precision_graph_rewrite_v1,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,210,function,"Enable mixed precision via a graph rewrite. Mixed precision is the use of both float32 and float16 data types when training a model to improve performance. This is achieved via a graph rewrite @@ -111717,8 +121063,7 @@ Args: Returns: A version of `opt` that will use loss scaling to prevent underflow." -12408,_enable_mixed_precision_graph_rewrite_base,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,322,function,Enables mixed precision. See `enable_mixed_precision_graph_rewrite`. -12409,disable_mixed_precision_graph_rewrite,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,352,function,"Disables the mixed precision graph rewrite. +11619,disable_mixed_precision_graph_rewrite,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,352,function,"Disables the mixed precision graph rewrite. After this is called, the mixed precision graph rewrite will no longer run for tf.functions, and so float32 operations will no longer be converted to @@ -111732,7 +121077,7 @@ tf.functions to use float16. This function is useful for unit testing. A unit test can test using the mixed precision graph rewrite, then disable it so future unit tests continue using float32." -12410,disable_mixed_precision_graph_rewrite_v1,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,376,function,"Disables the mixed precision graph rewrite. +11620,disable_mixed_precision_graph_rewrite_v1,tensorflow/tensorflow/python/training/experimental/mixed_precision.py,376,function,"Disables the mixed precision graph rewrite. After this is called, the mixed precision graph rewrite will no longer run for new Sessions, and so float32 operations will no longer be converted to float16 @@ -111751,8 +121096,7 @@ mixed precision graph rewrite, then disable it so future unit tests continue using float32. If this is done, unit tests should not share a single session, as `enable_mixed_precision_graph_rewrite` and `disable_mixed_precision_graph_rewrite` have no effect on existing sessions." -12411,MixedPrecisionTest,tensorflow/tensorflow/python/training/experimental/mixed_precision_test.py,50,class, -12412,CheckpointOptions,tensorflow/tensorflow/python/training/saving/checkpoint_options.py,25,class,"Options for constructing a Checkpoint. +11621,CheckpointOptions,tensorflow/tensorflow/python/training/saving/checkpoint_options.py,25,class,"Options for constructing a Checkpoint. Used as the `_options` argument to the `tf.Checkpoint` constructor to adjust how variables are saved. @@ -111765,8 +121109,7 @@ checkpoint = tf.Checkpoint(step=step) options = tf.CheckpointOptions(experimental_io_device=""/job:localhost"") checkpoint.save(""/tmp/ckpt"", options=options) ```" -12413,_SingleDeviceSaver,tensorflow/tensorflow/python/training/saving/functional_saver.py,41,class,Saves and restores checkpoints from the current device. -12414,sharded_filename,tensorflow/tensorflow/python/training/saving/functional_saver.py,117,function,"Append sharding information to a filename. +11622,sharded_filename,tensorflow/tensorflow/python/training/saving/functional_saver.py,117,function,"Append sharding information to a filename. Args: filename_tensor: A string tensor. @@ -111775,13 +121118,34 @@ Args: Returns: A string tensor." -12415,MultiDeviceSaver,tensorflow/tensorflow/python/training/saving/functional_saver.py,131,class,"Saves checkpoints directly from multiple devices. +11623,MultiDeviceSaver,tensorflow/tensorflow/python/training/saving/functional_saver.py,131,class,"Saves checkpoints directly from multiple devices. Note that this is a low-level utility which stores Tensors in the keys specified by `SaveableObject`s. Higher-level utilities for object-based checkpointing are built on top of it." -12416,SaverTest,tensorflow/tensorflow/python/training/saving/functional_saver_test.py,42,class, -12417,SaveableHook,tensorflow/tensorflow/python/training/saving/saveable_hook.py,24,class,"Base class for running callbacks at Save/Restore time. +11624,to_proto,tensorflow/tensorflow/python/training/saving/functional_saver.py,174,method,Serializes to a SaverDef referencing the current graph. +11625,save,tensorflow/tensorflow/python/training/saving/functional_saver.py,204,method,"Save the saveable objects to a checkpoint with `file_prefix`. + +Args: + file_prefix: A string or scalar string Tensor containing the prefix to + save under. + options: Optional `CheckpointOptions` object. +Returns: + An `Operation`, or None when executing eagerly." +11626,restore,tensorflow/tensorflow/python/training/saving/functional_saver.py,299,method,"Restore the saveable objects from a checkpoint with `file_prefix`. + +Args: + file_prefix: A string or scalar string Tensor containing the prefix for + files to read from. + options: Optional `CheckpointOptions` object. + +Returns: + A dictionary mapping from SaveableObject names to restore operations." +11627,save_fn,tensorflow/tensorflow/python/training/saving/functional_saver.py,254,method, +11628,restore_fn,tensorflow/tensorflow/python/training/saving/functional_saver.py,312,method, +11629,tf_function_save,tensorflow/tensorflow/python/training/saving/functional_saver.py,293,method, +11630,tf_function_restore,tensorflow/tensorflow/python/training/saving/functional_saver.py,329,method, +11631,SaveableHook,tensorflow/tensorflow/python/training/saving/saveable_hook.py,24,class,"Base class for running callbacks at Save/Restore time. Subclasses should override one or both methods to modify or read variables during the saving process. No guarantees are made regarding the precedence @@ -111792,9 +121156,28 @@ Users should emit the SaveableHook alongside other SaveableObjects, such as in Trackable._gather_saveables_for_checkpoint(). Saves a single constant in order to be compliant with the SaveableObject API." -12418,SaveSpec,tensorflow/tensorflow/python/training/saving/saveable_object.py,21,class,Class used to describe tensor slices that need to be saved. -12419,SaveableObject,tensorflow/tensorflow/python/training/saving/saveable_object.py,58,class,Base class for saving and restoring saveable objects. -12420,set_cpu0,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,54,function,"Creates a new device string based on `device_string` but using /CPU:0. +11632,device,tensorflow/tensorflow/python/training/saving/saveable_hook.py,50,method, +11633,before_save,tensorflow/tensorflow/python/training/saving/saveable_hook.py,53,method,This method will be called before iterating devices for saving. +11634,after_restore,tensorflow/tensorflow/python/training/saving/saveable_hook.py,57,method,This method will be called after each device is restored. +11635,SaveSpec,tensorflow/tensorflow/python/training/saving/saveable_object.py,21,class,Class used to describe tensor slices that need to be saved. +11636,tensor,tensorflow/tensorflow/python/training/saving/saveable_object.py,54,method, +11637,SaveableObject,tensorflow/tensorflow/python/training/saving/saveable_object.py,58,class,Base class for saving and restoring saveable objects. +11638,optional_restore,tensorflow/tensorflow/python/training/saving/saveable_object.py,76,method,A hint to restore assertions that this object is optional. +11639,device,tensorflow/tensorflow/python/training/saving/saveable_object.py,81,method,The device for SaveSpec Tensors. +11640,restore,tensorflow/tensorflow/python/training/saving/saveable_object.py,85,method,"Restores this object from 'restored_tensors'. + +Args: + restored_tensors: the tensors that were loaded from a checkpoint + restored_shapes: the shapes this object should conform to after + restore, or None. + +Returns: + An operation that restores the state of the object. + +Raises: + ValueError: If the object cannot be restored using the provided + parameters." +11641,set_cpu0,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,54,function,"Creates a new device string based on `device_string` but using /CPU:0. If the device is already on /CPU:0, this is a no-op. @@ -111803,10 +121186,12 @@ Args: Returns: A device string." -12421,ReferenceVariableSaveable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,70,class,SaveableObject implementation that handles reference variables. -12422,ResourceVariableSaveable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,88,class,SaveableObject implementation that handles ResourceVariables. -12423,_tensor_comes_from_variable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,130,function, -12424,saveable_objects_for_op,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,134,function,"Create `SaveableObject`s from an operation. +11642,ReferenceVariableSaveable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,70,class,SaveableObject implementation that handles reference variables. +11643,restore,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,77,method, +11644,ResourceVariableSaveable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,88,class,SaveableObject implementation that handles ResourceVariables. +11645,restore,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,119,method, +11646,f,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,100,method, +11647,saveable_objects_for_op,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,134,function,"Create `SaveableObject`s from an operation. Args: op: A variable, operation, or SaveableObject to coerce into a @@ -111819,7 +121204,7 @@ Yields: Raises: TypeError: If `name` is not a string. ValueError: For operations with no known conversion to SaveableObject." -12425,op_list_to_dict,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,224,function,"Create a dictionary of names to operation lists. +11648,op_list_to_dict,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,224,function,"Create a dictionary of names to operation lists. Args: op_list: A (nested) list, tuple, or set of Variables or SaveableObjects. @@ -111834,17 +121219,7 @@ Returns: Raises: TypeError: If the type of op_list or its elements is not supported. ValueError: If at least two saveables share the same name." -12426,_add_saveable,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,317,function,"Adds the saveable to the saveables list. - -Args: - saveables: List to append the SaveableObject to. - seen_ops: Set of the ops of the saveables already processed. Used to - check that each saveable is only saved once. - saveable: The saveable. - -Raises: - ValueError: If the saveable has already been processed." -12427,validate_and_slice_inputs,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,336,function,"Returns the variables and names that will be used for a Saver. +11649,validate_and_slice_inputs,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,336,function,"Returns the variables and names that will be used for a Saver. Args: names_to_saveables: A dict (k, v) where k is the name of an operation and @@ -111858,11 +121233,11 @@ Raises: values are not one of Tensor or Variable or a trackable operation. ValueError: If the same operation is given in more than one value (this also applies to slices of SlicedVariables)." -12428,trace_save_restore_functions,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,365,function,Gathers all SaveableObjects and traces the save and restore ops. -12429,_trace_save_and_restore_function,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,390,function,Traces the save and restore concrete functions. -12430,RestoredSaveableObject,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,444,class,SaveableObject restored from SavedModel using the traced save/restore. -12431,restored_saved_object_factory,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,467,function, -12432,create_saveable_object,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,473,function,"Creates a SaveableObject while potentially in a different graph. +11650,trace_save_restore_functions,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,365,function,Gathers all SaveableObjects and traces the save and restore ops. +11651,RestoredSaveableObject,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,444,class,SaveableObject restored from SavedModel using the traced save/restore. +11652,restore,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,461,method, +11653,restored_saved_object_factory,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,467,function, +11654,create_saveable_object,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,473,function,"Creates a SaveableObject while potentially in a different graph. When creating the frozen saver for SavedModel, the save and restore ops are placed in a separate graph. Since RestoredSaveableObject uses tf.functions to @@ -111876,8 +121251,8 @@ Args: Returns: a SaveableObject." -12433,is_factory_for_restored_saveable_object,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,504,function, -12434,CheckpointInitialValue,tensorflow/tensorflow/python/training/tracking/base.py,57,class,"Tensor wrapper for managing update UIDs in `Variables`. +11655,is_factory_for_restored_saveable_object,tensorflow/tensorflow/python/training/saving/saveable_object_util.py,504,function, +11656,CheckpointInitialValue,tensorflow/tensorflow/python/training/tracking/base.py,57,class,"Tensor wrapper for managing update UIDs in `Variables`. When supplied as an initial value, objects of this type let a `Variable` (`Variable`, `ResourceVariable`, etc.) know the UID of the restore the initial @@ -111887,11 +121262,63 @@ initial value is not set (e.g. due to a custom getter interfering). See comments in _add_variable_with_custom_getter for more information about how `CheckpointInitialValue` is used." -12435,NoRestoreSaveable,tensorflow/tensorflow/python/training/tracking/base.py,89,class,Embeds a tensor in a checkpoint with no restore ops. -12436,PythonStateSaveable,tensorflow/tensorflow/python/training/tracking/base.py,102,class,An interface for saving/restoring volatile Python state. -12437,PythonStringStateSaveable,tensorflow/tensorflow/python/training/tracking/base.py,129,class,Saves Python state in a checkpoint. -12438,CheckpointPosition,tensorflow/tensorflow/python/training/tracking/base.py,190,class,Indicates a position within a `_CheckpointRestoreCoordinator`. -12439,no_automatic_dependency_tracking,tensorflow/tensorflow/python/training/tracking/base.py,443,function,"Disables automatic dependency tracking on attribute assignment. +11657,checkpoint_position,tensorflow/tensorflow/python/training/tracking/base.py,85,method, +11658,NoRestoreSaveable,tensorflow/tensorflow/python/training/tracking/base.py,89,class,Embeds a tensor in a checkpoint with no restore ops. +11659,restore,tensorflow/tensorflow/python/training/tracking/base.py,97,method, +11660,PythonStateSaveable,tensorflow/tensorflow/python/training/tracking/base.py,102,class,An interface for saving/restoring volatile Python state. +11661,feed_dict_additions,tensorflow/tensorflow/python/training/tracking/base.py,106,method,"When running a graph, indicates fresh state to feed. + +Returns: + A dictionary mapping `Tensor`s to current Python state." +11662,freeze,tensorflow/tensorflow/python/training/tracking/base.py,115,method,"Create a new `SaveableObject` which freezes current state as a constant. + +Used when executing eagerly to embed the current state as a constant, or +when creating a static tf.compat.v1.train.Saver with the frozen current +Python state. + +Returns: + A `SaveableObject` which is not a `PythonStateSaveable` instance (i.e. has + no Python state associated with it)." +11663,PythonStringStateSaveable,tensorflow/tensorflow/python/training/tracking/base.py,129,class,Saves Python state in a checkpoint. +11664,optional_restore,tensorflow/tensorflow/python/training/tracking/base.py,159,method,"For values with no restore, relaxes assert_consumed()." +11665,feed_dict_additions,tensorflow/tensorflow/python/training/tracking/base.py,163,method,"When running a graph, indicates fresh state to feed." +11666,freeze,tensorflow/tensorflow/python/training/tracking/base.py,167,method,Create a frozen `SaveableObject` which saves the current state. +11667,python_restore,tensorflow/tensorflow/python/training/tracking/base.py,179,method,Called to restore Python state. +11668,restore,tensorflow/tensorflow/python/training/tracking/base.py,185,method,Called to restore TensorFlow state (nothing to do). +11669,CheckpointPosition,tensorflow/tensorflow/python/training/tracking/base.py,190,class,Indicates a position within a `_CheckpointRestoreCoordinator`. +11670,restore,tensorflow/tensorflow/python/training/tracking/base.py,205,method,Restore this value into `trackable`. +11671,bind_object,tensorflow/tensorflow/python/training/tracking/base.py,215,method,"Set a checkpoint<->object correspondence and process slot variables. + +Args: + trackable: The object to record a correspondence for. + +Returns: + True if this is a new assignment, False if this object has already been + mapped to a checkpointed `Object` proto. +Raises: + AssertionError: If another object is already bound to the `Object` proto." +11672,is_simple_variable,tensorflow/tensorflow/python/training/tracking/base.py,282,method,Determine whether this value is restorable with a Tensor initializer. +11673,value_tensors,tensorflow/tensorflow/python/training/tracking/base.py,289,method,"Create value `Tensor`s for this object's attributes. + +Does not require that the Python object has been created. Used for +restore-on-create when executing eagerly. + +Returns: + A dictionary mapping from object attribute names to `Tensor`s." +11674,gather_ops_or_named_saveables,tensorflow/tensorflow/python/training/tracking/base.py,317,method,Looks up or creates SaveableObjects which don't have cached ops. +11675,restore_ops,tensorflow/tensorflow/python/training/tracking/base.py,389,method,"Create or fetch restore ops for this object's attributes. + +Requires that the `Trackable` Python object has been bound to an object +ID in the checkpoint. + +Returns: + A list of operations when graph building, or an empty list when executing + eagerly." +11676,checkpoint,tensorflow/tensorflow/python/training/tracking/base.py,406,method, +11677,trackable,tensorflow/tensorflow/python/training/tracking/base.py,410,method, +11678,object_proto,tensorflow/tensorflow/python/training/tracking/base.py,414,method, +11679,restore_uid,tensorflow/tensorflow/python/training/tracking/base.py,418,method, +11680,no_automatic_dependency_tracking,tensorflow/tensorflow/python/training/tracking/base.py,443,function,"Disables automatic dependency tracking on attribute assignment. Use to decorate any method of a Trackable object. Attribute assignment in that method will not add dependencies (also respected in Model). Harmless if @@ -111905,7 +121332,7 @@ Args: Returns: A decorated method which sets and un-sets automatic dependency tracking for the object the method is called on (not thread safe)." -12440,no_manual_dependency_tracking_scope,tensorflow/tensorflow/python/training/tracking/base.py,474,function,"A context that disables manual dependency tracking for the given `obj`. +11681,no_manual_dependency_tracking_scope,tensorflow/tensorflow/python/training/tracking/base.py,474,function,"A context that disables manual dependency tracking for the given `obj`. Sometimes library methods might track objects on their own and we might want to disable that and do the tracking on our own. One can then use this context @@ -111925,7 +121352,7 @@ Args: Yields: a scope in which the object doesn't track dependencies manually." -12441,no_automatic_dependency_tracking_scope,tensorflow/tensorflow/python/training/tracking/base.py,506,function,"A context that disables automatic dependency tracking when assigning attrs. +11682,no_automatic_dependency_tracking_scope,tensorflow/tensorflow/python/training/tracking/base.py,506,function,"A context that disables automatic dependency tracking when assigning attrs. Objects that inherit from Autotrackable automatically creates dependencies to trackable objects through attribute assignments, and wraps data structures @@ -111946,19 +121373,18 @@ Args: Yields: a scope in which the object doesn't track dependencies." -12442,Trackable,tensorflow/tensorflow/python/training/tracking/base.py,537,class,"Base class for `Trackable` objects without automatic dependencies. +11683,Trackable,tensorflow/tensorflow/python/training/tracking/base.py,537,class,"Base class for `Trackable` objects without automatic dependencies. This class has no __setattr__ override for performance reasons. Dependencies must be added explicitly. Unless attribute assignment is performance-critical, use `AutoTrackable` instead. Use `Trackable` for `isinstance` checks." -12443,InterfaceTests,tensorflow/tensorflow/python/training/tracking/base_test.py,29,class, -12444,_TrivialSaveable,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,37,class, -12445,_TrivialRestore,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,51,class, -12446,_LazyTrivialObjects,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,57,class, -12447,_save_checkpoint,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,69,function, -12448,SavingBenchmarks,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,75,class, -12449,NoDependency,tensorflow/tensorflow/python/training/tracking/data_structures.py,41,class,"Allows attribute assignment to `Trackable` objects with no dependency. +11684,SavingBenchmarks,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,75,class, +11685,benchmark_baseline_no_restore,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,89,method, +11686,benchmark_batch_restore,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,97,method, +11687,benchmark_restore_on_create,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,107,method, +11688,benchmark_raw_restore,tensorflow/tensorflow/python/training/tracking/benchmarks_test.py,117,method, +11689,NoDependency,tensorflow/tensorflow/python/training/tracking/data_structures.py,41,class,"Allows attribute assignment to `Trackable` objects with no dependency. Example usage: ```python @@ -111976,9 +121402,8 @@ dependencies: wrapping a `Layer` in `NoDependency` will assign the (unwrapped) `Layer` to the attribute without a checkpoint dependency, but the `Model` will still track the `Layer` (so it will appear in `Model.layers`, and its variables will appear in `Model.variables`)." -12450,_should_wrap_tuple,tensorflow/tensorflow/python/training/tracking/data_structures.py,68,function,Determine if a tuple has any trackable components. -12451,wrap_or_unwrap,tensorflow/tensorflow/python/training/tracking/data_structures.py,82,function,"Wraps basic data structures, unwraps NoDependency objects." -12452,sticky_attribute_assignment,tensorflow/tensorflow/python/training/tracking/data_structures.py,105,function,"Adds dependencies, generally called from __setattr__. +11690,wrap_or_unwrap,tensorflow/tensorflow/python/training/tracking/data_structures.py,82,function,"Wraps basic data structures, unwraps NoDependency objects." +11691,sticky_attribute_assignment,tensorflow/tensorflow/python/training/tracking/data_structures.py,105,function,"Adds dependencies, generally called from __setattr__. This behavior is shared between Trackable and Model. @@ -111994,9 +121419,19 @@ Args: Returns: The value which should be stored in the attribute (unwrapped from a NoDependency object if necessary)." -12453,_UntrackableError,tensorflow/tensorflow/python/training/tracking/data_structures.py,140,class, -12454,TrackableDataStructure,tensorflow/tensorflow/python/training/tracking/data_structures.py,151,class,Base class for data structures which contain trackable objects. -12455,List,tensorflow/tensorflow/python/training/tracking/data_structures.py,276,class,"An append-only sequence type which is trackable. +11692,TrackableDataStructure,tensorflow/tensorflow/python/training/tracking/data_structures.py,151,class,Base class for data structures which contain trackable objects. +11693,trainable,tensorflow/tensorflow/python/training/tracking/data_structures.py,168,method, +11694,trainable,tensorflow/tensorflow/python/training/tracking/data_structures.py,172,method, +11695,layers,tensorflow/tensorflow/python/training/tracking/data_structures.py,211,method, +11696,trainable_weights,tensorflow/tensorflow/python/training/tracking/data_structures.py,215,method, +11697,non_trainable_weights,tensorflow/tensorflow/python/training/tracking/data_structures.py,222,method, +11698,weights,tensorflow/tensorflow/python/training/tracking/data_structures.py,229,method, +11699,trainable_variables,tensorflow/tensorflow/python/training/tracking/data_structures.py,233,method, +11700,non_trainable_variables,tensorflow/tensorflow/python/training/tracking/data_structures.py,237,method, +11701,variables,tensorflow/tensorflow/python/training/tracking/data_structures.py,241,method, +11702,updates,tensorflow/tensorflow/python/training/tracking/data_structures.py,245,method,Aggregate updates from any `Layer` instances. +11703,losses,tensorflow/tensorflow/python/training/tracking/data_structures.py,257,method,Aggregate losses from any `Layer` instances. +11704,List,tensorflow/tensorflow/python/training/tracking/data_structures.py,276,class,"An append-only sequence type which is trackable. Maintains checkpoint dependencies on its contents (which must also be trackable), and forwards any `Layer` metadata such as updates and losses. @@ -112028,7 +121463,10 @@ This kind of wrapping is necessary because `Trackable` objects do not a regular list (`self.layer_list = [layers.Dense(3)]`) does not create a checkpoint dependency and does not add the `Layer` instance's weights to its parent `Model`." -12456,ListWrapper,tensorflow/tensorflow/python/training/tracking/data_structures.py,398,class,"Wraps the built-in `list` to support restore-on-create for variables. +11705,copy,tensorflow/tensorflow/python/training/tracking/data_structures.py,319,method, +11706,append,tensorflow/tensorflow/python/training/tracking/data_structures.py,340,method,Add a new trackable value. +11707,extend,tensorflow/tensorflow/python/training/tracking/data_structures.py,345,method,Add a sequence of trackable values. +11708,ListWrapper,tensorflow/tensorflow/python/training/tracking/data_structures.py,398,class,"Wraps the built-in `list` to support restore-on-create for variables. Unlike `List`, this sequence type is mutable in the same ways built-in lists are. Instead of throwing an error immediately like `List`, it records @@ -112039,42 +121477,75 @@ refuses to save. On assignment to an attribute of a Model or Trackable object, Python lists are replaced with ListWrapper. Wrapping a list in a `NoDependency` object prevents this." -12457,Mapping,tensorflow/tensorflow/python/training/tracking/data_structures.py,658,class,"An append-only trackable mapping data structure with string keys. +11709,append,tensorflow/tensorflow/python/training/tracking/data_structures.py,566,method,Add a new trackable value. +11710,extend,tensorflow/tensorflow/python/training/tracking/data_structures.py,572,method,Add a sequence of trackable values. +11711,insert,tensorflow/tensorflow/python/training/tracking/data_structures.py,613,method, +11712,sort,tensorflow/tensorflow/python/training/tracking/data_structures.py,620,method, +11713,Mapping,tensorflow/tensorflow/python/training/tracking/data_structures.py,658,class,"An append-only trackable mapping data structure with string keys. Maintains checkpoint dependencies on its contents (which must also be trackable), named based on its keys. Note that once a key has been added, it may not be deleted or replaced." -12458,_DictWrapper,tensorflow/tensorflow/python/training/tracking/data_structures.py,728,class,"Wraps built-in dicts to support restore-on-create for variables. +11714,update,tensorflow/tensorflow/python/training/tracking/data_structures.py,711,method, +11715,ObjectGraphView,tensorflow/tensorflow/python/training/tracking/graph_view.py,142,class,Gathers and serializes an object graph. +11716,list_dependencies,tensorflow/tensorflow/python/training/tracking/graph_view.py,158,method, +11717,saveables_cache,tensorflow/tensorflow/python/training/tracking/graph_view.py,165,method,"Maps Trackable objects -> attribute names -> list(SaveableObjects). -_DictWrapper is to Mapping as ListWrapper is to List. Unlike Mapping, -_DictWrapper allows non-string keys and values and arbitrary mutations (delete -keys, reassign values). Like ListWrapper, these mutations mean that -_DictWrapper will raise an exception on save." -12459,_TupleWrapper,tensorflow/tensorflow/python/training/tracking/data_structures.py,911,class,Trackable wrapper for tuples and namedtuples. -12460,_is_function,tensorflow/tensorflow/python/training/tracking/data_structures.py,1035,function, -12461,_set_list_item,tensorflow/tensorflow/python/training/tracking/data_structures.py,1052,function, -12462,_set_tuple_item,tensorflow/tensorflow/python/training/tracking/data_structures.py,1070,function, -12463,ListTests,tensorflow/tensorflow/python/training/tracking/data_structures_test.py,45,class, -12464,ListWrapperTest,tensorflow/tensorflow/python/training/tracking/data_structures_test.py,146,class, -12465,MappingTests,tensorflow/tensorflow/python/training/tracking/data_structures_test.py,335,class, -12466,TupleTests,tensorflow/tensorflow/python/training/tracking/data_structures_test.py,517,class, -12467,_escape_local_name,tensorflow/tensorflow/python/training/tracking/graph_view.py,51,function, -12468,_object_prefix_from_path,tensorflow/tensorflow/python/training/tracking/graph_view.py,61,function, -12469,_slot_variable_naming_for_optimizer,tensorflow/tensorflow/python/training/tracking/graph_view.py,67,function,Make a function for naming slot variables in an optimizer. -12470,_serialize_slot_variables,tensorflow/tensorflow/python/training/tracking/graph_view.py,89,function,Gather and name slot variables. -12471,ObjectGraphView,tensorflow/tensorflow/python/training/tracking/graph_view.py,142,class,Gathers and serializes an object graph. -12472,is_layer,tensorflow/tensorflow/python/training/tracking/layer_utils.py,37,function,Implicit check for Layer-like objects. -12473,has_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,43,function,Implicit check for Layer-like objects. -12474,invalidate_recursive_cache,tensorflow/tensorflow/python/training/tracking/layer_utils.py,52,function,Convenience decorator to invalidate the cache when setting attributes. -12475,MutationSentinel,tensorflow/tensorflow/python/training/tracking/layer_utils.py,64,class,Container for tracking whether a property is in a cached state. -12476,AttributeSentinel,tensorflow/tensorflow/python/training/tracking/layer_utils.py,78,class,"Container for managing attribute cache state within a Layer. +Used to avoid re-creating SaveableObjects when graph building. None when +executing eagerly. + +Returns: + The cache (an object-identity dictionary), or None if caching is disabled." +11718,root,tensorflow/tensorflow/python/training/tracking/graph_view.py,177,method, +11719,serialize_object_graph,tensorflow/tensorflow/python/training/tracking/graph_view.py,364,method,"Determine checkpoint keys for variables and build a serialized graph. + +Non-slot variables are keyed based on a shortest path from the root saveable +to the object which owns the variable (i.e. the one which called +`Trackable._add_variable` to create it). + +Slot variables are keyed based on a shortest path to the variable being +slotted for, a shortest path to their optimizer, and the slot name. + +Returns: + A tuple of (named_variables, object_graph_proto, feed_additions): + named_variables: A dictionary mapping names to variable objects. + object_graph_proto: A TrackableObjectGraph protocol buffer + containing the serialized object graph and variable references. + feed_additions: A dictionary mapping from Tensors to values which should + be fed when saving. + +Raises: + ValueError: If there are invalid characters in an optimizer's slot names." +11720,frozen_saveable_objects,tensorflow/tensorflow/python/training/tracking/graph_view.py,389,method,Creates SaveableObjects with the current object graph frozen. +11721,objects_ids_and_slot_variables,tensorflow/tensorflow/python/training/tracking/graph_view.py,412,method,"Traverse the object graph and list all accessible objects. + +Looks for `Trackable` objects which are dependencies of +`root_trackable`. Includes slot variables only if the variable they are +slotting for and the optimizer are dependencies of `root_trackable` +(i.e. if they would be saved with a checkpoint). + +Returns: + A tuple of (trackable objects, object -> node id, slot variables)" +11722,list_objects,tensorflow/tensorflow/python/training/tracking/graph_view.py,436,method,Traverse the object graph and list all accessible objects. +11723,is_layer,tensorflow/tensorflow/python/training/tracking/layer_utils.py,37,function,Implicit check for Layer-like objects. +11724,has_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,43,function,Implicit check for Layer-like objects. +11725,invalidate_recursive_cache,tensorflow/tensorflow/python/training/tracking/layer_utils.py,52,function,Convenience decorator to invalidate the cache when setting attributes. +11726,MutationSentinel,tensorflow/tensorflow/python/training/tracking/layer_utils.py,64,class,Container for tracking whether a property is in a cached state. +11727,mark_as,tensorflow/tensorflow/python/training/tracking/layer_utils.py,68,method, +11728,in_cached_state,tensorflow/tensorflow/python/training/tracking/layer_utils.py,74,method, +11729,AttributeSentinel,tensorflow/tensorflow/python/training/tracking/layer_utils.py,78,class,"Container for managing attribute cache state within a Layer. The cache can be invalidated either on an individual basis (for instance when an attribute is mutated) or a layer-wide basis (such as when a new dependency is added)." -12477,filter_empty_layer_containers,tensorflow/tensorflow/python/training/tracking/layer_utils.py,141,function,Filter out empty Layer-like containers and uniquify. -12478,gather_trainable_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,161,function,"Lists the trainable weights for an object with sub-layers. +11730,add_parent,tensorflow/tensorflow/python/training/tracking/layer_utils.py,101,method, +11731,get,tensorflow/tensorflow/python/training/tracking/layer_utils.py,112,method, +11732,mark_cached,tensorflow/tensorflow/python/training/tracking/layer_utils.py,123,method, +11733,invalidate,tensorflow/tensorflow/python/training/tracking/layer_utils.py,127,method, +11734,invalidate_all,tensorflow/tensorflow/python/training/tracking/layer_utils.py,131,method, +11735,filter_empty_layer_containers,tensorflow/tensorflow/python/training/tracking/layer_utils.py,141,function,Filter out empty Layer-like containers and uniquify. +11736,gather_trainable_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,161,function,"Lists the trainable weights for an object with sub-layers. Args: trainable: Whether the object collecting the variables is trainable. @@ -112085,7 +121556,7 @@ Args: Returns: A list of collected trainable weights/variables." -12479,gather_non_trainable_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,184,function,"Lists the non-trainable weights for an object with sub-layers. +11737,gather_non_trainable_weights,tensorflow/tensorflow/python/training/tracking/layer_utils.py,184,function,"Lists the non-trainable weights for an object with sub-layers. Args: trainable: Whether the object collecting the variables is trainable. @@ -112096,7 +121567,7 @@ Args: Returns: A list of collected non-trainable weights/variables." -12480,PythonState,tensorflow/tensorflow/python/training/tracking/python_state.py,31,class,"A mixin for putting Python state in an object-based checkpoint. +11738,PythonState,tensorflow/tensorflow/python/training/tracking/python_state.py,31,class,"A mixin for putting Python state in an object-based checkpoint. This is an abstract class which allows extensions to TensorFlow's object-based checkpointing (see `tf.train.Checkpoint`). For example a wrapper for NumPy @@ -112139,46 +121610,15 @@ assert [2.] == root.numpy.array root.restore(save_path) assert [1.] == root.numpy.array ```" -12481,_NumpyState,tensorflow/tensorflow/python/training/tracking/python_state_test.py,33,class,"A checkpointable object whose NumPy array attributes are saved/restored. - -Example usage: - -```python -arrays = _NumpyState() -checkpoint = tf.train.Checkpoint(numpy_arrays=arrays) -arrays.x = numpy.zeros([3, 4]) -save_path = checkpoint.save(""/tmp/ckpt"") -arrays.x[1, 1] = 4. -checkpoint.restore(save_path) -assert (arrays.x == numpy.zeros([3, 4])).all() - -second_checkpoint = tf.train.Checkpoint( - numpy_arrays=_NumpyState()) -# Attributes of NumpyState objects are created automatically by restore() -second_checkpoint.restore(save_path) -assert (second_checkpoint.numpy_arrays.x == numpy.zeros([3, 4])).all() -``` - -Note that `NumpyState` objects re-create the attributes of the previously -saved object on `restore()`. This is in contrast to TensorFlow variables, for -which a `Variable` object must be created and assigned to an attribute. - -This snippet works both when graph building and when executing eagerly. On -save, the NumPy array(s) are fed as strings to be saved in the checkpoint (via -a placeholder when graph building, or as a string constant when executing -eagerly). When restoring they skip the TensorFlow graph entirely, and so no -restore ops need be run. This means that restoration always happens eagerly, -rather than waiting for `checkpoint.restore(...).run_restore_ops()` like -TensorFlow variables when graph building." -12482,_NumpyWrapper,tensorflow/tensorflow/python/training/tracking/python_state_test.py,106,class,Wraps a NumPy array for storage in an object-based checkpoint. -12483,NumpyStateTests,tensorflow/tensorflow/python/training/tracking/python_state_test.py,136,class, -12484,NotTrackable,tensorflow/tensorflow/python/training/tracking/tracking.py,41,class,"Marks instances of child classes as unsaveable using an object-based API. +11739,serialize,tensorflow/tensorflow/python/training/tracking/python_state.py,78,method,Callback to serialize the object. Returns a string. +11740,deserialize,tensorflow/tensorflow/python/training/tracking/python_state.py,82,method,Callback to deserialize the object. +11741,NotTrackable,tensorflow/tensorflow/python/training/tracking/tracking.py,41,class,"Marks instances of child classes as unsaveable using an object-based API. Useful for marking objects which would otherwise look trackable because of inheritance (e.g. through `Layer`) as not trackable. Inheriting from `NotTrackable` does not prevent an object from being assigned to any attributes, but will throw an error on save/restore." -12485,AutoTrackable,tensorflow/tensorflow/python/training/tracking/tracking.py,52,class,"Manages dependencies on other objects. +11742,AutoTrackable,tensorflow/tensorflow/python/training/tracking/tracking.py,52,class,"Manages dependencies on other objects. `Trackable` objects may have dependencies: other `Trackable` objects which should be saved if the object declaring the dependency is saved. A @@ -112203,9 +121643,11 @@ variable. directly (e.g. a `Variable` indicating how to save itself) rather than through dependencies on other objects. See `Trackable._gather_saveables_for_checkpoint` for details." -12486,delete_tracking,tensorflow/tensorflow/python/training/tracking/tracking.py,127,function,Removes the tracking of name from object. -12487,ResourceTracker,tensorflow/tensorflow/python/training/tracking/tracking.py,140,class,An object that tracks a list of resources. -12488,resource_tracker_scope,tensorflow/tensorflow/python/training/tracking/tracking.py,157,function,"A context to manage resource trackers. +11743,delete_tracking,tensorflow/tensorflow/python/training/tracking/tracking.py,127,function,Removes the tracking of name from object. +11744,ResourceTracker,tensorflow/tensorflow/python/training/tracking/tracking.py,140,class,An object that tracks a list of resources. +11745,resources,tensorflow/tensorflow/python/training/tracking/tracking.py,149,method, +11746,add_resource,tensorflow/tensorflow/python/training/tracking/tracking.py,152,method, +11747,resource_tracker_scope,tensorflow/tensorflow/python/training/tracking/tracking.py,157,function,"A context to manage resource trackers. Use this in order to collect up all resources created within a block of code. Example usage: @@ -112222,16 +121664,18 @@ Args: Yields: A scope in which the resource_tracker is active." -12489,CapturableResourceDeleter,tensorflow/tensorflow/python/training/tracking/tracking.py,185,class,Deleter to destroy CapturableResource without overriding its __del__(). -12490,CapturableResource,tensorflow/tensorflow/python/training/tracking/tracking.py,209,class,"Holds a Tensor which a tf.function can capture. +11748,CapturableResourceDeleter,tensorflow/tensorflow/python/training/tracking/tracking.py,185,class,Deleter to destroy CapturableResource without overriding its __del__(). +11749,destroy_resource,tensorflow/tensorflow/python/training/tracking/tracking.py,199,method, +11750,CapturableResource,tensorflow/tensorflow/python/training/tracking/tracking.py,209,class,"Holds a Tensor which a tf.function can capture. `CapturableResource`s are discovered by traversing the graph of object attributes, e.g. during `tf.saved_model.save`. They are excluded from the scope-based tracking of `TrackableResource`; generally things that require initialization should inherit from `TrackableResource` instead of `CapturableResource` directly." -12491,TrackableResource,tensorflow/tensorflow/python/training/tracking/tracking.py,286,class,Adds scope tracking to CapturableResource. -12492,Asset,tensorflow/tensorflow/python/training/tracking/tracking.py,307,class,"Represents a file asset to hermetically include in a SavedModel. +11751,resource_handle,tensorflow/tensorflow/python/training/tracking/tracking.py,244,method,Returns the resource handle associated with this Resource. +11752,TrackableResource,tensorflow/tensorflow/python/training/tracking/tracking.py,286,class,Adds scope tracking to CapturableResource. +11753,Asset,tensorflow/tensorflow/python/training/tracking/tracking.py,307,class,"Represents a file asset to hermetically include in a SavedModel. A SavedModel can include arbitrary files, called assets, that are needed for its use. For example a vocabulary file used initialize a lookup table. @@ -112266,7 +121710,8 @@ print(reloaded_obj.func()) Attributes: asset_path: A 0-D `tf.string` tensor with path to the asset." -12493,cached_per_instance,tensorflow/tensorflow/python/training/tracking/tracking.py,360,function,"Lightweight decorator for caching lazily constructed properties. +11754,asset_path,tensorflow/tensorflow/python/training/tracking/tracking.py,355,method,Fetch the current asset path. +11755,cached_per_instance,tensorflow/tensorflow/python/training/tracking/tracking.py,360,function,"Lightweight decorator for caching lazily constructed properties. When to use: This decorator provides simple caching with minimal overhead. It is designed @@ -112345,26 +121790,15 @@ Args: Returns: f decorated with simple caching behavior." -12494,MyPickleableObject,tensorflow/tensorflow/python/training/tracking/tracking_test.py,41,class,"Needed for InterfaceTests.test_property_cache_serialization. +11756,MyPickleableObject,tensorflow/tensorflow/python/training/tracking/tracking_test.py,41,class,"Needed for InterfaceTests.test_property_cache_serialization. This class must be at the top level. This is a constraint of pickle, unrelated to `cached_per_instance`." -12495,InterfaceTests,tensorflow/tensorflow/python/training/tracking/tracking_test.py,55,class, -12496,_DummyResource,tensorflow/tensorflow/python/training/tracking/tracking_test.py,287,class, -12497,ResourceTrackerTest,tensorflow/tensorflow/python/training/tracking/tracking_test.py,297,class, -12498,register_session_provider,tensorflow/tensorflow/python/training/tracking/util.py,65,function, -12499,get_session,tensorflow/tensorflow/python/training/tracking/util.py,71,function, -12500,_ObjectGraphProtoPrettyPrinter,tensorflow/tensorflow/python/training/tracking/util.py,81,class,"Lazily traverses an object graph proto to pretty print names. - -If no calls to `node_names` are made this object has no performance -overhead. On the other hand, it will only traverse the object graph once, so -repeated naming is cheap after the first." -12501,_CheckpointRestoreCoordinatorDeleter,tensorflow/tensorflow/python/training/tracking/util.py,126,class,Deleter to avoid overriding _CheckpointRestoreCoordinator.__del__(). -12502,_CheckpointRestoreCoordinator,tensorflow/tensorflow/python/training/tracking/util.py,175,class,Holds the status of an object-based checkpoint load. -12503,_NameBasedRestoreCoordinator,tensorflow/tensorflow/python/training/tracking/util.py,313,class,Keeps the status of a name-based checkpoint restore. -12504,_default_getter,tensorflow/tensorflow/python/training/tracking/util.py,400,function,A pared-down version of get_variable which does not reuse variables. -12505,add_variable,tensorflow/tensorflow/python/training/tracking/util.py,441,function,Add a variable to a Trackable with no scope influence. -12506,object_metadata,tensorflow/tensorflow/python/training/tracking/util.py,457,function,"Retrieves information about the objects in a checkpoint. +11757,my_id,tensorflow/tensorflow/python/training/tracking/tracking_test.py,50,method, +11758,register_session_provider,tensorflow/tensorflow/python/training/tracking/util.py,65,function, +11759,get_session,tensorflow/tensorflow/python/training/tracking/util.py,71,function, +11760,add_variable,tensorflow/tensorflow/python/training/tracking/util.py,441,function,Add a variable to a Trackable with no scope influence. +11761,object_metadata,tensorflow/tensorflow/python/training/tracking/util.py,457,function,"Retrieves information about the objects in a checkpoint. Example usage: @@ -112385,7 +121819,7 @@ Returns: A parsed `tf.contrib.checkpoint.TrackableObjectGraph` protocol buffer. Raises: ValueError: If an object graph was not found in the checkpoint." -12507,list_objects,tensorflow/tensorflow/python/training/tracking/util.py,494,function,"Traverse the object graph and list all accessible objects. +11762,list_objects,tensorflow/tensorflow/python/training/tracking/util.py,494,function,"Traverse the object graph and list all accessible objects. Looks for `Trackable` objects which are dependencies of `root_trackable`. Includes slot variables only if the variable they are @@ -112397,7 +121831,7 @@ Args: Returns: A flat list of objects." -12508,gather_initializers,tensorflow/tensorflow/python/training/tracking/util.py,511,function,"Traverse the object graph and find initialization ops. +11763,gather_initializers,tensorflow/tensorflow/python/training/tracking/util.py,511,function,"Traverse the object graph and find initialization ops. Looks for `Trackable` objects which are dependencies of `root_trackable` and which have an `initializer` property. Includes @@ -112410,7 +121844,7 @@ Args: Returns: A list of initialization ops." -12509,capture_dependencies,tensorflow/tensorflow/python/training/tracking/util.py,535,function,"Capture variables created within this scope as `Template` dependencies. +11764,capture_dependencies,tensorflow/tensorflow/python/training/tracking/util.py,535,function,"Capture variables created within this scope as `Template` dependencies. Requires that `template.variable_scope` is active. @@ -112425,15 +121859,13 @@ Args: Yields: None (when used as a context manager)." -12510,_LoadStatus,tensorflow/tensorflow/python/training/tracking/util.py,625,class,Abstract base for load status callbacks. -12511,streaming_restore,tensorflow/tensorflow/python/training/tracking/util.py,658,function,"When graph building, runs restore ops as soon as they come in. +11765,streaming_restore,tensorflow/tensorflow/python/training/tracking/util.py,658,function,"When graph building, runs restore ops as soon as they come in. Args: status: A _LoadStatus objects from an object-based saver's restore(). Streaming restore from name-based checkpoints is not currently supported. session: A session to run new restore ops in." -12512,_objects_with_attributes,tensorflow/tensorflow/python/training/tracking/util.py,684,function,Filters out objects with no direct variable dependencies for assertions. -12513,CheckpointLoadStatus,tensorflow/tensorflow/python/training/tracking/util.py,689,class,"Checks the status of checkpoint loading and manages restore ops. +11766,CheckpointLoadStatus,tensorflow/tensorflow/python/training/tracking/util.py,689,class,"Checks the status of checkpoint loading and manages restore ops. Returned from `Saver.restore`. Since `restore` may defer the loading of values in the checkpoint which don't yet have corresponding Python objects, @@ -112448,16 +121880,92 @@ calling `run_restore_ops` while `assert_consumed` fails is supported and will partially restore the checkpoint). See `Saver.restore` for usage examples." -12514,InitializationOnlyStatus,tensorflow/tensorflow/python/training/tracking/util.py,868,class,"Returned from `Saver.restore` when no checkpoint has been specified. +11767,assert_consumed,tensorflow/tensorflow/python/training/tracking/util.py,714,method,"Asserts that all objects in the checkpoint have been created/matched. + +Returns: + `self` for chaining. +Raises: + AssertionError: If there are any Python objects in the dependency graph + which have not been restored from this checkpoint or a later `restore`, + or if there are any checkpointed values which have not been matched to + Python objects." +11768,assert_existing_objects_matched,tensorflow/tensorflow/python/training/tracking/util.py,757,method,"Asserts that trackable Python objects have been matched. + +Note that this is a weaker assertion than `assert_consumed`. It will only +fail for existing Python objects which are (transitive) dependencies of the +root object and which do not have an entry in the checkpoint. + +It will not fail, for example, if a `tf.keras.Layer` object has not yet been +built and so has not created any `tf.Variable` objects. + +Returns: + `self` for chaining. + +Raises: + AssertionError: If a Python object exists in the transitive dependencies + of the root object but does not have a value in the checkpoint." +11769,assert_nontrivial_match,tensorflow/tensorflow/python/training/tracking/util.py,801,method,Raises an exception if only the root object matched. +11770,run_restore_ops,tensorflow/tensorflow/python/training/tracking/util.py,823,method,Run operations to restore objects in the dependency graph. +11771,initialize_or_restore,tensorflow/tensorflow/python/training/tracking/util.py,831,method,"Run operations to initialize or restore objects in the dependency graph. + +Any objects in the dependency graph which have initializers but are not in +the checkpoint will have those initializers run, unless those variables are +being restored by a later call to `tf.train.Checkpoint.restore()`. + +This method has a sibling in `InitializationOnlyStatus` which instead +initializes variables. That type is returned if no checkpoint is specified +in `Saver.restore`. + +Args: + session: The session to run init/restore ops in. If `None`, uses the + default session." +11772,expect_partial,tensorflow/tensorflow/python/training/tracking/util.py,862,method,Silence warnings about incomplete checkpoint restores. +11773,InitializationOnlyStatus,tensorflow/tensorflow/python/training/tracking/util.py,868,class,"Returned from `Saver.restore` when no checkpoint has been specified. Objects of this type have the same `assert_consumed` method as `CheckpointLoadStatus`, but it always fails. However, `initialize_or_restore` works on objects of both types, and will initialize variables in `InitializationOnlyStatus` objects or restore them otherwise." -12515,NameBasedSaverStatus,tensorflow/tensorflow/python/training/tracking/util.py,948,class,Status for loading a name-based training checkpoint. -12516,_SessionWithFeedDictAdditions,tensorflow/tensorflow/python/training/tracking/util.py,1047,class,"Pretends to be a session, inserts extra feeds on run()." -12517,TrackableSaver,tensorflow/tensorflow/python/training/tracking/util.py,1064,class,"Saves and restores a `Trackable` object and its dependencies. +11774,assert_consumed,tensorflow/tensorflow/python/training/tracking/util.py,884,method,Assertion for consistency with `CheckpointLoadStatus`. Always fails. +11775,assert_existing_objects_matched,tensorflow/tensorflow/python/training/tracking/util.py,889,method,Assertion for consistency with `CheckpointLoadStatus`. Always fails. +11776,assert_nontrivial_match,tensorflow/tensorflow/python/training/tracking/util.py,894,method,Assertion for consistency with `CheckpointLoadStatus`. Always fails. +11777,run_restore_ops,tensorflow/tensorflow/python/training/tracking/util.py,899,method,"For consistency with `CheckpointLoadStatus`. + +Use `initialize_or_restore` for initializing if no checkpoint was passed +to `Saver.restore` and restoring otherwise. + +Args: + session: Not used." +11778,initialize_or_restore,tensorflow/tensorflow/python/training/tracking/util.py,912,method,"Runs initialization ops for variables. + +Objects which would be saved by `Saver.save` will be initialized, unless +those variables are being restored by a later call to +`tf.train.Checkpoint.restore()`. + +This method does nothing when executing eagerly (initializers get run +eagerly). + +Args: + session: The session to run initialization ops in. If `None`, uses the + default session." +11779,NameBasedSaverStatus,tensorflow/tensorflow/python/training/tracking/util.py,948,class,Status for loading a name-based training checkpoint. +11780,add_to_optionally_restored,tensorflow/tensorflow/python/training/tracking/util.py,962,method,"Add a variable to the list of optionally restored variables. + +There are situations where certain variables should be ignored in assertions +such as assert_existing_objects_matched(). One example is that of a +checkpoint saved with train.Saver(), and restored with train.Checkpoint(): +it is possible for the train.Saver() checkpoint to be missing the internal +`save_counter` variable, which we want to ignore on restore. + +Args: + var: The variable to treat as optionally restored." +11781,assert_consumed,tensorflow/tensorflow/python/training/tracking/util.py,976,method,Raises an exception if any variables are unmatched. +11782,assert_existing_objects_matched,tensorflow/tensorflow/python/training/tracking/util.py,999,method,Raises an exception if currently created objects are unmatched. +11783,assert_nontrivial_match,tensorflow/tensorflow/python/training/tracking/util.py,1007,method,Raises an exception if currently created objects are unmatched. +11784,run_restore_ops,tensorflow/tensorflow/python/training/tracking/util.py,1031,method,Load the name-based checkpoint using a new `tf.compat.v1.train.Saver`. +11785,initialize_or_restore,tensorflow/tensorflow/python/training/tracking/util.py,1042,method,Alias for `run_restore_ops`. +11786,TrackableSaver,tensorflow/tensorflow/python/training/tracking/util.py,1064,class,"Saves and restores a `Trackable` object and its dependencies. See `Trackable` for details of dependency management. `Saver` wraps `tf.compat.v1.train.Saver` for saving, including extra information about the @@ -112475,7 +121983,85 @@ objects are assigned) may not change. These names are local to objects, in contrast to the `Variable.name`-based save/restore from `tf.compat.v1.train.Saver`, and so allow additional program transformations." -12518,frozen_saver,tensorflow/tensorflow/python/training/tracking/util.py,1335,function,"Creates a static `tf.compat.v1.train.Saver` from a trackable object. +11787,save,tensorflow/tensorflow/python/training/tracking/util.py,1159,method,"Save a training checkpoint. + +The saved checkpoint includes variables created by this object and any +Trackable objects it depends on at the time `Saver.save()` is called. + +Args: + file_prefix: A prefix to use for the checkpoint filenames + (/path/to/directory/and_a_prefix). Names are generated based on this + prefix and `checkpoint_number`, if provided. + checkpoint_number: An integer variable or Tensor, used to number + checkpoints. Typically this value is saved along with other variables in + training checkpoints, which will happen automatically if it was created + by `root_trackable` or one of its dependencies (via + `Trackable._add_variable`). + session: The session to evaluate variables in. Ignored when executing + eagerly. If not provided when graph building, the default session is + used. + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + The full path to the checkpoint." +11788,restore,tensorflow/tensorflow/python/training/tracking/util.py,1220,method,"Restore a training checkpoint. + +Restores `root_trackable` and any objects that it tracks +(transitive). Either assigns values immediately if variables to restore have +been created already, or defers restoration until the variables are +created. Dependencies added to the `root_trackable` passed to the +constructor after this call will be matched if they have a corresponding +object in the checkpoint. + +When building a graph, restorations are added to the graph but not run. + +To disallow deferred loading, assert immediately that all checkpointed +variables have been matched to variable objects: + +```python +saver = Saver(root) +saver.restore(path).assert_consumed() +``` + +An exception will be raised unless every object was matched and its +variables already exist. + +When graph building, `assert_consumed()` indicates that all of the restore +ops which will be created for this checkpoint have been created. They can be +run via the `run_restore_ops()` function of the status object: + +```python +saver.restore(path).assert_consumed().run_restore_ops() +``` + +If the checkpoint has not been consumed completely, then the list of restore +ops will grow as more objects are added to the dependency graph. + +Name-based `tf.compat.v1.train.Saver` checkpoints can be loaded using this +method. There is no deferred loading, and names are used to match +variables. No restore ops are created/run until `run_restore_ops()` or +`initialize_or_restore()` are called on the returned status object, even +when executing eagerly. Re-encode name-based checkpoints using this +object-based `Saver.save` as soon as possible. + +Args: + save_path: The path to the checkpoint, as returned by `save` or + `tf.train.latest_checkpoint`. If None (as when there is no latest + checkpoint for `tf.train.latest_checkpoint` to return), returns an + object which may run initializers for objects in the dependency graph. + If the checkpoint was written by the name-based + `tf.compat.v1.train.Saver`, names are used to match variables. + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + A load status object, which can be used to make assertions about the + status of checkpoint restoration and run initialization/restore ops + (of type `CheckpointLoadStatus`, or `InitializationOnlyStatus` if + `save_path` is `None`). + + If `save_path` points to a name-based checkpoint, a `NameBasedSaverStatus` + object is returned which runs restore ops from a name-based saver." +11789,frozen_saver,tensorflow/tensorflow/python/training/tracking/util.py,1335,function,"Creates a static `tf.compat.v1.train.Saver` from a trackable object. The returned `Saver` saves object-based checkpoints, but these checkpoints will no longer reflect structural changes to the object graph, only changes to @@ -112494,8 +122080,8 @@ Args: Returns: A saver which saves object-based checkpoints for the object graph frozen at the time `frozen_saver` was called." -12519,saver_with_op_caching,tensorflow/tensorflow/python/training/tracking/util.py,1361,function,A TrackableSaver with a SaveableObject cache when graph building. -12520,CheckpointV1,tensorflow/tensorflow/python/training/tracking/util.py,1374,class,"Groups trackable objects, saving and restoring them. +11790,saver_with_op_caching,tensorflow/tensorflow/python/training/tracking/util.py,1361,function,A TrackableSaver with a SaveableObject cache when graph building. +11791,CheckpointV1,tensorflow/tensorflow/python/training/tracking/util.py,1374,class,"Groups trackable objects, saving and restoring them. `Checkpoint`'s constructor accepts keyword arguments whose values are types that contain trackable state, such as `tf.compat.v1.train.Optimizer` @@ -112599,7 +122185,156 @@ training checkpoints. Attributes: save_counter: Incremented when `save()` is called. Used to number checkpoints." -12521,Checkpoint,tensorflow/tensorflow/python/training/tracking/util.py,1739,class,"Groups trackable objects, saving and restoring them. +11792,write,tensorflow/tensorflow/python/training/tracking/util.py,1521,method,"Writes a training checkpoint. + +The checkpoint includes variables created by this object and any +trackable objects it depends on at the time `Checkpoint.write()` is +called. + +`write` does not number checkpoints, increment `save_counter`, or update the +metadata used by `tf.train.latest_checkpoint`. It is primarily intended for +use by higher level checkpoint management utilities. `save` provides a very +basic implementation of these features. + +Args: + file_prefix: A prefix to use for the checkpoint filenames + (/path/to/directory/and_a_prefix). + session: The session to evaluate variables in. Ignored when executing + eagerly. If not provided when graph building, the default session is + used. + +Returns: + The full path to the checkpoint (i.e. `file_prefix`)." +11793,save_counter,tensorflow/tensorflow/python/training/tracking/util.py,1555,method,"An integer variable which starts at zero and is incremented on save. + +Used to number checkpoints. + +Returns: + The save counter variable." +11794,save,tensorflow/tensorflow/python/training/tracking/util.py,1566,method,"Saves a training checkpoint and provides basic checkpoint management. + +The saved checkpoint includes variables created by this object and any +trackable objects it depends on at the time `Checkpoint.save()` is +called. + +`save` is a basic convenience wrapper around the `write` method, +sequentially numbering checkpoints using `save_counter` and updating the +metadata used by `tf.train.latest_checkpoint`. More advanced checkpoint +management, for example garbage collection and custom numbering, may be +provided by other utilities which also wrap `write` +(`tf.train.CheckpointManager` for example). + +Args: + file_prefix: A prefix to use for the checkpoint filenames + (/path/to/directory/and_a_prefix). Names are generated based on this + prefix and `Checkpoint.save_counter`. + session: The session to evaluate variables in. Ignored when executing + eagerly. If not provided when graph building, the default session is + used. + +Returns: + The full path to the checkpoint." +11795,restore,tensorflow/tensorflow/python/training/tracking/util.py,1626,method,"Restore a training checkpoint. + +Restores this `Checkpoint` and any objects it depends on. + +When executing eagerly, either assigns values immediately if variables to +restore have been created already, or defers restoration until the variables +are created. Dependencies added after this call will be matched if they have +a corresponding object in the checkpoint (the restore request will queue in +any trackable object waiting for the expected dependency to be added). + +When graph building, restoration ops are added to the graph but not run +immediately. + +To ensure that loading is complete and no more assignments will take place, +use the `assert_consumed()` method of the status object returned by +`restore`: + +```python +checkpoint = tf.train.Checkpoint( ... ) +checkpoint.restore(path).assert_consumed() +``` + +An exception will be raised if any Python objects in the dependency graph +were not found in the checkpoint, or if any checkpointed values do not have +a matching Python object. + +When graph building, `assert_consumed()` indicates that all of the restore +ops that will be created for this checkpoint have been created. They can be +run via the `run_restore_ops()` method of the status object: + +```python +checkpoint.restore(path).assert_consumed().run_restore_ops() +``` + +If the checkpoint has not been consumed completely, then the list of restore +ops will grow as more objects are added to the dependency graph. + +Name-based `tf.compat.v1.train.Saver` checkpoints can be loaded using this +method. Names are used to match variables. No restore ops are created/run +until `run_restore_ops()` or `initialize_or_restore()` are called on the +returned status object when graph building, but there is restore-on-creation +when executing eagerly. Re-encode name-based checkpoints using +`tf.train.Checkpoint.save` as soon as possible. + +Args: + save_path: The path to the checkpoint, as returned by `save` or + `tf.train.latest_checkpoint`. If None (as when there is no latest + checkpoint for `tf.train.latest_checkpoint` to return), returns an + object which may run initializers for objects in the dependency graph. + If the checkpoint was written by the name-based + `tf.compat.v1.train.Saver`, names are used to match variables. + +Returns: + A load status object, which can be used to make assertions about the + status of a checkpoint restoration and run initialization/restore ops. + + The returned status object has the following methods: + + * `assert_consumed()`: + Raises an exception if any variables are unmatched: either + checkpointed values which don't have a matching Python object or + Python objects in the dependency graph with no values in the + checkpoint. This method returns the status object, and so may be + chained with `initialize_or_restore` or `run_restore_ops`. + + * `assert_existing_objects_matched()`: + Raises an exception if any existing Python objects in the dependency + graph are unmatched. Unlike `assert_consumed`, this assertion will + pass if values in the checkpoint have no corresponding Python + objects. For example a `tf.keras.Layer` object which has not yet been + built, and so has not created any variables, will pass this assertion + but fail `assert_consumed`. Useful when loading part of a larger + checkpoint into a new Python program, e.g. a training checkpoint with + a `tf.compat.v1.train.Optimizer` was saved but only the state required + for + inference is being loaded. This method returns the status object, and + so may be chained with `initialize_or_restore` or `run_restore_ops`. + + * `assert_nontrivial_match()`: Asserts that something aside from the root + object was matched. This is a very weak assertion, but is useful for + sanity checking in library code where objects may exist in the + checkpoint which haven't been created in Python and some Python + objects may not have a checkpointed value. + + * `expect_partial()`: Silence warnings about incomplete checkpoint + restores. Warnings are otherwise printed for unused parts of the + checkpoint file or object when the `Checkpoint` object is deleted + (often at program shutdown). + + * `initialize_or_restore(session=None)`: + When graph building, runs variable initializers if `save_path` is + `None`, but otherwise runs restore operations. If no `session` is + explicitly specified, the default session is used. No effect when + executing eagerly (variables are initialized or restored eagerly). + + * `run_restore_ops(session=None)`: + When graph building, runs restore operations. If no `session` is + explicitly specified, the default session is used. No effect when + executing eagerly (restore operations are run eagerly). May only be + called when `save_path` is not `None`." +11796,Checkpoint,tensorflow/tensorflow/python/training/tracking/util.py,1739,class,"Groups trackable objects, saving and restoring them. `Checkpoint`'s constructor accepts keyword arguments whose values are types that contain trackable state, such as `tf.keras.optimizers.Optimizer` @@ -112680,31 +122415,240 @@ training checkpoints. Attributes: save_counter: Incremented when `save()` is called. Used to number checkpoints." -12522,NonLayerTrackable,tensorflow/tensorflow/python/training/tracking/util_test.py,49,class, -12523,InterfaceTests,tensorflow/tensorflow/python/training/tracking/util_test.py,57,class, -12524,_MirroringSaveable,tensorflow/tensorflow/python/training/tracking/util_test.py,165,class, -12525,_OwnsMirroredVariables,tensorflow/tensorflow/python/training/tracking/util_test.py,186,class,A Trackable object which returns a more complex SaveableObject. -12526,CheckpointingTests,tensorflow/tensorflow/python/training/tracking/util_test.py,209,class, -12527,TemplateTests,tensorflow/tensorflow/python/training/tracking/util_test.py,798,class, -12528,CheckpointingTests,tensorflow/tensorflow/python/training/tracking/util_with_v1_optimizers_test.py,39,class, -12529,_ManualScope,tensorflow/tensorflow/python/training/tracking/util_with_v1_optimizers_test.py,197,class, -12530,TemplateTests,tensorflow/tensorflow/python/training/tracking/util_with_v1_optimizers_test.py,209,class, -12531,Tensor,tensorflow/tensorflow/python/types/core.py,33,class,"The base class of all dense Tensor objects. +11797,write,tensorflow/tensorflow/python/training/tracking/util.py,1863,method,"Writes a training checkpoint. + +The checkpoint includes variables created by this object and any +trackable objects it depends on at the time `Checkpoint.write()` is +called. + +`write` does not number checkpoints, increment `save_counter`, or update the +metadata used by `tf.train.latest_checkpoint`. It is primarily intended for +use by higher level checkpoint management utilities. `save` provides a very +basic implementation of these features. + +Checkpoints written with `write` must be read with `read`. + +Example usage: + +``` +step = tf.Variable(0, name=""step"") +checkpoint = tf.Checkpoint(step=step) +checkpoint.write(""/tmp/ckpt"") + +# Later, read the checkpoint with read() +checkpoint.read(""/tmp/ckpt"").assert_consumed() + +# You can also pass options to write() and read(). For example this +# runs the IO ops on the localhost: +options = tf.CheckpointOptions(experimental_io_device=""/job:localhost"") +checkpoint.write(""/tmp/ckpt"", options=options) + +# Later, read the checkpoint with read() +checkpoint.read(""/tmp/ckpt"", options=options).assert_consumed() +``` + +Args: + file_prefix: A prefix to use for the checkpoint filenames + (/path/to/directory/and_a_prefix). + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + The full path to the checkpoint (i.e. `file_prefix`)." +11798,save_counter,tensorflow/tensorflow/python/training/tracking/util.py,1917,method,"An integer variable which starts at zero and is incremented on save. + +Used to number checkpoints. + +Returns: + The save counter variable." +11799,save,tensorflow/tensorflow/python/training/tracking/util.py,1928,method,"Saves a training checkpoint and provides basic checkpoint management. + +The saved checkpoint includes variables created by this object and any +trackable objects it depends on at the time `Checkpoint.save()` is +called. + +`save` is a basic convenience wrapper around the `write` method, +sequentially numbering checkpoints using `save_counter` and updating the +metadata used by `tf.train.latest_checkpoint`. More advanced checkpoint +management, for example garbage collection and custom numbering, may be +provided by other utilities which also wrap `write` and `read`. +(`tf.train.CheckpointManager` for example). + +``` +step = tf.Variable(0, name=""step"") +checkpoint = tf.Checkpoint(step=step) +checkpoint.save(""/tmp/ckpt"") + +# Later, read the checkpoint with restore() +checkpoint.restore(""/tmp/ckpt"").assert_consumed() + +# You can also pass options to save() and restore(). For example this +# runs the IO ops on the localhost: +options = tf.CheckpointOptions(experimental_io_device=""/job:localhost"") +checkpoint.save(""/tmp/ckpt"", options=options) + +# Later, read the checkpoint with restore() +checkpoint.restore(""/tmp/ckpt"", options=options).assert_consumed() +``` + +Args: + file_prefix: A prefix to use for the checkpoint filenames + (/path/to/directory/and_a_prefix). Names are generated based on this + prefix and `Checkpoint.save_counter`. + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + The full path to the checkpoint." +11800,read,tensorflow/tensorflow/python/training/tracking/util.py,2003,method,"Reads a training checkpoint written with `write`. + +Reads this `Checkpoint` and any objects it depends on. + +This method is just like `restore()` but does not expect the `save_counter` +variable in the checkpoint. It only restores the objects that the checkpoint +already depends on. + +The method is primarily intended for use by higher level checkpoint +management utilities that use `write()` instead of `save()` and have their +own mechanisms to number and track checkpoints. + +Example usage: + +```python +# Create a checkpoint with write() +ckpt = tf.train.Checkpoint(v=tf.Variable(1.)) +path = ckpt.write('/tmp/my_checkpoint') + +# Later, load the checkpoint with read() +# With restore() assert_consumed() would have failed. +checkpoint.read(path).assert_consumed() + +# You can also pass options to read(). For example this +# runs the IO ops on the localhost: +options = tf.CheckpointOptions(experimental_io_device=""/job:localhost"") +checkpoint.read(path, options=options) +``` + +Args: + save_path: The path to the checkpoint as returned by `write`. + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + A load status object, which can be used to make assertions about the + status of a checkpoint restoration. See `restore` for details." +11801,restore,tensorflow/tensorflow/python/training/tracking/util.py,2044,method,"Restores a training checkpoint. + +Restores this `Checkpoint` and any objects it depends on. + +This method is intended to be used to load checkpoints created by `save()`. +For checkpoints created by `write()` use the `read()` method which does not +expect the `save_counter` variable added by `save()`. + +`restore()` either assigns values immediately if variables to restore have +been created already, or defers restoration until the variables are +created. Dependencies added after this call will be matched if they have a +corresponding object in the checkpoint (the restore request will queue in +any trackable object waiting for the expected dependency to be added). + +To ensure that loading is complete and no more assignments will take place, +use the `assert_consumed()` method of the status object returned by +`restore()`: + +```python +checkpoint = tf.train.Checkpoint( ... ) +checkpoint.restore(path).assert_consumed() + +# You can additionally pass options to restore(): +options = tf.CheckpointOptions(experimental_io_device=""/job:localhost"") +checkpoint.restore(path, options=options).assert_consumed() +``` + +An exception will be raised if any Python objects in the dependency graph +were not found in the checkpoint, or if any checkpointed values do not have +a matching Python object. + +Name-based `tf.compat.v1.train.Saver` checkpoints from TensorFlow 1.x can be +loaded +using this method. Names are used to match variables. Re-encode name-based +checkpoints using `tf.train.Checkpoint.save` as soon as possible. + +Args: + save_path: The path to the checkpoint, as returned by `save` or + `tf.train.latest_checkpoint`. If the checkpoint was written by the + name-based `tf.compat.v1.train.Saver`, names are used to match + variables. + options: Optional `tf.train.CheckpointOptions` object. + +Returns: + A load status object, which can be used to make assertions about the + status of a checkpoint restoration. + + The returned status object has the following methods: + + * `assert_consumed()`: + Raises an exception if any variables are unmatched: either + checkpointed values which don't have a matching Python object or + Python objects in the dependency graph with no values in the + checkpoint. This method returns the status object, and so may be + chained with other assertions. + + * `assert_existing_objects_matched()`: + Raises an exception if any existing Python objects in the dependency + graph are unmatched. Unlike `assert_consumed`, this assertion will + pass if values in the checkpoint have no corresponding Python + objects. For example a `tf.keras.Layer` object which has not yet been + built, and so has not created any variables, will pass this assertion + but fail `assert_consumed`. Useful when loading part of a larger + checkpoint into a new Python program, e.g. a training checkpoint with + a `tf.compat.v1.train.Optimizer` was saved but only the state required + for + inference is being loaded. This method returns the status object, and + so may be chained with other assertions. + + * `assert_nontrivial_match()`: Asserts that something aside from the root + object was matched. This is a very weak assertion, but is useful for + sanity checking in library code where objects may exist in the + checkpoint which haven't been created in Python and some Python + objects may not have a checkpointed value. + + * `expect_partial()`: Silence warnings about incomplete checkpoint + restores. Warnings are otherwise printed for unused parts of the + checkpoint file or object when the `Checkpoint` object is deleted + (often at program shutdown)." +11802,NonLayerTrackable,tensorflow/tensorflow/python/training/tracking/util_test.py,49,class, +11803,Tensor,tensorflow/tensorflow/python/types/core.py,33,class,"The base class of all dense Tensor objects. A dense tensor has a static data type (dtype), and may have a static rank and shape. Tensor objects are immutable. Mutable objects may be backed by a Tensor which holds the unique handle that identifies the mutable object." -12532,Symbol,tensorflow/tensorflow/python/types/core.py,50,class,"Symbolic ""graph"" Tensor. +11804,dtype,tensorflow/tensorflow/python/types/core.py,42,method, +11805,shape,tensorflow/tensorflow/python/types/core.py,46,method, +11806,Symbol,tensorflow/tensorflow/python/types/core.py,50,class,"Symbolic ""graph"" Tensor. These objects represent the output of an op definition and do not carry a value." -12533,Value,tensorflow/tensorflow/python/types/core.py,59,class,"Tensor that can be associated with a value (aka ""eager tensor""). +11807,Value,tensorflow/tensorflow/python/types/core.py,59,class,"Tensor that can be associated with a value (aka ""eager tensor""). These objects represent the (usually future) output of executing an op immediately." -12534,Iterable,tensorflow/tensorflow/python/types/distribute.py,25,class,Interface for distributed objects that admit iteration/reduction. -12535,Iterator,tensorflow/tensorflow/python/types/distribute.py,51,class,Interface for distributed iterators. -12536,document,tensorflow/tensorflow/python/types/doc_typealias.py,24,function,"Adds a docstring to typealias by overriding the `__doc__` attribute. +11808,numpy,tensorflow/tensorflow/python/types/core.py,66,method, +11809,Iterable,tensorflow/tensorflow/python/types/distribute.py,25,class,Interface for distributed objects that admit iteration/reduction. +11810,reduce,tensorflow/tensorflow/python/types/distribute.py,32,method,"Reduces this iterable object to a single element. + +The transformation calls `reduce_func` successively on each element. +The `initial_state` argument is used for the initial state and the final +state is returned as the result. + +Args: + initial_state: An element representing the initial state of the + reduction. + reduce_func: A function that maps `(old_state, input_element)` to + `new_state`. The structure of `new_state` must match the structure of + `old_state`. For the first element, `old_state` is `initial_state`. + +Returns: + The final state of the transformation." +11811,Iterator,tensorflow/tensorflow/python/types/distribute.py,51,class,Interface for distributed iterators. +11812,get_next,tensorflow/tensorflow/python/types/distribute.py,54,method,"Unlike __next__, this may use a non-raising mechanism." +11813,document,tensorflow/tensorflow/python/types/doc_typealias.py,24,function,"Adds a docstring to typealias by overriding the `__doc__` attribute. Note: Overriding `__doc__` is only possible after python 3.7. @@ -112712,11 +122656,11 @@ Args: obj: Typealias object that needs to be documented. doc: Docstring of the typealias. It should follow the standard pystyle docstring rules." -12537,NativeObject,tensorflow/tensorflow/python/types/internal.py,26,class,"Types natively supported by various TF operations. +11814,NativeObject,tensorflow/tensorflow/python/types/internal.py,26,class,"Types natively supported by various TF operations. The most notable example of NativeObject is Tensor." -12538,my_fact,tensorflow/tensorflow/python/user_ops/user_ops.py,30,function,Example of overriding the generated code for an Op. -12539,make_all,tensorflow/tensorflow/python/util/all_util.py,30,function,"Generates `__all__` from the docstring of one or more modules. +11815,my_fact,tensorflow/tensorflow/python/user_ops/user_ops.py,30,function,Example of overriding the generated code for an Op. +11816,make_all,tensorflow/tensorflow/python/util/all_util.py,30,function,"Generates `__all__` from the docstring of one or more modules. Usage: `make_all(__name__)` or `make_all(__name__, [sys.modules(__name__), other_module])`. The doc string @@ -112731,7 +122675,7 @@ Args: Returns: A list suitable for use as `__all__`." -12540,reveal_undocumented,tensorflow/tensorflow/python/util/all_util.py,66,function,"Reveals a symbol that was previously removed by `remove_undocumented`. +11817,reveal_undocumented,tensorflow/tensorflow/python/util/all_util.py,66,function,"Reveals a symbol that was previously removed by `remove_undocumented`. This should be used by tensorflow internal tests only. It explicitly defeats the encapsulation afforded by `remove_undocumented`. @@ -112741,7 +122685,7 @@ It throws an exception when the symbol was not hidden in the first place. Args: symbol_name: a string representing the full absolute path of the symbol. target_module: if specified, the module in which to restore the symbol." -12541,remove_undocumented,tensorflow/tensorflow/python/util/all_util.py,86,function,"Removes symbols in a module that are not referenced by a docstring. +11818,remove_undocumented,tensorflow/tensorflow/python/util/all_util.py,86,function,"Removes symbols in a module that are not referenced by a docstring. Args: module_name: the name of the module (usually `__name__`). @@ -112754,7 +122698,7 @@ Args: Returns: None" -12542,as_bytes,tensorflow/tensorflow/python/util/compat.py,64,function,"Converts `bytearray`, `bytes`, or unicode python input types to `bytes`. +11819,as_bytes,tensorflow/tensorflow/python/util/compat.py,64,function,"Converts `bytearray`, `bytes`, or unicode python input types to `bytes`. Uses utf-8 encoding for text by default. @@ -112767,7 +122711,7 @@ Returns: Raises: TypeError: If `bytes_or_text` is not a binary or unicode string." -12543,as_text,tensorflow/tensorflow/python/util/compat.py,90,function,"Converts any string-like python input types to unicode. +11820,as_text,tensorflow/tensorflow/python/util/compat.py,90,function,"Converts any string-like python input types to unicode. Returns the input as a unicode string. Uses utf-8 encoding for text by default. @@ -112781,8 +122725,8 @@ Returns: Raises: TypeError: If `bytes_or_text` is not a binary or unicode string." -12544,as_str,tensorflow/tensorflow/python/util/compat.py,114,function, -12545,as_str_any,tensorflow/tensorflow/python/util/compat.py,126,function,"Converts input to `str` type. +11821,as_str,tensorflow/tensorflow/python/util/compat.py,114,function, +11822,as_str_any,tensorflow/tensorflow/python/util/compat.py,126,function,"Converts input to `str` type. Uses `str(value)`, except for `bytes` typed inputs, which are converted using `as_str`. @@ -112792,7 +122736,7 @@ Args: Returns: A `str` object." -12546,path_to_str,tensorflow/tensorflow/python/util/compat.py,145,function,"Converts input which is a `PathLike` object to `str` type. +11823,path_to_str,tensorflow/tensorflow/python/util/compat.py,145,function,"Converts input which is a `PathLike` object to `str` type. Converts from any python constant representation of a `PathLike` object to a string. If the input is not a `PathLike` object, simply returns the input. @@ -112823,7 +122767,7 @@ $ tf.compat.path_to_str(Path('./..////../')) '../..' # Linux OS ```" -12547,path_to_bytes,tensorflow/tensorflow/python/util/compat.py,183,function,"Converts input which is a `PathLike` object to `bytes`. +11824,path_to_bytes,tensorflow/tensorflow/python/util/compat.py,183,function,"Converts input which is a `PathLike` object to `bytes`. Converts from any python constant representation of a `PathLike` object or `str` to bytes. @@ -112837,7 +122781,7 @@ Returns: Usage: In case a simplified `bytes` version of the path is needed from an `os.PathLike` object" -12548,path_to_str,tensorflow/tensorflow/python/util/compat_internal.py,24,function,"Returns the file system path representation of a `PathLike` object, +11825,path_to_str,tensorflow/tensorflow/python/util/compat_internal.py,24,function,"Returns the file system path representation of a `PathLike` object, else as it is. Args: @@ -112845,21 +122789,8 @@ Args: Returns: A `str` object." -12549,get_qualified_name,tensorflow/tensorflow/python/util/decorator_utils.py,24,function, -12550,_normalize_docstring,tensorflow/tensorflow/python/util/decorator_utils.py,35,function,"Normalizes the docstring. - -Replaces tabs with spaces, removes leading and trailing blanks lines, and -removes any indentation. - -Copied from PEP-257: -https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation - -Args: - docstring: the docstring to normalize - -Returns: - The normalized docstring" -12551,add_notice_to_docstring,tensorflow/tensorflow/python/util/decorator_utils.py,76,function,"Adds a deprecation notice to a docstring. +11826,get_qualified_name,tensorflow/tensorflow/python/util/decorator_utils.py,24,function, +11827,add_notice_to_docstring,tensorflow/tensorflow/python/util/decorator_utils.py,76,function,"Adds a deprecation notice to a docstring. Args: doc: The original docstring. @@ -112873,8 +122804,8 @@ Returns: Raises: ValueError: If `notice` is empty." -12552,validate_callable,tensorflow/tensorflow/python/util/decorator_utils.py,117,function, -12553,classproperty,tensorflow/tensorflow/python/util/decorator_utils.py,126,class,"Class property decorator. +11828,validate_callable,tensorflow/tensorflow/python/util/decorator_utils.py,117,function, +11829,classproperty,tensorflow/tensorflow/python/util/decorator_utils.py,126,class,"Class property decorator. Example usage: @@ -112886,31 +122817,8 @@ class MyClass(object): > print MyClass.value 123" -12554,_test_function,tensorflow/tensorflow/python/util/decorator_utils_test.py,29,function, -12555,GetQualifiedNameTest,tensorflow/tensorflow/python/util/decorator_utils_test.py,33,class, -12556,AddNoticeToDocstringTest,tensorflow/tensorflow/python/util/decorator_utils_test.py,45,class, -12557,ValidateCallableTest,tensorflow/tensorflow/python/util/decorator_utils_test.py,99,class, -12558,DeprecatedNamesAlreadySet,tensorflow/tensorflow/python/util/deprecation.py,41,class,Raised when setting deprecated names multiple times for the same symbol. -12559,_add_deprecated_function_notice_to_docstring,tensorflow/tensorflow/python/util/deprecation.py,46,function,Adds a deprecation notice to a docstring for deprecated functions. -12560,_add_deprecated_arg_notice_to_docstring,tensorflow/tensorflow/python/util/deprecation.py,58,function,Adds a deprecation notice to a docstring for deprecated arguments. -12561,_add_deprecated_arg_value_notice_to_docstring,tensorflow/tensorflow/python/util/deprecation.py,74,function,Adds a deprecation notice to a docstring for deprecated arguments. -12562,_validate_deprecation_args,tensorflow/tensorflow/python/util/deprecation.py,93,function, -12563,_call_location,tensorflow/tensorflow/python/util/deprecation.py,100,function,Returns call location given level up from current call. -12564,_wrap_decorator,tensorflow/tensorflow/python/util/deprecation.py,113,function,"Indicate that one function wraps another. - -This decorator wraps a function using `tf_decorator.make_decorator` -so that doc generation scripts can pick up original function -signature. -It would be better to use @functools.wrap decorator, but it would -not update function signature to match wrapped function in Python 2. - -Args: - wrapped_function: The function that decorated function wraps. - -Returns: - Function that accepts wrapper function as an argument and returns - `TFDecorator` instance." -12565,deprecated_alias,tensorflow/tensorflow/python/util/deprecation.py,134,function,"Deprecate a symbol in favor of a new name with identical semantics. +11830,DeprecatedNamesAlreadySet,tensorflow/tensorflow/python/util/deprecation.py,41,class,Raised when setting deprecated names multiple times for the same symbol. +11831,deprecated_alias,tensorflow/tensorflow/python/util/deprecation.py,134,function,"Deprecate a symbol in favor of a new name with identical semantics. This function is meant to be used when defining a backwards-compatibility alias for a symbol which has been moved. For example: @@ -112962,7 +122870,7 @@ Args: Returns: A wrapped version of `func_or_class` which prints a deprecation warning on use and has a modified docstring." -12566,deprecated_endpoints,tensorflow/tensorflow/python/util/deprecation.py,245,function,"Decorator for marking endpoints deprecated. +11832,deprecated_endpoints,tensorflow/tensorflow/python/util/deprecation.py,245,function,"Decorator for marking endpoints deprecated. This decorator does not print deprecation messages. TODO(annarev): eventually start printing deprecation warnings when @@ -112976,7 +122884,7 @@ Returns: _tf_deprecated_api_names to that symbol. _tf_deprecated_api_names would be set to a list of deprecated endpoint names for the symbol." -12567,deprecated,tensorflow/tensorflow/python/util/deprecation.py,274,function,"Decorator for marking functions or methods deprecated. +11833,deprecated,tensorflow/tensorflow/python/util/deprecation.py,274,function,"Decorator for marking functions or methods deprecated. This decorator logs a deprecation warning whenever the decorated function is called. It has the following format: @@ -113006,7 +122914,7 @@ Returns: Raises: ValueError: If date is not None or in ISO 8601 format, or instructions are empty." -12568,deprecated_args,tensorflow/tensorflow/python/util/deprecation.py,336,function,"Decorator for marking specific function arguments as deprecated. +11834,deprecated_args,tensorflow/tensorflow/python/util/deprecation.py,336,function,"Decorator for marking specific function arguments as deprecated. This decorator logs a deprecation warning whenever the decorated function is called with the deprecated argument. It has the following format: @@ -113044,7 +122952,7 @@ Raises: empty, the deprecated arguments are not present in the function signature, the second element of a deprecated_tuple is not a list, or if a kwarg other than `warn_once` is passed." -12569,deprecated_arg_values,tensorflow/tensorflow/python/util/deprecation.py,516,function,"Decorator for marking specific function argument values as deprecated. +11835,deprecated_arg_values,tensorflow/tensorflow/python/util/deprecation.py,516,function,"Decorator for marking specific function argument values as deprecated. This decorator logs a deprecation warning whenever the decorated function is called with the deprecated argument values. It has the following format: @@ -113076,7 +122984,7 @@ Returns: Raises: ValueError: If date is not None or in ISO 8601 format, or instructions are empty." -12570,deprecated_argument_lookup,tensorflow/tensorflow/python/util/deprecation.py,583,function,"Looks up deprecated argument name and ensures both are not used. +11836,deprecated_argument_lookup,tensorflow/tensorflow/python/util/deprecation.py,583,function,"Looks up deprecated argument name and ensures both are not used. Args: new_name: new name of argument @@ -113087,9 +122995,9 @@ Returns: The effective argument that should be used. Raises: ValueError: if new_value and old_value are both non-null" -12571,rewrite_argument_docstring,tensorflow/tensorflow/python/util/deprecation.py,604,function, -12572,silence,tensorflow/tensorflow/python/util/deprecation.py,610,function,Temporarily silence deprecation warnings. -12573,HiddenTfApiAttribute,tensorflow/tensorflow/python/util/deprecation.py,619,class,"Hides a class attribute from the public API. +11837,rewrite_argument_docstring,tensorflow/tensorflow/python/util/deprecation.py,604,function, +11838,silence,tensorflow/tensorflow/python/util/deprecation.py,610,function,Temporarily silence deprecation warnings. +11839,HiddenTfApiAttribute,tensorflow/tensorflow/python/util/deprecation.py,619,class,"Hides a class attribute from the public API. Attributes in public classes can be hidden from the API by having an '_' in front of the name (e.g. ClassName._variables). This doesn't work when @@ -113099,20 +123007,36 @@ For example, this is used in V2 Estimator to hide the deprecated export_savedmodel method: class EstimatorV2(Estimator): export_savedmodel = deprecation.hide_attribute_from_api('...')" -12574,DeprecatedAliasTest,tensorflow/tensorflow/python/util/deprecation_test.py,29,class, -12575,DeprecationTest,tensorflow/tensorflow/python/util/deprecation_test.py,82,class, -12576,DeprecatedArgsTest,tensorflow/tensorflow/python/util/deprecation_test.py,459,class, -12577,DeprecatedArgValuesTest,tensorflow/tensorflow/python/util/deprecation_test.py,742,class, -12578,DeprecationArgumentsTest,tensorflow/tensorflow/python/util/deprecation_test.py,926,class, -12579,DeprecatedEndpointsTest,tensorflow/tensorflow/python/util/deprecation_test.py,961,class, -12580,OpDispatcher,tensorflow/tensorflow/python/util/dispatch.py,46,class,"Abstract base class for TensorFlow operator dispatchers. +11840,raise_error,tensorflow/tensorflow/python/util/deprecation.py,634,method, +11841,OpDispatcher,tensorflow/tensorflow/python/util/dispatch.py,46,class,"Abstract base class for TensorFlow operator dispatchers. Each operation dispatcher acts as an override handler for a single TensorFlow operation, and its results are used when the handler indicates that it can handle the operation's arguments (by returning any value other than `OpDispatcher.NOT_SUPPORTED`)." -12581,GlobalOpDispatcher,tensorflow/tensorflow/python/util/dispatch.py,89,class,Abstract base class for TensorFlow global operator dispatchers. -12582,dispatch,tensorflow/tensorflow/python/util/dispatch.py,102,function,"Returns the result from the first successful dispatcher for a given op. +11842,handle,tensorflow/tensorflow/python/util/dispatch.py,59,method,"Handle this dispatcher's operation with the specified arguments. + +If this operation dispatcher can handle the given arguments, then +return an appropriate value (or raise an appropriate exception). + +Args: + args: The arguments to the operation. + kwargs: They keyword arguments to the operation. + +Returns: + The result of the operation, or `OpDispatcher.NOT_SUPPORTED` if this + dispatcher can not handle the given arguments." +11843,register,tensorflow/tensorflow/python/util/dispatch.py,75,method,"Register this dispatcher as a handler for `op`. + +Args: + op: Python function: the TensorFlow operation that should be handled. Must + have a dispatch list (which is added automatically for generated ops, + and can be added to Python ops using the `add_dispatch_support` + decorator)." +11844,GlobalOpDispatcher,tensorflow/tensorflow/python/util/dispatch.py,89,class,Abstract base class for TensorFlow global operator dispatchers. +11845,handle,tensorflow/tensorflow/python/util/dispatch.py,94,method,Handle the specified operation with the specified arguments. +11846,register,tensorflow/tensorflow/python/util/dispatch.py,97,method,Register this dispatcher as a handler for all ops. +11847,dispatch,tensorflow/tensorflow/python/util/dispatch.py,102,function,"Returns the result from the first successful dispatcher for a given op. Calls the `handle` method of each `OpDispatcher` that has been registered to handle `op`, and returns the value from the first successful handler. @@ -113125,12 +123049,7 @@ Args: Returns: The result of the operation, or `NOT_SUPPORTED` if no registered dispatcher can handle the given arguments." -12583,_TypeBasedDispatcher,tensorflow/tensorflow/python/util/dispatch.py,128,class,"Dispatcher that handles op if any arguments have a specified type. - -Checks the types of the arguments and keyword arguments (including elements -of lists or tuples), and if any argument values have the indicated type(s), -then delegates to an override function." -12584,dispatch_for_types,tensorflow/tensorflow/python/util/dispatch.py,156,function,"Decorator to declare that a Python function overrides an op for a type. +11848,dispatch_for_types,tensorflow/tensorflow/python/util/dispatch.py,156,function,"Decorator to declare that a Python function overrides an op for a type. The decorated function is used to override `op` if any of the arguments or keyword arguments (including elements of lists or tuples) have one of the @@ -113146,17 +123065,17 @@ def ragged_add(x, y, name=None): ... Args: op: Python function: the operation that should be overridden. *types: The argument types for which this function should be used." -12585,add_dispatch_list,tensorflow/tensorflow/python/util/dispatch.py,188,function,Decorator that adds a dispatch_list attribute to an op. -12586,add_dispatch_support,tensorflow/tensorflow/python/util/dispatch.py,196,function,Decorator that adds a dispatch handling wrapper to an op. -12587,CustomTensor,tensorflow/tensorflow/python/util/dispatch_test.py,37,class,"A fake composite tensor class, for testing type-based dispatching." -12588,test_op,tensorflow/tensorflow/python/util/dispatch_test.py,47,function,A fake op for testing dispatch of Python ops. -12589,TensorTracer,tensorflow/tensorflow/python/util/dispatch_test.py,52,class,"An object used to trace TensorFlow graphs. +11849,add_dispatch_list,tensorflow/tensorflow/python/util/dispatch.py,188,function,Decorator that adds a dispatch_list attribute to an op. +11850,add_dispatch_support,tensorflow/tensorflow/python/util/dispatch.py,196,function,Decorator that adds a dispatch handling wrapper to an op. +11851,CustomTensor,tensorflow/tensorflow/python/util/dispatch_test.py,37,class,"A fake composite tensor class, for testing type-based dispatching." +11852,TensorTracer,tensorflow/tensorflow/python/util/dispatch_test.py,52,class,"An object used to trace TensorFlow graphs. This is an example class that is used to test global op dispatchers. The global op dispatcher for TensorTracers is defined below." -12590,TensorTracerOpDispatcher,tensorflow/tensorflow/python/util/dispatch_test.py,93,class,Global op dispatcher for TensorTracer. -12591,DispatchTest,tensorflow/tensorflow/python/util/dispatch_test.py,120,class, -12592,extract_example_parser_configuration,tensorflow/tensorflow/python/util/example_parser_configuration.py,26,function,"Returns an ExampleParserConfig proto. +11853,TensorTracerOpDispatcher,tensorflow/tensorflow/python/util/dispatch_test.py,93,class,Global op dispatcher for TensorTracer. +11854,handle,tensorflow/tensorflow/python/util/dispatch_test.py,105,method, +11855,is_tensor_tracer_arg,tensorflow/tensorflow/python/util/dispatch_test.py,114,method, +11856,extract_example_parser_configuration,tensorflow/tensorflow/python/util/example_parser_configuration.py,26,function,"Returns an ExampleParserConfig proto. Args: parse_example_op: A ParseExample or ParseExampleV2 `Operation` @@ -113166,12 +123085,7 @@ Returns: Raises: ValueError: If attributes are inconsistent." -12593,_extract_from_parse_example,tensorflow/tensorflow/python/util/example_parser_configuration.py,46,function,Extract ExampleParserConfig from ParseExample op. -12594,_extract_from_parse_example_v2,tensorflow/tensorflow/python/util/example_parser_configuration.py,135,function,Extract ExampleParserConfig from ParseExampleV2 op. -12595,ExampleParserConfigurationTest,tensorflow/tensorflow/python/util/example_parser_configuration_test.py,73,class, -12596,_is_bound_method,tensorflow/tensorflow/python/util/function_utils.py,30,function, -12597,_is_callable_object,tensorflow/tensorflow/python/util/function_utils.py,35,function, -12598,fn_args,tensorflow/tensorflow/python/util/function_utils.py,39,function,"Get argument names for function-like object. +11857,fn_args,tensorflow/tensorflow/python/util/function_utils.py,39,function,"Get argument names for function-like object. Args: fn: Function, or function-like object (e.g., result of `functools.partial`). @@ -113181,7 +123095,7 @@ Returns: Raises: ValueError: if partial function has positionally bound arguments" -12599,has_kwargs,tensorflow/tensorflow/python/util/function_utils.py,66,function,"Returns whether the passed callable has **kwargs in its signature. +11858,has_kwargs,tensorflow/tensorflow/python/util/function_utils.py,66,function,"Returns whether the passed callable has **kwargs in its signature. Args: fn: Function, or function-like object (e.g., result of `functools.partial`). @@ -113191,16 +123105,12 @@ Returns: Raises: `TypeError`: If fn is not a Function, or function-like object." -12600,get_func_name,tensorflow/tensorflow/python/util/function_utils.py,89,function,Returns name of passed callable. -12601,get_func_code,tensorflow/tensorflow/python/util/function_utils.py,104,function,"Returns func_code of passed callable, or None if not available." -12602,get_disabled_rewriter_config,tensorflow/tensorflow/python/util/function_utils.py,125,function, -12603,silly_example_function,tensorflow/tensorflow/python/util/function_utils_test.py,27,function, -12604,SillyCallableClass,tensorflow/tensorflow/python/util/function_utils_test.py,31,class, -12605,FnArgsTest,tensorflow/tensorflow/python/util/function_utils_test.py,37,class, -12606,HasKwargsTest,tensorflow/tensorflow/python/util/function_utils_test.py,147,class, -12607,GetFuncNameTest,tensorflow/tensorflow/python/util/function_utils_test.py,242,class, -12608,GetFuncCodeTest,tensorflow/tensorflow/python/util/function_utils_test.py,274,class, -12609,keyword_args_only,tensorflow/tensorflow/python/util/keyword_args.py,27,function,"Decorator for marking specific function accepting keyword args only. +11859,get_func_name,tensorflow/tensorflow/python/util/function_utils.py,89,function,Returns name of passed callable. +11860,get_func_code,tensorflow/tensorflow/python/util/function_utils.py,104,function,"Returns func_code of passed callable, or None if not available." +11861,get_disabled_rewriter_config,tensorflow/tensorflow/python/util/function_utils.py,125,function, +11862,silly_example_function,tensorflow/tensorflow/python/util/function_utils_test.py,27,function, +11863,SillyCallableClass,tensorflow/tensorflow/python/util/function_utils_test.py,31,class, +11864,keyword_args_only,tensorflow/tensorflow/python/util/keyword_args.py,27,function,"Decorator for marking specific function accepting keyword args only. This decorator raises a `ValueError` if the input `func` is called with any non-keyword args. This prevents the caller from providing the arguments in @@ -113214,12 +123124,11 @@ Returns: Raises: ValueError: If `func` is not callable." -12610,KeywordArgsTest,tensorflow/tensorflow/python/util/keyword_args_test.py,25,class, -12611,LazyLoader,tensorflow/tensorflow/python/util/lazy_loader.py,27,class,"Lazily import a module, mainly to avoid pulling in large dependencies. +11865,LazyLoader,tensorflow/tensorflow/python/util/lazy_loader.py,27,class,"Lazily import a module, mainly to avoid pulling in large dependencies. `contrib`, and `ffmpeg` are examples of modules that are large and not always needed, and this allows them to only be loaded when they are used." -12612,GroupLock,tensorflow/tensorflow/python/util/lock_util.py,24,class,"A lock to allow many members of a group to access a resource exclusively. +11866,GroupLock,tensorflow/tensorflow/python/util/lock_util.py,24,class,"A lock to allow many members of a group to access a resource exclusively. This lock provides a way to allow access to a resource by multiple threads belonging to a logical group at the same time, while restricting access to @@ -113246,8 +123155,16 @@ with lock.group(1): Using as a context manager with `.group(group_id)` is the easiest way. You can also use the `acquire` and `release` method directly." -12613,GroupLockTest,tensorflow/tensorflow/python/util/lock_util_test.py,30,class, -12614,dismantle_ordered_dict,tensorflow/tensorflow/python/util/memory.py,24,function,"Remove reference cycle in OrderedDict `ordered_dict`. +11867,group,tensorflow/tensorflow/python/util/lock_util.py,76,method,"Enter a context where the lock is with group `group_id`. + +Args: + group_id: The group for which to acquire and release the lock. + +Returns: + A context manager which will acquire the lock for `group_id`." +11868,acquire,tensorflow/tensorflow/python/util/lock_util.py,88,method,Acquire the group lock for a specific group `group_id`. +11869,release,tensorflow/tensorflow/python/util/lock_util.py,98,method,Release the group lock for a specific group `group_id`. +11870,dismantle_ordered_dict,tensorflow/tensorflow/python/util/memory.py,24,function,"Remove reference cycle in OrderedDict `ordered_dict`. Helpful for making sure the garbage collector doesn't need to run after using an OrderedDict. @@ -113255,10 +123172,9 @@ using an OrderedDict. Args: ordered_dict: A `OrderedDict` object to destroy. This object is unusable after this function runs." -12615,get_rename_v2,tensorflow/tensorflow/python/util/module_wrapper.py,34,function, -12616,_call_location,tensorflow/tensorflow/python/util/module_wrapper.py,40,function, -12617,contains_deprecation_decorator,tensorflow/tensorflow/python/util/module_wrapper.py,51,function, -12618,has_deprecation_decorator,tensorflow/tensorflow/python/util/module_wrapper.py,56,function,"Checks if given object has a deprecation decorator. +11871,get_rename_v2,tensorflow/tensorflow/python/util/module_wrapper.py,34,function, +11872,contains_deprecation_decorator,tensorflow/tensorflow/python/util/module_wrapper.py,51,function, +11873,has_deprecation_decorator,tensorflow/tensorflow/python/util/module_wrapper.py,56,function,"Checks if given object has a deprecation decorator. We check if deprecation decorator is in decorators as well as whether symbol is a class whose __init__ method has a deprecation @@ -113268,57 +123184,9 @@ Args: Returns: True if symbol has deprecation decorator." -12619,TFModuleWrapper,tensorflow/tensorflow/python/util/module_wrapper.py,81,class,Wrapper for TF modules to support deprecation messages and lazyloading. -12620,MockModule,tensorflow/tensorflow/python/util/module_wrapper_test.py,34,class, -12621,DeprecationWrapperTest,tensorflow/tensorflow/python/util/module_wrapper_test.py,38,class, -12622,LazyLoadingWrapperTest,tensorflow/tensorflow/python/util/module_wrapper_test.py,72,class, -12623,PickleTest,tensorflow/tensorflow/python/util/module_wrapper_test.py,136,class, -12624,_get_attrs_items,tensorflow/tensorflow/python/util/nest.py,80,function,"Returns a list of (name, value) pairs from an attrs instance. - -The list will be sorted by name. - -Args: - obj: an object. - -Returns: - A list of (attr_name, attr_value) pairs, sorted by attr_name." -12625,_sorted,tensorflow/tensorflow/python/util/nest.py,96,function,"Returns a sorted list of the dict keys, with error if keys not sortable." -12626,_is_namedtuple,tensorflow/tensorflow/python/util/nest.py,104,function,"Returns True iff `instance` is a `namedtuple`. - -Args: - instance: An instance of a Python object. - strict: If True, `instance` is considered to be a `namedtuple` only if - it is a ""plain"" namedtuple. For instance, a class inheriting - from a `namedtuple` will be considered to be a `namedtuple` - iff `strict=False`. - -Returns: - True if `instance` is a `namedtuple`." -12627,_sequence_like,tensorflow/tensorflow/python/util/nest.py,129,function,"Converts the sequence `args` to the same type as `instance`. - -Args: - instance: an instance of `tuple`, `list`, `namedtuple`, `dict`, - `collections.OrderedDict`, or `composite_tensor.Composite_Tensor` - or `type_spec.TypeSpec`. - args: elements to be converted to the `instance` type. - -Returns: - `args` with the type of `instance`." -12628,_yield_value,tensorflow/tensorflow/python/util/nest.py,198,function, -12629,_yield_sorted_items,tensorflow/tensorflow/python/util/nest.py,203,function,"Yield (key, value) pairs for `iterable` in a deterministic order. - -For Sequences, the key will be an int, the array index of a value. -For Mappings, the key will be the dictionary key. -For objects (e.g. namedtuples), the key will be the attribute name. - -In all cases, the keys will be iterated in sorted order. - -Args: - iterable: an iterable. - -Yields: - The iterable's (key, value) pairs, in order of sorted keys." -12630,is_nested,tensorflow/tensorflow/python/util/nest.py,261,function,"Returns true if its input is a collections.abc.Sequence (except strings). +11874,TFModuleWrapper,tensorflow/tensorflow/python/util/module_wrapper.py,81,class,Wrapper for TF modules to support deprecation messages and lazyloading. +11875,MockModule,tensorflow/tensorflow/python/util/module_wrapper_test.py,34,class, +11876,is_nested,tensorflow/tensorflow/python/util/nest.py,261,function,"Returns true if its input is a collections.abc.Sequence (except strings). Args: seq: an input sequence. @@ -113326,7 +123194,7 @@ Args: Returns: True if the sequence is a not a string and is a collections.abc.Sequence or a dict." -12631,flatten,tensorflow/tensorflow/python/util/nest.py,275,function,"Returns a flat list from a given nested structure. +11877,flatten,tensorflow/tensorflow/python/util/nest.py,275,function,"Returns a flat list from a given nested structure. If nest is not a structure , tuple (or a namedtuple), dict, or an attrs class, then returns a single-element list: @@ -113387,8 +123255,7 @@ Returns: Raises: TypeError: The nest is or contains a dict with non-sortable keys." -12632,_DotString,tensorflow/tensorflow/python/util/nest.py,345,class, -12633,assert_same_structure,tensorflow/tensorflow/python/util/nest.py,360,function,"Asserts that two structures are nested in the same way. +11878,assert_same_structure,tensorflow/tensorflow/python/util/nest.py,360,function,"Asserts that two structures are nested in the same way. Note that namedtuples with identical name and fields are always considered to have the same shallow structure (even with `check_types=True`). @@ -113420,7 +123287,7 @@ Raises: if the two structures are not nested in the same way. TypeError: If the two structures differ in the type of sequence in any of their substructures. Only possible if `check_types` is `True`." -12634,flatten_dict_items,tensorflow/tensorflow/python/util/nest.py,407,function,"Returns a dictionary with flattened keys and values. +11879,flatten_dict_items,tensorflow/tensorflow/python/util/nest.py,407,function,"Returns a dictionary with flattened keys and values. This function flattens the keys and values of a dictionary, which can be arbitrarily nested structures, and returns the flattened version of such @@ -113448,27 +123315,7 @@ Raises: TypeError: If the input is not a dictionary. ValueError: If any key and value do not have the same structure layout, or if keys are not unique." -12635,_packed_nest_with_indices,tensorflow/tensorflow/python/util/nest.py,463,function,"Helper function for pack_sequence_as. - -Args: - structure: Substructure (list / tuple / dict) to mimic. - flat: Flattened values to output substructure for. - index: Index at which to start reading from flat. - is_seq: Function used to test if a value should be treated as a sequence. - sequence_fn: Function used to generate a new sequence instance. - -Returns: - The tuple (new_index, child), where: - * new_index - the updated index into `flat` having processed `structure`. - * packed - the subset of `flat` corresponding to `structure`, - having started at `index`, and packed into the same nested - format. - -Raises: - ValueError: if `structure` contains more elements than `flat` - (assuming indexing starts from `index`)." -12636,_pack_sequence_as,tensorflow/tensorflow/python/util/nest.py,498,function,"Implements sequence packing, with the option to alter the structure." -12637,pack_sequence_as,tensorflow/tensorflow/python/util/nest.py,539,function,"Returns a given flattened sequence packed into a given structure. +11880,pack_sequence_as,tensorflow/tensorflow/python/util/nest.py,539,function,"Returns a given flattened sequence packed into a given structure. If `structure` is a scalar, `flat_sequence` must be a single-element list; in this case the return value is `flat_sequence[0]`. @@ -113499,7 +123346,7 @@ Raises: ValueError: If `flat_sequence` and `structure` have different element counts. TypeError: `structure` is or contains a dict with non-sortable keys." -12638,map_structure,tensorflow/tensorflow/python/util/nest.py,576,function,"Applies `func` to each entry in `structure` and returns a new structure. +11881,map_structure,tensorflow/tensorflow/python/util/nest.py,576,function,"Applies `func` to each entry in `structure` and returns a new structure. Applies `func(x[0], x[1], ...)` where x[i] is an entry in `structure[i]`. All structures in `structure` must have the same arity, @@ -113536,7 +123383,7 @@ Raises: ValueError: If no structure is provided or if the structures do not match each other by type. ValueError: If wrong keyword arguments are provided." -12639,map_structure_with_paths,tensorflow/tensorflow/python/util/nest.py,641,function,"Applies `func` to each entry in `structure` and returns a new structure. +11882,map_structure_with_paths,tensorflow/tensorflow/python/util/nest.py,641,function,"Applies `func` to each entry in `structure` and returns a new structure. Applies `func(path, x[0], x[1], ..., **kwargs)` where x[i] is an entry in `structure[i]` and `path` is the common path to x[i] in the structures. All @@ -113566,7 +123413,7 @@ Raises: TypeError: If `check_types` is not `False` and the two structures differ in the type of sequence in any of their substructures. ValueError: If no structures are provided." -12640,map_structure_with_tuple_paths,tensorflow/tensorflow/python/util/nest.py,683,function,"Applies `func` to each entry in `structure` and returns a new structure. +11883,map_structure_with_tuple_paths,tensorflow/tensorflow/python/util/nest.py,683,function,"Applies `func` to each entry in `structure` and returns a new structure. Applies `func(tuple_path, x[0], x[1], ..., **kwargs)` where `x[i]` is an entry in `structure[i]` and `tuple_path` is a tuple of indices and/or dictionary @@ -113597,22 +123444,7 @@ Raises: TypeError: If `check_types` is not `False` and the two structures differ in the type of sequence in any of their substructures. ValueError: If no structures are provided." -12641,_yield_flat_up_to,tensorflow/tensorflow/python/util/nest.py,722,function,"Yields (path, value) pairs of input_tree flattened up to shallow_tree. - -Args: - shallow_tree: Nested structure. Traverse no further than its leaf nodes. - input_tree: Nested structure. Return the paths and values from this tree. - Must have the same upper structure as shallow_tree. - is_seq: Function used to test if a value should be treated as a sequence. - path: Tuple. Optional argument, only used when recursing. The path from the - root of the original shallow_tree, down to the root of the shallow_tree - arg of this recursive call. - -Yields: - Pairs of (path, value), where path the tuple path of a leaf node in - shallow_tree, and value is the value of the corresponding node in - input_tree." -12642,assert_shallow_structure,tensorflow/tensorflow/python/util/nest.py,752,function,"Asserts that `shallow_tree` is a shallow structure of `input_tree`. +11884,assert_shallow_structure,tensorflow/tensorflow/python/util/nest.py,752,function,"Asserts that `shallow_tree` is a shallow structure of `input_tree`. That is, this function tests if the `input_tree` structure can be created from the `shallow_tree` structure by replacing its leaf nodes with deeper @@ -113650,7 +123482,7 @@ Raises: `input_tree`. Only raised if `check_types` is `True`. ValueError: If the sequence lengths of `shallow_tree` are different from `input_tree`." -12643,flatten_up_to,tensorflow/tensorflow/python/util/nest.py,875,function,"Flattens `input_tree` up to `shallow_tree`. +11885,flatten_up_to,tensorflow/tensorflow/python/util/nest.py,875,function,"Flattens `input_tree` up to `shallow_tree`. Any further depth in structure in `input_tree` is retained as elements in the partially flatten output. @@ -113722,7 +123554,7 @@ Raises: `input_tree`. ValueError: If the sequence lengths of `shallow_tree` are different from `input_tree`." -12644,flatten_with_tuple_paths_up_to,tensorflow/tensorflow/python/util/nest.py,959,function,"Flattens `input_tree` up to `shallow_tree`. +11886,flatten_with_tuple_paths_up_to,tensorflow/tensorflow/python/util/nest.py,959,function,"Flattens `input_tree` up to `shallow_tree`. Any further depth in structure in `input_tree` is retained as elements in the partially flattened output. @@ -113813,7 +123645,7 @@ Raises: `input_tree`. ValueError: If the sequence lengths of `shallow_tree` are different from `input_tree`." -12645,map_structure_up_to,tensorflow/tensorflow/python/util/nest.py,1063,function,"Applies a function or op to a number of partially flattened inputs. +11887,map_structure_up_to,tensorflow/tensorflow/python/util/nest.py,1063,function,"Applies a function or op to a number of partially flattened inputs. The `inputs` are flattened up to `shallow_tree` before being mapped. @@ -113885,7 +123717,7 @@ Raises: Returns: result of repeatedly applying `func`, with the same structure layout as `shallow_tree`." -12646,map_structure_with_tuple_paths_up_to,tensorflow/tensorflow/python/util/nest.py,1144,function,"Applies a function or op to a number of partially flattened inputs. +11888,map_structure_with_tuple_paths_up_to,tensorflow/tensorflow/python/util/nest.py,1144,function,"Applies a function or op to a number of partially flattened inputs. Like map_structure_up_to(), except that the 'func' argument takes a path tuple as its first argument, followed by the corresponding values from @@ -113950,7 +123782,7 @@ Raises: Returns: Result of repeatedly applying `func`. Has the same structure layout as `shallow_tree`." -12647,get_traverse_shallow_structure,tensorflow/tensorflow/python/util/nest.py,1242,function,"Generates a shallow structure from a `traverse_fn` and `structure`. +11889,get_traverse_shallow_structure,tensorflow/tensorflow/python/util/nest.py,1242,function,"Generates a shallow structure from a `traverse_fn` and `structure`. `traverse_fn` must accept any possible subtree of `structure` and return a depth=1 structure containing `True` or `False` values, describing which @@ -113978,7 +123810,7 @@ Raises: or a structure with depth higher than 1 for a sequence input, or if any leaf values in the returned structure or scalar are not type `bool`." -12648,yield_flat_paths,tensorflow/tensorflow/python/util/nest.py,1312,function,"Yields paths for some nested structure. +11890,yield_flat_paths,tensorflow/tensorflow/python/util/nest.py,1312,function,"Yields paths for some nested structure. Paths are lists of objects which can be str-converted, which may include integers or other types which are used as indices in a dict. @@ -114012,7 +123844,7 @@ Args: Yields: Tuples containing index or key values which form the path to a specific leaf value in the nested structure." -12649,flatten_with_joined_string_paths,tensorflow/tensorflow/python/util/nest.py,1353,function,"Returns a list of (string path, data element) tuples. +11891,flatten_with_joined_string_paths,tensorflow/tensorflow/python/util/nest.py,1353,function,"Returns a list of (string path, data element) tuples. The order of tuples produced matches that of `nest.flatten`. This allows you to flatten a nested structure while keeping information about where in the @@ -114029,7 +123861,7 @@ Args: Returns: A list of (string, data element) tuples." -12650,flatten_with_tuple_paths,tensorflow/tensorflow/python/util/nest.py,1381,function,"Returns a list of `(tuple_path, leaf_element)` tuples. +11892,flatten_with_tuple_paths,tensorflow/tensorflow/python/util/nest.py,1381,function,"Returns a list of `(tuple_path, leaf_element)` tuples. The order of pairs produced matches that of `nest.flatten`. This allows you to flatten a nested structure while keeping information about where in the @@ -114046,7 +123878,7 @@ Returns: A list of `(tuple_path, leaf_element)` tuples. Each `tuple_path` is a tuple of indices and/or dictionary keys that uniquely specify the path to `leaf_element` within `structure`." -12651,list_to_tuple,tensorflow/tensorflow/python/util/nest.py,1405,function,"Replace all lists with tuples. +11893,list_to_tuple,tensorflow/tensorflow/python/util/nest.py,1405,function,"Replace all lists with tuples. The fork of nest that tf.data uses treats lists as single elements, while tf.nest treats them as structures to recurse into. Keras has chosen to adopt @@ -114058,17 +123890,10 @@ Args: Returns: structure mapped to replace all lists with tuples." -12652,_CustomMapping,tensorflow/tensorflow/python/util/nest_test.py,43,class, -12653,_CustomSequenceThatRaisesException,tensorflow/tensorflow/python/util/nest_test.py,58,class, -12654,NestTest,tensorflow/tensorflow/python/util/nest_test.py,67,class, -12655,NestBenchmark,tensorflow/tensorflow/python/util/nest_test.py,1220,class, -12656,_ObjectIdentityWrapper,tensorflow/tensorflow/python/util/object_identity.py,25,class,"Wraps an object, mapping __eq__ on wrapper to ""is"" on wrapped. - -Since __eq__ is based on object identity, it's safe to also define __hash__ -based on object ids. This lets us add unhashable types like trackable -_ListWrapper objects to object-identity collections." -12657,_WeakObjectIdentityWrapper,tensorflow/tensorflow/python/util/object_identity.py,73,class, -12658,Reference,tensorflow/tensorflow/python/util/object_identity.py,83,class,"Reference that refers an object. +11894,NestBenchmark,tensorflow/tensorflow/python/util/nest_test.py,1220,class, +11895,run_and_report,tensorflow/tensorflow/python/util/nest_test.py,1222,method, +11896,benchmark_assert_structure,tensorflow/tensorflow/python/util/nest_test.py,1236,method, +11897,Reference,tensorflow/tensorflow/python/util/object_identity.py,83,class,"Reference that refers an object. ```python x = [1] @@ -114084,17 +123909,28 @@ print(x_ref1 == x_ref2) print(x_ref1 == y) ==> False ```" -12659,ObjectIdentityDictionary,tensorflow/tensorflow/python/util/object_identity.py,117,class,"A mutable mapping data structure which compares using ""is"". +11898,deref,tensorflow/tensorflow/python/util/object_identity.py,105,method,"Returns the referenced object. + +```python +x_ref = Reference(x) +print(x is x_ref.deref()) +==> True +```" +11899,ObjectIdentityDictionary,tensorflow/tensorflow/python/util/object_identity.py,117,class,"A mutable mapping data structure which compares using ""is"". This is necessary because we have trackable objects (_ListWrapper) which have behavior identical to built-in Python lists (including being unhashable and comparing based on the equality of their contents by default)." -12660,ObjectIdentityWeakKeyDictionary,tensorflow/tensorflow/python/util/object_identity.py,153,class,"Like weakref.WeakKeyDictionary, but compares objects with ""is""." -12661,ObjectIdentitySet,tensorflow/tensorflow/python/util/object_identity.py,173,class,"Like the built-in set, but compares objects with ""is""." -12662,ObjectIdentityWeakSet,tensorflow/tensorflow/python/util/object_identity.py,221,class,"Like weakref.WeakSet, but compares objects with ""is""." -12663,ObjectIdentityWrapperTest,tensorflow/tensorflow/python/util/object_identity_test.py,26,class, -12664,ObjectIdentitySetTest,tensorflow/tensorflow/python/util/object_identity_test.py,71,class, -12665,get_json_type,tensorflow/tensorflow/python/util/serialization.py,29,function,"Serializes any object to a JSON-serializable structure. +11900,ObjectIdentityWeakKeyDictionary,tensorflow/tensorflow/python/util/object_identity.py,153,class,"Like weakref.WeakKeyDictionary, but compares objects with ""is""." +11901,ObjectIdentitySet,tensorflow/tensorflow/python/util/object_identity.py,173,class,"Like the built-in set, but compares objects with ""is""." +11902,discard,tensorflow/tensorflow/python/util/object_identity.py,193,method, +11903,add,tensorflow/tensorflow/python/util/object_identity.py,196,method, +11904,update,tensorflow/tensorflow/python/util/object_identity.py,199,method, +11905,clear,tensorflow/tensorflow/python/util/object_identity.py,202,method, +11906,intersection,tensorflow/tensorflow/python/util/object_identity.py,205,method, +11907,difference,tensorflow/tensorflow/python/util/object_identity.py,208,method, +11908,ObjectIdentityWeakSet,tensorflow/tensorflow/python/util/object_identity.py,221,class,"Like weakref.WeakSet, but compares objects with ""is""." +11909,get_json_type,tensorflow/tensorflow/python/util/serialization.py,29,function,"Serializes any object to a JSON-serializable structure. Arguments: obj: the object to serialize @@ -114104,8 +123940,7 @@ Returns: Raises: TypeError: if `obj` cannot be serialized." -12666,SerializationTests,tensorflow/tensorflow/python/util/serialization_test.py,28,class, -12667,contextmanager,tensorflow/tensorflow/python/util/tf_contextlib.py,25,function,"A tf_decorator-aware wrapper for `contextlib.contextmanager`. +11910,contextmanager,tensorflow/tensorflow/python/util/tf_contextlib.py,25,function,"A tf_decorator-aware wrapper for `contextlib.contextmanager`. Usage is identical to `contextlib.contextmanager`. @@ -114113,11 +123948,7 @@ Args: target: A callable to be wrapped in a contextmanager. Returns: A callable that can be used inside of a `with` statement." -12668,test_yield_append_before_and_after_yield,tensorflow/tensorflow/python/util/tf_contextlib_test.py,29,function, -12669,test_yield_return_x_plus_1,tensorflow/tensorflow/python/util/tf_contextlib_test.py,36,function, -12670,test_params_and_defaults,tensorflow/tensorflow/python/util/tf_contextlib_test.py,41,function, -12671,TfContextlibTest,tensorflow/tensorflow/python/util/tf_contextlib_test.py,45,class, -12672,make_decorator,tensorflow/tensorflow/python/util/tf_decorator.py,67,function,"Make a decorator from a wrapper and a target. +11911,make_decorator,tensorflow/tensorflow/python/util/tf_decorator.py,67,function,"Make a decorator from a wrapper and a target. Args: target: The final callable to be wrapped. @@ -114130,14 +123961,7 @@ Args: Returns: The `decorator_func` argument with new metadata attached." -12673,_has_tf_decorator_attr,tensorflow/tensorflow/python/util/tf_decorator.py,114,function,"Checks if object has _tf_decorator attribute. - -This check would work for mocked object as well since it would -check if returned attribute has the right type. - -Args: - obj: Python object." -12674,rewrap,tensorflow/tensorflow/python/util/tf_decorator.py,128,function,"Injects a new target into a function built by make_decorator. +11912,rewrap,tensorflow/tensorflow/python/util/tf_decorator.py,128,function,"Injects a new target into a function built by make_decorator. This function allows replacing a function wrapped by `decorator_func`, assuming the decorator that wraps the function is written as described below. @@ -114169,7 +123993,7 @@ Args: Returns: The updated decorator. If decorator_func is not a tf_decorator, new_target is returned." -12675,unwrap,tensorflow/tensorflow/python/util/tf_decorator.py,200,function,"Unwraps an object into a list of TFDecorators and a final target. +11913,unwrap,tensorflow/tensorflow/python/util/tf_decorator.py,200,function,"Unwraps an object into a list of TFDecorators and a final target. Args: maybe_tf_decorator: Any callable object. @@ -114181,27 +124005,19 @@ Returns: not decorated by any TFDecorators, the first tuple element will be an empty list. The `TFDecorator` list is ordered from outermost to innermost decorators." -12676,TFDecorator,tensorflow/tensorflow/python/util/tf_decorator.py,229,class,"Base class for all TensorFlow decorators. +11914,TFDecorator,tensorflow/tensorflow/python/util/tf_decorator.py,229,class,"Base class for all TensorFlow decorators. TFDecorator captures and exposes the wrapped target, and provides details about the current decorator." -12677,test_tfdecorator,tensorflow/tensorflow/python/util/tf_decorator_test.py,30,function, -12678,test_decorator_increment_first_int_arg,tensorflow/tensorflow/python/util/tf_decorator_test.py,38,function,This test decorator skips past `self` as args[0] in the bound case. -12679,test_injectable_decorator_square,tensorflow/tensorflow/python/util/tf_decorator_test.py,55,function, -12680,test_injectable_decorator_increment,tensorflow/tensorflow/python/util/tf_decorator_test.py,63,function, -12681,test_function,tensorflow/tensorflow/python/util/tf_decorator_test.py,71,function,Test Function Docstring. -12682,test_decorated_function,tensorflow/tensorflow/python/util/tf_decorator_test.py,79,function,Test Decorated Function Docstring. -12683,test_rewrappable_decorated,tensorflow/tensorflow/python/util/tf_decorator_test.py,86,function, -12684,TestDecoratedClass,tensorflow/tensorflow/python/util/tf_decorator_test.py,91,class,Test Decorated Class. -12685,TfDecoratorTest,tensorflow/tensorflow/python/util/tf_decorator_test.py,110,class, -12686,test_wrapper,tensorflow/tensorflow/python/util/tf_decorator_test.py,195,function, -12687,TfMakeDecoratorTest,tensorflow/tensorflow/python/util/tf_decorator_test.py,199,class, -12688,TfDecoratorRewrapTest,tensorflow/tensorflow/python/util/tf_decorator_test.py,275,class, -12689,TfDecoratorUnwrapTest,tensorflow/tensorflow/python/util/tf_decorator_test.py,299,class, -12690,SymbolAlreadyExposedError,tensorflow/tensorflow/python/util/tf_export.py,88,class,Raised when adding API names to symbol that already has API names. -12691,InvalidSymbolNameError,tensorflow/tensorflow/python/util/tf_export.py,93,class,Raised when trying to export symbol as an invalid or unallowed name. -12692,get_symbol_from_name,tensorflow/tensorflow/python/util/tf_export.py,100,function, -12693,get_canonical_name_for_symbol,tensorflow/tensorflow/python/util/tf_export.py,104,function,"Get canonical name for the API symbol. +11915,decorated_target,tensorflow/tensorflow/python/util/tf_decorator.py,263,method, +11916,decorated_target,tensorflow/tensorflow/python/util/tf_decorator.py,267,method, +11917,decorator_name,tensorflow/tensorflow/python/util/tf_decorator.py,271,method, +11918,decorator_doc,tensorflow/tensorflow/python/util/tf_decorator.py,275,method, +11919,decorator_argspec,tensorflow/tensorflow/python/util/tf_decorator.py,279,method, +11920,SymbolAlreadyExposedError,tensorflow/tensorflow/python/util/tf_export.py,88,class,Raised when adding API names to symbol that already has API names. +11921,InvalidSymbolNameError,tensorflow/tensorflow/python/util/tf_export.py,93,class,Raised when trying to export symbol as an invalid or unallowed name. +11922,get_symbol_from_name,tensorflow/tensorflow/python/util/tf_export.py,100,function, +11923,get_canonical_name_for_symbol,tensorflow/tensorflow/python/util/tf_export.py,104,function,"Get canonical name for the API symbol. Args: symbol: API function or class. @@ -114212,7 +124028,7 @@ Args: Returns: Canonical name for the API symbol (for e.g. initializers.zeros) if canonical name could be determined. Otherwise, returns None." -12694,get_canonical_name,tensorflow/tensorflow/python/util/tf_export.py,142,function,"Get preferred endpoint name. +11924,get_canonical_name,tensorflow/tensorflow/python/util/tf_export.py,142,function,"Get preferred endpoint name. Args: api_names: API names iterable. @@ -114222,7 +124038,7 @@ Returns: - first non-deprecated endpoint - first endpoint - None" -12695,get_v1_names,tensorflow/tensorflow/python/util/tf_export.py,164,function,"Get a list of TF 1.* names for this symbol. +11925,get_v1_names,tensorflow/tensorflow/python/util/tf_export.py,164,function,"Get a list of TF 1.* names for this symbol. Args: symbol: symbol to get API names for. @@ -114230,7 +124046,7 @@ Args: Returns: List of all API names for this symbol including TensorFlow and Estimator names." -12696,get_v2_names,tensorflow/tensorflow/python/util/tf_export.py,190,function,"Get a list of TF 2.0 names for this symbol. +11926,get_v2_names,tensorflow/tensorflow/python/util/tf_export.py,190,function,"Get a list of TF 2.0 names for this symbol. Args: symbol: symbol to get API names for. @@ -114238,7 +124054,7 @@ Args: Returns: List of all API names for this symbol including TensorFlow and Estimator names." -12697,get_v1_constants,tensorflow/tensorflow/python/util/tf_export.py,216,function,"Get a list of TF 1.* constants in this module. +11927,get_v1_constants,tensorflow/tensorflow/python/util/tf_export.py,216,function,"Get a list of TF 1.* constants in this module. Args: module: TensorFlow module. @@ -114246,7 +124062,7 @@ Args: Returns: List of all API constants under the given module including TensorFlow and Estimator constants." -12698,get_v2_constants,tensorflow/tensorflow/python/util/tf_export.py,237,function,"Get a list of TF 2.0 constants in this module. +11928,get_v2_constants,tensorflow/tensorflow/python/util/tf_export.py,237,function,"Get a list of TF 2.0 constants in this module. Args: module: TensorFlow module. @@ -114254,37 +124070,27 @@ Args: Returns: List of all API constants under the given module including TensorFlow and Estimator constants." -12699,api_export,tensorflow/tensorflow/python/util/tf_export.py,258,class,Provides ways to export symbols to the TensorFlow API. -12700,kwarg_only,tensorflow/tensorflow/python/util/tf_export.py,394,function,A wrapper that throws away all non-kwarg arguments. -12701,_test_function,tensorflow/tensorflow/python/util/tf_export_test.py,29,function, -12702,_test_function2,tensorflow/tensorflow/python/util/tf_export_test.py,33,function, -12703,TestClassA,tensorflow/tensorflow/python/util/tf_export_test.py,37,class, -12704,TestClassB,tensorflow/tensorflow/python/util/tf_export_test.py,41,class, -12705,ValidateExportTest,tensorflow/tensorflow/python/util/tf_export_test.py,45,class,Tests for tf_export class. -12706,_convert_maybe_argspec_to_fullargspec,tensorflow/tensorflow/python/util/tf_inspect.py,40,function, -12707,_getargspec,tensorflow/tensorflow/python/util/tf_inspect.py,55,function,"A python3 version of getargspec. +11929,api_export,tensorflow/tensorflow/python/util/tf_export.py,258,class,Provides ways to export symbols to the TensorFlow API. +11930,set_attr,tensorflow/tensorflow/python/util/tf_export.py,349,method, +11931,export_constant,tensorflow/tensorflow/python/util/tf_export.py,360,method,"Store export information for constants/string literals. -Calls `getfullargspec` and assigns args, varargs, -varkw, and defaults to a python 2/3 compatible `ArgSpec`. +Export information is stored in the module where constants/string literals +are defined. -The parameter name 'varkw' is changed to 'keywords' to fit the -`ArgSpec` struct. +e.g. +```python +foo = 1 +bar = 2 +tf_export(""consts.foo"").export_constant(__name__, 'foo') +tf_export(""consts.bar"").export_constant(__name__, 'bar') +``` Args: - target: the target object to inspect. - -Returns: - An ArgSpec with args, varargs, keywords, and defaults parameters - from FullArgSpec." -12708,_getfullargspec,tensorflow/tensorflow/python/util/tf_inspect.py,81,function,"A python2 version of getfullargspec. - -Args: - target: the target object to inspect. - -Returns: - A FullArgSpec with empty kwonlyargs, kwonlydefaults and annotations." -12709,currentframe,tensorflow/tensorflow/python/util/tf_inspect.py,93,function,TFDecorator-aware replacement for inspect.currentframe. -12710,getargspec,tensorflow/tensorflow/python/util/tf_inspect.py,98,function,"TFDecorator-aware replacement for `inspect.getargspec`. + module_name: (string) Name of the module to store constant at. + name: (string) Current constant name." +11932,kwarg_only,tensorflow/tensorflow/python/util/tf_export.py,394,function,A wrapper that throws away all non-kwarg arguments. +11933,currentframe,tensorflow/tensorflow/python/util/tf_inspect.py,93,function,TFDecorator-aware replacement for inspect.currentframe. +11934,getargspec,tensorflow/tensorflow/python/util/tf_inspect.py,98,function,"TFDecorator-aware replacement for `inspect.getargspec`. Note: `getfullargspec` is recommended as the python 2/3 compatible replacement for this function. @@ -114301,16 +124107,7 @@ Raises: ValueError: When callable's signature can not be expressed with ArgSpec. TypeError: For objects of unsupported types." -12711,_get_argspec_for_partial,tensorflow/tensorflow/python/util/tf_inspect.py,150,function,"Implements `getargspec` for `functools.partial` objects. - -Args: - obj: The `functools.partial` object -Returns: - An `inspect.ArgSpec` -Raises: - ValueError: When callable's signature can not be expressed with - ArgSpec." -12712,getfullargspec,tensorflow/tensorflow/python/util/tf_inspect.py,238,function,"TFDecorator-aware replacement for `inspect.getfullargspec`. +11935,getfullargspec,tensorflow/tensorflow/python/util/tf_inspect.py,238,function,"TFDecorator-aware replacement for `inspect.getfullargspec`. This wrapper emulates `inspect.getfullargspec` in[^)]* Python2. @@ -114322,7 +124119,7 @@ Returns: the outermost decorator that changes the callable's signature. If the callable is not decorated, `inspect.getfullargspec()` will be called directly on the callable." -12713,getcallargs,tensorflow/tensorflow/python/util/tf_inspect.py,260,function,"TFDecorator-aware replacement for inspect.getcallargs. +11936,getcallargs,tensorflow/tensorflow/python/util/tf_inspect.py,260,function,"TFDecorator-aware replacement for inspect.getcallargs. Args: *func_and_positional: A callable, possibly decorated, followed by any @@ -114336,8 +124133,8 @@ Returns: `getcallargs` will use the argspec from the outermost decorator that provides it. If no attached decorators modify argspec, the final unwrapped target's argspec will be used." -12714,getframeinfo,tensorflow/tensorflow/python/util/tf_inspect.py,297,function, -12715,getdoc,tensorflow/tensorflow/python/util/tf_inspect.py,301,function,"TFDecorator-aware replacement for inspect.getdoc. +11937,getframeinfo,tensorflow/tensorflow/python/util/tf_inspect.py,297,function, +11938,getdoc,tensorflow/tensorflow/python/util/tf_inspect.py,301,function,"TFDecorator-aware replacement for inspect.getdoc. Args: object: An object, possibly decorated. @@ -114347,65 +124144,24 @@ Returns: The outermost-decorated object is intended to have the most complete documentation, so the decorated parameter is not unwrapped." -12716,getfile,tensorflow/tensorflow/python/util/tf_inspect.py,316,function,TFDecorator-aware replacement for inspect.getfile. -12717,getmembers,tensorflow/tensorflow/python/util/tf_inspect.py,330,function,TFDecorator-aware replacement for inspect.getmembers. -12718,getmodule,tensorflow/tensorflow/python/util/tf_inspect.py,335,function,TFDecorator-aware replacement for inspect.getmodule. -12719,getmro,tensorflow/tensorflow/python/util/tf_inspect.py,340,function,TFDecorator-aware replacement for inspect.getmro. -12720,getsource,tensorflow/tensorflow/python/util/tf_inspect.py,345,function,TFDecorator-aware replacement for inspect.getsource. -12721,getsourcefile,tensorflow/tensorflow/python/util/tf_inspect.py,350,function,TFDecorator-aware replacement for inspect.getsourcefile. -12722,getsourcelines,tensorflow/tensorflow/python/util/tf_inspect.py,355,function,TFDecorator-aware replacement for inspect.getsourcelines. -12723,isbuiltin,tensorflow/tensorflow/python/util/tf_inspect.py,360,function,TFDecorator-aware replacement for inspect.isbuiltin. -12724,isclass,tensorflow/tensorflow/python/util/tf_inspect.py,365,function,TFDecorator-aware replacement for inspect.isclass. -12725,isfunction,tensorflow/tensorflow/python/util/tf_inspect.py,370,function,TFDecorator-aware replacement for inspect.isfunction. -12726,isframe,tensorflow/tensorflow/python/util/tf_inspect.py,375,function,TFDecorator-aware replacement for inspect.ismodule. -12727,isgenerator,tensorflow/tensorflow/python/util/tf_inspect.py,380,function,TFDecorator-aware replacement for inspect.isgenerator. -12728,isgeneratorfunction,tensorflow/tensorflow/python/util/tf_inspect.py,385,function,TFDecorator-aware replacement for inspect.isgeneratorfunction. -12729,ismethod,tensorflow/tensorflow/python/util/tf_inspect.py,390,function,TFDecorator-aware replacement for inspect.ismethod. -12730,ismodule,tensorflow/tensorflow/python/util/tf_inspect.py,395,function,TFDecorator-aware replacement for inspect.ismodule. -12731,isroutine,tensorflow/tensorflow/python/util/tf_inspect.py,400,function,TFDecorator-aware replacement for inspect.isroutine. -12732,stack,tensorflow/tensorflow/python/util/tf_inspect.py,405,function,TFDecorator-aware replacement for inspect.stack. -12733,test_decorator,tensorflow/tensorflow/python/util/tf_inspect_test.py,31,function, -12734,test_undecorated_function,tensorflow/tensorflow/python/util/tf_inspect_test.py,39,function, -12735,test_decorated_function,tensorflow/tensorflow/python/util/tf_inspect_test.py,46,function,Test Decorated Function Docstring. -12736,test_decorated_function_with_defaults,tensorflow/tensorflow/python/util/tf_inspect_test.py,52,function,Test Decorated Function With Defaults Docstring. -12737,TestDecoratedClass,tensorflow/tensorflow/python/util/tf_inspect_test.py,58,class,Test Decorated Class. -12738,TfInspectTest,tensorflow/tensorflow/python/util/tf_inspect_test.py,68,class, -12739,TfInspectGetCallArgsTest,tensorflow/tensorflow/python/util/tf_inspect_test.py,588,class, -12740,_TFShouldUseHelper,tensorflow/tensorflow/python/util/tf_should_use.py,32,class,"Object stored in TFShouldUse-wrapped objects. - -When it is deleted it will emit a warning or error if its `sate` method -has not been called by time of deletion, and Tensorflow is not executing -eagerly or inside a tf.function (which use autodeps and resolve the -main issues this wrapper warns about)." -12741,_new__init__,tensorflow/tensorflow/python/util/tf_should_use.py,96,function, -12742,_new__setattr__,tensorflow/tensorflow/python/util/tf_should_use.py,102,function, -12743,_new__getattribute__,tensorflow/tensorflow/python/util/tf_should_use.py,110,function, -12744,_new_mark_used,tensorflow/tensorflow/python/util/tf_should_use.py,119,function, -12745,_get_wrapper,tensorflow/tensorflow/python/util/tf_should_use.py,133,function,"Create a wrapper for object x, whose class subclasses type(x). - -The wrapper will emit a warning if it is deleted without any of its -properties being accessed or methods being called. - -Args: - x: The instance to wrap. - tf_should_use_helper: The object that tracks usage. - -Returns: - An object wrapping `x`, of type `type(x)`." -12746,_add_should_use_warning,tensorflow/tensorflow/python/util/tf_should_use.py,175,function,"Wraps object x so that if it is never used, a warning is logged. - -Args: - x: Python object. - error_in_function: Python bool. If `True`, a `RuntimeError` is raised - if the returned value is never used when created during `tf.function` - tracing. - warn_in_eager: Python bool. If `True` raise warning if in Eager mode as well - as graph mode. - -Returns: - An instance of `TFShouldUseWarningWrapper` which subclasses `type(x)` - and is a very shallow wrapper for `x` which logs access into `x`." -12747,should_use_result,tensorflow/tensorflow/python/util/tf_should_use.py,216,function,"Function wrapper that ensures the function's output is used. +11939,getfile,tensorflow/tensorflow/python/util/tf_inspect.py,316,function,TFDecorator-aware replacement for inspect.getfile. +11940,getmembers,tensorflow/tensorflow/python/util/tf_inspect.py,330,function,TFDecorator-aware replacement for inspect.getmembers. +11941,getmodule,tensorflow/tensorflow/python/util/tf_inspect.py,335,function,TFDecorator-aware replacement for inspect.getmodule. +11942,getmro,tensorflow/tensorflow/python/util/tf_inspect.py,340,function,TFDecorator-aware replacement for inspect.getmro. +11943,getsource,tensorflow/tensorflow/python/util/tf_inspect.py,345,function,TFDecorator-aware replacement for inspect.getsource. +11944,getsourcefile,tensorflow/tensorflow/python/util/tf_inspect.py,350,function,TFDecorator-aware replacement for inspect.getsourcefile. +11945,getsourcelines,tensorflow/tensorflow/python/util/tf_inspect.py,355,function,TFDecorator-aware replacement for inspect.getsourcelines. +11946,isbuiltin,tensorflow/tensorflow/python/util/tf_inspect.py,360,function,TFDecorator-aware replacement for inspect.isbuiltin. +11947,isclass,tensorflow/tensorflow/python/util/tf_inspect.py,365,function,TFDecorator-aware replacement for inspect.isclass. +11948,isfunction,tensorflow/tensorflow/python/util/tf_inspect.py,370,function,TFDecorator-aware replacement for inspect.isfunction. +11949,isframe,tensorflow/tensorflow/python/util/tf_inspect.py,375,function,TFDecorator-aware replacement for inspect.ismodule. +11950,isgenerator,tensorflow/tensorflow/python/util/tf_inspect.py,380,function,TFDecorator-aware replacement for inspect.isgenerator. +11951,isgeneratorfunction,tensorflow/tensorflow/python/util/tf_inspect.py,385,function,TFDecorator-aware replacement for inspect.isgeneratorfunction. +11952,ismethod,tensorflow/tensorflow/python/util/tf_inspect.py,390,function,TFDecorator-aware replacement for inspect.ismethod. +11953,ismodule,tensorflow/tensorflow/python/util/tf_inspect.py,395,function,TFDecorator-aware replacement for inspect.ismodule. +11954,isroutine,tensorflow/tensorflow/python/util/tf_inspect.py,400,function,TFDecorator-aware replacement for inspect.isroutine. +11955,stack,tensorflow/tensorflow/python/util/tf_inspect.py,405,function,TFDecorator-aware replacement for inspect.stack. +11956,should_use_result,tensorflow/tensorflow/python/util/tf_should_use.py,216,function,"Function wrapper that ensures the function's output is used. If the output is not used, a `logging.error` is logged. If `error_in_function` is set, then a `RuntimeError` will be raised at the @@ -114431,13 +124187,18 @@ Args: Returns: The wrapped function." -12748,reroute_error,tensorflow/tensorflow/python/util/tf_should_use_test.py,36,function,Temporarily reroute errors written to tf_logging.error into `captured`. -12749,TfShouldUseTest,tensorflow/tensorflow/python/util/tf_should_use_test.py,42,class, -12750,StackTraceTransform,tensorflow/tensorflow/python/util/tf_stack.py,47,class,Base class for stack trace transformation functions. -12751,StackTraceMapper,tensorflow/tensorflow/python/util/tf_stack.py,79,class,Allows remapping traceback information to different source code. -12752,StackTraceFilter,tensorflow/tensorflow/python/util/tf_stack.py,91,class,Allows filtering traceback information by removing superfluous frames. -12753,CurrentModuleFilter,tensorflow/tensorflow/python/util/tf_stack.py,102,class,Filters stack frames from the module where this is used (best effort). -12754,extract_stack,tensorflow/tensorflow/python/util/tf_stack.py,131,function,"A lightweight, extensible re-implementation of traceback.extract_stack. +11957,reroute_error,tensorflow/tensorflow/python/util/tf_should_use_test.py,36,function,Temporarily reroute errors written to tf_logging.error into `captured`. +11958,StackTraceTransform,tensorflow/tensorflow/python/util/tf_stack.py,47,class,Base class for stack trace transformation functions. +11959,reset,tensorflow/tensorflow/python/util/tf_stack.py,75,method, +11960,StackTraceMapper,tensorflow/tensorflow/python/util/tf_stack.py,79,class,Allows remapping traceback information to different source code. +11961,reset,tensorflow/tensorflow/python/util/tf_stack.py,83,method, +11962,get_effective_source_map,tensorflow/tensorflow/python/util/tf_stack.py,86,method,"Returns a map (filename, lineno) -> (filename, lineno, function_name)." +11963,StackTraceFilter,tensorflow/tensorflow/python/util/tf_stack.py,91,class,Allows filtering traceback information by removing superfluous frames. +11964,reset,tensorflow/tensorflow/python/util/tf_stack.py,95,method, +11965,get_filtered_filenames,tensorflow/tensorflow/python/util/tf_stack.py,98,method, +11966,CurrentModuleFilter,tensorflow/tensorflow/python/util/tf_stack.py,102,class,Filters stack frames from the module where this is used (best effort). +11967,get_filtered_filenames,tensorflow/tensorflow/python/util/tf_stack.py,123,method, +11968,extract_stack,tensorflow/tensorflow/python/util/tf_stack.py,131,function,"A lightweight, extensible re-implementation of traceback.extract_stack. NOTE(mrry): traceback.extract_stack eagerly retrieves the line of code for each stack frame using linecache, which results in an abundance of stat() @@ -114451,10 +124212,9 @@ Args: Returns: A sequence of FrameSummary objects (filename, lineno, name, line) corresponding to the call stack of the current thread." -12755,TFStackTest,tensorflow/tensorflow/python/util/tf_stack_test.py,27,class, -12756,extract_stack,tensorflow/tensorflow/python/util/tf_stack_test.py,56,function, -12757,convert_stack_frame,tensorflow/tensorflow/python/util/tf_stack_test.py,61,function,Converts a TF stack frame into Python's. -12758,assertProtoEqual,tensorflow/tensorflow/python/util/protobuf/compare.py,77,function,"Fails with a useful error if a and b aren't equal. +11969,extract_stack,tensorflow/tensorflow/python/util/tf_stack_test.py,56,function, +11970,convert_stack_frame,tensorflow/tensorflow/python/util/tf_stack_test.py,61,function,Converts a TF stack frame into Python's. +11971,assertProtoEqual,tensorflow/tensorflow/python/util/protobuf/compare.py,77,function,"Fails with a useful error if a and b aren't equal. Comparison of repeated fields matches the semantics of unittest.TestCase.assertEqual(), ie order and extra duplicates fields matter. @@ -114468,7 +124228,7 @@ Args: normalize_numbers: boolean, whether to normalize types and precision of numbers before comparison. msg: if specified, is used as the error message on failure." -12759,NormalizeNumberFields,tensorflow/tensorflow/python/util/protobuf/compare.py,121,function,"Normalizes types and precisions of number fields in a protocol buffer. +11972,NormalizeNumberFields,tensorflow/tensorflow/python/util/protobuf/compare.py,121,function,"Normalizes types and precisions of number fields in a protocol buffer. Due to subtleties in the python protocol buffer implementation, it is possible for values to have different types and precision depending on whether they @@ -114484,9 +124244,7 @@ Args: Returns: the given pb, modified in place." -12760,_IsMap,tensorflow/tensorflow/python/util/protobuf/compare.py,189,function, -12761,_IsRepeatedContainer,tensorflow/tensorflow/python/util/protobuf/compare.py,193,function, -12762,ProtoEq,tensorflow/tensorflow/python/util/protobuf/compare.py,203,function,"Compares two proto2 objects for equality. +11973,ProtoEq,tensorflow/tensorflow/python/util/protobuf/compare.py,203,function,"Compares two proto2 objects for equality. Recurses into nested messages. Uses list (not set) semantics for comparing repeated fields, ie duplicates and order matter. @@ -114497,7 +124255,7 @@ Args: Returns: `True` if the messages are equal." -12763,ProtoAssertions,tensorflow/tensorflow/python/util/protobuf/compare.py,258,class,"Mix this into a googletest.TestCase class to get proto2 assertions. +11974,ProtoAssertions,tensorflow/tensorflow/python/util/protobuf/compare.py,258,class,"Mix this into a googletest.TestCase class to get proto2 assertions. Usage: @@ -114508,67 +124266,18 @@ class SomeTestCase(compare.ProtoAssertions, googletest.TestCase): self.assertProtoEqual(a, b) See module-level definitions for method documentation." -12764,LargePbs,tensorflow/tensorflow/python/util/protobuf/compare_test.py,34,function,Converts ASCII string Large PBs to messages. -12765,ProtoEqTest,tensorflow/tensorflow/python/util/protobuf/compare_test.py,45,class, -12766,NormalizeNumbersTest,tensorflow/tensorflow/python/util/protobuf/compare_test.py,211,class,Tests for NormalizeNumberFields(). -12767,AssertTest,tensorflow/tensorflow/python/util/protobuf/compare_test.py,270,class,Tests assertProtoEqual(). -12768,MixinTests,tensorflow/tensorflow/python/util/protobuf/compare_test.py,476,class, -12769,_SkipMember,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,79,function, -12770,_SkipMember,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,94,function, -12771,_NormalizeType,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,111,function, -12772,_NormalizeIsInstance,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,115,function, -12773,_SanitizedArgSpec,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,119,function,"Get an ArgSpec string that is free of addresses. - -We have callables as function arg defaults. This results in addresses in -getargspec output. This function returns a sanitized string list of base -classes. - -Args: - obj: A python routine for us the create the sanitized arspec of. - -Returns: - string, a string representation of the argspec." -12774,_SanitizedMRO,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,157,function,"Get a list of superclasses with minimal amount of non-TF classes. - -Based on many parameters like python version, OS, protobuf implementation -or changes in google core libraries the list of superclasses of a class -can change. We only return the first non-TF class to be robust to non API -affecting changes. The Method Resolution Order returned by `tf_inspect.getmro` -is still maintained in the return value. - -Args: - obj: A python routine for us the create the sanitized arspec of. - -Returns: - list of strings, string representation of the class names." -12775,_IsProtoClass,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,191,function,Returns whether the passed obj is a Protocol Buffer class. -12776,PythonObjectToProtoVisitor,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,196,class,A visitor that summarizes given python objects as protobufs. -12777,_InitPathConstants,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,86,function, -12778,_KeyToFilePath,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,114,function,"From a given key, construct a filepath. - -Filepath will be inside golden folder for api_version. - -Args: - key: a string used to determine the file path - api_version: a number indicating the tensorflow API version, e.g. 1 or 2. - -Returns: - A string of file path to the pbtxt file which describes the public API" -12779,_FileNameToKey,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,145,function,"From a given filename, construct a key we use for api objects." -12780,_VerifyNoSubclassOfMessageVisitor,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,159,function,A Visitor that crashes on subclasses of generated proto classes. -12781,_FilterNonCoreGoldenFiles,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,173,function,Filter out non-core API pbtxt files. -12782,_FilterGoldenProtoDict,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,186,function,Filter out golden proto dict symbols that should be omitted. -12783,_GetTFNumpyGoldenPattern,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,209,function, -12784,ApiCompatibilityTest,tensorflow/tensorflow/tools/api/tests/api_compatibility_test.py,215,class, -12785,ModuleTest,tensorflow/tensorflow/tools/api/tests/module_test.py,30,class, -12786,write_build_info,tensorflow/tensorflow/tools/build_info/gen_build_info.py,32,function,"Writes a Python that describes the build. +11975,assertProtoEqual,tensorflow/tensorflow/python/util/protobuf/compare.py,273,method, +11976,LargePbs,tensorflow/tensorflow/python/util/protobuf/compare_test.py,34,function,Converts ASCII string Large PBs to messages. +11977,PythonObjectToProtoVisitor,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,196,class,A visitor that summarizes given python objects as protobufs. +11978,GetProtos,tensorflow/tensorflow/tools/api/lib/python_object_to_proto_visitor.py,204,method,Return the list of protos stored. +11979,write_build_info,tensorflow/tensorflow/tools/build_info/gen_build_info.py,32,function,"Writes a Python that describes the build. Args: filename: filename to write to. key_value_list: A list of ""key=value"" strings that will be added to the module's ""build_info"" dictionary as additional entries." -12787,check_existence,tensorflow/tensorflow/tools/ci_build/copy_binary.py,40,function,Check the existence of file or dir. -12788,copy_binary,tensorflow/tensorflow/tools/ci_build/copy_binary.py,46,function,"Rename and copy binaries for different python versions. +11980,check_existence,tensorflow/tensorflow/tools/ci_build/copy_binary.py,40,function,Check the existence of file or dir. +11981,copy_binary,tensorflow/tensorflow/tools/ci_build/copy_binary.py,46,function,"Rename and copy binaries for different python versions. Arguments: directory: string of directory @@ -114576,53 +124285,72 @@ Arguments: new_tag: str of the new tag version: the version of the package package: str, name of the package" -12789,main,tensorflow/tensorflow/tools/ci_build/copy_binary.py,94,function,"This script copies binaries. +11982,check_existence,tensorflow/tensorflow/tools/ci_build/update_version.py,46,function,Check the existence of file or dir. +11983,check_all_files,tensorflow/tensorflow/tools/ci_build/update_version.py,53,function,Check all relevant files necessary for upgrade. +11984,replace_string_in_line,tensorflow/tensorflow/tools/ci_build/update_version.py,59,function,Replace with sed when regex is required. +11985,Version,tensorflow/tensorflow/tools/ci_build/update_version.py,67,class,Version class object that stores SemVer version information. +11986,set_identifier_string,tensorflow/tensorflow/tools/ci_build/update_version.py,96,method, +11987,pep_440_str,tensorflow/tensorflow/tools/ci_build/update_version.py,101,method, +11988,parse_from_string,tensorflow/tensorflow/tools/ci_build/update_version.py,115,method,"Returns version object from Semver string. -Requirements: - filename: The path to the whl file - AND - new_py_ver: Create a nightly tag with current date +Args: + string: version string + version_type: version parameter Raises: - RuntimeError: If the whl file was not found" -12790,check_existence,tensorflow/tensorflow/tools/ci_build/update_version.py,46,function,Check the existence of file or dir. -12791,check_all_files,tensorflow/tensorflow/tools/ci_build/update_version.py,53,function,Check all relevant files necessary for upgrade. -12792,replace_string_in_line,tensorflow/tensorflow/tools/ci_build/update_version.py,59,function,Replace with sed when regex is required. -12793,Version,tensorflow/tensorflow/tools/ci_build/update_version.py,67,class,Version class object that stores SemVer version information. -12794,get_current_semver_version,tensorflow/tensorflow/tools/ci_build/update_version.py,146,function,"Returns a Version object of current version. + RuntimeError: If the version string is not valid." +11989,get_current_semver_version,tensorflow/tensorflow/tools/ci_build/update_version.py,146,function,"Returns a Version object of current version. Returns: version: Version object of current SemVer string based on information from core/public/version.h" -12795,update_version_h,tensorflow/tensorflow/tools/ci_build/update_version.py,183,function,Update tensorflow/core/public/version.h. -12796,update_setup_dot_py,tensorflow/tensorflow/tools/ci_build/update_version.py,200,function,Update setup.py. -12797,update_readme,tensorflow/tensorflow/tools/ci_build/update_version.py,206,function,Update README. -12798,update_tensorflow_bzl,tensorflow/tensorflow/tools/ci_build/update_version.py,214,function,Update tensorflow.bzl. -12799,major_minor_change,tensorflow/tensorflow/tools/ci_build/update_version.py,224,function,Check if a major or minor change occurred. -12800,check_for_lingering_string,tensorflow/tensorflow/tools/ci_build/update_version.py,233,function,Check for given lingering strings. -12801,check_for_old_version,tensorflow/tensorflow/tools/ci_build/update_version.py,255,function,Check for old version references. -12802,main,tensorflow/tensorflow/tools/ci_build/update_version.py,265,function,"This script updates all instances of version in the tensorflow directory. +11990,update_version_h,tensorflow/tensorflow/tools/ci_build/update_version.py,183,function,Update tensorflow/core/public/version.h. +11991,update_setup_dot_py,tensorflow/tensorflow/tools/ci_build/update_version.py,200,function,Update setup.py. +11992,update_readme,tensorflow/tensorflow/tools/ci_build/update_version.py,206,function,Update README. +11993,update_tensorflow_bzl,tensorflow/tensorflow/tools/ci_build/update_version.py,214,function,Update tensorflow.bzl. +11994,major_minor_change,tensorflow/tensorflow/tools/ci_build/update_version.py,224,function,Check if a major or minor change occurred. +11995,check_for_lingering_string,tensorflow/tensorflow/tools/ci_build/update_version.py,233,function,Check for given lingering strings. +11996,check_for_old_version,tensorflow/tensorflow/tools/ci_build/update_version.py,255,function,Check for old version references. +11997,IntelPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,34,class, +11998,set_host_gcc_version,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,50,method, +11999,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,73,method, +12000,use_old_arch_names,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,79,method, +12001,NehalemPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,89,class, +12002,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,94,method, +12003,SandyBridgePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,105,class, +12004,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,110,method, +12005,HaswellPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,121,class, +12006,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,126,method, +12007,SkylakePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,140,class, +12008,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,145,method, +12009,CascadelakePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,163,class, +12010,get_bazel_gcc_flags,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,168,method, +12011,BuildEnvSetter,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,183,class,Prepares the proper environment settings for various Intel platforms. +12012,get_gcc_version,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,201,method, +12013,parse_args,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,232,method,"Set up argument parser, and parse CLI args." +12014,validate_args,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,287,method, +12015,set_build_args,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,307,method,Generate Bazel build flags. +12016,write_build_args,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,325,method, +12017,go,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,333,method, +12018,PublicAPIVisitor,tensorflow/tensorflow/tools/common/public_api.py,29,class,Visitor to use with `traverse` to visit exactly the public TF API. +12019,private_map,tensorflow/tensorflow/tools/common/public_api.py,81,method,"A map from parents to symbols that should not be included at all. -Requirements: - version: The version tag - OR - nightly: Create a nightly tag with current date +This map can be edited, but it should not be edited once traversal has +begun. -Raises: - RuntimeError: If the script is not being run from tf source dir" -12803,IntelPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,34,class, -12804,NehalemPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,89,class, -12805,SandyBridgePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,105,class, -12806,HaswellPlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,121,class, -12807,SkylakePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,140,class, -12808,CascadelakePlatform,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,163,class, -12809,BuildEnvSetter,tensorflow/tensorflow/tools/ci_build/linux/mkl/set-build-env.py,183,class,Prepares the proper environment settings for various Intel platforms. -12810,PublicAPIVisitor,tensorflow/tensorflow/tools/common/public_api.py,29,class,Visitor to use with `traverse` to visit exactly the public TF API. -12811,PublicApiTest,tensorflow/tensorflow/tools/common/public_api_test.py,25,class, -12812,ModuleClass1,tensorflow/tensorflow/tools/common/test_module1.py,24,class, -12813,ModuleClass2,tensorflow/tensorflow/tools/common/test_module2.py,22,class, -12814,_traverse_internal,tensorflow/tensorflow/tools/common/traverse.py,32,function,Internal helper for traverse. -12815,traverse,tensorflow/tensorflow/tools/common/traverse.py,77,function,"Recursively enumerate all members of `root`. +Returns: + The map marking symbols to not include." +12020,do_not_descend_map,tensorflow/tensorflow/tools/common/public_api.py,93,method,"A map from parents to symbols that should not be descended into. + +This map can be edited, but it should not be edited once traversal has +begun. + +Returns: + The map marking symbols to not explore." +12021,set_root_name,tensorflow/tensorflow/tools/common/public_api.py,104,method,Override the default root name of 'tf'. +12022,ModuleClass1,tensorflow/tensorflow/tools/common/test_module1.py,24,class, +12023,ModuleClass2,tensorflow/tensorflow/tools/common/test_module2.py,22,class, +12024,traverse,tensorflow/tensorflow/tools/common/traverse.py,77,function,"Recursively enumerate all members of `root`. Similar to the Python library function `os.path.walk`. @@ -114654,11 +124382,8 @@ Args: root: A python object with which to start the traversal. visit: A function taking arguments `(path, parent, children)`. Will be called for each object found in the traversal." -12816,TestVisitor,tensorflow/tensorflow/tools/common/traverse_test.py,27,class, -12817,TraverseTest,tensorflow/tensorflow/tools/common/traverse_test.py,36,class, -12818,add_contrib_direct_import_support,tensorflow/tensorflow/tools/compatibility/all_renames_v2.py,560,function,Add support for `tf.contrib.*` alias `contrib_*.` Updates dict in place. -12819,AllRenamesV2Test,tensorflow/tensorflow/tools/compatibility/all_renames_v2_test.py,28,class, -12820,full_name_node,tensorflow/tensorflow/tools/compatibility/ast_edits.py,49,function,"Make an Attribute or Name node for name. +12025,add_contrib_direct_import_support,tensorflow/tensorflow/tools/compatibility/all_renames_v2.py,560,function,Add support for `tf.contrib.*` alias `contrib_*.` Updates dict in place. +12026,full_name_node,tensorflow/tensorflow/tools/compatibility/ast_edits.py,49,function,"Make an Attribute or Name node for name. Translate a qualified name into nested Attribute nodes (and a Name node). @@ -114668,7 +124393,7 @@ Args: Returns: A Name or Attribute node." -12821,get_arg_value,tensorflow/tensorflow/tools/compatibility/ast_edits.py,72,function,"Get the value of an argument from a ast.Call node. +12027,get_arg_value,tensorflow/tensorflow/tools/compatibility/ast_edits.py,72,function,"Get the value of an argument from a ast.Call node. This function goes through the positional and keyword arguments to check whether a given argument was used, and if so, returns its value (the node @@ -114686,7 +124411,7 @@ Args: Returns: A tuple (arg_present, arg_value) containing a boolean indicating whether the argument is present, and its value in case it is." -12822,uses_star_args_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,111,function,"Check if an ast.Call node uses arbitrary-length positional *args. +12028,uses_star_args_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,111,function,"Check if an ast.Call node uses arbitrary-length positional *args. This function works with the AST call node format of Python3.5+ as well as the different AST format of earlier versions of Python. @@ -114697,7 +124422,7 @@ Args: Returns: True if the node uses starred variadic positional args or keyword args. False if it does not." -12823,uses_star_kwargs_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,135,function,"Check if an ast.Call node uses arbitrary-length **kwargs. +12029,uses_star_kwargs_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,135,function,"Check if an ast.Call node uses arbitrary-length **kwargs. This function works with the AST call node format of Python3.5+ as well as the different AST format of earlier versions of Python. @@ -114708,7 +124433,7 @@ Args: Returns: True if the node uses starred variadic positional args or keyword args. False if it does not." -12824,uses_star_args_or_kwargs_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,159,function,"Check if an ast.Call node uses arbitrary-length *args or **kwargs. +12030,uses_star_args_or_kwargs_in_call,tensorflow/tensorflow/tools/compatibility/ast_edits.py,159,function,"Check if an ast.Call node uses arbitrary-length *args or **kwargs. This function works with the AST call node format of Python3.5+ as well as the different AST format of earlier versions of Python. @@ -114719,7 +124444,7 @@ Args: Returns: True if the node uses starred variadic positional args or keyword args. False if it does not." -12825,excluded_from_module_rename,tensorflow/tensorflow/tools/compatibility/ast_edits.py,175,function,"Check if this module import should not be renamed. +12031,excluded_from_module_rename,tensorflow/tensorflow/tools/compatibility/ast_edits.py,175,function,"Check if this module import should not be renamed. Args: module: (string) module name. @@ -114728,7 +124453,7 @@ Args: Returns: True if this import should not be renamed according to the import_rename_spec." -12826,APIChangeSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,192,class,"This class defines the transformations that need to happen. +12032,APIChangeSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,192,class,"This class defines the transformations that need to happen. This class must provide the following fields: @@ -114748,12 +124473,12 @@ This class must provide the following fields: to ImportRename instance. For an example, see `TFAPIChangeSpec`." -12827,NoUpdateSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,227,class,A specification of an API change which doesn't change anything. -12828,_PastaEditVisitor,tensorflow/tensorflow/tools/compatibility/ast_edits.py,242,class,"AST Visitor that processes function calls. +12033,preprocess,tensorflow/tensorflow/tools/compatibility/ast_edits.py,215,method,"Preprocess a parse tree. Return a preprocessed node, logs and errors." +12034,clear_preprocessing,tensorflow/tensorflow/tools/compatibility/ast_edits.py,219,method,"Restore this APIChangeSpec to before it preprocessed a file. -Updates function calls from old API version to new API version using a given -change spec." -12829,AnalysisResult,tensorflow/tensorflow/tools/compatibility/ast_edits.py,787,class,"This class represents an analysis result and how it should be logged. +This is needed if preprocessing a file changed any rewriting rules." +12035,NoUpdateSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,227,class,A specification of an API change which doesn't change anything. +12036,AnalysisResult,tensorflow/tensorflow/tools/compatibility/ast_edits.py,787,class,"This class represents an analysis result and how it should be logged. This class must provide the following fields: @@ -114761,7 +124486,7 @@ This class must provide the following fields: * `log_message`: The message that should be logged for this detection For an example, see `VersionedTFImport`." -12830,APIAnalysisSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,799,class,"This class defines how `AnalysisResult`s should be generated. +12037,APIAnalysisSpec,tensorflow/tensorflow/tools/compatibility/ast_edits.py,799,class,"This class defines how `AnalysisResult`s should be generated. It specifies how to map imports and symbols to `AnalysisResult`s. @@ -114773,49 +124498,97 @@ This class must provide the following fields: notifications) For an example, see `TFAPIImportAnalysisSpec`." -12831,PastaAnalyzeVisitor,tensorflow/tensorflow/tools/compatibility/ast_edits.py,815,class,"AST Visitor that looks for specific API usage without editing anything. +12038,PastaAnalyzeVisitor,tensorflow/tensorflow/tools/compatibility/ast_edits.py,815,class,"AST Visitor that looks for specific API usage without editing anything. This is used before any rewriting is done to detect if any symbols are used that require changing imports or disabling rewriting altogether." -12832,ASTCodeUpgrader,tensorflow/tensorflow/tools/compatibility/ast_edits.py,893,class,Handles upgrading a set of Python files using a given API change spec. -12833,ModuleDeprecationSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,57,class,A specification which deprecates 'a.b'. -12834,RenameKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,65,class,"A specification where kw2 gets renamed to kw3. +12039,results,tensorflow/tensorflow/tools/compatibility/ast_edits.py,828,method, +12040,add_result,tensorflow/tensorflow/tools/compatibility/ast_edits.py,831,method, +12041,visit_Attribute,tensorflow/tensorflow/tools/compatibility/ast_edits.py,834,method,"Handle bare Attributes i.e. [tf.foo, tf.bar]." +12042,visit_Import,tensorflow/tensorflow/tools/compatibility/ast_edits.py,847,method,"Handle visiting an import node in the AST. + +Args: + node: Current Node" +12043,visit_ImportFrom,tensorflow/tensorflow/tools/compatibility/ast_edits.py,866,method,"Handle visiting an import-from node in the AST. + +Args: + node: Current Node" +12044,ASTCodeUpgrader,tensorflow/tensorflow/tools/compatibility/ast_edits.py,893,class,Handles upgrading a set of Python files using a given API change spec. +12045,process_file,tensorflow/tensorflow/tools/compatibility/ast_edits.py,902,method,"Process the given python file for incompatible changes. + +Args: + in_filename: filename to parse + out_filename: output file to write to + no_change_to_outfile_on_error: not modify the output file on errors +Returns: + A tuple representing number of files processed, log of actions, errors" +12046,format_log,tensorflow/tensorflow/tools/compatibility/ast_edits.py,930,method, +12047,update_string_pasta,tensorflow/tensorflow/tools/compatibility/ast_edits.py,937,method,Updates a file using pasta. +12048,process_opened_file,tensorflow/tensorflow/tools/compatibility/ast_edits.py,968,method,"Process the given python file for incompatible changes. + +This function is split out to facilitate StringIO testing from +tf_upgrade_test.py. + +Args: + in_filename: filename to parse + in_file: opened file (or StringIO) + out_filename: output file to write to + out_file: opened file (or StringIO) +Returns: + A tuple representing number of files processed, log of actions, errors" +12049,process_tree,tensorflow/tensorflow/tools/compatibility/ast_edits.py,993,method,"Processes upgrades on an entire tree of python files in place. + +Note that only Python files. If you have custom code in other languages, +you will need to manually upgrade those. + +Args: + root_directory: Directory to walk and process. + output_root_directory: Directory to use as base. + copy_other_files: Copy files that are not touched by this converter. + +Returns: + A tuple of files processed, the report string for all files, and a dict + mapping filenames to errors encountered in that file." +12050,process_tree_inplace,tensorflow/tensorflow/tools/compatibility/ast_edits.py,1087,method,Process a directory of python files in place. +12051,ModuleDeprecationSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,57,class,A specification which deprecates 'a.b'. +12052,RenameKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,65,class,"A specification where kw2 gets renamed to kw3. The new API is def f(a, b, kw1, kw3): ..." -12835,ReorderKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,82,class,"A specification where kw2 gets moved in front of kw1. +12053,update_renames,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,78,method, +12054,ReorderKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,82,class,"A specification where kw2 gets moved in front of kw1. The new API is def f(a, b, kw2, kw1): ..." -12836,ReorderAndRenameKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,100,class,"A specification where kw2 gets moved in front of kw1 and is changed to kw3. +12055,update_reorders,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,95,method, +12056,ReorderAndRenameKeywordSpec,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,100,class,"A specification where kw2 gets moved in front of kw1 and is changed to kw3. The new API is def f(a, b, kw3, kw1): ..." -12837,RemoveDeprecatedAliasKeyword,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,116,class,"A specification where kw1_alias is removed in g. +12057,RemoveDeprecatedAliasKeyword,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,116,class,"A specification where kw1_alias is removed in g. The new API is def g(a, b, kw1, c): ... def g2(a, b, kw1, c, d): ..." -12838,RemoveDeprecatedAliasAndReorderRest,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,132,class,"A specification where kw1_alias is removed in g. +12058,RemoveDeprecatedAliasAndReorderRest,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,132,class,"A specification where kw1_alias is removed in g. The new API is def g(a, b, c, kw1): ... def g2(a, b, c, d, kw1): ..." -12839,RemoveMultipleKeywordArguments,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,149,class,"A specification where both keyword aliases are removed from h. +12059,RemoveMultipleKeywordArguments,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,149,class,"A specification where both keyword aliases are removed from h. The new API is def h(a, kw1, kw2): ..." -12840,RenameImports,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,166,class,Specification for renaming imports. -12841,TestAstEdits,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,178,class, -12842,is_python,tensorflow/tensorflow/tools/compatibility/ipynb.py,33,function,Checks if the cell consists of Python code. -12843,process_file,tensorflow/tensorflow/tools/compatibility/ipynb.py,41,function,The function where we inject the support for ipynb upgrade. -12844,skip_magic,tensorflow/tensorflow/tools/compatibility/ipynb.py,71,function,"Checks if the cell has magic, that is not Python-based. +12060,RenameImports,tensorflow/tensorflow/tools/compatibility/ast_edits_test.py,166,class,Specification for renaming imports. +12061,is_python,tensorflow/tensorflow/tools/compatibility/ipynb.py,33,function,Checks if the cell consists of Python code. +12062,process_file,tensorflow/tensorflow/tools/compatibility/ipynb.py,41,function,The function where we inject the support for ipynb upgrade. +12063,skip_magic,tensorflow/tensorflow/tools/compatibility/ipynb.py,71,function,"Checks if the cell has magic, that is not Python-based. Args: code_line: A line of Python code @@ -114826,7 +124599,7 @@ Returns: >>> skip_magic('!ls -laF', ['%', '!', '?']) True" -12845,check_line_split,tensorflow/tensorflow/tools/compatibility/ipynb.py,92,function,"Checks if a line was split with `\`. +12064,check_line_split,tensorflow/tensorflow/tools/compatibility/ipynb.py,92,function,"Checks if a line was split with `\`. Args: code_line: A line of Python code @@ -114836,170 +124609,25 @@ Returns: >>> skip_magic(""!gcloud ml-engine models create ${MODEL} \\\n"") True" -12846,_get_code,tensorflow/tensorflow/tools/compatibility/ipynb.py,108,function,Loads the ipynb file and returns a list of CodeLines. -12847,_update_notebook,tensorflow/tensorflow/tools/compatibility/ipynb.py,155,function,"Updates notebook, once migration is done." -12848,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade.py,29,class,List of maps that describe what changed in the API. -12849,TestUpgrade,tensorflow/tensorflow/tools/compatibility/tf_upgrade_test.py,31,class,"Test various APIs that have been changed in 1.0. - -We also test whether a converted file is executable. test_file_v0_11.py -aims to exhaustively test that API changes are convertible and actually -work when run with current TensorFlow." -12850,TestUpgradeFiles,tensorflow/tensorflow/tools/compatibility/tf_upgrade_test.py,138,class, -12851,UnaliasedTFImport,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,39,class, -12852,VersionedTFImport,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,48,class, -12853,TFAPIImportAnalysisSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,61,class, -12854,CompatV1ImportReplacer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,72,class,"AST Visitor that replaces `import tensorflow.compat.v1 as tf`. +12065,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade.py,29,class,List of maps that describe what changed in the API. +12066,UnaliasedTFImport,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,39,class, +12067,VersionedTFImport,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,48,class, +12068,TFAPIImportAnalysisSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,61,class, +12069,CompatV1ImportReplacer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,72,class,"AST Visitor that replaces `import tensorflow.compat.v1 as tf`. Converts `import tensorflow.compat.v1 as tf` to `import tensorflow as tf`" -12855,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,92,class,List of maps that describe what changed in the API. -12856,_is_ast_str,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1678,function,Determine whether this node represents a string. -12857,_is_ast_true,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1690,function, -12858,_is_ast_false,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1697,function, -12859,_rename_if_arg_found_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1708,function,"Replaces the given call with tf.compat.v1 if the given arg is found. - -This requires the function to be called with all named args, so for using -this transformer, the function should also be added to renames. - -If the arg is not found, the call site is left alone. - -If the arg is found, and if arg_ok_predicate is given, it is called with -the ast Expression representing the argument value found. If it returns -True, the function is left alone. - -If the arg is found, arg_ok_predicate is not None and returns ok, and -remove_if_ok is True, the argument is removed from the call. - -Otherwise, `compat.v1` is inserted between tf and the function name. +12070,visit_Import,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,78,method,"Handle visiting an import node in the AST. Args: - parent: Parent of node. - node: ast.Call node to maybe modify. - full_name: full name of function to modify - name: name of function to modify - logs: list of logs to append to - arg_name: name of the argument to look for - arg_ok_predicate: predicate callable with the ast of the argument value, - returns whether the argument value is allowed. - remove_if_ok: remove the argument if present and ok as determined by - arg_ok_predicate. - message: message to print if a non-ok arg is found (and hence, the function - is renamed to its compat.v1 version). - -Returns: - node, if it was modified, else None." -12860,_add_argument_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1777,function,Adds an argument (as a final kwarg arg_name=arg_value_ast). -12861,_iterator_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1789,function,Transform iterator methods to compat function calls. -12862,_dropout_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1815,function,Replace keep_prob with 1-rate. -12863,_cast_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1856,function,"Transforms to_int and to_float to cast(..., dtype=...)." -12864,_softmax_cross_entropy_with_logits_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1895,function,Wrap labels argument with stop_gradients. -12865,_image_resize_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1934,function,"Transforms image.resize_* to image.resize(..., method=*, ...)." -12866,_pool_seed_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1982,function,"Removes seed2 and deterministic, and adds non-zero seed if needed." -12867,_extract_glimpse_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2032,function, -12868,_add_summary_step_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2069,function,"Adds a step argument to the summary API call if not specified. - -The inserted argument value is tf.compat.v1.train.get_or_create_global_step()." -12869,_add_summary_recording_cond_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2088,function,"Adds cond argument to tf.contrib.summary.xxx_record_summaries(). - -This is in anticipation of them being renamed to tf.summary.record_if(), which -requires the cond argument." -12870,_add_loss_reduction_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2103,function,"Adds a loss_reduction argument if not specified. - -Default value for tf.estimator.*Classifier and tf.estimator.*Regressor -loss_reduction argument changed to SUM_OVER_BATCH_SIZE. So, we update -existing calls to use the old default value `tf.keras.losses.Reduction.SUM`. - -Note: to apply this transformation, symbol must be added -to reordered_function_names above." -12871,_rename_if_any_arg_found_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2128,function,"Replaces the given call with tf.compat.v1 if any of the arg_names is found. - -Args: - parent: Parent of node. - node: ast.Call node to modify. - full_name: full name of function to modify. - name: name of function to modify. - logs: list of logs to append to. - arg_names: list of names of the argument to look for. - arg_ok_predicate: predicate callable with the ast of the argument value, - returns whether the argument value is allowed. - remove_if_ok: remove the argument if present and ok as determined by - arg_ok_predicate. - message: message to print if a non-ok arg is found (and hence, the function - is renamed to its compat.v1 version). - -Returns: - node, if it was modified, else None." -12872,_rename_if_arg_found_and_add_loss_reduction_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2167,function,"Combination of _rename_if_arg_found and _add_loss_reduction transformers. - -Args: - parent: Parent of node. - node: ast.Call node to maybe modify. - full_name: full name of function to modify - name: name of function to modify - logs: list of logs to append to - arg_names: list of names of the argument to look for - arg_ok_predicate: predicate callable with the ast of the argument value, - returns whether the argument value is allowed. - remove_if_ok: remove the argument if present and ok as determined by - arg_ok_predicate. - message: message to print if a non-ok arg is found (and hence, the function - is renamed to its compat.v1 version). - -Returns: - node, if it was modified, else None." -12873,_add_uniform_scaling_initializer_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2208,function,"Updates references to uniform_unit_scaling_initializer. - -Transforms: -tf.uniform_unit_scaling_initializer(factor, seed, dtype) to -tf.compat.v1.keras.initializers.VarianceScaling( - scale=factor, distribution=""uniform"", seed=seed) - -Note: to apply this transformation, symbol must be added -to reordered_function_names above." -12874,_contrib_layers_xavier_initializer_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2238,function,"Updates references to contrib.layers.xavier_initializer. - -Transforms: -tf.contrib.layers.xavier_initializer(uniform, seed, dtype) to -tf.compat.v1.keras.initializers.VarianceScaling( - scale=1.0, mode=""fan_avg"", - distribution=(""uniform"" if uniform else ""truncated_normal""), - seed=seed, dtype=dtype) - -Returns: The new node" -12875,_contrib_layers_variance_scaling_initializer_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2316,function,"Updates references to contrib.layers.variance_scaling_initializer. - -Transforms: -tf.contrib.layers.variance_scaling_initializer( - factor, mode, uniform, seed, dtype -) to -tf.compat.v1.keras.initializers.VarianceScaling( - scale=factor, mode=mode.lower(), - distribution=(""uniform"" if uniform else ""truncated_normal""), - seed=seed, dtype=dtype) - -And handles the case where no factor is provided and scale needs to be -set to 2.0 to match contrib's default instead of tf.keras.initializer's -default of 1.0" -12876,_contrib_layers_l1_regularizer_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2402,function,"Replace slim l1 regularizer with Keras one. - -This entails renaming the 'scale' arg to 'l' and dropping any -provided scope arg." -12877,_contrib_layers_l2_regularizer_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2441,function,"Replace slim l2 regularizer with Keras one, with l=0.5*scale. - -Also drops the scope argument." -12878,_name_scope_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2501,function,Fix name scope invocation to use 'default_name' and omit 'values' args. -12879,_rename_to_compat_v1,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2539,function, -12880,_rename_func,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2544,function, -12881,_string_split_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2553,function,"Update tf.string_split arguments: skip_empty, sep, result_type, source." -12882,_string_split_rtype_transformer,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,2596,function,"Update tf.strings.split arguments: result_type, source." -12883,process_file,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_main.py,42,function,Process a file of type `.py` or `.ipynb`. -12884,main,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_main.py,58,function, -12885,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_safety.py,26,class,List of maps that describe what changed in the API. -12886,TfUpgradeV2SafetyTest,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_safety_test.py,28,class, -12887,testTensorFlowDontChangeContrib,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_safety_test.py,176,function, -12888,test_contrib_to_addons_move,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_safety_test.py,185,function, -12889,get_symbol_for_name,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,42,function, -12890,get_args,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,51,function, -12891,get_func_and_args_from_str,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,60,function,"Parse call string to get function and argument names. + node: Current Node" +12071,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,92,class,List of maps that describe what changed in the API. +12072,preprocess,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1644,method, +12073,clear_preprocessing,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2.py,1674,method, +12074,process_file,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_main.py,42,function,Process a file of type `.py` or `.ipynb`. +12075,TFAPIChangeSpec,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_safety.py,26,class,List of maps that describe what changed in the API. +12076,get_symbol_for_name,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,42,function, +12077,get_args,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,51,function, +12078,get_func_and_args_from_str,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,60,function,"Parse call string to get function and argument names. Args: call_str: Call string must be in the form: @@ -115007,60 +124635,45 @@ Args: Returns: (function_name, list of arg names) tuple." -12892,TestUpgrade,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,81,class,"Test various APIs that have been changed in 2.0. - -We also test whether a converted file is executable. test_file_v1_10.py -aims to exhaustively test that API changes are convertible and actually -work when run with current TensorFlow." -12893,TestUpgradeFiles,tensorflow/tensorflow/tools/compatibility/tf_upgrade_v2_test.py,2388,class, -12894,TestUpgrade,tensorflow/tensorflow/tools/compatibility/testdata/test_file_v0_11.py,29,class,"Test various APIs that have been changed in 1.0. - -This test will not run in current TensorFlow, but did run in 0.11. -This file is intended to be converted by a genrule() that uses the converter -so that a 1.0 compatible version of this file is generated. That is run as -a unit test if the converter is successful." -12895,TestUpgrade,tensorflow/tensorflow/tools/compatibility/testdata/test_file_v1_12.py,28,class,Test various APIs that have been changed in 2.0. -12896,get_canonical_name,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,72,function, -12897,get_all_v2_names,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,78,function,Get a set of function/class names available in TensorFlow 2.0. -12898,collect_constant_renames,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,97,function,"Looks for constants that need to be renamed in TF 2.0. +12079,get_canonical_name,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,72,function, +12080,get_all_v2_names,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,78,function,Get a set of function/class names available in TensorFlow 2.0. +12081,collect_constant_renames,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,97,function,"Looks for constants that need to be renamed in TF 2.0. Returns: Set of tuples of the form (current name, new name)." -12899,collect_function_renames,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,128,function,"Looks for functions/classes that need to be renamed in TF 2.0. +12082,collect_function_renames,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,128,function,"Looks for functions/classes that need to be renamed in TF 2.0. Returns: Set of tuples of the form (current name, new name)." -12900,get_rename_line,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,162,function, -12901,update_renames_v2,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,166,function,"Writes a Python dictionary mapping deprecated to canonical API names. +12083,get_rename_line,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,162,function, +12084,update_renames_v2,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,166,function,"Writes a Python dictionary mapping deprecated to canonical API names. Args: output_file_path: File path to write output to. Any existing contents would be replaced." -12902,main,tensorflow/tensorflow/tools/compatibility/update/generate_v2_renames_map.py,191,function, -12903,collect_function_arg_names,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,69,function,"Determines argument names for reordered function signatures. +12085,collect_function_arg_names,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,69,function,"Determines argument names for reordered function signatures. Args: function_names: Functions to collect arguments for. Returns: Dictionary mapping function name to its arguments." -12904,get_reorder_line,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,111,function, -12905,update_reorders_v2,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,115,function,"Writes a Python dictionary mapping function name to argument order. +12086,get_reorder_line,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,111,function, +12087,update_reorders_v2,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,115,function,"Writes a Python dictionary mapping function name to argument order. Args: output_file_path: File path to write output to. Any existing contents would be replaced." -12906,main,tensorflow/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py,137,function, -12907,TfDockerTagValidator,tensorflow/tensorflow/tools/dockerfiles/assembler.py,228,class,"Custom Cerberus validator for TF tag spec. +12088,TfDockerTagValidator,tensorflow/tensorflow/tools/dockerfiles/assembler.py,228,class,"Custom Cerberus validator for TF tag spec. Note: Each _validate_foo function's docstring must end with a segment describing its own validation schema, e.g. ""The rule's arguments are..."". If you add a new validator, you can copy/paste that section." -12908,eprint,tensorflow/tensorflow/tools/dockerfiles/assembler.py,272,function, -12909,aggregate_all_slice_combinations,tensorflow/tensorflow/tools/dockerfiles/assembler.py,276,function,Figure out all of the possible slice groupings for a tag spec. -12910,build_name_from_slices,tensorflow/tensorflow/tools/dockerfiles/assembler.py,289,function,Build the tag name (cpu-devel...) from a list of slices. -12911,update_args_dict,tensorflow/tensorflow/tools/dockerfiles/assembler.py,302,function,Update a dict of arg values with more values from a list or dict. -12912,get_slice_sets_and_required_args,tensorflow/tensorflow/tools/dockerfiles/assembler.py,315,function,"Extract used-slice-sets and required CLI arguments from a spec string. +12089,eprint,tensorflow/tensorflow/tools/dockerfiles/assembler.py,272,function, +12090,aggregate_all_slice_combinations,tensorflow/tensorflow/tools/dockerfiles/assembler.py,276,function,Figure out all of the possible slice groupings for a tag spec. +12091,build_name_from_slices,tensorflow/tensorflow/tools/dockerfiles/assembler.py,289,function,Build the tag name (cpu-devel...) from a list of slices. +12092,update_args_dict,tensorflow/tensorflow/tools/dockerfiles/assembler.py,302,function,Update a dict of arg values with more values from a list or dict. +12093,get_slice_sets_and_required_args,tensorflow/tensorflow/tools/dockerfiles/assembler.py,315,function,"Extract used-slice-sets and required CLI arguments from a spec string. For example, {FOO}{bar}{bat} finds FOO, bar, and bat. Assuming bar and bat are both named slice sets, FOO must be specified on the command line. @@ -115071,10 +124684,10 @@ Args: Returns: (used_slice_sets, required_args), a tuple of lists" -12913,gather_tag_args,tensorflow/tensorflow/tools/dockerfiles/assembler.py,342,function,Build a dictionary of all the CLI and slice-specified args for a tag. -12914,gather_slice_list_items,tensorflow/tensorflow/tools/dockerfiles/assembler.py,360,function,"For a list of slices, get the flattened list of all of a certain key." -12915,find_first_slice_value,tensorflow/tensorflow/tools/dockerfiles/assembler.py,365,function,"For a list of slices, get the first value for a certain key." -12916,assemble_tags,tensorflow/tensorflow/tools/dockerfiles/assembler.py,373,function,"Gather all the tags based on our spec. +12094,gather_tag_args,tensorflow/tensorflow/tools/dockerfiles/assembler.py,342,function,Build a dictionary of all the CLI and slice-specified args for a tag. +12095,gather_slice_list_items,tensorflow/tensorflow/tools/dockerfiles/assembler.py,360,function,"For a list of slices, get the flattened list of all of a certain key." +12096,find_first_slice_value,tensorflow/tensorflow/tools/dockerfiles/assembler.py,365,function,"For a list of slices, get the first value for a certain key." +12097,assemble_tags,tensorflow/tensorflow/tools/dockerfiles/assembler.py,373,function,"Gather all the tags based on our spec. Args: spec: Nested dict containing full Tag spec @@ -115084,10 +124697,10 @@ Args: Returns: Dict of tags and how to build them" -12917,merge_partials,tensorflow/tensorflow/tools/dockerfiles/assembler.py,426,function,Merge all partial contents with their header. -12918,upload_in_background,tensorflow/tensorflow/tools/dockerfiles/assembler.py,432,function,Upload a docker image (to be used by multiprocessing). -12919,mkdir_p,tensorflow/tensorflow/tools/dockerfiles/assembler.py,438,function,"Create a directory and its parents, even if it already exists." -12920,gather_existing_partials,tensorflow/tensorflow/tools/dockerfiles/assembler.py,447,function,"Find and read all available partials. +12098,merge_partials,tensorflow/tensorflow/tools/dockerfiles/assembler.py,426,function,Merge all partial contents with their header. +12099,upload_in_background,tensorflow/tensorflow/tools/dockerfiles/assembler.py,432,function,Upload a docker image (to be used by multiprocessing). +12100,mkdir_p,tensorflow/tensorflow/tools/dockerfiles/assembler.py,438,function,"Create a directory and its parents, even if it already exists." +12101,gather_existing_partials,tensorflow/tensorflow/tools/dockerfiles/assembler.py,447,function,"Find and read all available partials. Args: partial_path (string): read partials from this directory. @@ -115095,10 +124708,8 @@ Args: Returns: Dict[string, string] of partial short names (like ""ubuntu/python"" or ""bazel"") to the full contents of that partial." -12921,main,tensorflow/tensorflow/tools/dockerfiles/assembler.py,473,function, -12922,get_base_dirs_and_prefixes,tensorflow/tensorflow/tools/docs/base_dir.py,29,function,Returns the base_dirs and code_prefixes for OSS TensorFlow api gen. -12923,main,tensorflow/tensorflow/tools/docs/build_java_api_docs.py,60,function, -12924,do_not_generate_docs,tensorflow/tensorflow/tools/docs/doc_controls.py,24,function,"A decorator: Do not generate docs for this object. +12102,get_base_dirs_and_prefixes,tensorflow/tensorflow/tools/docs/base_dir.py,29,function,Returns the base_dirs and code_prefixes for OSS TensorFlow api gen. +12103,do_not_generate_docs,tensorflow/tensorflow/tools/docs/doc_controls.py,24,function,"A decorator: Do not generate docs for this object. For example the following classes: @@ -115170,7 +124781,7 @@ Args: Returns: obj" -12925,do_not_doc_inheritable,tensorflow/tensorflow/tools/docs/doc_controls.py,105,function,"A decorator: Do not generate docs for this method. +12104,do_not_doc_inheritable,tensorflow/tensorflow/tools/docs/doc_controls.py,105,function,"A decorator: Do not generate docs for this method. This version of the decorator is ""inherited"" by subclasses. No docs will be generated for the decorated method in any subclass. Even if the sub-class @@ -115224,7 +124835,7 @@ Args: Returns: obj" -12926,for_subclass_implementers,tensorflow/tensorflow/tools/docs/doc_controls.py,168,function,"A decorator: Only generate docs for this method in the defining class. +12105,for_subclass_implementers,tensorflow/tensorflow/tools/docs/doc_controls.py,168,function,"A decorator: Only generate docs for this method in the defining class. Also group this method's docs with and `@abstractmethod` in the class's docs. @@ -115293,7 +124904,7 @@ Args: Returns: obj" -12927,should_skip,tensorflow/tensorflow/tools/docs/doc_controls.py,246,function,"Returns true if docs generation should be skipped for this object. +12106,should_skip,tensorflow/tensorflow/tools/docs/doc_controls.py,246,function,"Returns true if docs generation should be skipped for this object. checks for the `do_not_generate_docs` or `do_not_doc_inheritable` decorators. @@ -115302,7 +124913,7 @@ Args: Returns: True if the object should be skipped" -12928,should_skip_class_attr,tensorflow/tensorflow/tools/docs/doc_controls.py,264,function,"Returns true if docs should be skipped for this class attribute. +12107,should_skip_class_attr,tensorflow/tensorflow/tools/docs/doc_controls.py,264,function,"Returns true if docs should be skipped for this class attribute. Args: cls: The class the attribute belongs to. @@ -115310,20 +124921,58 @@ Args: Returns: True if the attribute should be skipped." -12929,DocControlsTest,tensorflow/tensorflow/tools/docs/doc_controls_test.py,25,class, -12930,DocGeneratorVisitor,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,28,class,A visitor that generates docs for a python object when __call__ed. -12931,generate_raw_ops_doc,tensorflow/tensorflow/tools/docs/generate2.py,97,function,Generates docs for `tf.raw_ops`. -12932,TfExportAwareVisitor,tensorflow/tensorflow/tools/docs/generate2.py,134,class,"A `tf_export`, `keras_export` and `estimator_export` aware doc_visitor." -12933,_hide_layer_and_module_methods,tensorflow/tensorflow/tools/docs/generate2.py,154,function,Hide methods and properties defined in the base classes of keras layers. -12934,build_docs,tensorflow/tensorflow/tools/docs/generate2.py,176,function,"Build api docs for tensorflow v2. +12108,DocGeneratorVisitor,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,28,class,A visitor that generates docs for a python object when __call__ed. +12109,set_root_name,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,49,method,Sets the root name for subsequent __call__s. +12110,index,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,55,method,"A map from fully qualified names to objects to be documented. + +The index is filled when the visitor is passed to `traverse`. + +Returns: + The index filled by traversal." +12111,tree,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,66,method,"A map from fully qualified names to all its child names for traversal. + +The full name to member names map is filled when the visitor is passed to +`traverse`. + +Returns: + The full name to member name map filled by traversal." +12112,reverse_index,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,78,method,"A map from `id(object)` to the preferred fully qualified name. + +This map only contains non-primitive objects (no numbers or strings) present +in `index` (for primitive objects, `id()` doesn't quite do the right thing). + +It is computed when it, `duplicate_of`, or `duplicates` are first accessed. + +Returns: + The `id(object)` to full name map." +12113,duplicate_of,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,93,method,"A map from duplicate full names to a preferred fully qualified name. + +This map only contains names that are not themself a preferred name. + +It is computed when it, `reverse_index`, or `duplicates` are first accessed. + +Returns: + The map from duplicate name to preferred name." +12114,duplicates,tensorflow/tensorflow/tools/docs/doc_generator_visitor.py,107,method,"A map from preferred full names to a list of all names for this symbol. + +This function returns a map from preferred (master) name for a symbol to a +lexicographically sorted list of all aliases for that name (incl. the master +name). Symbols without duplicate names do not appear in this map. + +It is computed when it, `reverse_index`, or `duplicate_of` are first +accessed. + +Returns: + The map from master name to list of all duplicate names." +12115,generate_raw_ops_doc,tensorflow/tensorflow/tools/docs/generate2.py,97,function,Generates docs for `tf.raw_ops`. +12116,TfExportAwareVisitor,tensorflow/tensorflow/tools/docs/generate2.py,134,class,"A `tf_export`, `keras_export` and `estimator_export` aware doc_visitor." +12117,build_docs,tensorflow/tensorflow/tools/docs/generate2.py,176,function,"Build api docs for tensorflow v2. Args: output_dir: A string path, where to put the files. code_url_prefix: prefix for ""Defined in"" links. search_hints: Bool. Include meta-data search hints at the top of each file." -12935,main,tensorflow/tensorflow/tools/docs/generate2.py,283,function, -12936,Generate2Test,tensorflow/tensorflow/tools/docs/generate2_test.py,44,class, -12937,write_docs,tensorflow/tensorflow/tools/docs/generate_lib.py,40,function,"Write previously extracted docs to disk. +12118,write_docs,tensorflow/tensorflow/tools/docs/generate_lib.py,40,function,"Write previously extracted docs to disk. Write a docs page for each symbol included in the indices of parser_config to a tree of docs at `output_dir`. @@ -115345,25 +124994,15 @@ Args: Raises: ValueError: if `output_dir` is not an absolute path" -12938,add_dict_to_dict,tensorflow/tensorflow/tools/docs/generate_lib.py,221,function, -12939,_get_default_private_map,tensorflow/tensorflow/tools/docs/generate_lib.py,230,function, -12940,_get_default_do_not_descend_map,tensorflow/tensorflow/tools/docs/generate_lib.py,239,function, -12941,DocControlsAwareCrawler,tensorflow/tensorflow/tools/docs/generate_lib.py,246,class,A `docs_controls` aware API-crawler. -12942,extract,tensorflow/tensorflow/tools/docs/generate_lib.py,255,function,Extract docs from tf namespace and write them to disk. -12943,_GetMarkdownTitle,tensorflow/tensorflow/tools/docs/generate_lib.py,278,class,Extract the title from a .md file. -12944,_DocInfo,tensorflow/tensorflow/tools/docs/generate_lib.py,290,class,A simple struct for holding a doc's url and title. -12945,build_doc_index,tensorflow/tensorflow/tools/docs/generate_lib.py,298,function,Build an index from a keyword designating a doc to _DocInfo objects. -12946,_GuideRef,tensorflow/tensorflow/tools/docs/generate_lib.py,332,class, -12947,_GenerateGuideIndex,tensorflow/tensorflow/tools/docs/generate_lib.py,344,class,Turn guide files into an index from symbol name to a list of _GuideRefs. -12948,_build_guide_index,tensorflow/tensorflow/tools/docs/generate_lib.py,378,function,Return dict: symbol name -> _GuideRef from the files in `guide_src_dir`. -12949,_UpdateTags,tensorflow/tensorflow/tools/docs/generate_lib.py,387,class,"Rewrites a Python guide so that each section has an explicit id tag. - -""section"" here refers to blocks delimited by second level headings." -12950,update_id_tags_inplace,tensorflow/tensorflow/tools/docs/generate_lib.py,397,function,"Set explicit ids on all second-level headings to ensure back-links work. +12119,add_dict_to_dict,tensorflow/tensorflow/tools/docs/generate_lib.py,221,function, +12120,DocControlsAwareCrawler,tensorflow/tensorflow/tools/docs/generate_lib.py,246,class,A `docs_controls` aware API-crawler. +12121,extract,tensorflow/tensorflow/tools/docs/generate_lib.py,255,function,Extract docs from tf namespace and write them to disk. +12122,build_doc_index,tensorflow/tensorflow/tools/docs/generate_lib.py,298,function,Build an index from a keyword designating a doc to _DocInfo objects. +12123,update_id_tags_inplace,tensorflow/tensorflow/tools/docs/generate_lib.py,397,function,"Set explicit ids on all second-level headings to ensure back-links work. Args: src_dir: The directory of md-files to convert (inplace)." -12951,replace_refs,tensorflow/tensorflow/tools/docs/generate_lib.py,421,function,"Fix @{} references in all files under `src_dir` matching `file_pattern`. +12124,replace_refs,tensorflow/tensorflow/tools/docs/generate_lib.py,421,function,"Fix @{} references in all files under `src_dir` matching `file_pattern`. A matching directory structure, with the modified files is written to `output_dir`. @@ -115382,8 +125021,46 @@ Args: file_pattern: Only replace references in files matching file_patters, using fnmatch. Non-matching files are copied unchanged. api_docs_relpath: Relative-path string to the api_docs, from the src_dir." -12952,DocGenerator,tensorflow/tensorflow/tools/docs/generate_lib.py,483,class,Main entry point for generating docs. -12953,is_free_function,tensorflow/tensorflow/tools/docs/parser.py,40,function,"Check if input is a free function (and not a class- or static method). +12125,DocGenerator,tensorflow/tensorflow/tools/docs/generate_lib.py,483,class,Main entry point for generating docs. +12126,add_output_dir_argument,tensorflow/tensorflow/tools/docs/generate_lib.py,512,method, +12127,add_src_dir_argument,tensorflow/tensorflow/tools/docs/generate_lib.py,520,method, +12128,add_base_dir_argument,tensorflow/tensorflow/tools/docs/generate_lib.py,528,method, +12129,parse_known_args,tensorflow/tensorflow/tools/docs/generate_lib.py,535,method, +12130,add_to_private_map,tensorflow/tensorflow/tools/docs/generate_lib.py,539,method, +12131,add_to_do_not_descend_map,tensorflow/tensorflow/tools/docs/generate_lib.py,542,method, +12132,set_private_map,tensorflow/tensorflow/tools/docs/generate_lib.py,545,method, +12133,set_do_not_descend_map,tensorflow/tensorflow/tools/docs/generate_lib.py,548,method, +12134,set_py_modules,tensorflow/tensorflow/tools/docs/generate_lib.py,551,method, +12135,py_module_names,tensorflow/tensorflow/tools/docs/generate_lib.py,554,method, +12136,make_reference_resolver,tensorflow/tensorflow/tools/docs/generate_lib.py,560,method, +12137,make_parser_config,tensorflow/tensorflow/tools/docs/generate_lib.py,564,method, +12138,run_extraction,tensorflow/tensorflow/tools/docs/generate_lib.py,576,method, +12139,build,tensorflow/tensorflow/tools/docs/generate_lib.py,580,method,"Build all the docs. + +This produces two outputs + +python api docs: + + * generated from modules set with `set_py_modules`. + * written to '{FLAGS.output_dir}/api_docs/python/' + +non-api docs: + + * Everything in '{FLAGS.src_dir}' is copied to '{FLAGS.output_dir}'. + * '@{}' references in '.md' files are replaced with links. + * '.md' files under 'api_guides/python' have explicit ids set for their + second level headings. + +Args: + flags: + * src_dir: Where to fetch the non-api-docs. + * base_dir: Base of the docs directory (Used to build correct + relative links). + * output_dir: Where to write the resulting docs. + +Returns: + The number of errors encountered while processing." +12140,is_free_function,tensorflow/tensorflow/tools/docs/parser.py,40,function,"Check if input is a free function (and not a class- or static method). Args: py_object: The the object in question. @@ -115393,9 +125070,8 @@ Args: Returns: True if the obeject is a stand-alone function, and not part of a class definition." -12954,TFDocsError,tensorflow/tensorflow/tools/docs/parser.py,66,class, -12955,_Errors,tensorflow/tensorflow/tools/docs/parser.py,70,class,A collection of errors. -12956,documentation_path,tensorflow/tensorflow/tools/docs/parser.py,101,function,"Returns the file path for the documentation for the given API symbol. +12141,TFDocsError,tensorflow/tensorflow/tools/docs/parser.py,66,class, +12142,documentation_path,tensorflow/tensorflow/tools/docs/parser.py,101,function,"Returns the file path for the documentation for the given API symbol. Given the fully qualified name of a library symbol, compute the path to which to write the documentation for that symbol (relative to a base directory). @@ -115409,166 +125085,97 @@ Args: `tf/a/b.md#c` Returns: The file path to which to write the documentation for `full_name`." -12957,_get_raw_docstring,tensorflow/tensorflow/tools/docs/parser.py,129,function,"Get the docs for a given python object. - -Args: - py_object: A python object to retrieve the docs for (class, function/method, - or module). - -Returns: - The docstring, or the empty string if no docstring was found." -12958,ReferenceResolver,tensorflow/tensorflow/tools/docs/parser.py,164,class,"Class for replacing @{...} references with Markdown links. +12143,ReferenceResolver,tensorflow/tensorflow/tools/docs/parser.py,164,class,"Class for replacing @{...} references with Markdown links. Attributes: current_doc_full_name: A string (or None) indicating the name of the document currently being processed, so errors can reference the broken doc." -12959,_handle_compatibility,tensorflow/tensorflow/tools/docs/parser.py,477,function,"Parse and remove compatibility blocks from the main docstring. +12144,add_error,tensorflow/tensorflow/tools/docs/parser.py,195,method, +12145,log_errors,tensorflow/tensorflow/tools/docs/parser.py,198,method, +12146,num_errors,tensorflow/tensorflow/tools/docs/parser.py,201,method, +12147,from_visitor,tensorflow/tensorflow/tools/docs/parser.py,205,method,"A factory function for building a ReferenceResolver from a visitor. Args: - doc: The docstring that contains compatibility notes"" + visitor: an instance of `DocGeneratorVisitor` + doc_index: a dictionary mapping document names to references objects with + ""title"" and ""url"" fields + **kwargs: all remaining args are passed to the constructor +Returns: + an instance of `ReferenceResolver` ()" +12148,from_json_file,tensorflow/tensorflow/tools/docs/parser.py,231,method, +12149,to_json_file,tensorflow/tensorflow/tools/docs/parser.py,237,method,"Converts the RefenceResolver to json and writes it to the specified file. + +Args: + filepath: The file path to write the json to." +12150,replace_references,tensorflow/tensorflow/tools/docs/parser.py,262,method,"Replace ""@{symbol}"" references with links to symbol's documentation page. + +This functions finds all occurrences of ""@{symbol}"" in `string` +and replaces them with markdown links to the documentation page +for ""symbol"". + +`relative_path_to_root` is the relative path from the document +that contains the ""@{symbol}"" reference to the root of the API +documentation that is linked to. If the containing page is part of +the same API docset, `relative_path_to_root` can be set to +`os.path.dirname(documentation_path(name))`, where `name` is the +python name of the object whose documentation page the reference +lives on. + +Args: + string: A string in which ""@{symbol}"" references should be replaced. + relative_path_to_root: The relative path from the containing document to + the root of the API documentation that is being linked to. Returns: - a tuple of the modified doc string and a hash that maps from compatibility - note type to the text of the note." -12960,_gen_pairs,tensorflow/tensorflow/tools/docs/parser.py,496,function,"Given an list of items [a,b,a,b...], generate pairs [(a,b),(a,b)...]. + `string`, with ""@{symbol}"" references replaced by Markdown links." +12151,python_link,tensorflow/tensorflow/tools/docs/parser.py,305,method,"Resolve a ""@{python symbol}"" reference to a Markdown link. + +This will pick the canonical location for duplicate symbols. The +input to this function should already be stripped of the '@' and +'{}'. This function returns a Markdown link. If `code_ref` is +true, it is assumed that this is a code reference, so the link +text will be rendered as code (using backticks). +`link_text` should refer to a library symbol, starting with 'tf.'. Args: - items: A list of items (length must be even) - -Yields: - The original items, in pairs" -12961,_FunctionDetail,tensorflow/tensorflow/tools/docs/parser.py,514,class,"A simple class to contain function details. - -Composed of a ""keyword"", a possibly empty ""header"" string, and a possibly -empty -list of key-value pair ""items""." -12962,_parse_function_details,tensorflow/tensorflow/tools/docs/parser.py,535,function,"Given a docstring, split off the header and parse the function details. - -For example the docstring of tf.nn.relu: - -'''Computes rectified linear: `max(features, 0)`. - -Args: - features: A `Tensor`. Must be one of the following types: `float32`, - `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, - `half`. - name: A name for the operation (optional). - -Returns: - A `Tensor`. Has the same type as `features`. -''' - -This is parsed, and returned as: - -``` -('Computes rectified linear: `max(features, 0)`.\n\n', [ - _FunctionDetail( - keyword='Args', - header='', - items=[ - ('features', ' A `Tensor`. Must be ...'), - ('name', ' A name for the operation (optional).\n\n')]), - _FunctionDetail( - keyword='Returns', - header=' A `Tensor`. Has the same type as `features`.', - items=[]) -]) -``` - -Args: - docstring: The docstring to parse - -Returns: - A (header, function_details) pair, where header is a string and - function_details is a (possibly empty) list of `_FunctionDetail` objects." -12963,_parse_md_docstring,tensorflow/tensorflow/tools/docs/parser.py,607,function,"Parse the object's docstring and return a `_DocstringInfo`. - -This function clears @@'s from the docstring, and replaces @{} references -with markdown links. - -For links within the same set of docs, the `relative_path_to_root` for a -docstring on the page for `full_name` can be set to: - -```python -relative_path_to_root = os.path.relpath( - path='.', start=os.path.dirname(documentation_path(full_name)) or '.') -``` - -Args: - py_object: A python object to retrieve the docs for (class, function/method, - or module). + link_text: The text of the Markdown link. + ref_full_name: The fully qualified name of the symbol to link to. relative_path_to_root: The relative path from the location of the current - document to the root of the Python API documentation. This is used to - compute links for ""@{symbol}"" references. - reference_resolver: An instance of ReferenceResolver. + document to the root of the API documentation. + code_ref: If true (the default), put `link_text` in `...`. Returns: - A _DocstringInfo object, all fields will be empty if no docstring was found." -12964,_get_arg_spec,tensorflow/tensorflow/tools/docs/parser.py,653,function,"Extracts signature information from a function or functools.partial object. + A markdown link to the documentation page of `ref_full_name`." +12152,py_master_name,tensorflow/tensorflow/tools/docs/parser.py,340,method,Return the master name for a Python symbol name. +12153,reference_to_url,tensorflow/tensorflow/tools/docs/parser.py,344,method,"Resolve a ""@{python symbol}"" reference to a relative path. -For functions, uses `tf_inspect.getfullargspec`. For `functools.partial` -objects, corrects the signature of the underlying function to take into -account the removed arguments. +The input to this function should already be stripped of the '@' +and '{}', and its output is only the link, not the full Markdown. + +If `ref_full_name` is the name of a class member, method, or property, the +link will point to the page of the containing class, and it will include the +method name as an anchor. For example, `tf.module.MyClass.my_method` will be +translated into a link to +`os.join.path(relative_path_to_root, 'tf/module/MyClass.md#my_method')`. Args: - func: A function whose signature to extract. + ref_full_name: The fully qualified name of the symbol to link to. + relative_path_to_root: The relative path from the location of the current + document to the root of the API documentation. Returns: - An `FullArgSpec` namedtuple `(args, varargs, varkw, defaults, etc.)`, - as returned by `tf_inspect.getfullargspec`." -12965,_remove_first_line_indent,tensorflow/tensorflow/tools/docs/parser.py,704,function, -12966,_generate_signature,tensorflow/tensorflow/tools/docs/parser.py,713,function,"Given a function, returns a list of strings representing its args. + A relative path that links from the documentation page of `from_full_name` + to the documentation page of `ref_full_name`. -This function produces a list of strings representing the arguments to a -python function. It uses tf_inspect.getfullargspec, which -does not generalize well to Python 3.x, which is more flexible in how *args -and **kwargs are handled. This is not a problem in TF, since we have to remain -compatible to Python 2.7 anyway. - -This function uses `__name__` for callables if it is available. This can lead -to poor results for functools.partial and other callable objects. - -The returned string is Python code, so if it is included in a Markdown -document, it should be typeset as code (using backticks), or escaped. - -Args: - func: A function, method, or functools.partial to extract the signature for. - reverse_index: A map from object ids to canonical full names to use. - -Returns: - A list of strings representing the argument signature of `func` as python - code." -12967,_get_guides_markdown,tensorflow/tensorflow/tools/docs/parser.py,812,function, -12968,_get_defining_class,tensorflow/tensorflow/tools/docs/parser.py,824,function, -12969,_LinkInfo,tensorflow/tensorflow/tools/docs/parser.py,831,class, -12970,_OtherMemberInfo,tensorflow/tensorflow/tools/docs/parser.py,841,class, -12971,_FunctionPageInfo,tensorflow/tensorflow/tools/docs/parser.py,859,class,Collects docs For a function Page. -12972,_ClassPageInfo,tensorflow/tensorflow/tools/docs/parser.py,947,class,"Collects docs for a class page. - -Attributes: - full_name: The fully qualified name of the object at the master - location. Aka `master_name`. For example: `tf.nn.sigmoid`. - short_name: The last component of the `full_name`. For example: `sigmoid`. - defined_in: The path to the file where this object is defined. - aliases: The list of all fully qualified names for the locations where the - object is visible in the public api. This includes the master location. - doc: A `_DocstringInfo` object representing the object's docstring (can be - created with `_parse_md_docstring`). - guides: A markdown string, of back links pointing to the api_guides that - reference this object. - bases: A list of `_LinkInfo` objects pointing to the docs for the parent - classes. - properties: A list of `_PropertyInfo` objects documenting the class' - properties (attributes that use `@property`). - methods: A list of `_MethodInfo` objects documenting the class' methods. - classes: A list of `_LinkInfo` objects pointing to docs for any nested - classes. - other_members: A list of `_OtherMemberInfo` objects documenting any other - object's defined inside the class object (mostly enum style fields)." -12973,_ModulePageInfo,tensorflow/tensorflow/tools/docs/parser.py,1313,class,Collects docs for a module page. -12974,ParserConfig,tensorflow/tensorflow/tools/docs/parser.py,1459,class,Stores all indexes required to parse the docs. -12975,docs_for_object,tensorflow/tensorflow/tools/docs/parser.py,1501,function,"Return a PageInfo object describing a given object from the TF API. +Raises: + RuntimeError: If `ref_full_name` is not documented. + TFDocsError: If the @{} syntax cannot be decoded." +12154,strict_one_ref,tensorflow/tensorflow/tools/docs/parser.py,286,method, +12155,sloppy_one_ref,tensorflow/tensorflow/tools/docs/parser.py,295,method, +12156,ParserConfig,tensorflow/tensorflow/tools/docs/parser.py,1459,class,Stores all indexes required to parse the docs. +12157,py_name_to_object,tensorflow/tensorflow/tools/docs/parser.py,1496,method,Return the Python object for a Python symbol name. +12158,docs_for_object,tensorflow/tensorflow/tools/docs/parser.py,1501,function,"Return a PageInfo object describing a given object from the TF API. This function uses _parse_md_docstring to parse the docs pertaining to `object`. @@ -115595,29 +125202,7 @@ Returns: Raises: RuntimeError: If an object is encountered for which we don't know how to make docs." -12976,_PythonBuiltin,tensorflow/tensorflow/tools/docs/parser.py,1570,class,"This class indicated that the object in question is a python builtin. - -This can be used for the `defined_in` slot of the `PageInfo` objects." -12977,_PythonFile,tensorflow/tensorflow/tools/docs/parser.py,1589,class,"This class indicates that the object is defined in a regular python file. - -This can be used for the `defined_in` slot of the `PageInfo` objects." -12978,_ProtoFile,tensorflow/tensorflow/tools/docs/parser.py,1615,class,"This class indicates that the object is defined in a .proto file. - -This can be used for the `defined_in` slot of the `PageInfo` objects." -12979,_GeneratedFile,tensorflow/tensorflow/tools/docs/parser.py,1641,class,"This class indicates that the object is defined in a generated python file. - -Generated files should not be linked to directly. - -This can be used for the `defined_in` slot of the `PageInfo` objects." -12980,_get_defined_in,tensorflow/tensorflow/tools/docs/parser.py,1666,function,"Returns a description of where the passed in python object was defined. - -Args: - py_object: The Python object. - parser_config: A ParserConfig object. - -Returns: - Either a `_PythonBuiltin`, `_PythonFile`, or a `_GeneratedFile`" -12981,generate_global_index,tensorflow/tensorflow/tools/docs/parser.py,1711,function,"Given a dict of full names to python objects, generate an index page. +12159,generate_global_index,tensorflow/tensorflow/tools/docs/parser.py,1711,function,"Given a dict of full names to python objects, generate an index page. The index page generated contains a list of links for all symbols in `index` that have their own documentation page. @@ -115629,12 +125214,7 @@ Args: Returns: A string containing an index page as Markdown." -12982,_Metadata,tensorflow/tensorflow/tools/docs/parser.py,1749,class,"A class for building a page's Metadata block. - -Attributes: - name: The name of the page being described by the Metadata block. - version: The source version." -12983,build_md_page,tensorflow/tensorflow/tools/docs/pretty_docs.py,36,function,"Given a PageInfo object, return markdown for the page. +12160,build_md_page,tensorflow/tensorflow/tools/docs/pretty_docs.py,36,function,"Given a PageInfo object, return markdown for the page. Args: page_info: must be a `parser.FunctionPageInfo`, `parser.ClassPageInfo`, or @@ -115645,36 +125225,27 @@ Returns: Raises: ValueError: if `page_info` is an instance of an unrecognized class" -12984,_build_function_page,tensorflow/tensorflow/tools/docs/pretty_docs.py,61,function,Given a FunctionPageInfo object Return the page as an md string. -12985,_build_class_page,tensorflow/tensorflow/tools/docs/pretty_docs.py,82,function,Given a ClassPageInfo object Return the page as an md string. -12986,_build_method_section,tensorflow/tensorflow/tools/docs/pretty_docs.py,170,function,"Generates a markdown section for a method. - -Args: - method_info: A `MethodInfo` object. - heading_level: An Int, which HTML heading level to use. - -Returns: - A markdown string." -12987,_build_module_page,tensorflow/tensorflow/tools/docs/pretty_docs.py,197,function,Given a ClassPageInfo object Return the page as an md string. -12988,_build_signature,tensorflow/tensorflow/tools/docs/pretty_docs.py,260,function,Returns a md code block showing the function signature. -12989,_build_compatibility,tensorflow/tensorflow/tools/docs/pretty_docs.py,292,function,Return the compatibility section as an md string. -12990,_build_function_details,tensorflow/tensorflow/tools/docs/pretty_docs.py,306,function,Return the function details section as an md string. -12991,_build_aliases,tensorflow/tensorflow/tools/docs/pretty_docs.py,320,function, -12992,md_files_in_dir,tensorflow/tensorflow/tools/docs/py_guide_parser.py,29,function,"Returns a list of filename (full_path, base) pairs for guide files." -12993,PyGuideParser,tensorflow/tensorflow/tools/docs/py_guide_parser.py,38,class,"Simple parsing of a guide .md file. +12161,md_files_in_dir,tensorflow/tensorflow/tools/docs/py_guide_parser.py,29,function,"Returns a list of filename (full_path, base) pairs for guide files." +12162,PyGuideParser,tensorflow/tensorflow/tools/docs/py_guide_parser.py,38,class,"Simple parsing of a guide .md file. Descendants can override the process_*() functions (called by process()) to either record information from the guide, or call replace_line() to affect the return value of process()." -12994,recursive_import,tensorflow/tensorflow/tools/docs/tf_doctest.py,58,function,"Recursively imports all the sub-modules under a root package. +12163,process,tensorflow/tensorflow/tools/docs/py_guide_parser.py,49,method,Read and process the file at `full_path`. +12164,replace_line,tensorflow/tensorflow/tools/docs/py_guide_parser.py,89,method,Replace the contents of line numbered `line_number` with `line`. +12165,process_title,tensorflow/tensorflow/tools/docs/py_guide_parser.py,93,method, +12166,process_section,tensorflow/tensorflow/tools/docs/py_guide_parser.py,96,method, +12167,process_in_blockquote,tensorflow/tensorflow/tools/docs/py_guide_parser.py,99,method, +12168,process_line,tensorflow/tensorflow/tools/docs/py_guide_parser.py,102,method, +12169,recursive_import,tensorflow/tensorflow/tools/docs/tf_doctest.py,58,function,"Recursively imports all the sub-modules under a root package. Args: root: A python package." -12995,find_modules,tensorflow/tensorflow/tools/docs/tf_doctest.py,72,function,"Finds all the modules in the core package imported. +12170,find_modules,tensorflow/tensorflow/tools/docs/tf_doctest.py,72,function,"Finds all the modules in the core package imported. Returns: A list containing all the modules in tensorflow.python." -12996,filter_on_submodules,tensorflow/tensorflow/tools/docs/tf_doctest.py,87,function,"Filters all the modules based on the modules flag. +12171,filter_on_submodules,tensorflow/tensorflow/tools/docs/tf_doctest.py,87,function,"Filters all the modules based on the modules flag. The module flag has to be relative to the core package imported. For example, if `module=keras.layers` then, this function will return @@ -115686,14 +125257,14 @@ Args: Returns: All the modules in the submodule." -12997,get_module_and_inject_docstring,tensorflow/tensorflow/tools/docs/tf_doctest.py,109,function,"Replaces the docstring of the module with the changed file's content. +12172,get_module_and_inject_docstring,tensorflow/tensorflow/tools/docs/tf_doctest.py,109,function,"Replaces the docstring of the module with the changed file's content. Args: file_path: Path to the file Returns: A list containing the module changed by the file." -12998,setup_gpu,tensorflow/tensorflow/tools/docs/tf_doctest.py,132,function,"Sets up the GPU devices. +12173,setup_gpu,tensorflow/tensorflow/tools/docs/tf_doctest.py,132,function,"Sets up the GPU devices. If there're more available GPUs than needed, it hides the additional ones. If there're less, it creates logical devices. This is to make sure the tests see @@ -115704,27 +125275,9 @@ Args: Raises: ValueError: if num_gpus is larger than zero but no GPU is available." -12999,TfTestCase,tensorflow/tensorflow/tools/docs/tf_doctest.py,164,class, -13000,load_tests,tensorflow/tensorflow/tools/docs/tf_doctest.py,173,function,Loads all the tests in the docstrings and runs them. -13001,setUpModule,tensorflow/tensorflow/tools/docs/tf_doctest.py,219,function, -13002,_FloatExtractor,tensorflow/tensorflow/tools/docs/tf_doctest_lib.py,29,class,"Class for extracting floats from a string. - -For example: - ->>> text_parts, floats = _FloatExtractor()(""Text 1.0 Text"") ->>> text_parts -[""Text "", "" Text""] ->>> floats -np.array([1.0])" -13003,TfDoctestOutputChecker,tensorflow/tensorflow/tools/docs/tf_doctest_lib.py,104,class,"Changes the `want` and `got` strings. - -This allows it to be customized before they are compared." -13004,TfDoctestOutputCheckerTest,tensorflow/tensorflow/tools/docs/tf_doctest_test.py,30,class, -13005,create_examples,tensorflow/tensorflow/tools/gcs_test/python/gcs_smoke.py,39,function,Create ExampleProto's containing data. -13006,create_dir_test,tensorflow/tensorflow/tools/gcs_test/python/gcs_smoke.py,54,function,Verifies file_io directory handling methods. -13007,create_object_test,tensorflow/tensorflow/tools/gcs_test/python/gcs_smoke.py,128,function,Verifies file_io's object manipulation methods . -13008,main,tensorflow/tensorflow/tools/gcs_test/python/gcs_smoke.py,192,function, -13009,parse_branch_ref,tensorflow/tensorflow/tools/git/gen_git_source.py,39,function,"Given a filename of a .git/HEAD file return ref path. +12174,setUpModule,tensorflow/tensorflow/tools/docs/tf_doctest.py,219,function, +12175,create_examples,tensorflow/tensorflow/tools/gcs_test/python/gcs_smoke.py,39,function,Create ExampleProto's containing data. +12176,parse_branch_ref,tensorflow/tensorflow/tools/git/gen_git_source.py,39,function,"Given a filename of a .git/HEAD file return ref path. In particular, if git is in detached head state, this will return None. If git is in attached head, it will return @@ -115739,8 +125292,8 @@ Returns: None if detached head, otherwise ref subpath Raises: RuntimeError: if the HEAD file is unparseable." -13010,configure,tensorflow/tensorflow/tools/git/gen_git_source.py,67,function,Configure `src_base_path` to embed git hashes if available. -13011,get_git_version,tensorflow/tensorflow/tools/git/gen_git_source.py,144,function,"Get the git version from the repository. +12177,configure,tensorflow/tensorflow/tools/git/gen_git_source.py,67,function,Configure `src_base_path` to embed git hashes if available. +12178,get_git_version,tensorflow/tensorflow/tools/git/gen_git_source.py,144,function,"Get the git version from the repository. This function runs `git describe ...` in the path given as `git_base_path`. This will return a string of the form: @@ -115757,12 +125310,12 @@ Args: created. Returns: A bytestring representing the git version" -13012,write_version_info,tensorflow/tensorflow/tools/git/gen_git_source.py,190,function,"Write a c file that defines the version functions. +12179,write_version_info,tensorflow/tensorflow/tools/git/gen_git_source.py,190,function,"Write a c file that defines the version functions. Args: filename: filename to write to. git_version: the result of a git describe." -13013,generate,tensorflow/tensorflow/tools/git/gen_git_source.py,229,function,"Generate version_info.cc as given `destination_file`. +12180,generate,tensorflow/tensorflow/tools/git/gen_git_source.py,229,function,"Generate version_info.cc as given `destination_file`. Args: arglist: should be a sequence that contains @@ -115787,7 +125340,7 @@ Args: Raises: RuntimeError: If ./configure needs to be run, RuntimeError will be raised." -13014,raw_generate,tensorflow/tensorflow/tools/git/gen_git_source.py,274,function,"Simple generator used for cmake/make build systems. +12181,raw_generate,tensorflow/tensorflow/tools/git/gen_git_source.py,274,function,"Simple generator used for cmake/make build systems. This does not create any symlinks. It requires the build system to build unconditionally. @@ -115798,7 +125351,7 @@ Args: git_tag_override: Override the value for the git tag. This is useful for releases where we want to build the release before the git tag is created." -13015,TransformGraph,tensorflow/tensorflow/tools/graph_transforms/__init__.py,26,function,"Python wrapper for the Graph Transform Tool. +12182,TransformGraph,tensorflow/tensorflow/tools/graph_transforms/__init__.py,26,function,"Python wrapper for the Graph Transform Tool. Gives access to all graph transforms available through the command line tool. See documentation at https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/graph_transforms/README.md @@ -115812,77 +125365,140 @@ Args: Returns: New GraphDef with transforms applied." -13016,TransformGraphTest,tensorflow/tensorflow/tools/graph_transforms/python/transform_graph_test.py,29,class, -13017,check_output_despite_error,tensorflow/tensorflow/tools/pip_package/check_load_py_test.py,28,function,"Get output of args from command line, even if there are errors. +12183,check_output_despite_error,tensorflow/tensorflow/tools/pip_package/check_load_py_test.py,28,function,"Get output of args from command line, even if there are errors. Args: args: a list of command line args. Returns: output as string." -13018,main,tensorflow/tensorflow/tools/pip_package/check_load_py_test.py,44,function, -13019,GetBuild,tensorflow/tensorflow/tools/pip_package/pip_smoke_test.py,44,function,Get the list of BUILD file all targets recursively startind at dir_base. -13020,BuildPyTestDependencies,tensorflow/tensorflow/tools/pip_package/pip_smoke_test.py,54,function, -13021,main,tensorflow/tensorflow/tools/pip_package/pip_smoke_test.py,102,function,"This script runs the pip smoke test. - -Raises: - RuntimeError: If any dependencies for py_tests exist in subSet - -Prerequisites: - 1. Bazel is installed. - 2. Running in github repo of tensorflow. - 3. Configure has been run." -13022,BinaryDistribution,tensorflow/tensorflow/tools/pip_package/setup.py,132,class, -13023,InstallCommand,tensorflow/tensorflow/tools/pip_package/setup.py,138,class,Override the dir where the headers go. -13024,InstallHeaders,tensorflow/tensorflow/tools/pip_package/setup.py,149,class,"Override how headers are copied. +12184,GetBuild,tensorflow/tensorflow/tools/pip_package/pip_smoke_test.py,44,function,Get the list of BUILD file all targets recursively startind at dir_base. +12185,BinaryDistribution,tensorflow/tensorflow/tools/pip_package/setup.py,132,class, +12186,has_ext_modules,tensorflow/tensorflow/tools/pip_package/setup.py,134,method, +12187,InstallCommand,tensorflow/tensorflow/tools/pip_package/setup.py,138,class,Override the dir where the headers go. +12188,finalize_options,tensorflow/tensorflow/tools/pip_package/setup.py,141,method, +12189,InstallHeaders,tensorflow/tensorflow/tools/pip_package/setup.py,149,class,"Override how headers are copied. The install_headers that comes with setuptools copies all files to the same directory. But we need the files to be in a specific directory hierarchy for -I to work correctly." -13025,find_files,tensorflow/tensorflow/tools/pip_package/setup.py,217,function,Return all the files matching pattern below root dir. -13026,main,tensorflow/tensorflow/tools/pip_package/simple_console.py,26,function,Run an interactive console. -13027,main,tensorflow/tensorflow/tools/pip_package/simple_console_for_windows.py,26,function,Run an interactive console. -13028,_compare_versions,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,35,function,"Compare two versions and return information on which is smaller vs. larger. - -Args: - v1: String that is a version to be compared against `v2`. - v2: String that is a version to be compared against `v1`. - -Returns: - Dict that stores larger version with key `larger` and smaller version with - key `smaller`. - e.g. {`larger`: `1.5.0`, `smaller`: `1.2.0`} - -Raises: - RuntimeError: If asked to compare `inf` to `inf`." -13029,_list_to_string,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,96,function,"Concatenates list items into a single string separated by `s`. - -Args: - l: List with items to be concatenated into a single string. - s: String or char that will be concatenated in between each item. - -Returns: - String that has all items in list `l` concatenated with `s` separator." -13030,_get_func_name,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,110,function,"Get the name of current function. - -Returns: - String that is the name of current function." -13031,ConfigCompatChecker,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,119,class,"Class that checks configuration versions and dependency compatibilities. +12190,initialize_options,tensorflow/tensorflow/tools/pip_package/setup.py,165,method, +12191,finalize_options,tensorflow/tensorflow/tools/pip_package/setup.py,170,method, +12192,mkdir_and_copy_file,tensorflow/tensorflow/tools/pip_package/setup.py,174,method, +12193,run,tensorflow/tensorflow/tools/pip_package/setup.py,200,method, +12194,get_inputs,tensorflow/tensorflow/tools/pip_package/setup.py,210,method, +12195,get_outputs,tensorflow/tensorflow/tools/pip_package/setup.py,213,method, +12196,find_files,tensorflow/tensorflow/tools/pip_package/setup.py,217,function,Return all the files matching pattern below root dir. +12197,ConfigCompatChecker,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,119,class,"Class that checks configuration versions and dependency compatibilities. `ConfigCompatChecker` checks a given set of configurations and their versions against supported versions and dependency rules defined in `.ini` config file. For project `TensorFlow Builder`, it functions as a sub-module for the builder service that validates requested build configurations from a client prior to initiating a TensorFlow build." -13032,CompatCheckerTest,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker_test.py,70,class, -13033,run_shell_cmd,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,135,function,"Executes shell commands and returns output. +12198,get_all_reqs,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,352,method,"Parses all compatibility specifications listed in the `.ini` config file. + +Reads and parses each and all compatibility specifications from the `.ini` +config file by sections. It then populates appropriate dicts that represent +each section (e.g. `self.required`) and returns a tuple of the populated +dicts. + +Returns: + Dict of dict + { `required`: Dict of `Required` configs and supported versions, + `optional`: Dict of `Optional` configs and supported versions, + `unsupported`: Dict of `Unsupported` configs and supported versions, + `dependency`: Dict of `Dependency` configs and supported versions }" +12199,filter_dependency,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,535,method,"Filters dependency compatibility rules defined in the `.ini` config file. + +Dependency specifications are defined as the following: + ` requires ` +e.g. + `python 3.7 requires tensorflow 1.13` + `tensorflow range(1.0.0, 1.13.1) requires gcc range(4.8, )` + +Args: + line: String that is a dependency specification defined under `Dependency` + section in the `.ini` config file. + +Returns: + Dict with configuration and its dependency information. + e.g. {`cfg`: `python`, # configuration name + `cfg_spec`: `3.7`, # configuration version + `cfgd`: `tensorflow`, # dependency name + `cfgd_spec`: `4.8`} # dependency version" +12200,convert_to_list,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,565,method,"Converts a string into a list with a separator. + +Args: + item: String that needs to be separated into a list by a given separator. + List item is also accepted but will take no effect. + separator: String with which the `item` will be splited. + +Returns: + List that is a splited version of a given input string. + e.g. Input: `1.0, 2.0, 3.0` with `, ` separator + Output: [1.0, 2.0, 3.0]" +12201,filter_line,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,600,method,"Removes `[` or `]` from the input line. + +Args: + line: String that is a compatibility specification line from the `.ini` + config file. + +Returns: + String that is a compatibility specification line without `[` and `]`." +12202,in_range,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,653,method,"Checks if a version satisfies a version and/or compatibility requirement. + +Args: + ver: List whose first item is a config version that needs to be checked + for support status and version compatibility. + e.g. ver = [`1.0`] + req: `_Reqs` class instance that represents a configuration version and + compatibility specifications. + +Returns: + Boolean output of checking if version `ver` meets the requirement + stored in `req` (or a `_Reqs` requirements class instance)." +12203,check_compatibility,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,780,method,"Checks version and dependency compatibility for a given configuration. + +`check_compatibility` immediately returns with `False` (or failure status) +if any child process or checks fail. For error and warning messages, either +print `self.(error_msg|warning_msg)` or call `_print` function. + +Returns: + Boolean that is a status of the compatibility check result." +12204,get_status,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,167,method,"Get status of `_Reqs` initialization. + +Returns: + Tuple + (Boolean indicating initialization status, + List of error messages, if any)" +12205,parse_single_req,tensorflow/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py,207,method,"Parses a requirement and stores information. + +`self.req` _initialized in `__init__` is called for retrieving the +requirement. + +A requirement can come in two forms: + [1] String that includes `range` indicating range syntax for defining + a requirement. + e.g. `range(1.0, 2.0) include(3.0) exclude(1.5)` + [2] List that includes individual supported versions or items. + e.g. [`1.0`, `3.0`, `7.1`] + +For a list type requirement, it directly stores the list to +`self.include`. + +Call `get_status` for checking the status of the parsing. This function +sets `self._initialized` to `False` and immediately returns with an error +message upon encountering a failure. It sets `self._initialized` to `True` +and returns without an error message upon success." +12206,run_shell_cmd,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,135,function,"Executes shell commands and returns output. Args: args: String of shell commands to run. Returns: Tuple output (stdoutdata, stderrdata) from running the shell commands." -13034,get_platform,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,153,function,"Retrieves platform information. +12207,get_platform,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,153,function,"Retrieves platform information. Currently the script only support linux. If other platoforms such as Windows or MacOS is detected, it throws an error and terminates. @@ -115890,27 +125506,27 @@ or MacOS is detected, it throws an error and terminates. Returns: String that is platform type. e.g. 'linux'" -13035,get_cpu_type,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,179,function,"Retrieves CPU (type) information. +12208,get_cpu_type,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,179,function,"Retrieves CPU (type) information. Returns: String that is name of the CPU. e.g. 'GenuineIntel'" -13036,get_cpu_arch,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,195,function,"Retrieves processor architecture type (32-bit or 64-bit). +12209,get_cpu_arch,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,195,function,"Retrieves processor architecture type (32-bit or 64-bit). Returns: String that is CPU architecture. e.g. 'x86_64'" -13037,get_distrib,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,210,function,"Retrieves distribution name of the operating system. +12210,get_distrib,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,210,function,"Retrieves distribution name of the operating system. Returns: String that is the name of distribution. e.g. 'Ubuntu'" -13038,get_distrib_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,225,function,"Retrieves distribution version of the operating system. +12211,get_distrib_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,225,function,"Retrieves distribution version of the operating system. Returns: String that is the distribution version. e.g. '14.04'" -13039,get_gpu_type,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,242,function,"Retrieves GPU type. +12212,get_gpu_type,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,242,function,"Retrieves GPU type. Returns: String that is the name of the detected NVIDIA GPU. @@ -115919,11 +125535,11 @@ Returns: 'unknown' will be returned if detected GPU type is an unknown name. Unknown name refers to any GPU name that is not specified in this page: https://developer.nvidia.com/cuda-gpus" -13040,get_gpu_count,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,280,function,"Retrieves total number of GPU's available in the system. +12213,get_gpu_count,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,280,function,"Retrieves total number of GPU's available in the system. Returns: Integer that is the total # of GPU's found." -13041,get_cuda_version_all,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,294,function,"Retrieves all additional CUDA versions available (other than default). +12214,get_cuda_version_all,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,294,function,"Retrieves all additional CUDA versions available (other than default). For retrieving default CUDA version, use `get_cuda_version` function. @@ -115934,7 +125550,7 @@ stderr. Returns: List of all CUDA versions found (except default version). e.g. ['10.1', '10.2']" -13042,get_cuda_version_default,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,327,function,"Retrieves default CUDA version. +12215,get_cuda_version_default,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,327,function,"Retrieves default CUDA version. Default version is the version found in `/usr/local/cuda/` installation. @@ -115949,7 +125565,7 @@ It iterates through two types of version retrieval method: Returns: String that is the default CUDA version. e.g. '10.1'" -13043,get_cuda_compute_capability,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,368,function,"Retrieves CUDA compute capability based on the detected GPU type. +12216,get_cuda_compute_capability,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,368,function,"Retrieves CUDA compute capability based on the detected GPU type. This function uses the `cuda_compute_capability` module to retrieve the corresponding CUDA compute capability for the given GPU type. @@ -115961,39 +125577,39 @@ Args: Returns: List of all supported CUDA compute capabilities for the given GPU type. e.g. ['3.5', '3.7']" -13044,get_cudnn_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,402,function,"Retrieves the version of cuDNN library detected. +12217,get_cudnn_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,402,function,"Retrieves the version of cuDNN library detected. Returns: String that is the version of cuDNN library detected. e.g. '7.5.0'" -13045,get_gcc_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,426,function,"Retrieves version of GCC detected. +12218,get_gcc_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,426,function,"Retrieves version of GCC detected. Returns: String that is the version of GCC. e.g. '7.3.0'" -13046,get_glibc_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,441,function,"Retrieves version of GLIBC detected. +12219,get_glibc_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,441,function,"Retrieves version of GLIBC detected. Returns: String that is the version of GLIBC. e.g. '2.24'" -13047,get_libstdcpp_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,456,function,"Retrieves version of libstdc++ detected. +12220,get_libstdcpp_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,456,function,"Retrieves version of libstdc++ detected. Returns: String that is the version of libstdc++. e.g. '3.4.25'" -13048,get_cpu_isa_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,472,function,"Retrieves all Instruction Set Architecture(ISA) available. +12221,get_cpu_isa_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,472,function,"Retrieves all Instruction Set Architecture(ISA) available. Required ISA(s): 'avx', 'avx2', 'avx512f', 'sse4', 'sse4_1' Returns: Tuple (list of available ISA, list of missing ISA)" -13049,get_python_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,500,function,"Retrieves default Python version. +12222,get_python_version,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,500,function,"Retrieves default Python version. Returns: String that is the version of default Python. e.g. '2.7.4'" -13050,get_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,512,function,"Runs all functions for detecting user machine configurations. +12223,get_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,512,function,"Runs all functions for detecting user machine configurations. Returns: Tuple @@ -116001,24 +125617,23 @@ Returns: List of all missing configurations, List of all configurations found with warnings, Dict of all configurations)" -13051,print_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,581,function,"Prints the status and info on all configurations in a table format. +12224,print_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,581,function,"Prints the status and info on all configurations in a table format. Args: configs: List of all configurations found. missing: List of all configurations that are missing. warning: List of all configurations found with warnings." -13052,save_to_file,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,624,function,"Saves all detected configuration(s) into a JSON file. +12225,save_to_file,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,624,function,"Saves all detected configuration(s) into a JSON file. Args: json_data: Dict of all configurations found. filename: String that is the name of the output JSON file." -13053,manage_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,641,function,"Manages configuration detection and retrieval based on user input. +12226,manage_all_configs,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,641,function,"Manages configuration detection and retrieval based on user input. Args: save_results: Boolean indicating whether to save the results to a file. filename: String that is the name of the output JSON file." -13054,main,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py,657,function, -13055,retrieve_from_web,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,55,function,"Retrieves list of all CUDA compute capability from NVIDIA webpage. +12227,retrieve_from_web,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,55,function,"Retrieves list of all CUDA compute capability from NVIDIA webpage. Args: generate_csv: Boolean for generating an output file containing @@ -116027,7 +125642,7 @@ Args: Returns: OrderedDict that is a list of all CUDA compute capability listed on the NVIDIA page. Order goes from top to bottom of the webpage content (.html)." -13056,retrieve_from_golden,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,91,function,"Retrieves list of all CUDA compute capability from a golden file. +12228,retrieve_from_golden,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,91,function,"Retrieves list of all CUDA compute capability from a golden file. The following file is set as default: `./golden/compute_capability_golden.csv` @@ -116040,7 +125655,7 @@ Returns: If there are multiple versions available for a given GPU, then it appends all supported versions in the value list (in the key-value pair.)" -13057,create_gpu_capa_map,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,118,function,"Generates a map between GPU types and corresponding compute capability. +12229,create_gpu_capa_map,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,118,function,"Generates a map between GPU types and corresponding compute capability. This method is used for retrieving CUDA compute capability from the web only. @@ -116052,7 +125667,7 @@ Args: Returns: OrderedDict that lists in the incoming order of all CUDA compute capability provided as `match_list`." -13058,write_csv_from_dict,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,172,function,"Writes out a `.csv` file from an input dictionary. +12230,write_csv_from_dict,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,172,function,"Writes out a `.csv` file from an input dictionary. After writing out the file, it checks the new list against the golden to make sure golden file is up-to-date. @@ -116060,7 +125675,7 @@ to make sure golden file is up-to-date. Args: filename: String that is the output file name. input_dict: Dictionary that is to be written out to a `.csv` file." -13059,check_with_golden,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,195,function,"Checks the newly created CUDA compute capability file with the golden. +12231,check_with_golden,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,195,function,"Checks the newly created CUDA compute capability file with the golden. If differences are found, then it prints a list of all mismatches as a `WARNING`. @@ -116069,47 +125684,27 @@ Golden file must reside in `golden/` directory. Args: filename: String that is the name of the newly created file." -13060,print_dict,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,227,function,"Prints dictionary with formatting (2 column table). +12232,print_dict,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,227,function,"Prints dictionary with formatting (2 column table). Args: py_dict: Dictionary that is to be printed out in a table format." -13061,main,tensorflow/tensorflow/tools/tensorflow_builder/config_detector/data/cuda_compute_capability.py,237,function, -13062,check_file,tensorflow/tensorflow/tools/test/check_futures_test.py,57,function, -13063,main,tensorflow/tensorflow/tools/test/check_futures_test.py,88,function, -13064,main,tensorflow/tensorflow/tools/test/file_name_test.py,31,function, -13065,_gather_gpu_devices_proc,tensorflow/tensorflow/tools/test/gpu_info_lib.py,33,function,Try to gather NVidia GPU device information via /proc/driver. -13066,CUDADeviceProperties,tensorflow/tensorflow/tools/test/gpu_info_lib.py,51,class, -13067,_gather_gpu_devices_cudart,tensorflow/tensorflow/tools/test/gpu_info_lib.py,123,function,Try to gather NVidia GPU device information via libcudart. -13068,gather_gpu_devices,tensorflow/tensorflow/tools/test/gpu_info_lib.py,167,function,"Gather gpu device info. +12233,check_file,tensorflow/tensorflow/tools/test/check_futures_test.py,57,function, +12234,CUDADeviceProperties,tensorflow/tensorflow/tools/test/gpu_info_lib.py,51,class, +12235,gather_gpu_devices,tensorflow/tensorflow/tools/test/gpu_info_lib.py,167,function,"Gather gpu device info. Returns: A list of test_log_pb2.GPUInfo messages." -13069,gather_build_configuration,tensorflow/tensorflow/tools/test/run_and_gather_logs.py,58,function, -13070,main,tensorflow/tensorflow/tools/test/run_and_gather_logs.py,69,function, -13071,MissingLogsError,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,37,class, -13072,get_git_commit_sha,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,41,function,"Get git commit SHA for this build. +12236,gather_build_configuration,tensorflow/tensorflow/tools/test/run_and_gather_logs.py,58,function, +12237,MissingLogsError,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,37,class, +12238,get_git_commit_sha,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,41,function,"Get git commit SHA for this build. Attempt to get the SHA from environment variable GIT_COMMIT, which should be available on Jenkins build agents. Returns: SHA hash of the git commit used for the build, if available" -13073,process_test_logs,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,54,function,"Gather test information and put it in a TestResults proto. - -Args: - name: Benchmark target identifier. - test_name: A unique bazel target, e.g. ""//path/to:test"" - test_args: A string containing all arguments to run the target with. - benchmark_type: A string representing the BenchmarkType enum; the - benchmark type for this target. - start_time: Test starting time (epoch) - run_time: Wall time that the test ran for - log_files: Paths to the log files - -Returns: - A TestResults proto" -13074,process_benchmarks,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,92,function, -13075,run_and_gather_logs,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,101,function,"Run the bazel test given by test_name. Gather and return the logs. +12239,process_benchmarks,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,92,function, +12240,run_and_gather_logs,tensorflow/tensorflow/tools/test/run_and_gather_logs_lib.py,101,function,"Run the bazel test given by test_name. Gather and return the logs. Args: name: Benchmark target identifier. @@ -116129,19 +125724,18 @@ Raises: subprocess.CalledProcessError: If the target itself fails. IOError: If there are problems gathering test log output from the test. MissingLogsError: If we couldn't find benchmark logs." -13076,main,tensorflow/tensorflow/tools/test/system_info.py,25,function, -13077,gather_machine_configuration,tensorflow/tensorflow/tools/test/system_info_lib.py,44,function,Gather Machine Configuration. This is the top level fn of this library. -13078,gather_hostname,tensorflow/tensorflow/tools/test/system_info_lib.py,66,function, -13079,gather_memory_info,tensorflow/tensorflow/tools/test/system_info_lib.py,70,function,Gather memory info. -13080,gather_cpu_info,tensorflow/tensorflow/tools/test/system_info_lib.py,79,function,Gather CPU Information. Assumes all CPUs are the same. -13081,gather_available_device_info,tensorflow/tensorflow/tools/test/system_info_lib.py,126,function,"Gather list of devices available to TensorFlow. +12241,gather_machine_configuration,tensorflow/tensorflow/tools/test/system_info_lib.py,44,function,Gather Machine Configuration. This is the top level fn of this library. +12242,gather_hostname,tensorflow/tensorflow/tools/test/system_info_lib.py,66,function, +12243,gather_memory_info,tensorflow/tensorflow/tools/test/system_info_lib.py,70,function,Gather memory info. +12244,gather_cpu_info,tensorflow/tensorflow/tools/test/system_info_lib.py,79,function,Gather CPU Information. Assumes all CPUs are the same. +12245,gather_available_device_info,tensorflow/tensorflow/tools/test/system_info_lib.py,126,function,"Gather list of devices available to TensorFlow. Returns: A list of test_log_pb2.AvailableDeviceInfo messages." -13082,gather_platform_info,tensorflow/tensorflow/tools/test/system_info_lib.py,146,function,Gather platform info. -13083,is_real_file,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,94,function, -13084,get_mtime,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,99,function, -13085,list_files_by_mtime,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,104,function,"Return a list of files in the directory, sorted in increasing ""mtime"". +12246,gather_platform_info,tensorflow/tensorflow/tools/test/system_info_lib.py,146,function,Gather platform info. +12247,is_real_file,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,94,function, +12248,get_mtime,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,99,function, +12249,list_files_by_mtime,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,104,function,"Return a list of files in the directory, sorted in increasing ""mtime"". Return a list of files in the given directory, sorted from older to newer file according to their modification times. Only return actual files, skipping @@ -116152,10 +125746,10 @@ Args: Returns: A list of file names relative to the given directory path." -13086,lock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,125,function, -13087,unlock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,129,function, -13088,trylock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,133,function, -13089,upload_benchmark_data,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,141,function,"Parse benchmark data and use the client to upload it to the datastore. +12250,lock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,125,function, +12251,unlock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,129,function, +12252,trylock,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,133,function, +12253,upload_benchmark_data,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,141,function,"Parse benchmark data and use the client to upload it to the datastore. Parse the given benchmark data from the serialized JSON-format used to write the test results file. Create the different datastore Entities from that data @@ -116164,7 +125758,7 @@ and upload them to the datastore in a batch using the client connection. Args: client: datastore client connection data: JSON-encoded benchmark data" -13090,upload_benchmark_files,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,190,function,"Find benchmark files, process them, and upload their data to the datastore. +12254,upload_benchmark_files,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,190,function,"Find benchmark files, process them, and upload their data to the datastore. Locate benchmark files in the data directory, process them, and upload their data to the datastore. After processing each file, move it to the archive @@ -116179,14 +125773,12 @@ Note: To use locking, the file is first opened, then its descriptor is used to lock and read it. The lock is released when the file is closed. Do not open that same file a 2nd time while the lock is already held, because when that 2nd file descriptor is closed, the lock will be released prematurely." -13091,parse_cmd_line,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,221,function,"Parse command line options. +12255,parse_cmd_line,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,221,function,"Parse command line options. Returns: The parsed arguments object." -13092,main,tensorflow/tensorflow/tools/test/upload_test_benchmarks.py,242,function, -13093,ConfigError,tensorflow/third_party/gpus/check_cuda_libs.py,38,class, -13094,_is_windows,tensorflow/third_party/gpus/check_cuda_libs.py,42,function, -13095,check_cuda_lib,tensorflow/third_party/gpus/check_cuda_libs.py,46,function,"Tests if a library exists on disk and whether its soname matches the filename. +12256,ConfigError,tensorflow/third_party/gpus/check_cuda_libs.py,38,class, +12257,check_cuda_lib,tensorflow/third_party/gpus/check_cuda_libs.py,46,function,"Tests if a library exists on disk and whether its soname matches the filename. Args: path: the path to the library. @@ -116195,71 +125787,10 @@ Args: Raises: ConfigError: If the library does not exist or if its soname does not match the filename." -13096,main,tensorflow/third_party/gpus/check_cuda_libs.py,69,function, -13097,main,tensorflow/third_party/gpus/compress_find_cuda_config.py,24,function, -13098,ConfigError,tensorflow/third_party/gpus/find_cuda_config.py,72,class, -13099,_is_linux,tensorflow/third_party/gpus/find_cuda_config.py,76,function, -13100,_is_windows,tensorflow/third_party/gpus/find_cuda_config.py,80,function, -13101,_is_macos,tensorflow/third_party/gpus/find_cuda_config.py,84,function, -13102,_matches_version,tensorflow/third_party/gpus/find_cuda_config.py,88,function,"Checks whether some version meets the requirements. - -All elements of the required_version need to be present in the -actual_version. - - required_version actual_version result - ----------------------------------------- - 1 1.1 True - 1.2 1 False - 1.2 1.3 False - 1 True - -Args: - required_version: The version specified by the user. - actual_version: The version detected from the CUDA installation. -Returns: Whether the actual version matches the required one." -13103,_at_least_version,tensorflow/third_party/gpus/find_cuda_config.py,115,function, -13104,_get_header_version,tensorflow/third_party/gpus/find_cuda_config.py,121,function,Returns preprocessor defines in C header file. -13105,_cartesian_product,tensorflow/third_party/gpus/find_cuda_config.py,130,function,Returns all path combinations of first and second. -13106,_get_ld_config_paths,tensorflow/third_party/gpus/find_cuda_config.py,135,function,Returns all directories from 'ldconfig -p'. -13107,_get_default_cuda_paths,tensorflow/third_party/gpus/find_cuda_config.py,153,function, -13108,_header_paths,tensorflow/third_party/gpus/find_cuda_config.py,170,function,Returns hard-coded set of relative paths to look for header files. -13109,_library_paths,tensorflow/third_party/gpus/find_cuda_config.py,182,function,Returns hard-coded set of relative paths to look for library files. -13110,_not_found_error,tensorflow/third_party/gpus/find_cuda_config.py,194,function, -13111,_find_file,tensorflow/third_party/gpus/find_cuda_config.py,202,function, -13112,_find_library,tensorflow/third_party/gpus/find_cuda_config.py,209,function,Returns first valid path to the requested library. -13113,_find_versioned_file,tensorflow/third_party/gpus/find_cuda_config.py,222,function,Returns first valid path to a file that matches the requested version. -13114,_find_header,tensorflow/third_party/gpus/find_cuda_config.py,238,function,Returns first valid path to a header that matches the requested version. -13115,_find_cuda_config,tensorflow/third_party/gpus/find_cuda_config.py,244,function, -13116,_find_cublas_config,tensorflow/third_party/gpus/find_cuda_config.py,307,function, -13117,_find_cusolver_config,tensorflow/third_party/gpus/find_cuda_config.py,340,function, -13118,_find_curand_config,tensorflow/third_party/gpus/find_cuda_config.py,370,function, -13119,_find_cufft_config,tensorflow/third_party/gpus/find_cuda_config.py,400,function, -13120,_find_cudnn_config,tensorflow/third_party/gpus/find_cuda_config.py,429,function, -13121,_find_cusparse_config,tensorflow/third_party/gpus/find_cuda_config.py,452,function, -13122,_find_nccl_config,tensorflow/third_party/gpus/find_cuda_config.py,482,function, -13123,_find_tensorrt_config,tensorflow/third_party/gpus/find_cuda_config.py,504,function, -13124,_list_from_env,tensorflow/third_party/gpus/find_cuda_config.py,538,function,Returns comma-separated list from environment variable. -13125,_get_legacy_path,tensorflow/third_party/gpus/find_cuda_config.py,545,function,"Returns a path specified by a legacy environment variable. - -CUDNN_INSTALL_PATH, NCCL_INSTALL_PATH, TENSORRT_INSTALL_PATH set to -'/usr/lib/x86_64-linux-gnu' would previously find both library and header -paths. Detect those and return '/usr', otherwise forward to _list_from_env()." -13126,_normalize_path,tensorflow/third_party/gpus/find_cuda_config.py,559,function,"Returns normalized path, with forward slashes on Windows." -13127,find_cuda_config,tensorflow/third_party/gpus/find_cuda_config.py,567,function,Returns a dictionary of CUDA library and header file paths. -13128,main,tensorflow/third_party/gpus/find_cuda_config.py,638,function, -13129,_parse_args,tensorflow/third_party/llvm/expand_cmake_vars.py,30,function,Parses arguments with the form KEY=VALUE into a dictionary. -13130,_expand_variables,tensorflow/third_party/llvm/expand_cmake_vars.py,39,function,"Expands ${VARIABLE}s in 'input_str', using dictionary 'cmake_vars'. - -Args: - input_str: the string containing ${VARIABLE} expressions to expand. - cmake_vars: a dictionary mapping variable names to their values. - -Returns: - The expanded string." -13131,_expand_cmakedefines,tensorflow/third_party/llvm/expand_cmake_vars.py,56,function,"Expands #cmakedefine declarations, using a dictionary 'cmake_vars'." -13132,main,tensorflow/third_party/llvm/expand_cmake_vars.py,81,function, -13133,Log,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,41,function, -13134,GetOptionValue,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,45,function,"Extract the list of values for option from options. +12258,ConfigError,tensorflow/third_party/gpus/find_cuda_config.py,72,class, +12259,find_cuda_config,tensorflow/third_party/gpus/find_cuda_config.py,567,function,Returns a dictionary of CUDA library and header file paths. +12260,Log,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,41,function, +12261,GetOptionValue,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,45,function,"Extract the list of values for option from options. Args: option: The option whose value to extract. @@ -116269,8 +125800,7 @@ Returns: (eg., /opt val1 val2) or values collected from multiple occurrences of the option (eg., /opt val1 /opt val2). 2. The leftover options." -13135,_update_options,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,66,function, -13136,GetNvccOptions,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,74,function,"Collect the -nvcc_options values from argv. +12262,GetNvccOptions,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,74,function,"Collect the -nvcc_options values from argv. Args: argv: A list of strings, possibly the argv passed to main(). @@ -116278,7 +125808,7 @@ Args: Returns: 1. The string that can be passed directly to nvcc. 2. The leftover options." -13137,InvokeNvcc,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,96,function,"Call nvcc with arguments assembled from argv. +12263,InvokeNvcc,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,96,function,"Call nvcc with arguments assembled from argv. Args: argv: A list of strings, possibly the argv passed to main(). @@ -116286,4 +125816,3 @@ Args: Returns: The return value of calling os.system('nvcc ' + args)" -13138,main,tensorflow/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py,190,function, diff --git a/extract-data.py b/extract-data.py index 4f1b1771..3a1007f1 100644 --- a/extract-data.py +++ b/extract-data.py @@ -14,6 +14,11 @@ def find_py_files(dir): yield os.path.join(cwd, file) +def keep_name(name): + return not name.startswith("_") and not "main" in str(name).lower() and \ + "test" not in str(name).lower() + + class FeatureVisitor(ast.NodeVisitor): def __init__(self, filename): @@ -21,31 +26,35 @@ class FeatureVisitor(ast.NodeVisitor): self.rows = [] def visit_FunctionDef(self, node): - self.rows.append({ - "name": node.name, - "file": self.filename, - "line": node.lineno, - "type": "function", - "comment": ast.get_docstring(node) - }) + if keep_name(node.name): + self.rows.append({ + "name": node.name, + "file": self.filename, + "line": node.lineno, + "type": "function", + "comment": ast.get_docstring(node) + }) - def visit_MethodDef(self, node): - self.rows.append({ - "name": node.name, - "file": self.filename, - "line": node.lineno, - "type": "method", - "comment": ast.get_docstring(node) - }) - def visit_ClassDef(self, node): - self.rows.append({ - "name": node.name, - "file": self.filename, - "line": node.lineno, - "type": "class", - "comment": ast.get_docstring(node) - }) + if keep_name(node.name): + self.rows.append({ + "name": node.name, + "file": self.filename, + "line": node.lineno, + "type": "class", + "comment": ast.get_docstring(node) + }) + for nd in ast.walk(node): + if isinstance(nd, ast.FunctionDef): + if keep_name(nd.name): + self.rows.append({ + "name": nd.name, + "file": self.filename, + "line": nd.lineno, + "type": "method", + "comment": ast.get_docstring(nd) + }) + def main(): diff --git a/search-data.py b/search-data.py new file mode 100644 index 00000000..87eb44c5 --- /dev/null +++ b/search-data.py @@ -0,0 +1,23 @@ +import re +import argparse +import os +import pandas as pd + +SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) +IN_DATASET = os.path.join(SCRIPT_DIR, "data.csv") + + +def search(query): + df = pd.read_csv(IN_DATASET) + + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("query", help="the query to search the corpus with", type=str) + args = parser.parse_args() + search(query) + + +if __name__ == "__main__": + main()