diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9abe95e860..8a43696e190 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,27 +50,35 @@ jobs: steps: - name: Install environment run: | - yum -y update - yum -y install centos-release-scl-rh epel-release - yum -y install java-1.8.0-openjdk-devel devtoolset-7 rh-git218 patch python36-devel python36-numpy python36-pip python36-six + echo Not updating glibc since CUDA fails with updated versions + GLIBC="glibc glibc-common glibc-devel glibc-headers" + yum --disablerepo updates -y install $GLIBC + yum -x "$GLIBC" -y update + yum -x "$GLIBC" -y install centos-release-scl-rh epel-release + yum -x "$GLIBC" -y install java-1.8.0-openjdk-devel devtoolset-7 rh-git218 patch perl-Data-Dumper python36-devel python36-numpy python36-pip python36-six echo Downloading Maven curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -o $HOME/apache-maven-3.6.3-bin.tar.gz tar xzf $HOME/apache-maven-3.6.3-bin.tar.gz -C /opt/ ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn echo Downloading Bazel - curl -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-installer-linux-x86_64.sh -o bazel.sh --retry 10 + curl -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-linux-x86_64.sh -o bazel.sh --retry 10 bash bazel.sh + if [[ "${{ matrix.ext }}" == *-gpu ]]; then echo Installing CUDA - curl -L https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel7-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm -o $HOME/cuda.rpm - curl -L https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-linux-x64-v7.6.5.32.tgz -o $HOME/cudnn.tgz - curl -L https://developer.download.nvidia.com/compute/redist/nccl/v2.4/nccl_2.4.8-1+cuda10.1_x86_64.txz -o $HOME/nccl.txz + curl -L https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda-repo-rhel7-11-0-local-11.0.3_450.51.06-1.x86_64.rpm -o $HOME/cuda.rpm + curl -L https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.3/cudnn-11.0-linux-x64-v8.0.3.33.tgz -o $HOME/cudnn.tgz + curl -L https://developer.download.nvidia.com/compute/redist/nccl/v2.7/nccl_2.7.8-1+cuda11.0_x86_64.txz -o $HOME/nccl.txz rpm -i $HOME/cuda.rpm - cd /var/cuda-repo-10-1-local-10.1.243-418.87.00/; rpm -i --nodeps cuda*.rpm libc*.rpm + pushd /var/cuda-repo-rhel7-11-0-local/; rpm -i --nodeps cuda*.rpm libc*.rpm libn*.rpm; rm *.rpm; popd ln -sf /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/libcuda.so ln -sf /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/libnvidia-ml.so tar hxvf $HOME/cudnn.tgz -C /usr/local/ tar hxvf $HOME/nccl.txz --strip-components=1 -C /usr/local/cuda/ mv /usr/local/cuda/lib/* /usr/local/cuda/lib64/ + echo Removing downloaded archives and unused libraries to avoid running out of disk space + rm -f *.rpm *.tgz *.txz *.tar.* + rm -f $(find /usr/local/cuda/ -name '*.a' -and -not -name libcudart_static.a -and -not -name libcudadevrt.a) + fi - name: Checkout repository uses: actions/checkout@v1 - name: Build project @@ -101,9 +109,9 @@ jobs: run: | python3 -m pip install numpy six echo Downloading Bazel - curl -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-installer-darwin-x86_64.sh -o bazel.sh --retry 10 + curl -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-darwin-x86_64.sh -o bazel.sh --retry 10 bash bazel.sh - brew install libomp + brew install libomp perl - name: Checkout repository uses: actions/checkout@v1 - name: Build project @@ -129,26 +137,34 @@ jobs: steps: - name: Configure page file uses: al-cheb/configure-pagefile-action@v1.2 + with: + minimum-size: 8GB + maximum-size: 16GB + disk-root: "C:" - name: Install environment shell: cmd run: | + set "PATH=C:\msys64\usr\bin;%PATH%" + echo Removing broken stuff from WSL and MSYS2 + rm "C:/WINDOWS/system32/bash.EXE" "C:/msys64/usr/bin/python.exe" python -m pip install numpy six - echo Removing broken version of Bash from WSL - rm.exe "C:/WINDOWS/system32/bash.EXE" - echo Removing some unused stuff to avoid running out of disk space - rm.exe -Rf "C:/Program Files (x86)/Android" "C:/Program Files/dotnet" "%CONDA%" "%GOROOT_1_10_X64%" "%GOROOT_1_11_X64%" "%GOROOT_1_12_X64%" "%GOROOT_1_13_X64%" "C:\hostedtoolcache\windows\Ruby" "C:\Rust" echo Removing old versions of MSVC that interfere with Bazel bash.exe -lc "find 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/' -iname '14.1*' -exec rm -Rf {} \;" echo Downloading Bazel mkdir C:\bazel - curl.exe -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10 + curl.exe -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10 + set "EXT=${{ matrix.ext }}" + if "%EXT:~-4%"=="-gpu" ( + echo Removing some unused stuff to avoid running out of disk space + rm.exe -Rf "C:/Program Files (x86)/Android" "C:/Program Files/dotnet" "%CONDA%" "%GOROOT_1_10_X64%" "%GOROOT_1_11_X64%" "%GOROOT_1_12_X64%" "%GOROOT_1_13_X64%" "C:\hostedtoolcache\windows\Ruby" "C:\Rust" echo Installing CUDA - curl.exe -L http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_windows.exe -o cuda.exe - curl.exe -L https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-windows7-x64-v7.6.5.32.zip -o cudnn.zip + curl.exe -L https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_451.82_win10.exe -o cuda.exe + curl.exe -L https://developer.download.nvidia.com/compute/redist/cudnn/v8.0.3/cudnn-11.0-windows-x64-v8.0.3.33.zip -o cudnn.zip cuda.exe -s mkdir cuda unzip.exe cudnn.zip - cp.exe -a cuda/include cuda/lib cuda/bin "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/" + cp.exe -a cuda/include cuda/lib cuda/bin "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/" + ) echo %JAVA_HOME% - name: Checkout repository uses: actions/checkout@v1 @@ -156,9 +172,9 @@ jobs: shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 - set "CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1" - set "CUDA_PATH_V10_1=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1" - set "PATH=C:\bazel;C:\Program Files\Git\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;%PATH%" + set "CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v11.0" + set "CUDA_PATH_V11_0=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v11.0" + set "PATH=C:\msys64\usr\bin;C:\bazel;C:\Program Files\Git\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v11.0\libnvvp;%PATH%" echo Shorten work paths to prevent Bazel from reaching MAX_PATH limit set "TEST_TMPDIR=C:\tmp" set "TMPDIR=C:\tmp" diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml index 5140b1869d2..52a61d4615a 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -59,7 +59,6 @@ windows-x86${javacpp.platform.extension} windows-x86_64${javacpp.platform.extension} 1.5.4 - 0.21.5-${javacpp.version} diff --git a/tensorflow-core/tensorflow-core-api/.bazelrc b/tensorflow-core/tensorflow-core-api/.bazelrc index 2d1e0662524..461b2996401 100644 --- a/tensorflow-core/tensorflow-core-api/.bazelrc +++ b/tensorflow-core/tensorflow-core-api/.bazelrc @@ -5,6 +5,7 @@ # Android options: # android: # android_arm: +# android_arm64: # android_x86: # android_x86_64: # @@ -18,18 +19,22 @@ # # Compiler options: # cuda_clang: Use clang when building CUDA code. -# c++17: Build with C++17 options -# C++1z: Build with C++17 options +# c++17: Build with C++17 options (links with libc++) +# c++1z: Build with C++17 options (links with libc++) +# c++17_gcc: Build with C++17 options (links with stdlibc++) +# c++1z_gcc: Build with C++17 options (links with stdlibc++) # avx_linux: Build with avx instruction set on linux. # avx2_linux: Build with avx2 instruction set on linux. -# arch_native_linux: Build with instruction sets available to the host machine on linux +# native_arch_linux: Build with instruction sets available to the host machine on linux # avx_win: Build with avx instruction set on windows # avx2_win: Build with avx2 instruction set on windows # # Other build options: # short_logs: Only log errors during build, skip warnings. +# verbose_logs: Show all compiler warnings during build. # monolithic: Build all TF C++ code into a single shared object. # dynamic_kernels: Try to link all kernels dynamically (experimental). +# libc++: Link against libc++ instead of stdlibc++ # # # TF version options; @@ -38,13 +43,10 @@ # # Feature and Third party library support options: # xla: Build TF with XLA +# tpu: Build TF with TPU support # using_cuda: CUDA is available to build system. # cuda: Build with full cuda support. # rocm: Build with AMD GPU support (rocm). -# sycl: Build with SYCL support. -# sycl_nodouble: -# sycl_asan: -# sycl_trisycl: # mkl: Enable full mkl support. # tensorrt: Enable Tensorrt support. # ngraph: Enable ngraph support. @@ -56,13 +58,12 @@ # # # Remote build execution options (only configured to work with TF team projects for now.) -# rbe: General RBE options shared by all flavors. -# rbe_linux: General RBE options used on all linux builds. -# rbe_win: General RBE options used on all windows builds. +# rbe: General RBE options shared by all flavors. +# rbe_linux: General RBE options used on all linux builds. +# rbe_win: General RBE options used on all windows builds. # -# rbe_cpu_linux: RBE options to build with only CPU support. -# rbe_linux_cuda_nvcc: RBE options to build with GPU support using nvcc. -# rbe_gpu_linux: An alias for rbe_linux_cuda_nvcc +# rbe_cpu_linux: RBE options to build with only CPU support. +# rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc. # # rbe_linux_py2: Linux Python 2 RBE config. # rbe_linux_py3: Linux Python 3 RBE config @@ -73,8 +74,30 @@ # tensorflow_testing_rbe_linux: RBE options to use RBE with tensorflow-testing project on linux # tensorflow_testing_rbe_win: RBE options to use RBE with tensorflow-testing project on windows # - - +# Embedded Linux options (experimental and only tested with TFLite build yet) +# elinux: General Embedded Linux options shared by all flavors. +# elinux_aarch64: Embedded Linux options for aarch64 (ARM64) CPU support. +# elinux_armhf: Embedded Linux options for armhf (ARMv7) CPU support. +# +# Release build options (for all operating systems) +# release_common: Common options for all builds on all operating systems. +# release_windows_common: Common options for all builds on Windows. +# release_gpu_common: Common options for GPU builds on Linux and Windows. +# release_cpu_linux: Toolchain and CUDA options for Linux CPU builds. +# release_cpu_macos: Toolchain and CUDA options for MacOS CPU builds. +# release_gpu_linux: Toolchain and CUDA options for Linux GPU builds. +# release_gpu_linux_cuda_10_1: Toolchain and CUDA options for CUDA 10.1 Linux GPU builds. +# release_cpu_windows: Toolchain and CUDA options for Windows CPU builds. +# release_gpu_windows: Toolchain and CUDA options for Windows GPU builds. + +# Allow builds using libc++ as a linker library +# This is mostly for OSSFuzz, so we also pass in the flags from environment to clean build file +build:libc++ --action_env=CC +build:libc++ --action_env=CXX +build:libc++ --action_env=CXXFLAGS=-stdlib=libc++ +build:libc++ --action_env=PATH +build:libc++ --define force_libcpp=enabled +build:libc++ --linkopt -fuse-ld=lld # Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the # target CPU to build transient dependencies correctly. See @@ -136,15 +159,40 @@ build --host_java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java # environment variable "TF_MKL_ROOT" every time before build. build:mkl --define=build_with_mkl=true --define=enable_mkl=true build:mkl --define=tensorflow_mkldnn_contraction_kernel=0 -build:mkl --define=build_with_mkl_dnn_v1_only=true +build:mkl --define=build_with_openmp=true build:mkl -c opt +# config to build OneDNN backend with a user specified threadpool. +build:mkl_threadpool --define=build_with_mkl=true --define=enable_mkl=true +build:mkl_threadpool --define=tensorflow_mkldnn_contraction_kernel=0 +build:mkl_threadpool --define=build_with_mkl_opensource=true +build:mkl_threadpool --define=build_with_mkldnn_threadpool=true +build:mkl_threadpool -c opt + +# Config setting to build with oneDNN and without the binary blob +build:mkl_opensource_only --define=build_with_mkl=true --define=enable_mkl=true +build:mkl_opensource_only --define=tensorflow_mkldnn_contraction_kernel=0 +build:mkl_opensource_only --define=build_with_mkl_opensource=true +build:mkl_opensource_only --define=build_with_openmp=true +build:mkl_opensource_only -c opt + +# Config setting to build with oneDNN for Arm. +build:mkl_aarch64 --define=build_with_mkl_aarch64=true --define=enable_mkl=true +build:mkl_aarch64 --define=tensorflow_mkldnn_contraction_kernel=0 +build:mkl_aarch64 --define=build_with_mkl_opensource=true +build:mkl_aarch64 -c opt + # This config refers to building with CUDA available. It does not necessarily # mean that we build CUDA op kernels. build:using_cuda --define=using_cuda=true build:using_cuda --action_env TF_NEED_CUDA=1 build:using_cuda --crosstool_top=@local_config_cuda//crosstool:toolchain +# Enable the mlir generated GPU kernels only for cuda builds. +build --define=tensorflow_enable_mlir_generated_gpu_kernels=0 +# This is a more specific option, so it takes precedence over the line above for cuda builds. +build:using_cuda --define=tensorflow_enable_mlir_generated_gpu_kernels=1 + # This config refers to building CUDA op kernels with nvcc. build:cuda --config=using_cuda build:cuda --define=using_cuda_nvcc=true @@ -159,6 +207,11 @@ build:cuda_clang --action_env TF_CUDA_CLANG=1 build:dbg --config=opt -c dbg # for now, disable arm_neon. see: https://github.com/tensorflow/tensorflow/issues/33360 build:dbg --cxxopt -DTF_LITE_DISABLE_X86_NEON +# AWS SDK must be compiled in release mode. see: https://github.com/tensorflow/tensorflow/issues/37498 +build:dbg --copt -DDEBUG_BUILD + +# Config to build TPU backend +build:tpu --define=with_tpu_support=true build:tensorrt --action_env TF_NEED_TENSORRT=1 @@ -166,19 +219,6 @@ build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true build:rocm --action_env TF_NEED_ROCM=1 -build:sycl --crosstool_top=@local_config_sycl//crosstool:toolchain -build:sycl --define=using_sycl=true -build:sycl --action_env TF_NEED_OPENCL_SYCL=1 - -build:sycl_nodouble --config=sycl -build:sycl_nodouble --cxxopt -DTENSORFLOW_SYCL_NO_DOUBLE - -build:sycl_nodouble --config=sycl -build:sycl_asan --copt -fno-omit-frame-pointer --copt -fsanitize-coverage=3 --copt -DGPR_NO_DIRECT_SYSCALLS --linkopt -fPIC --linkopt -fsanitize=address - -build:sycl_nodouble --config=sycl -build:sycl_trisycl --define=using_trisycl=true - # Options extracted from configure script build:ngraph --define=with_ngraph_support=true build:numa --define=with_numa_support=true @@ -189,6 +229,8 @@ build:nogcp --define=no_gcp_support=true build:nohdfs --define=no_hdfs_support=true build:nonccl --define=no_nccl_support=true +build:stackdriver_support --define=stackdriver_support=true + build --define=use_fast_cpp_protos=true build --define=allow_oversize_protos=true @@ -228,29 +270,44 @@ build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS build:c++17 --cxxopt=-std=c++1z build:c++17 --cxxopt=-stdlib=libc++ build:c++1z --config=c++17 +build:c++17_gcc --cxxopt=-std=c++1z +build:c++1z_gcc --config=c++17_gcc -# Enable using platform specific build settings +# Enable using platform specific build settings, except when cross-compiling for +# mobile platforms. build --enable_platform_specific_config +build:android --noenable_platform_specific_config +build:ios --noenable_platform_specific_config # Suppress C++ compiler warnings, otherwise build logs become 10s of MBs. +build:android --copt=-w +build:ios --copt=-w build:linux --copt=-w +build:linux --host_copt=-w build:macos --copt=-w -build:windows --copt=/w +build:windows --copt=/W0 # Tensorflow uses M_* math constants that only get defined by MSVC headers if # _USE_MATH_DEFINES is defined. build:windows --copt=/D_USE_MATH_DEFINES +build:windows --host_copt=/D_USE_MATH_DEFINES # Default paths for TF_SYSTEM_LIBS build:linux --define=PREFIX=/usr build:linux --define=LIBDIR=$(PREFIX)/lib build:linux --define=INCLUDEDIR=$(PREFIX)/include +build:linux --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include build:macos --define=PREFIX=/usr build:macos --define=LIBDIR=$(PREFIX)/lib build:macos --define=INCLUDEDIR=$(PREFIX)/include +build:macos --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include # TF_SYSTEM_LIBS do not work on windows. # By default, build TF in C++ 14 mode. +build:android --cxxopt=-std=c++14 +build:android --host_cxxopt=-std=c++14 +build:ios --cxxopt=-std=c++14 +build:ios --host_cxxopt=-std=c++14 build:linux --cxxopt=-std=c++14 build:linux --host_cxxopt=-std=c++14 build:macos --cxxopt=-std=c++14 @@ -270,6 +327,11 @@ build:windows --host_copt=-DWIN32_LEAN_AND_MEAN build:windows --copt=-DNOGDI build:windows --host_copt=-DNOGDI +# MSVC (Windows): Standards-conformant preprocessor mode +# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview +build:windows --copt=/experimental:preprocessor +build:windows --host_copt=/experimental:preprocessor + # Misc build options we need for windows. build:windows --linkopt=/DEBUG build:windows --host_linkopt=/DEBUG @@ -291,11 +353,14 @@ build:windows --host_copt=/d2ReducedOptimizeHugeFunctions # Suppress all warning messages. build:short_logs --output_filter=DONT_MATCH_ANYTHING +build:verbose_logs --output_filter= +build --config=short_logs # Instruction set optimizations # TODO(gunan): Create a feature in toolchains for avx/avx2 to # avoid having to define linux/win separately. build:avx_linux --copt=-mavx +build:avx_linux --host_copt=-mavx build:avx2_linux --copt=-mavx2 build:native_arch_linux --copt=-march=native build:avx_win --copt=/arch=AVX @@ -310,7 +375,6 @@ build --config=v2 test --config=v2 # Enable XLA -build:xla --action_env=TF_ENABLE_XLA=1 build:xla --define=with_xla_support=true # BEGIN TF REMOTE BUILD EXECUTION OPTIONS @@ -350,34 +414,105 @@ build:rbe_linux --config=avx_linux build:rbe_linux --config=short_logs # TODO(gunan): Check why we need this specified in rbe, but not in other builds. build:rbe_linux --linkopt=-lrt +build:rbe_linux --host_linkopt=-lrt build:rbe_linux --linkopt=-lm +build:rbe_linux --host_linkopt=-lm build:rbe_cpu_linux --config=rbe_linux +build:rbe_cpu_linux --host_crosstool_top="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" build:rbe_cpu_linux --crosstool_top="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" build:rbe_cpu_linux --extra_toolchains="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:cc-toolchain-k8" -build:rbe_cpu_linux --extra_execution_platforms"=@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" -build:rbe_cpu_linux --host_platform="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" -build:rbe_cpu_linux --platforms="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" - -build:rbe_linux_cuda_nvcc --config=rbe_linux -build:rbe_linux_cuda_nvcc --crosstool_top="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain" -build:rbe_linux_cuda_nvcc --extra_toolchains="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain-linux-x86_64" -build:rbe_linux_cuda_nvcc --extra_execution_platforms="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --host_platform="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --platforms="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda" -build:rbe_linux_cuda_nvcc --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_tensorrt" -build:rbe_linux_cuda_nvcc --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_nccl" -build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_TENSORRT=1 -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_VERSION=10 -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDNN_VERSION=7 -build:rbe_linux_cuda_nvcc --repo_env=REMOTE_GPU_TESTING=1 -build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_CUDA=1 -build:rbe_linux_cuda_nvcc --define=using_cuda_nvcc=true -test:rbe_linux_cuda_nvcc --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" - -common:rbe_gpu_linux --config=rbe_linux_cuda_nvcc - +build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" +build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" +build:rbe_cpu_linux --host_platform="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" +build:rbe_cpu_linux --platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" + +build:rbe_linux_cuda_base --config=rbe_linux +build:rbe_linux_cuda_base --repo_env=TF_NEED_TENSORRT=1 +build:rbe_linux_cuda_base --repo_env=TF_CUDA_VERSION=10 +build:rbe_linux_cuda_base --repo_env=TF_CUDNN_VERSION=7 +build:rbe_linux_cuda_base --repo_env=REMOTE_GPU_TESTING=1 +build:rbe_linux_cuda_base --repo_env=TF_NEED_CUDA=1 +test:rbe_linux_cuda_base --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" + +build:rbe_linux_cuda10.1_nvcc_base --config=rbe_linux_cuda_base +build:rbe_linux_cuda10.1_nvcc_base --define=using_cuda_nvcc=true +build:rbe_linux_cuda10.1_nvcc_base --host_crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda10.1_nvcc_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda10.1_nvcc_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_linux_cuda10.1_nvcc_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda10.1_nvcc_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda10.1_nvcc_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda" +build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_tensorrt" +build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_nccl" +build:rbe_linux_cuda10.1_nvcc_py2.7 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python2.7" +build:rbe_linux_cuda10.1_nvcc_py3.5 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.5" +build:rbe_linux_cuda10.1_nvcc_py3.6 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.6" +build:rbe_linux_cuda10.1_nvcc_py3.7 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.7" +build:rbe_linux_cuda10.1_nvcc_py3.8 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.8" + +build:rbe_linux_cuda11.0_nvcc_base --config=rbe_linux_cuda_base +build:rbe_linux_cuda11.0_nvcc_base --define=using_cuda_nvcc=true +build:rbe_linux_cuda11.0_nvcc_base --host_crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda11.0_nvcc_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda11.0_nvcc_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_linux_cuda11.0_nvcc_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform" +build:rbe_linux_cuda11.0_nvcc_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform" +build:rbe_linux_cuda11.0_nvcc_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform" +build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda" +build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_tensorrt" +build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_nccl" +build:rbe_linux_cuda11.0_nvcc_py2.7 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python2.7" +build:rbe_linux_cuda11.0_nvcc_py3.5 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.5" +build:rbe_linux_cuda11.0_nvcc_py3.6 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.6" +build:rbe_linux_cuda11.0_nvcc_py3.7 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.7" +build:rbe_linux_cuda11.0_nvcc_py3.8 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.8" + +# Map default to CUDA 11 for PY35 and greater. +build:rbe_linux_cuda_nvcc_py27 --config=rbe_linux_cuda10.1_nvcc_py2.7 +build:rbe_linux_cuda_nvcc_py35 --config=rbe_linux_cuda11.0_nvcc_py3.5 +build:rbe_linux_cuda_nvcc_py36 --config=rbe_linux_cuda11.0_nvcc_py3.6 +build:rbe_linux_cuda_nvcc_py37 --config=rbe_linux_cuda11.0_nvcc_py3.7 +build:rbe_linux_cuda_nvcc_py38 --config=rbe_linux_cuda11.0_nvcc_py3.8 + +# Deprecated configs that people might still use. +build:rbe_linux_cuda_nvcc --config=rbe_linux_cuda_nvcc_py36 +build:rbe_gpu_linux --config=rbe_linux_cuda_nvcc + +build:rbe_linux_cuda_clang_base --config=rbe_linux_cuda_base +build:rbe_linux_cuda_clang_base --crosstool_top="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda_clang_base --extra_toolchains="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_linux_cuda_clang_base --extra_execution_platforms="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda_clang_base --host_platform="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda_clang_base --platforms="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" +build:rbe_linux_cuda_clang_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda" +build:rbe_linux_cuda_clang_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_tensorrt" +build:rbe_linux_cuda_clang_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_nccl" +build:rbe_linux_cuda_clang_base --define=using_cuda_clang=true +build:rbe_linux_cuda_clang_py27 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python2.7" +build:rbe_linux_cuda_clang_py35 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.5" +build:rbe_linux_cuda_clang_py36 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.6" +build:rbe_linux_cuda_clang_py37 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.7" +build:rbe_linux_cuda_clang_py38 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-clang_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.8" + +# ROCm +build:rbe_linux_rocm_base --config=rbe_linux +build:rbe_linux_rocm_base --repo_env=TF_NEED_ROCM=1 +build:rbe_linux_rocm_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain" +build:rbe_linux_rocm_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain-linux-x86_64" +build:rbe_linux_rocm_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --action_env=TF_ROCM_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm" +build:rbe_linux_rocm_base --define=using_rocm_hipcc=true +build:rbe_linux_rocm_py2.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python2.7" +build:rbe_linux_rocm_py3.5 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.5" +build:rbe_linux_rocm_py3.6 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.6" +build:rbe_linux_rocm_py3.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.7" +build:rbe_linux_rocm_py3.8 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.8" + +# Linux CPU build:rbe_linux_py2 --config=rbe_linux build:rbe_linux_py2 --repo_env=PYTHON_BIN_PATH="/usr/bin/python2" build:rbe_linux_py2 --python_path="/usr/bin/python2" @@ -388,8 +523,8 @@ build:rbe_linux_py3 --python_path="/usr/bin/python3" build:rbe_linux_py3 --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-manylinux2010-py3_config_python" build:rbe_win --config=rbe -build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win/bazel_211:toolchain" -build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win/bazel_211:cc-toolchain-x64_windows" +build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:toolchain" +build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:cc-toolchain-x64_windows" build:rbe_win --host_javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8" build:rbe_win --javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8" build:rbe_win --extra_execution_platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019" @@ -399,7 +534,7 @@ build:rbe_win --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe # TODO(gunan): Remove once we use MSVC 2019 with latest patches. build:rbe_win --define=override_eigen_strong_inline=true -build:rbe_win --jobs=500 +build:rbe_win --jobs=100 build:rbe_win_py37 --config=rbe build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python" @@ -420,6 +555,14 @@ build:tensorflow_testing_rbe_linux --config=rbe_linux common:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows build:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe + +# TFLite build configs for generic embedded Linux +build:elinux --crosstool_top=@local_config_embedded_arm//:toolchain +build:elinux --host_crosstool_top=@bazel_tools//tools/cpp:toolchain +build:elinux_aarch64 --config=elinux +build:elinux_aarch64 --cpu=aarch64 +build:elinux_armhf --config=elinux +build:elinux_armhf --cpu=armhf # END TF REMOTE BUILD EXECUTION OPTIONS # Default options should come above this line @@ -429,3 +572,47 @@ try-import %workspace%/.tf_configure.bazelrc # Put user-specific options in .bazelrc.user try-import %workspace%/.bazelrc.user + +# Here are bazelrc configs for release builds +build:release_common --config=opt +build:release_common --config=v2 +build:release_common --distinct_host_configuration=false +build:release_common --action_env TF_CONFIGURE_IOS="0" + +build:release_cpu_linux --config=release_common +build:release_cpu_linux --config=avx_linux +# We use the same toolchain for CPU/GPU packages. +# Did not add this to the defaults in case this changes. +build:release_cpu_linux --crosstool_top=//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1:toolchain + +build:release_cpu_macos --config=release_common +build:release_cpu_macos --config=avx_linux + +build:release_gpu_common --config=release_common +build:release_gpu_common --config=cuda +build:release_gpu_common --config=tensorrt +build:release_gpu_common --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-11.0" +build:release_gpu_common --action_env=TF_CUDA_VERSION="11" +build:release_gpu_common --action_env=TF_CUDNN_VERSION="8" +build:release_gpu_common --action_env=TF_NEED_TENSORRT="1" +build:release_gpu_common --action_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80" +build:release_gpu_common --action_env=TENSORRT_INSTALL_PATH="/usr/local/tensorrt" +build:release_gpu_common --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/tensorrt/lib" +build:release_gpu_common --action_env=GCC_HOST_COMPILER_PATH="/usr/bin/gcc-5" + + +build:release_gpu_linux --config=release_gpu_common +build:release_gpu_linux --config=avx_linux +build:release_gpu_linux --crosstool_top=//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda11:toolchain +build:release_windows_common --config=release_common +build:release_windows_common --define=no_tensorflow_py_deps=true +build:release_windows_common --announce_rc + +build:release_cpu_windows --config=release_windows_common + +build:release_gpu_windows --config=release_windows_common + +build:release_gpu_linux_cuda_10_1 --config=release_gpu_linux +build:release_gpu_linux_cuda_10_1 --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.1" +build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDA_VERSION="10" +build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDNN_VERSION="7" diff --git a/tensorflow-core/tensorflow-core-api/WORKSPACE b/tensorflow-core/tensorflow-core-api/WORKSPACE index 37dda9b59b0..bd5ce478f66 100644 --- a/tensorflow-core/tensorflow-core-api/WORKSPACE +++ b/tensorflow-core/tensorflow-core-api/WORKSPACE @@ -9,17 +9,18 @@ http_archive( name = "org_tensorflow", patches = [ ":tensorflow-visibility.patch", - ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213 + ":tensorflow-macosx.patch", +# ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213 ":tensorflow-proto.patch", ], patch_tool = "patch", patch_args = ["-p1"], patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"], urls = [ - "https://github.com/tensorflow/tensorflow/archive/v2.3.1.tar.gz", + "https://github.com/tensorflow/tensorflow/archive/v2.4.1.tar.gz", ], - sha256 = "ee534dd31a811f7a759453567257d1e643f216d8d55a25c32d2fbfff8153a1ac", - strip_prefix = "tensorflow-2.3.1" + sha256 = "f681331f8fc0800883761c7709d13cda11942d4ad5ff9f44ad855e9dc78387e0", + strip_prefix = "tensorflow-2.4.1" ) # START: Upstream TensorFlow dependencies diff --git a/tensorflow-core/tensorflow-core-api/build.sh b/tensorflow-core/tensorflow-core-api/build.sh index 356a00db91d..e66c4bab40d 100755 --- a/tensorflow-core/tensorflow-core-api/build.sh +++ b/tensorflow-core/tensorflow-core-api/build.sh @@ -7,19 +7,15 @@ export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 export BAZEL_VC="${VCINSTALLDIR:-}" if [[ -d $BAZEL_VC ]]; then - # Work around compiler issues on Windows documented mainly in configure.py but also elsewhere - export BUILD_FLAGS="--copt=//arch:AVX `#--copt=//arch:AVX2` --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=-D_USE_MATH_DEFINES --host_copt=-D_USE_MATH_DEFINES --define=override_eigen_strong_inline=true" - # https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide#wind_B_S - export PATH=$PATH:$(pwd)/bazel-tensorflow-core-api/external/mkl_windows/lib/ + export BUILD_FLAGS="--copt=//arch:AVX `#--copt=//arch:AVX2` --define=override_eigen_strong_inline=true" export PYTHON_BIN_PATH=$(which python.exe) else - export BUILD_FLAGS="--copt=-msse4.1 --copt=-msse4.2 --copt=-mavx `#--copt=-mavx2 --copt=-mfma` --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --linkopt=-lstdc++ --host_linkopt=-lstdc++" + export BUILD_FLAGS="--copt=-msse4.1 --copt=-msse4.2 --copt=-mavx `#--copt=-mavx2 --copt=-mfma` --linkopt=-lstdc++ --host_linkopt=-lstdc++" export PYTHON_BIN_PATH=$(which python3) fi if [[ "${EXTENSION:-}" == *mkl* ]]; then - # Don't use MKL-DNN v1 as it is only currently supported by Linux platform - export BUILD_FLAGS="$BUILD_FLAGS --config=mkl --define build_with_mkl_dnn_v1_only=false" + export BUILD_FLAGS="$BUILD_FLAGS --config=mkl" fi if [[ "${EXTENSION:-}" == *gpu* ]]; then @@ -71,6 +67,15 @@ for TENSORFLOW_DLL in ${TENSORFLOW_DLLS[@]}; do done echo "Listing $TENSORFLOW_BIN:" && ls -l $TENSORFLOW_BIN +if [[ -x /usr/bin/install_name_tool ]] && [[ -e $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib ]]; then + # Fix library with correct rpath on Mac + chmod +w $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib + UGLYPATH=$(otool -L $TENSORFLOW_BIN/libtensorflow_cc.2.dylib | grep @loader_path | cut -f1 -d ' ') + install_name_tool -add_rpath @loader_path/. -id @rpath/libiomp5.dylib $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib + install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib + install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib +fi + GEN_SRCS_DIR=src/gen/java mkdir -p $GEN_SRCS_DIR diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch new file mode 100644 index 00000000000..c83456e8408 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch @@ -0,0 +1,21 @@ +diff -ruN tensorflow-2.4.1/third_party/llvm_openmp/BUILD tensorflow-2.4.1-macosx/third_party/llvm_openmp/BUILD +--- tensorflow-2.4.1/third_party/llvm_openmp/BUILD 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-macosx/third_party/llvm_openmp/BUILD 2021-02-07 21:13:40.971556568 +0900 +@@ -63,7 +63,7 @@ + + # Linux Cmake vars to expand. + omp_vars_linux = { +- "LIBOMP_USE_VERSION_SYMBOLS": 1, ++ "LIBOMP_USE_VERSION_SYMBOLS": 0, + "LIBOMP_HAVE_WEAK_ATTRIBUTE": 1, + "LIBOMP_USE_ADAPTIVE_LOCKS": 1, + "LIBOMP_ENABLE_ASSERTIONS": 1, +@@ -199,7 +199,7 @@ + ] + srcdeps, + copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"], + includes = common_includes, +- linkopts = ["-lpthread -ldl -Wl,--version-script=$(location :ldscript)"], ++ linkopts = ["-lpthread -ldl"], + linkshared = True, + visibility = ["//visibility:public"], + ) diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch index f3e1b030826..3dac55ccee7 100644 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch +++ b/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch @@ -1,138 +1,150 @@ -diff -ruN a/tensorflow/core/protobuf/bfc_memory_map.proto b/tensorflow/core/protobuf/bfc_memory_map.proto ---- a/tensorflow/core/protobuf/bfc_memory_map.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/bfc_memory_map.proto 2020-03-30 23:43:29.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto 2021-02-08 09:43:41.885495355 +0900 @@ -3,6 +3,9 @@ package tensorflow; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +option java_outer_classname = "BfcMemoryMapProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.util"; // Some of the data from AllocatorStats message MemAllocatorStats { -diff -ruN a/tensorflow/core/protobuf/data/experimental/snapshot.proto b/tensorflow/core/protobuf/data/experimental/snapshot.proto ---- a/tensorflow/core/protobuf/data/experimental/snapshot.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/data/experimental/snapshot.proto 2020-03-30 23:56:11.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-02-08 09:40:24.584065472 +0900 @@ -6,6 +6,10 @@ import "tensorflow/core/framework/tensor_shape.proto"; import "tensorflow/core/framework/types.proto"; +option java_outer_classname = "SnapshotProtos"; +option java_multiple_files = true; -+option java_package = "org.tensorflow.util"; ++option java_package = "org.tensorflow.data.experimental"; + // Each SnapshotRecord represents one batch of pre-processed input data. A batch // consists of a list of tensors that we encode as TensorProtos. This message // doesn't store the structure of the batch. -diff -ruN a/tensorflow/core/protobuf/device_properties.proto b/tensorflow/core/protobuf/device_properties.proto ---- a/tensorflow/core/protobuf/device_properties.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/device_properties.proto 2020-03-30 23:44:22.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto 2021-02-08 09:41:23.317918806 +0900 @@ -19,6 +19,8 @@ option cc_enable_arenas = true; option java_outer_classname = "DevicePropertiesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; message DeviceProperties { -diff -ruN a/tensorflow/core/protobuf/saved_object_graph.proto b/tensorflow/core/protobuf/saved_object_graph.proto ---- a/tensorflow/core/protobuf/saved_object_graph.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/saved_object_graph.proto 2020-03-30 23:36:13.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto 2021-02-08 09:41:50.066852012 +0900 @@ -11,6 +11,9 @@ option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +option java_outer_classname = "SavedObjectGraphProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; // A SavedObjectGraph is part of object-based SavedModels in TF 2.0. It // describes the directed graph of Python objects (or equivalent in other -diff -ruN a/tensorflow/core/protobuf/struct.proto b/tensorflow/core/protobuf/struct.proto ---- a/tensorflow/core/protobuf/struct.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/struct.proto 2020-03-30 23:45:26.000000000 -0400 -@@ -6,6 +6,9 @@ +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto 2021-02-08 09:42:06.645810614 +0900 +@@ -7,6 +7,9 @@ import "tensorflow/core/framework/types.proto"; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +option java_outer_classname = "StructProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; // `StructuredValue` represents a dynamically typed value representing various // data structures that are inspired by Python data structures typically used in -diff -ruN a/tensorflow/core/protobuf/trackable_object_graph.proto b/tensorflow/core/protobuf/trackable_object_graph.proto ---- a/tensorflow/core/protobuf/trackable_object_graph.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/trackable_object_graph.proto 2020-03-30 23:51:22.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto 2021-02-08 09:42:24.581760720 +0900 @@ -4,6 +4,9 @@ option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +option java_outer_classname = "TrackableObjectGraphProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; // A TensorBundle addition which saves extra information about the objects which // own variables, allowing for more robust checkpoint loading into modified -diff -ruN a/tensorflow/core/protobuf/transport_options.proto b/tensorflow/core/protobuf/transport_options.proto ---- a/tensorflow/core/protobuf/transport_options.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/transport_options.proto 2020-03-30 23:53:15.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/transport_options.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto +--- tensorflow-2.4.1/tensorflow/core/protobuf/transport_options.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto 2021-02-08 09:42:56.660650580 +0900 @@ -3,6 +3,7 @@ package tensorflow; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; + option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; +option java_package = "org.tensorflow.distruntime"; // Extra data needed on a non-RDMA RecvBufResponse. message RecvBufRespExtra { -diff -ruN a/tensorflow/core/lib/core/error_codes.proto b/tensorflow/core/lib/core/error_codes.proto ---- a/tensorflow/core/lib/core/error_codes.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/lib/core/error_codes.proto 2020-03-30 23:44:22.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/lib/core/error_codes.proto tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto +--- tensorflow-2.4.1/tensorflow/core/lib/core/error_codes.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto 2021-02-08 09:40:24.590065457 +0900 @@ -1,3 +1,5 @@ syntax = "proto3"; - + +option java_package = "org.tensorflow.framework"; + import public "tensorflow/core/protobuf/error_codes.proto"; -diff -ruN a/tensorflow/core/profiler/protobuf/xplane.proto b/tensorflow/core/profiler/protobuf/xplane.proto ---- a/tensorflow/core/profiler/protobuf/xplane.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/profiler/protobuf/xplane.proto 2020-03-30 23:44:22.000000000 -0400 +diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto +--- tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto 2021-02-08 09:40:24.591065455 +0900 @@ -3,6 +3,9 @@ package tensorflow.profiler; - + option cc_enable_arenas = true; +option java_outer_classname = "XPlaneProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.profiler"; - + // A container of parallel XPlanes, generated by one or more profiling sources. - // Next ID: 2 -diff -ruN a/tensorflow/core/util/memmapped_file_system.proto b/tensorflow/core/util/memmapped_file_system.proto ---- a/tensorflow/core/util/memmapped_file_system.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/util/memmapped_file_system.proto 2020-03-30 23:44:22.000000000 -0400 + // Next ID: 5 +diff -ruN tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto +--- tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto 2021-02-08 09:40:24.592065452 +0900 @@ -17,6 +17,9 @@ package tensorflow; - + option cc_enable_arenas = true; +option java_outer_classname = "MemmappedFileSystemProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.util"; - + // A message that describes one region of memmapped file. message MemmappedFileSystemDirectoryElement { -diff --git a/tensorflow/core/profiler/profiler_options.proto b/tensorflow/core/profiler/profiler_options.proto -index 8b4fc3de6f..9a34ea5aaf 100644 ---- a/tensorflow/core/profiler/profiler_options.proto -+++ b/tensorflow/core/profiler/profiler_options.proto +diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto +--- tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto 2021-01-21 09:25:54.000000000 +0900 ++++ tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto 2021-02-08 09:40:24.593065450 +0900 @@ -1,6 +1,9 @@ syntax = "proto3"; - + package tensorflow; +option java_outer_classname = "ProfilerOptionsProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.profiler"; - + + // Next ID: 11 message ProfileOptions { - // Some default value of option are not proto3 default value. Use this version \ No newline at end of file + +diff --git a/tensorflow/core/protobuf/data/experimental/service_config.proto b/tensorflow/core/protobuf/data/experimental/service_config.proto +index 3dcd2cd48d..ae2cfdd94f 100644 +--- a/tensorflow/core/protobuf/data/experimental/service_config.proto ++++ b/tensorflow/core/protobuf/data/experimental/service_config.proto +@@ -1,6 +1,7 @@ + syntax = "proto3"; + + package tensorflow.data.experimental; ++option java_package = "org.tensorflow.data.experimental"; + + // Configuration for a tf.data service DispatchServer. + message DispatcherConfig { diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 8e303f1f235..f6a2ca2a14c 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -214,6 +214,7 @@ ${project.basedir}/bazel-${project.artifactId}/external/org_tensorflow/ + ${project.basedir}/bazel-bin/external/llvm_openmp/ ${project.basedir}/bazel-bin/external/org_tensorflow/tensorflow/ @@ -364,7 +365,6 @@ org/tensorflow/internal/c_api/${native.classifier}/*.lib org/tensorflow/internal/c_api/${native.classifier}/*.obj org/tensorflow/internal/c_api/${native.classifier}/*mklml* - org/tensorflow/internal/c_api/${native.classifier}/*iomp5* org/tensorflow/internal/c_api/${native.classifier}/*msvcr120* diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt index 6257954940d..5b2950c34fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt @@ -1,6 +1,5 @@ op { graph_op_name: "CSVDataset" - visibility: VISIBLE endpoint { name: "data.CSVDataset" } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDatasetV2.pbtxt new file mode 100644 index 00000000000..bba2cafbdb7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDatasetV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "CSVDatasetV2" + endpoint { + name: "data.CSVDatasetV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt index a5c7a7ffaba..8ada333e446 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt @@ -3,8 +3,4 @@ op { endpoint { name: "collective.BroadcastRecv" } - out_arg: { - name: "data" - rename_to: "output" - } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt index 628ad951a5b..18b4bef345e 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt @@ -3,8 +3,4 @@ op { endpoint { name: "collective.BroadcastSend" } - out_arg: { - name: "data" - rename_to: "output" - } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt index 5be0737f80a..06de25f3442 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt @@ -1,7 +1,10 @@ op { graph_op_name: "CollectiveGather" - out_arg: { - name: "data" - rename_to: "output" + endpoint: { + name: "collective.Gather" + } + endpoint: { + name: "CollectiveGather" + deprecated: true } } \ No newline at end of file diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGatherV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGatherV2.pbtxt new file mode 100644 index 00000000000..58f3ec99b53 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGatherV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "CollectiveGatherV2" + endpoint: { + name: "collective.GatherV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt index 84251a19aa5..0453fcdcdf6 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt @@ -1,10 +1,10 @@ op { graph_op_name: "CollectiveReduce" endpoint { - name: "collective.AllReduce" + name: "collective.Reduce" } - out_arg: { - name: "data" - rename_to: "output" + endpoint { + name: "collective.AllReduce" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduceV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduceV2.pbtxt new file mode 100644 index 00000000000..c3cbd7d2a39 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduceV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "CollectiveReduceV2" + endpoint { + name: "collective.ReduceV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ComputeBatchSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ComputeBatchSize.pbtxt new file mode 100644 index 00000000000..fd383570c1a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ComputeBatchSize.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "ComputeBatchSize" + endpoint { + name: "train.ComputeBatchSize" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DecodeImage.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DecodeImage.pbtxt new file mode 100644 index 00000000000..2cc6d31d1d1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DecodeImage.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "DecodeImage" + endpoint { + name: "image.DecodeImage" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EmptyTensorMap.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EmptyTensorMap.pbtxt new file mode 100644 index 00000000000..cf5cf52c931 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EmptyTensorMap.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "EmptyTensorMap" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ImageProjectiveTransformV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ImageProjectiveTransformV3.pbtxt new file mode 100644 index 00000000000..765ffe8107a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ImageProjectiveTransformV3.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "ImageProjectiveTransformV3" + endpoint { + name: "image.ImageProjectiveTransformV3" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IsotonicRegression.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IsotonicRegression.pbtxt new file mode 100644 index 00000000000..ec88abda69e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IsotonicRegression.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "IsotonicRegression" + endpoint { + name: "nn.IsotonicRegression" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KthOrderStatistic.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KthOrderStatistic.pbtxt new file mode 100644 index 00000000000..9e737cdf29c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KthOrderStatistic.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "KthOrderStatistic" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MakeUnique.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MakeUnique.pbtxt new file mode 100644 index 00000000000..a485fd5b938 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MakeUnique.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "MakeUnique" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt index 26ee24f6cde..eec537f2059 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt @@ -1,7 +1,10 @@ op { graph_op_name: "NcclAllReduce" - out_arg: { - name: "data" - rename_to: "output" + endpoint: { + name: "distribute.NcclAllReduce" + } + endpoint: { + name: "NcclAllReduce" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclBroadcast.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclBroadcast.pbtxt index b9b1a345c93..42150e2853b 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclBroadcast.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclBroadcast.pbtxt @@ -1,3 +1,10 @@ op { graph_op_name: "NcclBroadcast" + endpoint: { + name: "distribute.NcclBroadcast" + } + endpoint: { + name: "NcclBroadcast" + deprecated: true + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt index 42c6e131c14..77ce0f6d79a 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt @@ -1,7 +1,10 @@ op { graph_op_name: "NcclReduce" - out_arg: { - name: "data" - rename_to: "output" + endpoint: { + name: "distribute.NcclReduce" + } + endpoint: { + name: "NcclReduce" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDatasetV2.pbtxt new file mode 100644 index 00000000000..7f04d4d27a0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDatasetV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "OptimizeDatasetV2" + endpoint { + name: "data.OptimizeDatasetV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueTupleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueTupleV2.pbtxt new file mode 100644 index 00000000000..7fdebc8a3bd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueTupleV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "OutfeedDequeueTupleV2" + endpoint { + name: "tpu.OutfeedDequeueTupleV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueV2.pbtxt new file mode 100644 index 00000000000..cc61dd2a047 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OutfeedDequeueV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "OutfeedDequeueV2" + endpoint { + name: "tpu.OutfeedDequeueV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV3.pbtxt index c9e52e770a1..ce20ef12386 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV3.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV3.pbtxt @@ -1,5 +1,8 @@ op { graph_op_name: "QuantizeAndDequantizeV3" + endpoint { + name: "quantization.QuantizeAndDequantizeV3" + } endpoint { name: "quantization.QuantizeAndDequantize" } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4.pbtxt new file mode 100644 index 00000000000..9920bcd06a4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "QuantizeAndDequantizeV4" + endpoint { + name: "quantization.QuantizeAndDequantizeV4" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4Grad.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4Grad.pbtxt new file mode 100644 index 00000000000..49ee4ab14a7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV4Grad.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "QuantizeAndDequantizeV4Grad" + endpoint { + name: "quantization.QuantizeAndDequantizeV4Grad" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RaggedTensorToVariantGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RaggedTensorToVariantGradient.pbtxt new file mode 100644 index 00000000000..53abb4a0d2f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RaggedTensorToVariantGradient.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "RaggedTensorToVariantGradient" + endpoint { + name: "ragged.RaggedTensorToVariantGradient" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDatasetV2.pbtxt new file mode 100644 index 00000000000..f287e867d2d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDatasetV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "RebatchDatasetV2" + endpoint { + name: "data.RebatchDatasetV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RngReadAndSkip.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RngReadAndSkip.pbtxt new file mode 100644 index 00000000000..92057c8e041 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RngReadAndSkip.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "RngReadAndSkip" + endpoint { + name: "random.RngReadAndSkip" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessCase.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessCase.pbtxt new file mode 100644 index 00000000000..ded4c85ca32 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessCase.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "StatelessCase" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomGetKeyCounterAlg.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomGetKeyCounterAlg.pbtxt new file mode 100644 index 00000000000..f38cd9e7d55 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomGetKeyCounterAlg.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessRandomGetKeyCounterAlg" + endpoint { + name: "random.StatelessRandomGetKeyCounterAlg" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomNormalV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomNormalV2.pbtxt new file mode 100644 index 00000000000..db288c2cc74 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomNormalV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessRandomNormalV2" + endpoint { + name: "random.StatelessRandomNormalV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformFullIntV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformFullIntV2.pbtxt new file mode 100644 index 00000000000..f09a676ba26 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformFullIntV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessRandomUniformFullIntV2" + endpoint { + name: "random.StatelessRandomUniformFullIntV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformIntV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformIntV2.pbtxt new file mode 100644 index 00000000000..6d1578464cf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformIntV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessRandomUniformIntV2" + endpoint { + name: "random.StatelessRandomUniformIntV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformV2.pbtxt new file mode 100644 index 00000000000..006d0ce695d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessRandomUniformV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessRandomUniformV2" + endpoint { + name: "random.StatelessRandomUniformV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessSampleDistortedBoundingBox.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessSampleDistortedBoundingBox.pbtxt new file mode 100644 index 00000000000..fb5828c0016 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessSampleDistortedBoundingBox.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessSampleDistortedBoundingBox" + endpoint { + name: "image.StatelessSampleDistortedBoundingBox" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessTruncatedNormalV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessTruncatedNormalV2.pbtxt new file mode 100644 index 00000000000..61448d89e57 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_StatelessTruncatedNormalV2.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "StatelessTruncatedNormalV2" + endpoint { + name: "random.StatelessTruncatedNormalV2" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompilationResult.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompilationResult.pbtxt index 9f90a778dab..52d5f4ef40c 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompilationResult.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompilationResult.pbtxt @@ -1,6 +1,10 @@ op { graph_op_name: "TPUCompilationResult" + endpoint { + name: "tpu.CompilationResult" + } endpoint { name: "tpu.TPUCompilationResult" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompile.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompile.pbtxt new file mode 100644 index 00000000000..78361b1e6ab --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompile.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUCompile" + endpoint: { + name: "tpu.Compile" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompileSucceededAssert.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompileSucceededAssert.pbtxt new file mode 100644 index 00000000000..de403819900 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUCompileSucceededAssert.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUCompileSucceededAssert" + endpoint: { + name: "tpu.CompileSucceededAssert" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUEmbeddingActivations.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUEmbeddingActivations.pbtxt index 3645ea9ffba..9e71e00a371 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUEmbeddingActivations.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUEmbeddingActivations.pbtxt @@ -1,6 +1,10 @@ op { graph_op_name: "TPUEmbeddingActivations" + endpoint { + name: "tpu.EmbeddingActivations" + } endpoint { name: "tpu.TPUEmbeddingActivations" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecute.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecute.pbtxt new file mode 100644 index 00000000000..8d6be612503 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecute.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUExecute" + endpoint: { + name: "tpu.Execute" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecuteAndUpdateVariables.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecuteAndUpdateVariables.pbtxt new file mode 100644 index 00000000000..d51c7b9b39e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUExecuteAndUpdateVariables.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUExecuteAndUpdateVariables" + endpoint: { + name: "tpu.ExecuteAndUpdateVariables" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUOrdinalSelector.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUOrdinalSelector.pbtxt index 9c176bcdf33..45fd42ed30b 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUOrdinalSelector.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUOrdinalSelector.pbtxt @@ -1,6 +1,6 @@ op { graph_op_name: "TPUOrdinalSelector" endpoint { - name: "tpu.TPUOrdinalSelector" + name: "tpu.OrdinalSelector" } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedCall.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedCall.pbtxt index da08bb0826f..dc133981735 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedCall.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedCall.pbtxt @@ -1,6 +1,6 @@ op { graph_op_name: "TPUPartitionedCall" endpoint { - name: "tpu.TPUPartitionedCall" + name: "tpu.PartitionedCall" } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedInput.pbtxt new file mode 100644 index 00000000000..a0bc380b30c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedInput.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUPartitionedInput" + endpoint: { + name: "tpu.PartitionedInput" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedOutput.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedOutput.pbtxt new file mode 100644 index 00000000000..2b7bf743767 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUPartitionedOutput.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "TPUPartitionedOutput" + endpoint: { + name: "tpu.PartitionedOutput" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicateMetadata.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicateMetadata.pbtxt index 17677bb9164..b6a02c9970c 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicateMetadata.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicateMetadata.pbtxt @@ -1,6 +1,10 @@ op { graph_op_name: "TPUReplicateMetadata" + endpoint { + name: "tpu.ReplicateMetadata" + } endpoint { name: "tpu.TPUReplicateMetadata" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedInput.pbtxt index b251b2687f7..436fd057719 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedInput.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedInput.pbtxt @@ -1,6 +1,10 @@ op { graph_op_name: "TPUReplicatedInput" + endpoint { + name: "tpu.ReplicatedInput" + } endpoint { name: "tpu.TPUReplicatedInput" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedOutput.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedOutput.pbtxt index 4f954aedf4d..077eaf01c3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedOutput.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TPUReplicatedOutput.pbtxt @@ -1,6 +1,10 @@ op { graph_op_name: "TPUReplicatedOutput" + endpoint { + name: "tpu.ReplicatedOutput" + } endpoint { name: "tpu.TPUReplicatedOutput" + deprecated: true } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapErase.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapErase.pbtxt new file mode 100644 index 00000000000..ccdc25f3e23 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapErase.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TensorMapErase" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapHasKey.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapHasKey.pbtxt new file mode 100644 index 00000000000..1b7d4dc5187 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapHasKey.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TensorMapHasKey" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapInsert.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapInsert.pbtxt new file mode 100644 index 00000000000..e11af0f9f9d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapInsert.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TensorMapInsert" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapLookup.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapLookup.pbtxt new file mode 100644 index 00000000000..6082a8a716a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapLookup.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TensorMapLookup" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapSize.pbtxt new file mode 100644 index 00000000000..4404fe87304 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapSize.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "TensorMapSize" + out_arg { + name: "size" + rename_to: "output" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapStackKeys.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapStackKeys.pbtxt new file mode 100644 index 00000000000..db5ed2c5d7d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TensorMapStackKeys.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TensorMapStackKeys" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKUnique.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKUnique.pbtxt new file mode 100644 index 00000000000..4f73b1d2114 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKUnique.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TopKUnique" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKWithUnique.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKWithUnique.pbtxt new file mode 100644 index 00000000000..2db3b19ab22 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_TopKWithUnique.pbtxt @@ -0,0 +1,3 @@ +op { + graph_op_name: "TopKWithUnique" +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaHostCompute.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaHostCompute.pbtxt new file mode 100644 index 00000000000..2738b74c205 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaHostCompute.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "XlaHostCompute" + endpoint: { + name: "xla.XlaHostCompute" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaRecvFromHost.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaRecvFromHost.pbtxt new file mode 100644 index 00000000000..c5bbf50280d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaRecvFromHost.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "XlaRecvFromHost" + endpoint: { + name: "xla.XlaRecvFromHost" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSendToHost.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSendToHost.pbtxt new file mode 100644 index 00000000000..0168ae42782 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSendToHost.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "XlaSendToHost" + endpoint: { + name: "xla.XlaSendToHost" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSetBound.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSetBound.pbtxt new file mode 100644 index 00000000000..3a53a0e79fe --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaSetBound.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "XlaSetBound" + endpoint: { + name: "xla.XlaSetBound" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaVariadicReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaVariadicReduce.pbtxt new file mode 100644 index 00000000000..7bd52b37d87 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_XlaVariadicReduce.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "XlaVariadicReduce" + endpoint: { + name: "xla.XlaVariadicReduce" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/import/api_import.cc b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/import/api_import.cc index 1aed5fdb699..0d43afb5e6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/import/api_import.cc +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/import/api_import.cc @@ -155,7 +155,7 @@ int main(int argc, char* argv[]) { Env* env = Env::Default(); void* tf_lib_handle; - TF_CHECK_OK(env->LoadLibrary(tf_lib_path.c_str(), &tf_lib_handle)); // This registers all TF ops + TF_CHECK_OK(env->LoadDynamicLibrary(tf_lib_path.c_str(), &tf_lib_handle)); // This registers all TF ops OpList op_defs; OpRegistry::Global()->Export(false, &op_defs); ApiDefMap python_api_map(op_defs); diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_gen_main.cc b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_gen_main.cc index 5ab9c820832..2fade4fe3e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_gen_main.cc +++ b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_gen_main.cc @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) { tensorflow::Env* env = tensorflow::Env::Default(); void* ops_libs_handles[50]; for (int i = 1; i < argc; ++i) { - TF_CHECK_OK(env->LoadLibrary(argv[1], &ops_libs_handles[i - 1])); + TF_CHECK_OK(env->LoadDynamicLibrary(argv[1], &ops_libs_handles[i - 1])); } tensorflow::java::OpGenerator generator(api_dirs); tensorflow::OpList ops; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java index f5f3e7ebf86..56f85b0ea9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java @@ -22,7 +22,6 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.data.AnonymousIterator; import org.tensorflow.op.data.BatchDataset; -import org.tensorflow.op.data.CSVDataset; import org.tensorflow.op.data.ConcatenateDataset; import org.tensorflow.op.data.DeleteIterator; import org.tensorflow.op.data.DeserializeIterator; @@ -98,27 +97,6 @@ public BatchDataset batchDataset(Operand inputDataset, Operand batchS return BatchDataset.create(scope, inputDataset, batchSize, dropRemainder, outputTypes, outputShapes, options); } - /** - * - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param outputShapes - * @return a new instance of CSVDataset - */ - public CSVDataset cSVDataset(Operand filenames, Operand compressionType, - Operand bufferSize, Operand header, Operand fieldDelim, - Operand useQuoteDelim, Operand naValue, Operand selectCols, - Iterable> recordDefaults, List outputShapes) { - return CSVDataset.create(scope, filenames, compressionType, bufferSize, header, fieldDelim, useQuoteDelim, naValue, selectCols, recordDefaults, outputShapes); - } - /** * Creates a dataset that concatenates `input_dataset` with `another_dataset`. * diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java index 9ef048655ba..bd9ed2907ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java @@ -29,6 +29,7 @@ import org.tensorflow.op.image.DecodeAndCropJpeg; import org.tensorflow.op.image.DecodeBmp; import org.tensorflow.op.image.DecodeGif; +import org.tensorflow.op.image.DecodeImage; import org.tensorflow.op.image.DecodeJpeg; import org.tensorflow.op.image.DecodePng; import org.tensorflow.op.image.DrawBoundingBoxes; @@ -49,6 +50,7 @@ import org.tensorflow.op.image.RgbToHsv; import org.tensorflow.op.image.SampleDistortedBoundingBox; import org.tensorflow.op.image.ScaleAndTranslate; +import org.tensorflow.op.image.StatelessSampleDistortedBoundingBox; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -357,6 +359,69 @@ public DecodeGif decodeGif(Operand contents) { return DecodeGif.create(scope, contents); } + /** + * 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 of type + * dtype. + *

+ * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as + * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays + * [height, width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or + * PNG files. Alternately, set the expand_animations argument of this function to + * False, in which case the op will return 3-dimensional tensors and will truncate + * animated GIF files to the first frame. + *

+ * NOTE: If the first frame of an animated GIF does not occupy the entire + * canvas (maximum frame width x maximum frame height), then it fills the + * unoccupied areas (in the first frame) with zeros (black). For frames after the + * first frame that does not occupy the entire canvas, it uses the previous + * frame to fill the unoccupied areas. + * + * @param data type for {@code image()} output + * @param contents 0-D. The encoded image bytes. + * @param options carries optional attributes values + * @return a new instance of DecodeImage + */ + public DecodeImage decodeImage(Operand contents, + DecodeImage.Options... options) { + return DecodeImage.create(scope, contents, options); + } + + /** + * 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 of type + * dtype. + *

+ * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as + * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays + * [height, width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or + * PNG files. Alternately, set the expand_animations argument of this function to + * False, in which case the op will return 3-dimensional tensors and will truncate + * animated GIF files to the first frame. + *

+ * NOTE: If the first frame of an animated GIF does not occupy the entire + * canvas (maximum frame width x maximum frame height), then it fills the + * unoccupied areas (in the first frame) with zeros (black). For frames after the + * first frame that does not occupy the entire canvas, it uses the previous + * frame to fill the unoccupied areas. + * + * @param data type for {@code image()} output + * @param contents 0-D. The encoded image bytes. + * @param dtype The desired DType of the returned Tensor. + * @param options carries optional attributes values + * @return a new instance of DecodeImage + */ + public DecodeImage decodeImage(Operand contents, Class dtype, + DecodeImage.Options... options) { + return DecodeImage.create(scope, contents, dtype, options); + } + /** * Decode a JPEG-encoded image to a uint8 tensor. *

@@ -945,6 +1010,87 @@ public ScaleAndTranslate scaleAndTranslate(Operand images, return ScaleAndTranslate.create(scope, images, size, scale, translation, options); } + /** + * Generate a randomly distorted bounding box for an image deterministically. + *

+ * Bounding box annotations are often supplied in addition to ground-truth labels + * in image recognition or object localization tasks. A common technique for + * training such a system is to randomly distort an image while preserving its + * content, i.e. data augmentation. This Op, given the same `seed`, + * deterministically outputs a randomly distorted localization of an object, i.e. + * bounding box, given an `image_size`, `bounding_boxes` and a series of + * constraints. + *

+ * The output of this Op is a single bounding box that may be used to crop the + * original image. The output is returned as 3 tensors: `begin`, `size` and + * `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the + * image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize + * what the bounding box looks like. + *

+ * Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The + * bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and + * the height of the underlying image. + *

+ * The output of this Op is guaranteed to be the same given the same `seed` and is + * independent of how many times the function is called, and independent of global + * seed settings (e.g. `tf.random.set_seed`). + *

+ * Example usage: + *

+ * >>> image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) + * >>> bbox = tf.constant( + * ... [0.0, 0.0, 1.0, 1.0], dtype=tf.float32, shape=[1, 1, 4]) + * >>> seed = (1, 2) + * >>> # Generate a single distorted bounding box. + * >>> bbox_begin, bbox_size, bbox_draw = ( + * ... tf.image.stateless_sample_distorted_bounding_box( + * ... tf.shape(image), bounding_boxes=bbox, seed=seed)) + * >>> # Employ the bounding box to distort the image. + * >>> tf.slice(image, bbox_begin, bbox_size) + * + * >>> # Draw the bounding box in an image summary. + * >>> colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) + * >>> tf.image.draw_bounding_boxes( + * ... tf.expand_dims(tf.cast(image, tf.float32),0), bbox_draw, colors) + * + *

+ * Note that if no bounding box information is available, setting + * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit + * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + * false and no bounding boxes are supplied, an error is raised. + * + * @param data type for {@code begin()} output + * @param imageSize 1-D, containing `[height, width, channels]`. + * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * associated with the image. + * @param minObjectCovered The cropped area of the image must contain at least this + * fraction of any bounding box supplied. The value of this parameter should be + * non-negative. In the case of 0, the cropped area does not need to overlap + * any of the bounding boxes supplied. + * @param seed 1-D with shape `[2]`. The seed to the random number generator. Must have dtype + * `int32` or `int64`. (When using XLA, only `int32` is allowed.) + * @param options carries optional attributes values + * @return a new instance of StatelessSampleDistortedBoundingBox + */ + public StatelessSampleDistortedBoundingBox statelessSampleDistortedBoundingBox( + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Operand seed, StatelessSampleDistortedBoundingBox.Options... options) { + return StatelessSampleDistortedBoundingBox.create(scope, imageSize, boundingBoxes, minObjectCovered, seed, options); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java index f5d8d22e85e..a8e9c0d8a4c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java @@ -511,10 +511,9 @@ public EuclideanNorm euclideanNorm(Operand input, } /** - * Computes the inverse of one or more square invertible matrices or their - *

- * adjoints (conjugate transposes). + * Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). *

+ * * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions * form square matrices. The output is a tensor of the same shape as the input * containing the inverse for all input submatrices `[..., :, :]`. @@ -611,9 +610,9 @@ public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, * The input is a tensor of shape `[N, M, M]` whose inner-most 2 dimensions * form square matrices. The outputs are two tensors containing the signs and * absolute values of the log determinants for all N input submatrices - * `[..., :, :]` such that the determinant = sign*exp(log_abs_determinant). - * The log_abs_determinant is computed as det(P)*sum(log(diag(LU))) where LU - * is the LU decomposition of the input and P is the corresponding + * `[..., :, :]` such that `determinant = sign*exp(log_abs_determinant)`. + * The `log_abs_determinant` is computed as `det(P)*sum(log(diag(LU)))` where `LU` + * is the `LU` decomposition of the input and `P` is the corresponding * permutation matrix. * * @param data type for {@code sign()} output @@ -1334,6 +1333,10 @@ public MatrixSolveLs matrixSolveLs(Operand matrix, Opera *

* Computes the QR decomposition of each inner matrix in `tensor` such that * `tensor[..., :, :] = q[..., :, :] * r[..., :,:])` + *

+ * Currently, the gradient for the QR decomposition is well-defined only when + * the first `P` columns of the inner matrix are linearly independent, where + * `P` is the minimum of `M` and `N`, the 2 inner-most dimmensions of `tensor`. *

{@code
    *  # a is a tensor.
    *  # q is a tensor of orthonormal matrices.
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java
index 5027828c262..a70e6d72717 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java
@@ -182,6 +182,11 @@ public  AccumulateN accumulateN(Iterable> inputs,
 
   /**
    * Computes acos of x element-wise.
+   *  

+ * + * Provided an input tensor, the `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`. + *

+ * Input range is `[-1, 1]` and the output has a range of `[0, pi]`. * * @param data type for {@code y()} output * @param x @@ -214,6 +219,10 @@ public Acosh acosh(Operand x) { *

* NOTE: `math.Add` supports broadcasting. `AddN` does not. More about broadcasting * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

+ * Given two input tensors, the `tf.add` operation computes the sum for every element in the tensor. + *

+ * Both input and output have a range `(-inf, inf)`. * * @param data type for {@code z()} output * @param x @@ -2072,7 +2081,7 @@ public Square square(Operand x) { } /** - * Returns (x - y)(x - y) element-wise. + * Returns conj(x - y)(x - y) element-wise. *

* NOTE: `math.SquaredDifference` supports broadcasting. More about broadcasting * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) @@ -2129,10 +2138,11 @@ public Tan tan(Operand x) { * element in the tensor. Input range is `[-inf, inf]` and * output range is `[-1,1]`. *

- *

{@code
-   *    x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
-   *    tf.math.tanh(x) ==> [-1. -0.99990916 -0.46211717 0.7615942 0.8336547 0.9640276 0.9950547 1.]
-   *    }
+ * >>> x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) + * >>> tf.math.tanh(x) + * * * @param data type for {@code y()} output * @param x diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java index 5ec7f93020f..4f724578d14 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java @@ -136,6 +136,9 @@ public AvgPool avgPool(Operand value, List ksize /** * Performs 3D average pooling on the input. + *

+ * Each entry in `output` is the mean of the corresponding size `ksize` window in + * `value`. * * @param data type for {@code output()} output * @param input Shape `[batch, depth, rows, cols, channels]` tensor to pool over. @@ -666,9 +669,28 @@ public DataFormatDimMap dataFormatDimMap(Operand x, } /** - * Returns the permuted vector/tensor in the destination data format given the + * Permute input tensor from `src_format` to `dst_format`. + *

+ * Input tensor must be a vector of size 4, or a 4x2 tensor. *

- * one in the source data format. + * For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and inputs: + *

{@code
+   *  [1, 2, 3, 4]
+   *  }
+ * and + *
{@code
+   *  [[1, 2, 3, 4],
+   *   [5, 6, 7, 8]]
+   *  }
+ * , the outputs will be (respectively): + *
{@code
+   *  [1, 4, 2, 3]
+   *  }
+ * and + *
{@code
+   *  [[1, 4, 2, 3],
+   *   [5, 8, 6, 7]]
+   *  }
* * @param data type for {@code y()} output * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java index 84736ada6a5..bb3a2098d86 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java @@ -67,6 +67,7 @@ import org.tensorflow.op.core.ConsumeMutexLock; import org.tensorflow.op.core.ControlTrigger; import org.tensorflow.op.core.CountUpTo; +import org.tensorflow.op.core.DecodeProto; import org.tensorflow.op.core.DeepCopy; import org.tensorflow.op.core.DeleteSessionTensor; import org.tensorflow.op.core.DestroyResourceOp; @@ -76,6 +77,8 @@ import org.tensorflow.op.core.EditDistance; import org.tensorflow.op.core.Empty; import org.tensorflow.op.core.EmptyTensorList; +import org.tensorflow.op.core.EmptyTensorMap; +import org.tensorflow.op.core.EncodeProto; import org.tensorflow.op.core.EnsureShape; import org.tensorflow.op.core.ExpandDims; import org.tensorflow.op.core.ExtractVolumePatches; @@ -100,12 +103,14 @@ import org.tensorflow.op.core.InplaceSub; import org.tensorflow.op.core.InplaceUpdate; import org.tensorflow.op.core.IsVariableInitialized; +import org.tensorflow.op.core.KthOrderStatistic; import org.tensorflow.op.core.LookupTableExport; import org.tensorflow.op.core.LookupTableFind; import org.tensorflow.op.core.LookupTableImport; import org.tensorflow.op.core.LookupTableInsert; import org.tensorflow.op.core.LookupTableSize; import org.tensorflow.op.core.LoopCond; +import org.tensorflow.op.core.MakeUnique; import org.tensorflow.op.core.MapClear; import org.tensorflow.op.core.MapIncompleteSize; import org.tensorflow.op.core.MapPeek; @@ -243,6 +248,12 @@ import org.tensorflow.op.core.TensorListSetItem; import org.tensorflow.op.core.TensorListSplit; import org.tensorflow.op.core.TensorListStack; +import org.tensorflow.op.core.TensorMapErase; +import org.tensorflow.op.core.TensorMapHasKey; +import org.tensorflow.op.core.TensorMapInsert; +import org.tensorflow.op.core.TensorMapLookup; +import org.tensorflow.op.core.TensorMapSize; +import org.tensorflow.op.core.TensorMapStackKeys; import org.tensorflow.op.core.TensorScatterNdAdd; import org.tensorflow.op.core.TensorScatterNdMax; import org.tensorflow.op.core.TensorScatterNdMin; @@ -251,6 +262,8 @@ import org.tensorflow.op.core.TensorStridedSliceUpdate; import org.tensorflow.op.core.Tile; import org.tensorflow.op.core.Timestamp; +import org.tensorflow.op.core.TopKUnique; +import org.tensorflow.op.core.TopKWithUnique; import org.tensorflow.op.core.TryRpc; import org.tensorflow.op.core.Unbatch; import org.tensorflow.op.core.UnbatchGrad; @@ -337,6 +350,8 @@ public final class Ops { public final SparseOps sparse; + public final TpuOps tpu; + public final BitwiseOps bitwise; public final MathOps math; @@ -345,10 +360,10 @@ public final class Ops { public final SignalOps signal; - public final TrainOps train; - public final QuantizationOps quantization; + public final TrainOps train; + private final Scope scope; private Ops(Scope scope) { @@ -366,12 +381,13 @@ private Ops(Scope scope) { random = new RandomOps(this); strings = new StringsOps(this); sparse = new SparseOps(this); + tpu = new TpuOps(this); bitwise = new BitwiseOps(this); math = new MathOps(this); audio = new AudioOps(this); signal = new SignalOps(this); - train = new TrainOps(this); quantization = new QuantizationOps(this); + train = new TrainOps(this); } /** @@ -1918,6 +1934,71 @@ public CountUpTo countUpTo(Operand ref, Long limit) { return CountUpTo.create(scope, ref, limit); } + /** + * The op extracts fields from a serialized protocol buffers message into tensors. + *

+ * The `decode_proto` op extracts fields from a serialized protocol buffers + * message into tensors. The fields in `field_names` are decoded and converted + * to the corresponding `output_types` if possible. + *

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

+ * Each output tensor is a dense tensor. This means that it is padded to hold + * the largest number of repeated elements seen in the input minibatch. (The + * shape is also padded by one to prevent zero-sized dimensions). The actual + * repeat counts for each example in the minibatch can be found in the `sizes` + * output. In many cases the output of `decode_proto` is fed immediately into + * tf.squeeze if missing values are not a concern. When using tf.squeeze, always + * pass the squeeze dimension explicitly to avoid surprises. + *

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

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

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

+ * Both binary and text proto serializations are supported, and can be + * chosen using the `format` attribute. + *

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

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

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

+ * - A "bytes://", in which protocol descriptors are created from ``, + * which is expected to be a `FileDescriptorSet` serialized as a string. + * + * @param bytes Tensor of serialized protos with shape `batch_shape`. + * @param messageType Name of the proto message type to decode. + * @param fieldNames List of strings containing proto field names. An extension field can be decoded + * by using its full name, e.g. EXT_PACKAGE.EXT_FIELD_NAME. + * @param outputTypes List of TF types to use for the respective field in field_names. + * @param options carries optional attributes values + * @return a new instance of DecodeProto + */ + public DecodeProto decodeProto(Operand bytes, String messageType, + List fieldNames, List> outputTypes, + DecodeProto.Options... options) { + return DecodeProto.create(scope, bytes, messageType, fieldNames, outputTypes, options); + } + /** * Makes a copy of `x`. * @@ -2158,6 +2239,73 @@ public EmptyTensorList emptyTensorList(Operand + * handle: an empty tensor map + * + * @return a new instance of EmptyTensorMap + */ + public EmptyTensorMap emptyTensorMap() { + return EmptyTensorMap.create(scope); + } + + /** + * The op serializes protobuf messages provided in the input tensors. + *

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

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

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

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

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

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

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

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

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

+ * - A "bytes://", in which protocol descriptors are created from ``, + * which is expected to be a `FileDescriptorSet` serialized as a string. + * + * @param sizes Tensor of int32 with shape `[batch_shape, len(field_names)]`. + * @param values List of tensors containing values for the corresponding field. + * @param fieldNames List of strings containing proto field names. + * @param messageType Name of the proto message type to decode. + * @param options carries optional attributes values + * @return a new instance of EncodeProto + */ + public EncodeProto encodeProto(Operand sizes, Iterable> values, + List fieldNames, String messageType, EncodeProto.Options... options) { + return EncodeProto.create(scope, sizes, values, fieldNames, messageType, options); + } + /** * Ensures that the tensor's shape matches the expected shape. *

@@ -2218,7 +2366,7 @@ public ExpandDims expandDims(Operand input, } /** - * Extract `patches` from `input` and put them in the "depth" output dimension. 3D extension of `extract_image_patches`. + * Extract `patches` from `input` and put them in the `"depth"` output dimension. 3D extension of `extract_image_patches`. * * @param data type for {@code patches()} output * @param input 5-D Tensor with shape `[batch, in_planes, in_rows, in_cols, depth]`. @@ -2227,10 +2375,10 @@ public ExpandDims expandDims(Operand input, * `input`. Must be: `[1, stride_planes, stride_rows, stride_cols, 1]`. * @param padding The type of padding algorithm to use. *

- * We specify the size-related attributes as: + * The size-related attributes are specified as follows: *

{@code
-   *        ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
-   *        strides = [1, stride_planes, strides_rows, strides_cols, 1]
+   *  ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
+   *  strides = [1, stride_planes, strides_rows, strides_cols, 1]
    *  }
* @return a new instance of ExtractVolumePatches */ @@ -2863,6 +3011,32 @@ public IsVariableInitialized isVariableInitialized(Operand ref) return IsVariableInitialized.create(scope, ref); } + /** + * Computes the Kth order statistic of a data set. The current + *

+ * implementation uses a binary search requiring exactly 32 passes over + * the input data. The running time is linear with respect to input + * size. The median-of-medians algorithm is probably faster, but is + * difficult to implement efficiently in XLA. The implementation imposes + * a total ordering on floats. The ordering is consistent with the usual + * partial order. Positive NaNs are greater than positive + * infinity. Negative NaNs are less than negative infinity. NaNs with + * distinct payloads are treated as distinct. Subnormal numbers are + * preserved (not flushed to zero). Positive infinity is greater than all + * numbers. Negative infinity is less than all numbers. Positive is + * greater than negative zero. There are less than k values greater than + * the kth order statistic. There are at least k values greater than or + * equal to the Kth order statistic. The semantics are not the same as + * top_k_unique. + * + * @param input + * @param k + * @return a new instance of KthOrderStatistic + */ + public KthOrderStatistic kthOrderStatistic(Operand input, Long k) { + return KthOrderStatistic.create(scope, input, k); + } + /** * Outputs all keys and values in the table. * @@ -2953,6 +3127,21 @@ public LoopCond loopCond(Operand input) { return LoopCond.create(scope, input); } + /** + * Make all elements in the non-Batch dimension unique, but \"close\" to + *

+ * their initial value. Never returns a sub-normal number. Never returns + * zero. The sign of each input element is always identical to the sign + * of the corresponding output element. Behavior for infinite elements is + * undefined. Behavior for subnormal elements is undefined. + * + * @param input + * @return a new instance of MakeUnique + */ + public MakeUnique makeUnique(Operand input) { + return MakeUnique.create(scope, input); + } + /** * Op removes all elements in the underlying container. * @@ -6694,6 +6883,103 @@ public TensorListStack tensorListStack(Operand inputHand return TensorListStack.create(scope, inputHandle, elementShape, elementDtype, options); } + /** + * Returns a tensor map with item from given key erased. + *

+ * input_handle: the original map + * output_handle: the map with value from given key removed + * key: the key of the value to be erased + * + * @param inputHandle + * @param key + * @param valueDtype + * @return a new instance of TensorMapErase + */ + public TensorMapErase tensorMapErase(Operand inputHandle, + Operand key, Class valueDtype) { + return TensorMapErase.create(scope, inputHandle, key, valueDtype); + } + + /** + * Returns whether the given key exists in the map. + *

+ * input_handle: the input map + * key: the key to check + * has_key: whether the key is already in the map or not + * + * @param inputHandle + * @param key + * @return a new instance of TensorMapHasKey + */ + public TensorMapHasKey tensorMapHasKey(Operand inputHandle, Operand key) { + return TensorMapHasKey.create(scope, inputHandle, key); + } + + /** + * Returns a map that is the 'input_handle' with the given key-value pair inserted. + *

+ * input_handle: the original map + * output_handle: the map with key and value inserted + * key: the key to be inserted + * value: the value to be inserted + * + * @param inputHandle + * @param key + * @param value + * @return a new instance of TensorMapInsert + */ + public TensorMapInsert tensorMapInsert(Operand inputHandle, Operand key, + Operand value) { + return TensorMapInsert.create(scope, inputHandle, key, value); + } + + /** + * Returns the value from a given key in a tensor map. + *

+ * input_handle: the input map + * key: the key to be looked up + * value: the value found from the given key + * + * @param data type for {@code value()} output + * @param inputHandle + * @param key + * @param valueDtype + * @return a new instance of TensorMapLookup + */ + public TensorMapLookup tensorMapLookup(Operand inputHandle, + Operand key, Class valueDtype) { + return TensorMapLookup.create(scope, inputHandle, key, valueDtype); + } + + /** + * Returns the number of tensors in the input tensor map. + *

+ * input_handle: the input map + * size: the number of tensors in the map + * + * @param inputHandle + * @return a new instance of TensorMapSize + */ + public TensorMapSize tensorMapSize(Operand inputHandle) { + return TensorMapSize.create(scope, inputHandle); + } + + /** + * Returns a Tensor stack of all keys in a tensor map. + *

+ * input_handle: the input map + * keys: the returned Tensor of all keys in the map + * + * @param data type for {@code keys()} output + * @param inputHandle + * @param keyDtype + * @return a new instance of TensorMapStackKeys + */ + public TensorMapStackKeys tensorMapStackKeys(Operand inputHandle, + Class keyDtype) { + return TensorMapStackKeys.create(scope, inputHandle, keyDtype); + } + /** * Adds sparse `updates` to an existing tensor according to `indices`. *

@@ -6876,73 +7162,37 @@ public TensorScatterNdSub tensorScatterNdSub(Operand ten * scattered onto an existing tensor (as opposed to a zero-tensor). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. *

- * If `indices` contains duplicates, then their updates are accumulated (summed). + * If `indices` contains duplicates, then we pick the last update for the index. *

- * WARNING: The order in which updates are applied is nondeterministic, so the - * output will be nondeterministic if `indices` contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. + * If an out of bound index is found on CPU, an error is returned. *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. The last dimension of `indices` can be at most the rank of `shape`: - *

- * indices.shape[-1] <= shape.rank - *

- * The last dimension of `indices` corresponds to indices into elements - * (if `indices.shape[-1] = shape.rank`) or slices - * (if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of - * `shape`. `updates` is a tensor with shape - *

- * indices.shape[:-1] + shape[indices.shape[-1]:] + * WARNING: There are some GPU specific semantics for this operation. + * - If an out of bound index is found, the index is ignored. + * - The order in which updates are applied is nondeterministic, so the output + * will be nondeterministic if `indices` contains duplicates. *

- * The simplest form of scatter is to insert individual elements in a tensor by - * index. For example, say we want to insert 4 scattered elements in a rank-1 - * tensor with 8 elements. - *

- *

- * - *
- *

- * In Python, this scatter operation would look like this: - *

- * >>> indices = tf.constant([[4], [3], [1], [7]]) - * >>> updates = tf.constant([9, 10, 11, 12]) - * >>> tensor = tf.ones([8], dtype=tf.int32) - * >>> print(tf.tensor_scatter_nd_update(tensor, indices, updates)) - * tf.Tensor([ 1 11 1 10 9 1 1 12], shape=(8,), dtype=int32) - *

- * We can also, insert entire slices of a higher rank tensor all at once. For - * example, if we wanted to insert two slices in the first dimension of a - * rank-3 tensor with two matrices of new values. - *

- * In Python, this scatter operation would look like this: - *

- * >>> indices = tf.constant([[0], [2]]) - * >>> updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6], - * ... [7, 7, 7, 7], [8, 8, 8, 8]], - * ... [[5, 5, 5, 5], [6, 6, 6, 6], - * ... [7, 7, 7, 7], [8, 8, 8, 8]]]) - * >>> tensor = tf.ones([4, 4, 4], dtype=tf.int32) - * >>> print(tf.tensor_scatter_nd_update(tensor, indices, updates).numpy()) - * [[[5 5 5 5] - * [6 6 6 6] - * [7 7 7 7] - * [8 8 8 8]] - * [[1 1 1 1] - * [1 1 1 1] - * [1 1 1 1] - * [1 1 1 1]] - * [[5 5 5 5] - * [6 6 6 6] - * [7 7 7 7] - * [8 8 8 8]] - * [[1 1 1 1] - * [1 1 1 1] - * [1 1 1 1] - * [1 1 1 1]]] + * `indices` is an integer tensor containing indices into a new tensor of shape + * `shape`. + *

    + *
  • + * `indices` must have at least 2 axes: `(num_updates, index_depth)`. + *
  • + *
  • + * The last axis of `indices` is how deep to index into `tensor` so this index + * depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim` + *
  • + *
+ * if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements. + * if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input + * `tensor`. *

- * Note that on CPU, if an out of bound index is found, an error is returned. - * On GPU, if an out of bound index is found, the index is ignored. + * Each `update` has a rank of `tensor.rank - indices.shape[-1]`. + * The overall shape of `updates` is: + *

{@code
+   *  indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
+   *  }
+ * For usage examples see the python [tf.tensor_scatter_nd_update]( + * https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function * * @param data type for {@code output()} output * @param tensor Tensor to copy/update. @@ -7033,6 +7283,46 @@ public Timestamp timestamp() { return Timestamp.create(scope); } + /** + * Returns the TopK unique values in the array in sorted order. The + *

+ * running time is proportional to the product of K and the input + * size. Sorting the whole array is more efficient for sufficiently large + * values of K. The median-of-medians algorithm is probably faster, but + * difficult to implement efficiently in XLA. If there are fewer than K + * unique numbers (not NANs), the results are padded with negative + * infinity. NaNs are never returned. Subnormal numbers are flushed to + * zero. If an element appears at multiple indices, the highest index is + * returned. If a TopK element never appears in the input due to padding + * values, the indices are padded with negative one. If a padding value + * appears in the input and padding is needed, the highest index of the + * padding value will be returned. The semantics are not the same as + * kth_order_statistic. + * + * @param input + * @param k + * @return a new instance of TopKUnique + */ + public TopKUnique topKUnique(Operand input, Long k) { + return TopKUnique.create(scope, input, k); + } + + /** + * Returns the TopK values in the array in sorted order. This is a combination + *

+ * of MakeUnique and TopKUnique. The returned top-K will have its lower bits + * replaced by iota, thus it will be close to the original value but not exactly + * the same. The running time is proportional to the product of K and the input + * size. NaNs are never returned. Subnormal numbers are flushed to zero. + * + * @param input + * @param k + * @return a new instance of TopKWithUnique + */ + public TopKWithUnique topKWithUnique(Operand input, Long k) { + return TopKWithUnique.create(scope, input, k); + } + /** * Perform batches of RPC requests. *

diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java index 812f2563605..13323a555af 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java @@ -27,6 +27,9 @@ import org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient; import org.tensorflow.op.quantization.Quantize; import org.tensorflow.op.quantization.QuantizeAndDequantize; +import org.tensorflow.op.quantization.QuantizeAndDequantizeV3; +import org.tensorflow.op.quantization.QuantizeAndDequantizeV4; +import org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad; import org.tensorflow.op.quantization.QuantizeDownAndShrinkRange; import org.tensorflow.op.quantization.QuantizedConcat; import org.tensorflow.op.quantization.RequantizationRange; @@ -530,6 +533,64 @@ public QuantizeAndDequantize quantizeAndDequantize(Operan return QuantizeAndDequantize.create(scope, input, inputMin, inputMax, numBits, options); } + /** + * Quantizes then dequantizes a tensor. + *

+ * This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a + * tensor, so its value can change during training. + * + * @param data type for {@code output()} output + * @param input + * @param inputMin + * @param inputMax + * @param numBits + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV3 + */ + public QuantizeAndDequantizeV3 quantizeAndDequantizeV3(Operand input, + Operand inputMin, Operand inputMax, Operand numBits, + QuantizeAndDequantizeV3.Options... options) { + return QuantizeAndDequantizeV3.create(scope, input, inputMin, inputMax, numBits, options); + } + + /** + * Returns the gradient of `quantization.QuantizeAndDequantizeV4`. + *

+ * This is almost identical to QuantizeAndDequantizeV2, except that it returns a + * gradient of 1 for inputs that are within the quantization range, or 0 otherwise. + * + * @param data type for {@code output()} output + * @param input + * @param inputMin + * @param inputMax + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV4 + */ + public QuantizeAndDequantizeV4 quantizeAndDequantizeV4(Operand input, + Operand inputMin, Operand inputMax, QuantizeAndDequantizeV4.Options... options) { + return QuantizeAndDequantizeV4.create(scope, input, inputMin, inputMax, options); + } + + /** + * Returns the gradient of `QuantizeAndDequantizeV4`. + *

+ * Returns a gradient of 1 for inputs that are within the quantization range, + * or 0 otherwise. + * + * @param data type for {@code inputBackprop()} output + * @param gradients + * @param input + * @param inputMin + * @param inputMax + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV4Grad + */ + public QuantizeAndDequantizeV4Grad quantizeAndDequantizeV4Grad( + Operand gradients, Operand input, Operand inputMin, Operand inputMax, + QuantizeAndDequantizeV4Grad.Options... options) { + return QuantizeAndDequantizeV4Grad.create(scope, gradients, input, inputMin, inputMax, options); + } + /** * Convert the quantized 'input' tensor into a lower-precision 'output', using the *

diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java index d2527c6563f..b9baf04fec6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java @@ -494,7 +494,15 @@ public ToNumber toNumber(Operand stringTensor, C *

* This operation converts Unicode code points to script codes corresponding to * each code point. Script codes correspond to International Components for - * Unicode (ICU) UScriptCode values. See http://icu-project.org/apiref/icu4c/uscript_8h.html. + * Unicode (ICU) UScriptCode values. + *

+ * See + * [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) + * for more details on script codes. + *

+ * For an example, see the unicode strings guide on [unicode scripts] + * (https://www.tensorflow.org/tutorials/load_data/unicode#representing_unicode). + *

* Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will * match input shape. *

diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TpuOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TpuOps.java new file mode 100644 index 00000000000..b9b13e9cc22 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TpuOps.java @@ -0,0 +1,133 @@ +// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.op.tpu.CompileSucceededAssert; +import org.tensorflow.op.tpu.Execute; +import org.tensorflow.op.tpu.ExecuteAndUpdateVariables; +import org.tensorflow.op.tpu.PartitionedInput; +import org.tensorflow.op.tpu.PartitionedOutput; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code tpu} operations as {@link Op Op}s + * + * @see {@link Ops} + */ +public final class TpuOps { + private final Scope scope; + + private final Ops ops; + + TpuOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Asserts that compilation succeeded. This op produces no output and closes the + *

+ * device during failure to ensure all pending device interactions fail. + *

+ * 'compilation_status' is a serialized CompilationResultProto. + * + * @param compilationStatus + * @return a new instance of CompileSucceededAssert + */ + public CompileSucceededAssert compileSucceededAssert(Operand compilationStatus) { + return CompileSucceededAssert.create(scope, compilationStatus); + } + + /** + * Op that loads and executes a TPU program on a TPU device. + *

+ * For the internal use of the distributed TPU compiler. + * + * @param args + * @param key + * @param Tresults + * @return a new instance of Execute + */ + public Execute execute(Iterable> args, Operand key, + List> Tresults) { + return Execute.create(scope, args, key, Tresults); + } + + /** + * Op that executes a program with optional in-place variable updates. + *

+ * It (optionally) reads device variables, loads and executes a TPU program on a + * TPU device, and then (optionally) in-place updates variables using the program + * outputs, as specified in attributes device_var_reads_indices (program input + * indices from directly reading variables) and device_var_updates_indices (program + * output indices used to update variables, -1 means no-update/read-only). Such + * program outputs are consumed by these variables will not appear in the op + * output. For the internal use of the distributed TPU compiler. + * + * @param args + * @param key + * @param Tresults + * @param deviceVarReadsIndices + * @param deviceVarUpdatesIndices + * @return a new instance of ExecuteAndUpdateVariables + */ + public ExecuteAndUpdateVariables executeAndUpdateVariables(Iterable> args, + Operand key, List> Tresults, List deviceVarReadsIndices, + List deviceVarUpdatesIndices) { + return ExecuteAndUpdateVariables.create(scope, args, key, Tresults, deviceVarReadsIndices, deviceVarUpdatesIndices); + } + + /** + * An op that groups a list of partitioned inputs together. This op + * + * @param data type for {@code output()} output + * @param inputs A list of partitioned inputs which must have the same shape. + * @param options carries optional attributes values + * @return a new instance of PartitionedInput + */ + public PartitionedInput partitionedInput(Iterable> inputs, + PartitionedInput.Options... options) { + return PartitionedInput.create(scope, inputs, options); + } + + /** + * An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned + *

+ * outputs outside the XLA computation. + * + * @param data type for {@code output()} output + * @param inputs A tensor which represents the full shape of partitioned tensors. + * @param numSplits + * @param options carries optional attributes values + * @return a new instance of PartitionedOutput + */ + public PartitionedOutput partitionedOutput(Operand inputs, Long numSplits, + PartitionedOutput.Options... options) { + return PartitionedOutput.create(scope, inputs, numSplits, options); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java index 87809e1a4c3..eb8d94bc6e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java @@ -312,7 +312,7 @@ public ApplyAddSign applyAddSign(Operand var, Operand * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values @@ -809,7 +809,7 @@ public ResourceApplyAddSign resourceApplyAddSign(Operand va * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java index d4e9c94d250..393a754ff47 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java @@ -37,6 +37,10 @@ import org.tensorflow.op.xla.Sharding; import org.tensorflow.op.xla.Sort; import org.tensorflow.op.xla.Svd; +import org.tensorflow.op.xla.XlaRecvFromHost; +import org.tensorflow.op.xla.XlaSendToHost; +import org.tensorflow.op.xla.XlaSetBound; +import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -382,6 +386,53 @@ public Svd svd(Operand a, Long maxIter, Float epsilon, return Svd.create(scope, a, maxIter, epsilon, precisionConfig); } + /** + * An op to receive a tensor from the host. + *

+ * output: the tensor that will be received from the host. + * Toutput: element type for output. + * shape: shape for output. + * key: A unique identifier for this region used to match up host transfers. + * + * @param data type for {@code output()} output + * @param Toutput + * @param shape + * @param key + * @return a new instance of XlaRecvFromHost + */ + public XlaRecvFromHost xlaRecvFromHost(Class Toutput, Shape shape, + String key) { + return XlaRecvFromHost.create(scope, Toutput, shape, key); + } + + /** + * An op to send a tensor to the host. + *

+ * input: the tensor that will be sent to the host. + * Tinput: element type for input. + * key: A unique identifier for this region used to match up host transfers. + * + * @param input + * @param key + * @return a new instance of XlaSendToHost + */ + public XlaSendToHost xlaSendToHost(Operand input, String key) { + return XlaSendToHost.create(scope, input, key); + } + + /** + * Set a bound for the given input value as a hint to Xla compiler, + *

+ * returns the same value. + * + * @param input + * @param bound + * @return a new instance of XlaSetBound + */ + public XlaSetBound xlaSetBound(Operand input, Operand bound) { + return XlaSetBound.create(scope, input, bound); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java new file mode 100644 index 00000000000..4a7968111e1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + +// #endif + +// Allocator Attributes used for tensor allocation. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_AllocatorAttributes extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_AllocatorAttributes() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_AllocatorAttributes(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_AllocatorAttributes(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_AllocatorAttributes position(long position) { + return (TF_AllocatorAttributes)super.position(position); + } + @Override public TF_AllocatorAttributes getPointer(long i) { + return new TF_AllocatorAttributes(this).position(position + i); + } + + public native @Cast("size_t") long struct_size(); public native TF_AllocatorAttributes struct_size(long setter); + // Set boolean to 1 for CPU allocation, else 0. + public native @Cast("unsigned char") byte on_host(); public native TF_AllocatorAttributes on_host(byte setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java new file mode 100644 index 00000000000..3300f6416b1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +// -------------------------------------------------------------------------- +// Used to return strings across the C API. The caller does not take ownership +// of the underlying data pointer and is not responsible for freeing it. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_StringView extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_StringView() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_StringView(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_StringView(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_StringView position(long position) { + return (TF_StringView)super.position(position); + } + @Override public TF_StringView getPointer(long i) { + return new TF_StringView(this).position(position + i); + } + + public native @Cast("const char*") BytePointer data(); public native TF_StringView data(BytePointer setter); + public native @Cast("size_t") long len(); public native TF_StringView len(long setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java new file mode 100644 index 00000000000..1952ad9267d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java @@ -0,0 +1,37 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString position(long position) { + return (TF_TString)super.position(position); + } + @Override public TF_TString getPointer(long i) { + return new TF_TString(this).position(position + i); + } + // NOLINT + // small conflicts with '#define small char' in RpcNdr.h for MSVC, so we use + // smll instead. + @Name("u.smll") public native @ByRef TF_TString_Small u_smll(); public native TF_TString u_smll(TF_TString_Small setter); + @Name("u.large") public native @ByRef TF_TString_Large u_large(); public native TF_TString u_large(TF_TString_Large setter); + @Name("u.offset") public native @ByRef TF_TString_Offset u_offset(); public native TF_TString u_offset(TF_TString_Offset setter); + @Name("u.view") public native @ByRef TF_TString_View u_view(); public native TF_TString u_view(TF_TString_View setter); + @Name("u.raw") public native @ByRef TF_TString_Raw u_raw(); public native TF_TString u_raw(TF_TString_Raw setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java new file mode 100644 index 00000000000..2edcc0e3808 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java @@ -0,0 +1,33 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_Large extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_Large() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_Large(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_Large(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_Large position(long position) { + return (TF_TString_Large)super.position(position); + } + @Override public TF_TString_Large getPointer(long i) { + return new TF_TString_Large(this).position(position + i); + } + // NOLINT + public native @Cast("size_t") long size(); public native TF_TString_Large size(long setter); + public native @Cast("size_t") long cap(); public native TF_TString_Large cap(long setter); + public native @Cast("char*") BytePointer ptr(); public native TF_TString_Large ptr(BytePointer setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java new file mode 100644 index 00000000000..d46c62ec004 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java @@ -0,0 +1,33 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_Offset extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_Offset() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_Offset(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_Offset(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_Offset position(long position) { + return (TF_TString_Offset)super.position(position); + } + @Override public TF_TString_Offset getPointer(long i) { + return new TF_TString_Offset(this).position(position + i); + } + // NOLINT + public native @Cast("uint32_t") int size(); public native TF_TString_Offset size(int setter); + public native @Cast("uint32_t") int offset(); public native TF_TString_Offset offset(int setter); + public native @Cast("uint32_t") int count(); public native TF_TString_Offset count(int setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java new file mode 100644 index 00000000000..ffe3b6b087a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java @@ -0,0 +1,32 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_Raw extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_Raw() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_Raw(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_Raw(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_Raw position(long position) { + return (TF_TString_Raw)super.position(position); + } + @Override public TF_TString_Raw getPointer(long i) { + return new TF_TString_Raw(this).position(position + i); + } + // NOLINT + public native @Cast("uint8_t") byte raw(int i); public native TF_TString_Raw raw(int i, byte setter); + @MemberGetter public native @Cast("uint8_t*") BytePointer raw(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java new file mode 100644 index 00000000000..7ce9d5f9caf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java @@ -0,0 +1,33 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_Small extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_Small() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_Small(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_Small(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_Small position(long position) { + return (TF_TString_Small)super.position(position); + } + @Override public TF_TString_Small getPointer(long i) { + return new TF_TString_Small(this).position(position + i); + } + // NOLINT + public native @Cast("uint8_t") byte size(); public native TF_TString_Small size(byte setter); + public native @Cast("char") byte str(int i); public native TF_TString_Small str(int i, byte setter); + @MemberGetter public native @Cast("char*") BytePointer str(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java new file mode 100644 index 00000000000..ffa3cfeb5db --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java @@ -0,0 +1,34 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_Union extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_Union() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_Union(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_Union(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_Union position(long position) { + return (TF_TString_Union)super.position(position); + } + @Override public TF_TString_Union getPointer(long i) { + return new TF_TString_Union(this).position(position + i); + } + // NOLINT + public native @ByRef TF_TString_Large large(); public native TF_TString_Union large(TF_TString_Large setter); + public native @ByRef TF_TString_Offset offset(); public native TF_TString_Union offset(TF_TString_Offset setter); + public native @ByRef TF_TString_View view(); public native TF_TString_Union view(TF_TString_View setter); + public native @ByRef TF_TString_Raw raw(); public native TF_TString_Union raw(TF_TString_Raw setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java new file mode 100644 index 00000000000..bec84468a53 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java @@ -0,0 +1,32 @@ +// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.tensorflow.internal.c_api.global.tensorflow.*; + + +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_TString_View extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_TString_View() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_TString_View(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_TString_View(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_TString_View position(long position) { + return (TF_TString_View)super.position(position); + } + @Override public TF_TString_View getPointer(long i) { + return new TF_TString_View(this).position(position + i); + } + // NOLINT + public native @Cast("size_t") long size(); public native TF_TString_View size(long setter); + public native @Cast("const char*") BytePointer ptr(); public native TF_TString_View ptr(BytePointer setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java index b1839dadd2d..d96c2757dc6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java @@ -8,7 +8,6 @@ import static org.tensorflow.internal.c_api.global.tensorflow.*; -// #endif // -------------------------------------------------------------------------- // TF_Tensor holds a multi-dimensional array of elements of a single data type. diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java index bdd9cc618ac..f83bc6c1394 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java @@ -11,6 +11,264 @@ public class tensorflow extends org.tensorflow.internal.c_api.presets.tensorflow { static { Loader.load(); } +// Parsed from tensorflow/core/platform/ctstring_internal.h + +/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// #ifndef TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ +// #define TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ + +// #include +// #include +// #include +// #include + +// #if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && +// __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || +// defined(_WIN32) +public static final int TF_TSTRING_LITTLE_ENDIAN = 1; +// #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && +// __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +// #else +// #error "Unable to detect endianness." +// #endif + +// #if defined(__clang__) || +// (defined(__GNUC__) && +// ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ >= 5)) +public static native @Cast("uint32_t") int TF_swap32(@Cast("uint32_t") int host_int); + +// #elif defined(_MSC_VER) + +// #elif defined(__APPLE__) + +// #else +// #endif + +// #if TF_TSTRING_LITTLE_ENDIAN +// #define TF_le32toh(x) TF_swap32(x) +// #else // TF_TSTRING_LITTLE_ENDIAN +// #endif // TF_TSTRING_LITTLE_ENDIAN + +public static native @Cast("size_t") long TF_align16(@Cast("size_t") long i); + +public static native @Cast("size_t") long TF_max(@Cast("size_t") long a, @Cast("size_t") long b); +public static native @Cast("size_t") long TF_min(@Cast("size_t") long a, @Cast("size_t") long b); + +/** enum TF_TString_Type */ +public static final int // NOLINT + TF_TSTR_SMALL = 0x00, + TF_TSTR_LARGE = 0x01, + TF_TSTR_OFFSET = 0x02, + TF_TSTR_VIEW = 0x03, + TF_TSTR_TYPE_MASK = 0x03; +// Targeting ../TF_TString_Large.java + + +// Targeting ../TF_TString_Offset.java + + +// Targeting ../TF_TString_View.java + + +// Targeting ../TF_TString_Raw.java + + +// Targeting ../TF_TString_Union.java + + + +/** enum */ + +public static native @MemberGetter int TF_TString_SmallCapacity(); +public static final int + TF_TString_SmallCapacity = TF_TString_SmallCapacity(); +// Targeting ../TF_TString_Small.java + + +// Targeting ../TF_TString.java + + + +// TODO(dero): Fix for OSS, and add C only build test. +// _Static_assert(CHAR_BIT == 8); +// _Static_assert(sizeof(TF_TString) == 24); + +public static native @Cast("TF_TString_Type") int TF_TString_GetType(@Const TF_TString str); + +// XXX(dero): For the big-endian case, this function could potentially be more +// performant and readable by always storing the string size as little-endian +// and always byte-swapping on big endian, resulting in a simple 'bswap'+'shr' +// (for architectures that have a bswap op). +public static native @Cast("size_t") long TF_TString_ToActualSizeT(@Cast("size_t") long size); + +public static native @Cast("size_t") long TF_TString_ToInternalSizeT(@Cast("size_t") long size, + @Cast("TF_TString_Type") int type); + +public static native void TF_TString_Init(TF_TString str); + +public static native void TF_TString_Dealloc(TF_TString str); + +public static native @Cast("size_t") long TF_TString_GetSize(@Const TF_TString str); + +public static native @Cast("size_t") long TF_TString_GetCapacity(@Const TF_TString str); + +public static native @Cast("const char*") BytePointer TF_TString_GetDataPointer(@Const TF_TString str); + +public static native @Cast("char*") BytePointer TF_TString_ResizeUninitialized(TF_TString str, + @Cast("size_t") long new_size); + +public static native @Cast("char*") BytePointer TF_TString_GetMutableDataPointer(TF_TString str); + +public static native void TF_TString_Reserve(TF_TString str, @Cast("size_t") long new_cap); + +public static native @Cast("char*") BytePointer TF_TString_Resize(TF_TString str, @Cast("size_t") long new_size, + @Cast("char") byte c); + +public static native void TF_TString_AssignView(TF_TString dst, @Cast("const char*") BytePointer src, + @Cast("size_t") long size); +public static native void TF_TString_AssignView(TF_TString dst, String src, + @Cast("size_t") long size); + +public static native void TF_TString_AppendN(TF_TString dst, @Cast("const char*") BytePointer src, + @Cast("size_t") long src_size); +public static native void TF_TString_AppendN(TF_TString dst, String src, + @Cast("size_t") long src_size); + +public static native void TF_TString_Append(TF_TString dst, @Const TF_TString src); + +public static native void TF_TString_Copy(TF_TString dst, @Cast("const char*") BytePointer src, + @Cast("size_t") long size); +public static native void TF_TString_Copy(TF_TString dst, String src, + @Cast("size_t") long size); + +public static native void TF_TString_Assign(TF_TString dst, @Const TF_TString src); + +public static native void TF_TString_Move(TF_TString dst, TF_TString src); + +// #endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ + + +// Parsed from tensorflow/core/platform/ctstring.h + +/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// #ifndef TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ +// #define TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ + +// #include +// #include + +// #include "tensorflow/core/platform/ctstring_internal.h" + +// Initialize a new tstring. This must be called before using any function +// below. +// Deallocate a tstring. + +// Resizes `str' to `new_size'. This function will appropriately grow or shrink +// the string buffer to fit a `new_size' string. Grown regions of the string +// will be initialized with `c'. +// Similar to TF_TString_Resize, except the newly allocated regions will remain +// uninitialized. This is useful if you plan on overwriting the newly grown +// regions immediately after allocation; doing so will elide a superfluous +// initialization of the new buffer. +// Reserves a string buffer with a capacity of at least `new_cap'. +// ResizeUninitialized will not change the size, or the contents of the existing +// string. This is useful if you have a rough idea of `str's upperbound in +// size, and want to avoid allocations as you append to `str'. It should not be +// considered safe to write in the region between size and capacity; explicitly +// resize before doing so. + +// Returns the size of the string. +// Returns the capacity of the string buffer. It should not be considered safe +// to write in the region between size and capacity---call Resize or +// ResizeUninitialized before doing so. +// Returns the underlying type of the tstring: +// TF_TSTR_SMALL: +// Small string optimization; the contents of strings +// less than 22-bytes are stored in the TF_TString struct. This avoids any +// heap allocations. +// TF_TSTR_LARGE: +// Heap allocated string. +// TF_TSTR_OFFSET: (currently unused) +// An offset defined string. The string buffer begins at an internally +// defined little-endian offset from `str'; i.e. GetDataPointer() = str + +// offset. This type is useful for memory mapping or reading string tensors +// directly from file, without the need to deserialize the data. For +// security reasons, it is imperative that OFFSET based string tensors are +// validated before use, or are from a trusted source. +// TF_TSTR_VIEW: +// A view into an unowned character string. +// +// NOTE: +// VIEW and OFFSET types are immutable, so any modifcation via Append, +// AppendN, or GetMutableDataPointer of a VIEW/OFFSET based tstring will +// result in a conversion to an owned type (SMALL/LARGE). + +// Returns a const char pointer to the start of the underlying string. The +// underlying character buffer may not be null-terminated. +// Returns a char pointer to a mutable representation of the underlying string. +// In the case of VIEW and OFFSET types, `src' is converted to an owned type +// (SMALL/LARGE). The underlying character buffer may not be null-terminated. + +// Sets `dst' as a VIEW type to `src'. `dst' will not take ownership of `src'. +// It is the user's responsibility to ensure that the lifetime of `src' exceeds +// `dst'. Any mutations to `dst' via Append, AppendN, or GetMutableDataPointer, +// will result in a copy into an owned SMALL or LARGE type, and will not modify +// `src'. + +// Appends `src' onto `dst'. If `dst' is a VIEW or OFFSET type, it will first +// be converted to an owned LARGE or SMALL type. `dst' should not point to +// memory owned by `src'. + +// Copy/Move/Assign semantics +// +// | src | dst | complexity +// Copy | * | SMALL/LARGE | fixed/O(size) +// Assign | SMALL | SMALL | fixed +// Assign | OFFSET | VIEW | fixed +// Assign | VIEW | VIEW | fixed +// Assign | LARGE | LARGE | O(size) +// Move | * | same as src | fixed + +// Copies `src' to `dst'. `dst' will be an owned type (SMALL/LARGE). `src' +// should not point to memory owned by `dst'. +// Assigns a `src' tstring to `dst'. An OFFSET `src' type will yield a `VIEW' +// `dst'. LARGE `src' types will be copied to a new buffer; all other `src' +// types will incur a fixed cost. +// Moves a `src' tstring to `dst'. Moving a LARGE `src' to `dst' will result in +// a valid but unspecified `src'. This function incurs a fixed cost for all +// inputs. + +// #endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ + + // Parsed from tensorflow/core/util/port.h /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. @@ -103,6 +361,56 @@ public class tensorflow extends org.tensorflow.internal.c_api.presets.tensorflow // #endif // TENSORFLOW_C_TF_ATTRTYPE_H_ +// Parsed from tensorflow/c/c_api_macros.h + +/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// #ifndef TENSORFLOW_C_C_API_MACROS_H_ +// #define TENSORFLOW_C_C_API_MACROS_H_ + +// #ifdef SWIG +// #define TF_CAPI_EXPORT +// #else +// #if defined(_WIN32) +// #ifdef TF_COMPILE_LIBRARY +// #define TF_CAPI_EXPORT __declspec(dllexport) +// #else +// #define TF_CAPI_EXPORT __declspec(dllimport) +// #endif // TF_COMPILE_LIBRARY +// #else +// #define TF_CAPI_EXPORT __attribute__((visibility("default"))) +// #endif // _WIN32 +// #endif // SWIG + +// TF_Bool is the C API typedef for unsigned char, while TF_BOOL is +// the datatype for boolean tensors. +// #ifndef TF_Bool +// #define TF_Bool unsigned char +// #endif // TF_Bool + +// Macro used to calculate struct size for maintaining ABI stability across +// different struct implementations. +// #ifndef TF_OFFSET_OF_END +// #define TF_OFFSET_OF_END(TYPE, MEMBER) +// (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) +// #endif // TF_OFFSET_OF_END + +// #endif // TENSORFLOW_C_C_API_MACROS_H_ + + // Parsed from tensorflow/c/tf_datatype.h /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. @@ -311,6 +619,7 @@ public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, // #include // #include +// #include "tensorflow/c/c_api_macros.h" // #include "tensorflow/c/tf_datatype.h" // #include "tensorflow/c/tf_status.h" @@ -334,6 +643,12 @@ public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, // #endif // SWIG // #ifdef __cplusplus +// Targeting ../TF_AllocatorAttributes.java + + + +public static native @MemberGetter int TF_ALLOCATOR_ATTRIBUTES_STRUCT_SIZE(); +public static final int TF_ALLOCATOR_ATTRIBUTES_STRUCT_SIZE = TF_ALLOCATOR_ATTRIBUTES_STRUCT_SIZE(); // Targeting ../TF_Tensor.java @@ -438,67 +753,6 @@ public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, int num_new_dims, TF_Status status); -// -------------------------------------------------------------------------- -// Encode the string `src` (`src_len` bytes long) into `dst` in the format -// required by TF_STRING tensors. Does not write to memory more than `dst_len` -// bytes beyond `*dst`. `dst_len` should be at least -// TF_StringEncodedSize(src_len). -// -// On success returns the size in bytes of the encoded string. -// Returns an error into `status` otherwise. -public static native @Cast("size_t") long TF_StringEncode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("char*") BytePointer dst, @Cast("size_t") long dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringEncode(String src, @Cast("size_t") long src_len, - @Cast("char*") ByteBuffer dst, @Cast("size_t") long dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringEncode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("char*") byte[] dst, @Cast("size_t") long dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringEncode(String src, @Cast("size_t") long src_len, - @Cast("char*") BytePointer dst, @Cast("size_t") long dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringEncode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("char*") ByteBuffer dst, @Cast("size_t") long dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringEncode(String src, @Cast("size_t") long src_len, - @Cast("char*") byte[] dst, @Cast("size_t") long dst_len, - TF_Status status); - -// Decode a string encoded using TF_StringEncode. -// -// On success, sets `*dst` to the start of the decoded string and `*dst_len` to -// its length. Returns the number of bytes starting at `src` consumed while -// decoding. `*dst` points to memory within the encoded buffer. On failure, -// `*dst` and `*dst_len` are undefined and an error is set in `status`. -// -// Does not read memory more than `src_len` bytes beyond `src`. -public static native @Cast("size_t") long TF_StringDecode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("const char**") PointerPointer dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr BytePointer dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(String src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr ByteBuffer dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr byte[] dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(String src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr BytePointer dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(@Cast("const char*") BytePointer src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr ByteBuffer dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); -public static native @Cast("size_t") long TF_StringDecode(String src, @Cast("size_t") long src_len, - @Cast("const char**") @ByPtrPtr byte[] dst, @Cast("size_t*") SizeTPointer dst_len, - TF_Status status); - -// Return the size in bytes required to encode a string `len` bytes long into a -// TF_STRING tensor. -public static native @Cast("size_t") long TF_StringEncodedSize(@Cast("size_t") long len); - // Returns bool iff this tensor is aligned. public static native @Cast("bool") boolean TF_TensorIsAligned(@Const TF_Tensor arg0); @@ -508,6 +762,30 @@ public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, // #endif // TENSORFLOW_C_TF_TENSOR_H_ +// Parsed from tensorflow/c/tf_tstring.h + +/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ +// #ifndef TENSORFLOW_C_TF_TSTRING_H_ +// #define TENSORFLOW_C_TF_TSTRING_H_ + +// #include "tensorflow/core/platform/ctstring.h" + +// #endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_ + + // Parsed from tensorflow/c/c_api.h /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. @@ -535,6 +813,7 @@ public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, // #include "tensorflow/c/tf_datatype.h" // #include "tensorflow/c/tf_status.h" // #include "tensorflow/c/tf_tensor.h" +// #include "tensorflow/c/tf_tstring.h" // -------------------------------------------------------------------------- // C API for TensorFlow. @@ -623,6 +902,9 @@ public static native TF_Buffer TF_NewBufferFromString(@Const Pointer proto, public static native void TF_DeleteBuffer(TF_Buffer arg0); public static native @ByVal TF_Buffer TF_GetBuffer(TF_Buffer buffer); +// Targeting ../TF_StringView.java + + // Targeting ../TF_SessionOptions.java @@ -2699,6 +2981,10 @@ public static native TF_Buffer TF_GetRegisteredKernelsForOp( @Cast("const char*") BytePointer name, TF_Status status); public static native TF_Buffer TF_GetRegisteredKernelsForOp( String name, TF_Status status); + +// Update edge, switch input/ output in a node +public static native void TF_UpdateEdge(TF_Graph graph, @ByVal TF_Output new_src, + @ByVal TF_Input dst, TF_Status status); // Targeting ../TF_Server.java @@ -2743,6 +3029,15 @@ public static native void TF_RegisterLogListener( public static native void TF_RegisterLogListener( Listener_String listener); +// Register a FileSystem plugin from filename `plugin_filename`. +// +// On success, place OK in status. +// On failure, place an error status in status. +public static native void TF_RegisterFilesystemPlugin( + @Cast("const char*") BytePointer plugin_filename, TF_Status status); +public static native void TF_RegisterFilesystemPlugin( + String plugin_filename, TF_Status status); + // #ifdef __cplusplus /* end extern "C" */ // #endif @@ -2771,8 +3066,10 @@ public static native void TF_RegisterLogListener( // #include +// #include "tensorflow/c/c_api.h" // #include "tensorflow/c/tf_datatype.h" // #include "tensorflow/c/tf_status.h" +// #include "tensorflow/c/tf_tensor.h" // Macro to control visibility of exported symbols in the shared library (.so, // .dylib, .dll). @@ -2839,6 +3136,10 @@ public static native void TF_KernelBuilder_HostMemory( public static native void TF_KernelBuilder_HostMemory( TF_KernelBuilder kernel_builder, String arg_name); +// Specify a priority number for this kernel. +public static native void TF_KernelBuilder_Priority( + TF_KernelBuilder kernel_builder, int priority_number); + // Register the given kernel builder with the TensorFlow runtime. If // registration fails, the given status will be populated. // @@ -2947,6 +3248,10 @@ public static native void TF_OpKernelConstruction_GetAttrInt32( TF_OpKernelConstruction ctx, String attr_name, int[] val, TF_Status status); +// Returns the unique operation name for this OpKernel. +public static native @ByVal TF_StringView TF_OpKernelConstruction_GetName( + TF_OpKernelConstruction ctx); + // Allocates Tensor for output at given index. Caller takes ownership of // returned TF_Tensor and should deallocate it using TF_DeleteTensor(tensor). // @@ -2965,6 +3270,40 @@ public static native TF_Tensor TF_AllocateOutput(TF_OpKernelContext context, @Cast("int64_t*") long[] dims, int num_dims, @Cast("size_t") long len, TF_Status status); +// Tries to forward one of the inputs given in input_indices to +// output[output_index]. If none of the given inputs can be forwarded, calls +// allocate_output() to allocate a new output buffer. The index of the +// forwarded input will be assign to output argument forwarded_input (if it's +// not nullptr). If no inputs are forwarded, forwarded_input will be assigned +// -1. +public static native TF_Tensor TF_ForwardInputOrAllocateOutput( + TF_OpKernelContext context, IntPointer candidate_input_indices, + int num_candidate_input_indices, int output_index, @Cast("int64_t*") LongPointer output_dims, + int output_num_dims, IntPointer forwarded_input, TF_Status status); +public static native TF_Tensor TF_ForwardInputOrAllocateOutput( + TF_OpKernelContext context, IntBuffer candidate_input_indices, + int num_candidate_input_indices, int output_index, @Cast("int64_t*") LongBuffer output_dims, + int output_num_dims, IntBuffer forwarded_input, TF_Status status); +public static native TF_Tensor TF_ForwardInputOrAllocateOutput( + TF_OpKernelContext context, int[] candidate_input_indices, + int num_candidate_input_indices, int output_index, @Cast("int64_t*") long[] output_dims, + int output_num_dims, int[] forwarded_input, TF_Status status); + +// Allocates a temporary Tensor of the specified type and shape. The +// Tensor must not be used after kernel construction is +// complete. +// +// num_dims must equal the size of array dims +public static native TF_Tensor TF_AllocateTemp( + TF_OpKernelContext context, @Cast("TF_DataType") int dtype, @Cast("int64_t*") LongPointer dims, int num_dims, + TF_AllocatorAttributes alloc_attrs, TF_Status status); +public static native TF_Tensor TF_AllocateTemp( + TF_OpKernelContext context, @Cast("TF_DataType") int dtype, @Cast("int64_t*") LongBuffer dims, int num_dims, + TF_AllocatorAttributes alloc_attrs, TF_Status status); +public static native TF_Tensor TF_AllocateTemp( + TF_OpKernelContext context, @Cast("TF_DataType") int dtype, @Cast("int64_t*") long[] dims, int num_dims, + TF_AllocatorAttributes alloc_attrs, TF_Status status); + // #ifdef __cplusplus /* end extern "C" */ // #endif @@ -3269,6 +3608,11 @@ public static native void TF_ShapeInferenceContextSetOutput(TF_ShapeInferenceCon int i, TF_ShapeHandle handle, TF_Status status); +// Returns a newly-allocated scalar shape handle. The returned handle should +// be freed with TF_DeleteShapeHandle. +public static native TF_ShapeHandle TF_ShapeInferenceContextScalar( + TF_ShapeInferenceContext ctx); + // Returns a newly-allocate shape handle representing a vector of the given // size. The returned handle should be freed with TF_DeleteShapeHandle. public static native TF_ShapeHandle TF_ShapeInferenceContextVectorFromSize( @@ -3452,7 +3796,7 @@ public static native void TFE_ContextOptionsSetConfig( TFE_DEVICE_PLACEMENT_SILENT = 2, // Placement policy which silently copies int32 tensors but not other dtypes. TFE_DEVICE_PLACEMENT_SILENT_FOR_INT32 = 3; -// LINT.ThenChange(//tensorflow/core/common_runtime/eager/context.h) +// LINT.ThenChange(//tensorflow/c/eager/immediate_execution_context.h) // Sets the default execution mode (sync/async). Note that this can be // overridden per thread using TFE_ContextSetExecutorForThread. @@ -3608,24 +3952,24 @@ public static native TFE_Op TFE_NewOp(TFE_Context ctx, public static native TFE_Op TFE_NewOp(TFE_Context ctx, String op_or_function_name, TF_Status status); - public static native void TFE_DeleteOp(TFE_Op op); +// Returns the op or function name `op` will execute. +// +// The returned string remains valid throughout the lifetime of 'op'. +public static native @Cast("const char*") BytePointer TFE_OpGetName(@Const TFE_Op op, + TF_Status status); +public static native TFE_Context TFE_OpGetContext(@Const TFE_Op op, + TF_Status status); + public static native void TFE_OpSetDevice(TFE_Op op, @Cast("const char*") BytePointer device_name, TF_Status status); public static native void TFE_OpSetDevice(TFE_Op op, String device_name, TF_Status status); // The returned string remains valid throughout the lifetime of 'op'. -public static native @Cast("const char*") BytePointer TFE_OpGetDevice(TFE_Op op, +public static native @Cast("const char*") BytePointer TFE_OpGetDevice(@Const TFE_Op op, TF_Status status); -// When 'enable' is set to 1, and if TensorFlow library is built with XLA -// support, a subsequent TFE_Execute() call on `op` will run the op via XLA. -// -// If the library is not built with XLA support, this call would be a no-op. -public static native void TFE_OpSetXLACompilation(TFE_Op op, - @Cast("unsigned char") byte enable); - public static native void TFE_OpAddInput(TFE_Op op, TFE_TensorHandle input, TF_Status status); @@ -3638,6 +3982,23 @@ public static native void TFE_OpAddInputList(TFE_Op op, int num_inputs, TF_Status status); +// Fetches the current number of inputs attached to `op`. +// +// Does not use the operation's definition to determine how many inputs should +// be attached. It is intended for use with TFE_OpGetFlatInput to inspect an +// already-finalized operation. +// +// Note that TFE_OpGetFlatInputCount and TFE_OpGetFlatInput operate on a flat +// sequence of inputs, unlike TFE_OpGetInputLength (for getting the length of a +// particular named input list, which may only be part of the op's inputs). +public static native int TFE_OpGetFlatInputCount(@Const TFE_Op op, + TF_Status status); +// Returns a borrowed reference to one of `op`'s inputs. Use +// `TFE_TensorHandleCopySharingTensor` to make a new reference. +public static native TFE_TensorHandle TFE_OpGetFlatInput(@Const TFE_Op op, + int index, + TF_Status status); + public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") BytePointer is_list, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java index adaafc5fc90..443ca7dfb98 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java @@ -31,7 +31,7 @@ /** * Mutually reduces multiple tensors of identical type and shape. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class AllReduce extends RawOp implements Operand { @@ -144,23 +144,23 @@ public static Options timeoutSeconds(Float timeoutSeconds) { /** */ - public Output output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CollectiveReduce"; - private Output output; + private Output data; private AllReduce(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java index bce981a1f6f..4ade0cfc0a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java @@ -32,7 +32,7 @@ /** * Receives a tensor value broadcast from another device. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class BroadcastRecv extends RawOp implements Operand { @@ -114,23 +114,23 @@ public static Options timeoutSeconds(Float timeoutSeconds) { /** */ - public Output output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CollectiveBcastRecv"; - private Output output; + private Output data; private BroadcastRecv(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java index 84a99f4f1bb..9a2646dc630 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java @@ -31,7 +31,7 @@ /** * Broadcasts a tensor value to one or more other devices. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class BroadcastSend extends RawOp implements Operand { @@ -113,23 +113,23 @@ public static Options timeoutSeconds(Float timeoutSeconds) { /** */ - public Output output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CollectiveBcastSend"; - private Output output; + private Output data; private BroadcastSend(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java new file mode 100644 index 00000000000..be698afc2e7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java @@ -0,0 +1,135 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.collective; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Mutually accumulates multiple tensors of identical type and shape. + * + * @param data type for {@code data()} output + */ +public final class Gather extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.collective.Gather} + */ + public static class Options { + + /** + * @param communicationHint + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * @param timeoutSeconds + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + private String communicationHint; + private Float timeoutSeconds; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new Gather operation. + * + * @param scope current scope + * @param input + * @param groupSize + * @param groupKey + * @param instanceKey + * @param shape + * @param options carries optional attributes values + * @return a new instance of Gather + */ + @Endpoint(describeByClass = true) + public static Gather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGather", scope.makeOpName("Gather")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("group_size", groupSize); + opBuilder.setAttr("group_key", groupKey); + opBuilder.setAttr("instance_key", instanceKey); + opBuilder.setAttr("shape", shape); + if (options != null) { + for (Options opts : options) { + if (opts.communicationHint != null) { + opBuilder.setAttr("communication_hint", opts.communicationHint); + } + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new Gather(opBuilder.build()); + } + + /** + * @param communicationHint + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * @param timeoutSeconds + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "CollectiveGather"; + + private Output data; + + private Gather(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java new file mode 100644 index 00000000000..0b90160e904 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java @@ -0,0 +1,133 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.collective; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Mutually accumulates multiple tensors of identical type and shape. + * + * @param data type for {@code data()} output + */ +public final class GatherV2 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.collective.GatherV2} + */ + public static class Options { + + /** + * @param communicationHint + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * @param timeoutSeconds + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + private String communicationHint; + private Float timeoutSeconds; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new GatherV2 operation. + * + * @param scope current scope + * @param input + * @param groupSize + * @param groupKey + * @param instanceKey + * @param options carries optional attributes values + * @return a new instance of GatherV2 + */ + @Endpoint(describeByClass = true) + public static GatherV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGatherV2", scope.makeOpName("GatherV2")); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.communicationHint != null) { + opBuilder.setAttr("communication_hint", opts.communicationHint); + } + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new GatherV2(opBuilder.build()); + } + + /** + * @param communicationHint + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * @param timeoutSeconds + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "CollectiveGatherV2"; + + private Output data; + + private GatherV2(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java new file mode 100644 index 00000000000..71f4b0804e8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java @@ -0,0 +1,166 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.collective; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Mutually reduces multiple tensors of identical type and shape. + * + * @param data type for {@code data()} output + */ +public final class Reduce extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.collective.Reduce} + */ + public static class Options { + + /** + * @param waitFor + */ + public Options waitFor(List waitFor) { + this.waitFor = waitFor; + return this; + } + + /** + * @param communicationHint + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * @param timeoutSeconds + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + private List waitFor; + private String communicationHint; + private Float timeoutSeconds; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new Reduce operation. + * + * @param scope current scope + * @param input + * @param groupSize + * @param groupKey + * @param instanceKey + * @param mergeOp + * @param finalOp + * @param subdivOffsets + * @param options carries optional attributes values + * @return a new instance of Reduce + */ + @Endpoint(describeByClass = true) + public static Reduce create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduce", scope.makeOpName("Reduce")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("group_size", groupSize); + opBuilder.setAttr("group_key", groupKey); + opBuilder.setAttr("instance_key", instanceKey); + opBuilder.setAttr("merge_op", mergeOp); + opBuilder.setAttr("final_op", finalOp); + long[] subdivOffsetsArray = new long[subdivOffsets.size()]; + for (int i = 0; i < subdivOffsetsArray.length; ++i) { + subdivOffsetsArray[i] = subdivOffsets.get(i); + } + opBuilder.setAttr("subdiv_offsets", subdivOffsetsArray); + if (options != null) { + for (Options opts : options) { + if (opts.waitFor != null) { + long[] waitForArray = new long[opts.waitFor.size()]; + for (int i = 0; i < waitForArray.length; ++i) { + waitForArray[i] = opts.waitFor.get(i); + } + opBuilder.setAttr("wait_for", waitForArray); + } + if (opts.communicationHint != null) { + opBuilder.setAttr("communication_hint", opts.communicationHint); + } + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new Reduce(opBuilder.build()); + } + + /** + * @param waitFor + */ + public static Options waitFor(List waitFor) { + return new Options().waitFor(waitFor); + } + + /** + * @param communicationHint + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * @param timeoutSeconds + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "CollectiveReduce"; + + private Output data; + + private Reduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java new file mode 100644 index 00000000000..3e57567a099 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java @@ -0,0 +1,137 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.collective; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Mutually reduces multiple tensors of identical type and shape. + * + * @param data type for {@code data()} output + */ +public final class ReduceV2 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.collective.ReduceV2} + */ + public static class Options { + + /** + * @param communicationHint + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * @param timeoutSeconds + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + private String communicationHint; + private Float timeoutSeconds; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new ReduceV2 operation. + * + * @param scope current scope + * @param input + * @param groupSize + * @param groupKey + * @param instanceKey + * @param mergeOp + * @param finalOp + * @param options carries optional attributes values + * @return a new instance of ReduceV2 + */ + @Endpoint(describeByClass = true) + public static ReduceV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, String mergeOp, String finalOp, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduceV2", scope.makeOpName("ReduceV2")); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("merge_op", mergeOp); + opBuilder.setAttr("final_op", finalOp); + if (options != null) { + for (Options opts : options) { + if (opts.communicationHint != null) { + opBuilder.setAttr("communication_hint", opts.communicationHint); + } + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new ReduceV2(opBuilder.build()); + } + + /** + * @param communicationHint + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * @param timeoutSeconds + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "CollectiveReduceV2"; + + private Output data; + + private ReduceV2(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java index 2e1de3898fa..97fbec16aaf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java @@ -31,7 +31,7 @@ /** * Mutually accumulates multiple tensors of identical type and shape. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class CollectiveGather extends RawOp implements Operand { @@ -113,23 +113,23 @@ public static Options timeoutSeconds(Float timeoutSeconds) { /** */ - public Output output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CollectiveGather"; - private Output output; + private Output data; private CollectiveGather(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java index 1b8373c8e6b..807aa992ba9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java @@ -83,6 +83,7 @@ * - A "bytes://", in which protocol descriptors are created from ``, * which is expected to be a `FileDescriptorSet` serialized as a string. */ +@Operator public final class DecodeProto extends RawOp { /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java new file mode 100644 index 00000000000..6a2474076cf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java @@ -0,0 +1,73 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Creates and returns an empty tensor map. + *

+ * handle: an empty tensor map + */ +@Operator +public final class EmptyTensorMap extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new EmptyTensorMap operation. + * + * @param scope current scope + * @return a new instance of EmptyTensorMap + */ + @Endpoint(describeByClass = true) + public static EmptyTensorMap create(Scope scope) { + OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorMap", scope.makeOpName("EmptyTensorMap")); + opBuilder = scope.apply(opBuilder); + return new EmptyTensorMap(opBuilder.build()); + } + + /** + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "EmptyTensorMap"; + + private Output handle; + + private EmptyTensorMap(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java index 2b0680d7fc6..f0d22e0f6c1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java @@ -74,6 +74,7 @@ * - A "bytes://", in which protocol descriptors are created from ``, * which is expected to be a `FileDescriptorSet` serialized as a string. */ +@Operator public final class EncodeProto extends RawOp implements Operand { /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java index b52cc4b3a77..e733d79233a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java @@ -29,7 +29,7 @@ import org.tensorflow.types.family.TNumber; /** - * Extract `patches` from `input` and put them in the "depth" output dimension. 3D extension of `extract_image_patches`. + * Extract `patches` from `input` and put them in the `"depth"` output dimension. 3D extension of `extract_image_patches`. * * @param data type for {@code patches()} output */ @@ -46,10 +46,10 @@ public final class ExtractVolumePatches extends RawOp impleme * `input`. Must be: `[1, stride_planes, stride_rows, stride_cols, 1]`. * @param padding The type of padding algorithm to use. *

- * We specify the size-related attributes as: + * The size-related attributes are specified as follows: *

{@code
-   *       ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
-   *       strides = [1, stride_planes, strides_rows, strides_cols, 1]
+   * ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
+   * strides = [1, stride_planes, strides_rows, strides_cols, 1]
    * }
* * @return a new instance of ExtractVolumePatches diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java new file mode 100644 index 00000000000..c52e07c05dd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java @@ -0,0 +1,89 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Computes the Kth order statistic of a data set. The current + *

+ * implementation uses a binary search requiring exactly 32 passes over + * the input data. The running time is linear with respect to input + * size. The median-of-medians algorithm is probably faster, but is + * difficult to implement efficiently in XLA. The implementation imposes + * a total ordering on floats. The ordering is consistent with the usual + * partial order. Positive NaNs are greater than positive + * infinity. Negative NaNs are less than negative infinity. NaNs with + * distinct payloads are treated as distinct. Subnormal numbers are + * preserved (not flushed to zero). Positive infinity is greater than all + * numbers. Negative infinity is less than all numbers. Positive is + * greater than negative zero. There are less than k values greater than + * the kth order statistic. There are at least k values greater than or + * equal to the Kth order statistic. The semantics are not the same as + * top_k_unique. + */ +@Operator +public final class KthOrderStatistic extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new KthOrderStatistic operation. + * + * @param scope current scope + * @param input + * @param k + * @return a new instance of KthOrderStatistic + */ + @Endpoint(describeByClass = true) + public static KthOrderStatistic create(Scope scope, Operand input, Long k) { + OperationBuilder opBuilder = scope.env().opBuilder("KthOrderStatistic", scope.makeOpName("KthOrderStatistic")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("k", k); + return new KthOrderStatistic(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "KthOrderStatistic"; + + private Output output; + + private KthOrderStatistic(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java new file mode 100644 index 00000000000..f4366722c28 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java @@ -0,0 +1,77 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Make all elements in the non-Batch dimension unique, but \"close\" to + *

+ * their initial value. Never returns a sub-normal number. Never returns + * zero. The sign of each input element is always identical to the sign + * of the corresponding output element. Behavior for infinite elements is + * undefined. Behavior for subnormal elements is undefined. + */ +@Operator +public final class MakeUnique extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new MakeUnique operation. + * + * @param scope current scope + * @param input + * @return a new instance of MakeUnique + */ + @Endpoint(describeByClass = true) + public static MakeUnique create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.env().opBuilder("MakeUnique", scope.makeOpName("MakeUnique")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + return new MakeUnique(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "MakeUnique"; + + private Output output; + + private MakeUnique(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java index 8d891145adb..3621d772dd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java @@ -43,7 +43,7 @@ * num_devices: The number of devices participating in this reduction. * shared_name: Identifier that shared between ops of the same reduction. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class NcclAllReduce extends RawOp implements Operand { @@ -70,23 +70,23 @@ public static NcclAllReduce create(Scope scope, Operand output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "NcclAllReduce"; - private Output output; + private Output data; private NcclAllReduce(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java index ceb8480274c..eba12c24818 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java @@ -40,7 +40,7 @@ * data: the value of the reduction across all `num_devices` devices. * reduction: the reduction operation to perform. * - * @param data type for {@code output()} output + * @param data type for {@code data()} output */ public final class NcclReduce extends RawOp implements Operand { @@ -63,23 +63,23 @@ public static NcclReduce create(Scope scope, Iterable output() { - return output; + public Output data() { + return data; } @Override public Output asOutput() { - return output; + return data; } /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "NcclReduce"; - private Output output; + private Output data; private NcclReduce(Operation operation) { super(operation); int outputIdx = 0; - output = operation.output(outputIdx++); + data = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java new file mode 100644 index 00000000000..cd3fd969829 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java @@ -0,0 +1,82 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Returns a tensor map with item from given key erased. + *

+ * input_handle: the original map + * output_handle: the map with value from given key removed + * key: the key of the value to be erased + */ +@Operator +public final class TensorMapErase extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapErase operation. + * + * @param scope current scope + * @param inputHandle + * @param key + * @param valueDtype + * @return a new instance of TensorMapErase + */ + @Endpoint(describeByClass = true) + public static TensorMapErase create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapErase", scope.makeOpName("TensorMapErase")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + return new TensorMapErase(opBuilder.build()); + } + + /** + */ + public Output outputHandle() { + return outputHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) outputHandle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapErase"; + + private Output outputHandle; + + private TensorMapErase(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java new file mode 100644 index 00000000000..75a432c34b1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java @@ -0,0 +1,79 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; + +/** + * Returns whether the given key exists in the map. + *

+ * input_handle: the input map + * key: the key to check + * has_key: whether the key is already in the map or not + */ +@Operator +public final class TensorMapHasKey extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapHasKey operation. + * + * @param scope current scope + * @param inputHandle + * @param key + * @return a new instance of TensorMapHasKey + */ + @Endpoint(describeByClass = true) + public static TensorMapHasKey create(Scope scope, Operand inputHandle, Operand key) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapHasKey", scope.makeOpName("TensorMapHasKey")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder = scope.apply(opBuilder); + return new TensorMapHasKey(opBuilder.build()); + } + + /** + */ + public Output hasKey() { + return hasKey; + } + + @Override + public Output asOutput() { + return hasKey; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapHasKey"; + + private Output hasKey; + + private TensorMapHasKey(Operation operation) { + super(operation); + int outputIdx = 0; + hasKey = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java new file mode 100644 index 00000000000..2a1ea4eb399 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java @@ -0,0 +1,82 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Returns a map that is the 'input_handle' with the given key-value pair inserted. + *

+ * input_handle: the original map + * output_handle: the map with key and value inserted + * key: the key to be inserted + * value: the value to be inserted + */ +@Operator +public final class TensorMapInsert extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapInsert operation. + * + * @param scope current scope + * @param inputHandle + * @param key + * @param value + * @return a new instance of TensorMapInsert + */ + @Endpoint(describeByClass = true) + public static TensorMapInsert create(Scope scope, Operand inputHandle, Operand key, Operand value) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapInsert", scope.makeOpName("TensorMapInsert")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(value.asOutput()); + opBuilder = scope.apply(opBuilder); + return new TensorMapInsert(opBuilder.build()); + } + + /** + */ + public Output outputHandle() { + return outputHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) outputHandle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapInsert"; + + private Output outputHandle; + + private TensorMapInsert(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java new file mode 100644 index 00000000000..a8b17f51ee1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java @@ -0,0 +1,83 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Returns the value from a given key in a tensor map. + *

+ * input_handle: the input map + * key: the key to be looked up + * value: the value found from the given key + * + * @param data type for {@code value()} output + */ +@Operator +public final class TensorMapLookup extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapLookup operation. + * + * @param scope current scope + * @param inputHandle + * @param key + * @param valueDtype + * @return a new instance of TensorMapLookup + */ + @Endpoint(describeByClass = true) + public static TensorMapLookup create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapLookup", scope.makeOpName("TensorMapLookup")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + return new TensorMapLookup(opBuilder.build()); + } + + /** + */ + public Output value() { + return value; + } + + @Override + public Output asOutput() { + return value; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapLookup"; + + private Output value; + + private TensorMapLookup(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java new file mode 100644 index 00000000000..8e3ea33c75b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java @@ -0,0 +1,75 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * Returns the number of tensors in the input tensor map. + *

+ * input_handle: the input map + * size: the number of tensors in the map + */ +@Operator +public final class TensorMapSize extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapSize operation. + * + * @param scope current scope + * @param inputHandle + * @return a new instance of TensorMapSize + */ + @Endpoint(describeByClass = true) + public static TensorMapSize create(Scope scope, Operand inputHandle) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapSize", scope.makeOpName("TensorMapSize")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder = scope.apply(opBuilder); + return new TensorMapSize(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapSize"; + + private Output output; + + private TensorMapSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java new file mode 100644 index 00000000000..6166ddb357f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java @@ -0,0 +1,80 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Returns a Tensor stack of all keys in a tensor map. + *

+ * input_handle: the input map + * keys: the returned Tensor of all keys in the map + * + * @param data type for {@code keys()} output + */ +@Operator +public final class TensorMapStackKeys extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new TensorMapStackKeys operation. + * + * @param scope current scope + * @param inputHandle + * @param keyDtype + * @return a new instance of TensorMapStackKeys + */ + @Endpoint(describeByClass = true) + public static TensorMapStackKeys create(Scope scope, Operand inputHandle, Class keyDtype) { + OperationBuilder opBuilder = scope.env().opBuilder("TensorMapStackKeys", scope.makeOpName("TensorMapStackKeys")); + opBuilder.addInput(inputHandle.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); + return new TensorMapStackKeys(opBuilder.build()); + } + + /** + */ + public Output keys() { + return keys; + } + + @Override + public Output asOutput() { + return keys; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TensorMapStackKeys"; + + private Output keys; + + private TensorMapStackKeys(Operation operation) { + super(operation); + int outputIdx = 0; + keys = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java index ff7c1ee16d7..6cb02e0a8a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java @@ -37,73 +37,38 @@ * scattered onto an existing tensor (as opposed to a zero-tensor). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. *

- * If `indices` contains duplicates, then their updates are accumulated (summed). + * If `indices` contains duplicates, then we pick the last update for the index. *

- * WARNING: The order in which updates are applied is nondeterministic, so the - * output will be nondeterministic if `indices` contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. + * If an out of bound index is found on CPU, an error is returned. *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. The last dimension of `indices` can be at most the rank of `shape`: - *

- * indices.shape[-1] <= shape.rank - *

- * The last dimension of `indices` corresponds to indices into elements - * (if `indices.shape[-1] = shape.rank`) or slices - * (if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of - * `shape`. `updates` is a tensor with shape - *

- * indices.shape[:-1] + shape[indices.shape[-1]:] - *

- * The simplest form of scatter is to insert individual elements in a tensor by - * index. For example, say we want to insert 4 scattered elements in a rank-1 - * tensor with 8 elements. - *

- *

- * - *
+ * WARNING: There are some GPU specific semantics for this operation. + * - If an out of bound index is found, the index is ignored. + * - The order in which updates are applied is nondeterministic, so the output + * will be nondeterministic if `indices` contains duplicates. *

- * In Python, this scatter operation would look like this: - *

- * >>> indices = tf.constant([[4], [3], [1], [7]]) - * >>> updates = tf.constant([9, 10, 11, 12]) - * >>> tensor = tf.ones([8], dtype=tf.int32) - * >>> print(tf.tensor_scatter_nd_update(tensor, indices, updates)) - * tf.Tensor([ 1 11 1 10 9 1 1 12], shape=(8,), dtype=int32) - *

- * We can also, insert entire slices of a higher rank tensor all at once. For - * example, if we wanted to insert two slices in the first dimension of a - * rank-3 tensor with two matrices of new values. - *

- * In Python, this scatter operation would look like this: - *

- * >>> indices = tf.constant([[0], [2]]) - * >>> updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6], - * ... [7, 7, 7, 7], [8, 8, 8, 8]], - * ... [[5, 5, 5, 5], [6, 6, 6, 6], - * ... [7, 7, 7, 7], [8, 8, 8, 8]]]) - * >>> tensor = tf.ones([4, 4, 4], dtype=tf.int32) - * >>> print(tf.tensor_scatter_nd_update(tensor, indices, updates).numpy()) - * [[[5 5 5 5] - * [6 6 6 6] - * [7 7 7 7] - * [8 8 8 8]] - * [[1 1 1 1] - * [1 1 1 1] - * [1 1 1 1] - * [1 1 1 1]] - * [[5 5 5 5] - * [6 6 6 6] - * [7 7 7 7] - * [8 8 8 8]] - * [[1 1 1 1] - * [1 1 1 1] - * [1 1 1 1] - * [1 1 1 1]]] + * `indices` is an integer tensor containing indices into a new tensor of shape + * `shape`. + *

    + *
  • + * `indices` must have at least 2 axes: `(num_updates, index_depth)`. + *
  • + *
  • + * The last axis of `indices` is how deep to index into `tensor` so this index + * depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim` + *
  • + *
+ * if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements. + * if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input + * `tensor`. *

- * Note that on CPU, if an out of bound index is found, an error is returned. - * On GPU, if an out of bound index is found, the index is ignored. + * Each `update` has a rank of `tensor.rank - indices.shape[-1]`. + * The overall shape of `updates` is: + *

{@code
+ * indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
+ * }
+ * For usage examples see the python [tf.tensor_scatter_nd_update]( + * https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function + * * * @param data type for {@code output()} output */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java new file mode 100644 index 00000000000..1904a513a5a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java @@ -0,0 +1,91 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * Returns the TopK unique values in the array in sorted order. The + *

+ * running time is proportional to the product of K and the input + * size. Sorting the whole array is more efficient for sufficiently large + * values of K. The median-of-medians algorithm is probably faster, but + * difficult to implement efficiently in XLA. If there are fewer than K + * unique numbers (not NANs), the results are padded with negative + * infinity. NaNs are never returned. Subnormal numbers are flushed to + * zero. If an element appears at multiple indices, the highest index is + * returned. If a TopK element never appears in the input due to padding + * values, the indices are padded with negative one. If a padding value + * appears in the input and padding is needed, the highest index of the + * padding value will be returned. The semantics are not the same as + * kth_order_statistic. + */ +@Operator +public final class TopKUnique extends RawOp { + + /** + * Factory method to create a class wrapping a new TopKUnique operation. + * + * @param scope current scope + * @param input + * @param k + * @return a new instance of TopKUnique + */ + @Endpoint(describeByClass = true) + public static TopKUnique create(Scope scope, Operand input, Long k) { + OperationBuilder opBuilder = scope.env().opBuilder("TopKUnique", scope.makeOpName("TopKUnique")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("k", k); + return new TopKUnique(opBuilder.build()); + } + + /** + */ + public Output topk() { + return topk; + } + + /** + */ + public Output topkIndices() { + return topkIndices; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TopKUnique"; + + private Output topk; + private Output topkIndices; + + private TopKUnique(Operation operation) { + super(operation); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java new file mode 100644 index 00000000000..a2cc2c2adf5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java @@ -0,0 +1,83 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * Returns the TopK values in the array in sorted order. This is a combination + *

+ * of MakeUnique and TopKUnique. The returned top-K will have its lower bits + * replaced by iota, thus it will be close to the original value but not exactly + * the same. The running time is proportional to the product of K and the input + * size. NaNs are never returned. Subnormal numbers are flushed to zero. + */ +@Operator +public final class TopKWithUnique extends RawOp { + + /** + * Factory method to create a class wrapping a new TopKWithUnique operation. + * + * @param scope current scope + * @param input + * @param k + * @return a new instance of TopKWithUnique + */ + @Endpoint(describeByClass = true) + public static TopKWithUnique create(Scope scope, Operand input, Long k) { + OperationBuilder opBuilder = scope.env().opBuilder("TopKWithUnique", scope.makeOpName("TopKWithUnique")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("k", k); + return new TopKWithUnique(opBuilder.build()); + } + + /** + */ + public Output topk() { + return topk; + } + + /** + */ + public Output topkIndices() { + return topkIndices; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TopKWithUnique"; + + private Output topk; + private Output topkIndices; + + private TopKWithUnique(Operation operation) { + super(operation); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java index 1e18bf6be11..d16064aa7f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java @@ -57,7 +57,16 @@ public Options autoShardPolicy(Long autoShardPolicy) { return this; } + /** + * @param numReplicas + */ + public Options numReplicas(Long numReplicas) { + this.numReplicas = numReplicas; + return this; + } + private Long autoShardPolicy; + private Long numReplicas; private Options() { } @@ -93,6 +102,9 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper if (opts.autoShardPolicy != null) { opBuilder.setAttr("auto_shard_policy", opts.autoShardPolicy); } + if (opts.numReplicas != null) { + opBuilder.setAttr("num_replicas", opts.numReplicas); + } } } return new AutoShardDataset(opBuilder.build()); @@ -105,6 +117,13 @@ public static Options autoShardPolicy(Long autoShardPolicy) { return new Options().autoShardPolicy(autoShardPolicy); } + /** + * @param numReplicas + */ + public static Options numReplicas(Long numReplicas) { + return new Options().numReplicas(numReplicas); + } + /** */ public Output handle() { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java index e2bb15aed4d..d2df9f2f263 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java @@ -35,7 +35,6 @@ /** */ -@Operator(group = "data") public final class CSVDataset extends RawOp implements Operand { /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java new file mode 100644 index 00000000000..f724dca8e93 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java @@ -0,0 +1,101 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.data; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + */ +public final class CSVDatasetV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new CSVDatasetV2 operation. + * + * @param scope current scope + * @param filenames + * @param compressionType + * @param bufferSize + * @param header + * @param fieldDelim + * @param useQuoteDelim + * @param naValue + * @param selectCols + * @param recordDefaults + * @param excludeCols + * @param outputShapes + * @return a new instance of CSVDatasetV2 + */ + @Endpoint(describeByClass = true) + public static CSVDatasetV2 create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, Operand excludeCols, List outputShapes) { + OperationBuilder opBuilder = scope.env().opBuilder("CSVDatasetV2", scope.makeOpName("CSVDatasetV2")); + opBuilder.addInput(filenames.asOutput()); + opBuilder.addInput(compressionType.asOutput()); + opBuilder.addInput(bufferSize.asOutput()); + opBuilder.addInput(header.asOutput()); + opBuilder.addInput(fieldDelim.asOutput()); + opBuilder.addInput(useQuoteDelim.asOutput()); + opBuilder.addInput(naValue.asOutput()); + opBuilder.addInput(selectCols.asOutput()); + opBuilder.addInputList(Operands.asOutputs(recordDefaults)); + opBuilder.addInput(excludeCols.asOutput()); + opBuilder = scope.apply(opBuilder); + Shape[] outputShapesArray = new Shape[outputShapes.size()]; + for (int i = 0; i < outputShapesArray.length; ++i) { + outputShapesArray[i] = outputShapes.get(i); + } + opBuilder.setAttr("output_shapes", outputShapesArray); + return new CSVDatasetV2(opBuilder.build()); + } + + /** + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "CSVDatasetV2"; + + private Output handle; + + private CSVDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java index 0b4bec924b2..02c64a0b24e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java @@ -35,6 +35,25 @@ */ public final class IgnoreErrorsDataset extends RawOp implements Operand { + /** + * Optional attributes for {@link org.tensorflow.op.data.IgnoreErrorsDataset} + */ + public static class Options { + + /** + * @param logWarning + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = logWarning; + return this; + } + + private Boolean logWarning; + + private Options() { + } + } + /** * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. * @@ -42,10 +61,11 @@ public final class IgnoreErrorsDataset extends RawOp implements Operand { * @param inputDataset * @param outputTypes * @param outputShapes + * @param options carries optional attributes values * @return a new instance of IgnoreErrorsDataset */ @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("IgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); @@ -55,9 +75,23 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.logWarning != null) { + opBuilder.setAttr("log_warning", opts.logWarning); + } + } + } return new IgnoreErrorsDataset(opBuilder.build()); } + /** + * @param logWarning + */ + public static Options logWarning(Boolean logWarning) { + return new Options().logWarning(logWarning); + } + /** */ public Output handle() { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java index f62be66854b..6b102be4fc7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java @@ -58,8 +58,17 @@ public Options cpuBudget(Long cpuBudget) { return this; } + /** + * @param ramBudget + */ + public Options ramBudget(Long ramBudget) { + this.ramBudget = ramBudget; + return this; + } + private Long algorithm; private Long cpuBudget; + private Long ramBudget; private Options() { } @@ -94,6 +103,9 @@ public static ModelDataset create(Scope scope, Operand inputDataset, List handle() { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java new file mode 100644 index 00000000000..06e90b20cbc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java @@ -0,0 +1,130 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.data; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset by applying related optimizations to `input_dataset`. + *

+ * Creates a dataset by applying related optimizations to `input_dataset`. + */ +public final class OptimizeDatasetV2 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.data.OptimizeDatasetV2} + */ + public static class Options { + + /** + * @param optimizationConfigs + */ + public Options optimizationConfigs(List optimizationConfigs) { + this.optimizationConfigs = optimizationConfigs; + return this; + } + + private List optimizationConfigs; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new OptimizeDatasetV2 operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the input dataset. + * @param optimizationsEnabled A `tf.string` vector `tf.Tensor` identifying user enabled optimizations. + * @param optimizationsDisabled A `tf.string` vector `tf.Tensor` identifying user disabled optimizations. + * @param optimizationsDefault A `tf.string` vector `tf.Tensor` identifying optimizations by default. + * @param outputTypes + * @param outputShapes + * @param options carries optional attributes values + * @return a new instance of OptimizeDatasetV2 + */ + @Endpoint(describeByClass = true) + public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Operand optimizationsEnabled, Operand optimizationsDisabled, Operand optimizationsDefault, List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("OptimizeDatasetV2", scope.makeOpName("OptimizeDatasetV2")); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(optimizationsEnabled.asOutput()); + opBuilder.addInput(optimizationsDisabled.asOutput()); + opBuilder.addInput(optimizationsDefault.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); + Shape[] outputShapesArray = new Shape[outputShapes.size()]; + for (int i = 0; i < outputShapesArray.length; ++i) { + outputShapesArray[i] = outputShapes.get(i); + } + opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.optimizationConfigs != null) { + String[] optimizationConfigsArray = new String[opts.optimizationConfigs.size()]; + for (int i = 0; i < optimizationConfigsArray.length; ++i) { + optimizationConfigsArray[i] = opts.optimizationConfigs.get(i); + } + opBuilder.setAttr("optimization_configs", optimizationConfigsArray); + } + } + } + return new OptimizeDatasetV2(opBuilder.build()); + } + + /** + * @param optimizationConfigs + */ + public static Options optimizationConfigs(List optimizationConfigs) { + return new Options().optimizationConfigs(optimizationConfigs); + } + + /** + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "OptimizeDatasetV2"; + + private Output handle; + + private OptimizeDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java index 7e86b47bfe1..27409a575a9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java @@ -57,8 +57,17 @@ public Options legacyAutotune(Boolean legacyAutotune) { return this; } + /** + * @param bufferSizeMin + */ + public Options bufferSizeMin(Long bufferSizeMin) { + this.bufferSizeMin = bufferSizeMin; + return this; + } + private Long slackPeriod; private Boolean legacyAutotune; + private Long bufferSizeMin; private Options() { } @@ -96,6 +105,9 @@ public static PrefetchDataset create(Scope scope, Operand inputDataset, Opera if (opts.legacyAutotune != null) { opBuilder.setAttr("legacy_autotune", opts.legacyAutotune); } + if (opts.bufferSizeMin != null) { + opBuilder.setAttr("buffer_size_min", opts.bufferSizeMin); + } } } return new PrefetchDataset(opBuilder.build()); @@ -115,6 +127,13 @@ public static Options legacyAutotune(Boolean legacyAutotune) { return new Options().legacyAutotune(legacyAutotune); } + /** + * @param bufferSizeMin + */ + public static Options bufferSizeMin(Long bufferSizeMin) { + return new Options().bufferSizeMin(bufferSizeMin); + } + /** */ public Output handle() { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java new file mode 100644 index 00000000000..dd39cda094b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java @@ -0,0 +1,93 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.data; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset that changes the batch size. + *

+ * Creates a dataset that rebatches elements from `input_dataset` into new batch + * sizes. + */ +public final class RebatchDatasetV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new RebatchDatasetV2 operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the input dataset. + * @param batchSizes A vector of integers representing the size of batches to produce. These values + * are cycled through in order. + * @param dropRemainder + * @param outputTypes + * @param outputShapes + * @return a new instance of RebatchDatasetV2 + */ + @Endpoint(describeByClass = true) + public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, Operand batchSizes, Operand dropRemainder, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.env().opBuilder("RebatchDatasetV2", scope.makeOpName("RebatchDatasetV2")); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(batchSizes.asOutput()); + opBuilder.addInput(dropRemainder.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); + Shape[] outputShapesArray = new Shape[outputShapes.size()]; + for (int i = 0; i < outputShapesArray.length; ++i) { + outputShapesArray[i] = outputShapes.get(i); + } + opBuilder.setAttr("output_shapes", outputShapesArray); + return new RebatchDatasetV2(opBuilder.build()); + } + + /** + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "RebatchDatasetV2"; + + private Output handle; + + private RebatchDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java index 419baa98adf..83ddc19fe19 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java @@ -35,6 +35,25 @@ */ public final class IgnoreErrorsDataset extends RawOp implements Operand { + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.IgnoreErrorsDataset} + */ + public static class Options { + + /** + * @param logWarning + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = logWarning; + return this; + } + + private Boolean logWarning; + + private Options() { + } + } + /** * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. * @@ -42,10 +61,11 @@ public final class IgnoreErrorsDataset extends RawOp implements Operand { * @param inputDataset * @param outputTypes * @param outputShapes + * @param options carries optional attributes values * @return a new instance of IgnoreErrorsDataset */ @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); @@ -55,9 +75,23 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.logWarning != null) { + opBuilder.setAttr("log_warning", opts.logWarning); + } + } + } return new IgnoreErrorsDataset(opBuilder.build()); } + /** + * @param logWarning + */ + public static Options logWarning(Boolean logWarning) { + return new Options().logWarning(logWarning); + } + /** */ public Output handle() { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java new file mode 100644 index 00000000000..8eacb80357a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java @@ -0,0 +1,92 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.distribute; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs a tensor containing the reduction across all input tensors. + *

+ * Outputs a tensor containing the reduction across all input tensors passed to ops + * within the same `shared_name. + *

+ * The graph should be constructed so if one op runs with shared_name value `c`, + * then `num_devices` ops will run with shared_name value `c`. Failure to do so + * will cause the graph execution to fail to complete. + *

+ * input: the input to the reduction + * data: the value of the reduction across all `num_devices` devices. + * reduction: the reduction operation to perform. + * num_devices: The number of devices participating in this reduction. + * shared_name: Identifier that shared between ops of the same reduction. + * + * @param data type for {@code data()} output + */ +public final class NcclAllReduce extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new NcclAllReduce operation. + * + * @param scope current scope + * @param input + * @param reduction + * @param numDevices + * @param sharedName + * @return a new instance of NcclAllReduce + */ + @Endpoint(describeByClass = true) + public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { + OperationBuilder opBuilder = scope.env().opBuilder("NcclAllReduce", scope.makeOpName("NcclAllReduce")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("reduction", reduction); + opBuilder.setAttr("num_devices", numDevices); + opBuilder.setAttr("shared_name", sharedName); + return new NcclAllReduce(opBuilder.build()); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "NcclAllReduce"; + + private Output data; + + private NcclAllReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java new file mode 100644 index 00000000000..9a0557fb6e8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java @@ -0,0 +1,86 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.distribute; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Sends `input` to all devices that are connected to the output. + *

+ * Sends `input` to all devices that are connected to the output. + *

+ * The graph should be constructed so that all ops connected to the output have a + * valid device assignment, and the op itself is assigned one of these devices. + *

+ * input: The input to the broadcast. + * output: The same as input. + * shape: The shape of the input tensor. + * + * + * @param data type for {@code output()} output + */ +public final class NcclBroadcast extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new NcclBroadcast operation. + * + * @param scope current scope + * @param input + * @param shape + * @return a new instance of NcclBroadcast + */ + @Endpoint(describeByClass = true) + public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { + OperationBuilder opBuilder = scope.env().opBuilder("NcclBroadcast", scope.makeOpName("NcclBroadcast")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("shape", shape); + return new NcclBroadcast(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "NcclBroadcast"; + + private Output output; + + private NcclBroadcast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java new file mode 100644 index 00000000000..cc0c25b3c5a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java @@ -0,0 +1,85 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.distribute; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Reduces `input` from `num_devices` using `reduction` to a single device. + *

+ * Reduces `input` from `num_devices` using `reduction` to a single device. + *

+ * The graph should be constructed so that all inputs have a valid device + * assignment, and the op itself is assigned one of these devices. + *

+ * input: The input to the reduction. + * data: the value of the reduction across all `num_devices` devices. + * reduction: the reduction operation to perform. + * + * @param data type for {@code data()} output + */ +public final class NcclReduce extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new NcclReduce operation. + * + * @param scope current scope + * @param input + * @param reduction + * @return a new instance of NcclReduce + */ + @Endpoint(describeByClass = true) + public static NcclReduce create(Scope scope, Iterable> input, String reduction) { + OperationBuilder opBuilder = scope.env().opBuilder("NcclReduce", scope.makeOpName("NcclReduce")); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("reduction", reduction); + return new NcclReduce(opBuilder.build()); + } + + /** + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "NcclReduce"; + + private Output data; + + private NcclReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java new file mode 100644 index 00000000000..2f307368b9b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java @@ -0,0 +1,171 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.image; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUint8; +import org.tensorflow.types.family.TNumber; + +/** + * 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 of type + * dtype. + *

+ * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as + * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays + * [height, width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or + * PNG files. Alternately, set the expand_animations argument of this function to + * False, in which case the op will return 3-dimensional tensors and will truncate + * animated GIF files to the first frame. + *

+ * NOTE: If the first frame of an animated GIF does not occupy the entire + * canvas (maximum frame width x maximum frame height), then it fills the + * unoccupied areas (in the first frame) with zeros (black). For frames after the + * first frame that does not occupy the entire canvas, it uses the previous + * frame to fill the unoccupied areas. + * + * @param data type for {@code image()} output + */ +@Operator(group = "image") +public final class DecodeImage extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeImage} + */ + public static class Options { + + /** + * @param channels Number of color channels for the decoded image. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + + /** + * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will + * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all + * GIFs, whether animated or not. If, False, the returned op will produce a 3-D + * tensor for all file types and will truncate animated GIFs to the first frame. + */ + public Options expandAnimations(Boolean expandAnimations) { + this.expandAnimations = expandAnimations; + return this; + } + + private Long channels; + private Boolean expandAnimations; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new DecodeImage operation. + * + * @param scope current scope + * @param contents 0-D. The encoded image bytes. + * @param dtype The desired DType of the returned Tensor. + * @param options carries optional attributes values + * @return a new instance of DecodeImage + */ + @Endpoint(describeByClass = true) + public static DecodeImage create(Scope scope, Operand contents, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("DecodeImage", scope.makeOpName("DecodeImage")); + opBuilder.addInput(contents.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + if (options != null) { + for (Options opts : options) { + if (opts.channels != null) { + opBuilder.setAttr("channels", opts.channels); + } + if (opts.expandAnimations != null) { + opBuilder.setAttr("expand_animations", opts.expandAnimations); + } + } + } + return new DecodeImage(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new DecodeImage operation using default output types. + * + * @param scope current scope + * @param contents 0-D. The encoded image bytes. + * @param options carries optional attributes values + * @return a new instance of DecodeImage + */ + @Endpoint(describeByClass = true) + public static DecodeImage create(Scope scope, Operand contents, Options... options) { + return create(scope, contents, TUint8.class, options); + } + + /** + * @param channels Number of color channels for the decoded image. + */ + public static Options channels(Long channels) { + return new Options().channels(channels); + } + + /** + * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will + * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all + * GIFs, whether animated or not. If, False, the returned op will produce a 3-D + * tensor for all file types and will truncate animated GIFs to the first frame. + */ + public static Options expandAnimations(Boolean expandAnimations) { + return new Options().expandAnimations(expandAnimations); + } + + /** + * 3-D with shape `[height, width, channels]` or 4-D with shape + * `[frame, height, width, channels]`.. + */ + public Output image() { + return image; + } + + @Override + public Output asOutput() { + return image; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "DecodeImage"; + + private Output image; + + private DecodeImage(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java new file mode 100644 index 00000000000..2b4de22d4d4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java @@ -0,0 +1,127 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.image; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Applies the given transform to each of the images. + *

+ * If one row of `transforms` is `[a0, a1, a2, b0, b1, b2, c0, c1]`, then it maps + * the output point `(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`. If the transformed point lays outside of the input + * image, the output pixel is set to fill_value. + * + * @param data type for {@code transformedImages()} output + */ +public final class ImageProjectiveTransformV3 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV3} + */ + public static class Options { + + /** + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + */ + public Options fillMode(String fillMode) { + this.fillMode = fillMode; + return this; + } + + private String fillMode; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new ImageProjectiveTransformV3 operation. + * + * @param scope current scope + * @param images 4-D with shape `[batch, height, width, channels]`. + * @param transforms 2-D Tensor, `[batch, 8]` or `[1, 8]` matrix, where each row corresponds to a 3 x 3 + * projective transformation matrix, with the last entry assumed to be 1. If there + * is one row, the same transformation will be applied to all images. + * @param outputShape 1-D Tensor [new_height, new_width]. + * @param fillValue float, the value to be filled when fill_mode is constant". + * @param interpolation Interpolation method, "NEAREST" or "BILINEAR". + * @param options carries optional attributes values + * @return a new instance of ImageProjectiveTransformV3 + */ + @Endpoint(describeByClass = true) + public static ImageProjectiveTransformV3 create(Scope scope, Operand images, Operand transforms, Operand outputShape, Operand fillValue, String interpolation, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("ImageProjectiveTransformV3", scope.makeOpName("ImageProjectiveTransformV3")); + opBuilder.addInput(images.asOutput()); + opBuilder.addInput(transforms.asOutput()); + opBuilder.addInput(outputShape.asOutput()); + opBuilder.addInput(fillValue.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("interpolation", interpolation); + if (options != null) { + for (Options opts : options) { + if (opts.fillMode != null) { + opBuilder.setAttr("fill_mode", opts.fillMode); + } + } + } + return new ImageProjectiveTransformV3(opBuilder.build()); + } + + /** + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + */ + public static Options fillMode(String fillMode) { + return new Options().fillMode(fillMode); + } + + /** + * 4-D with shape + * `[batch, new_height, new_width, channels]`. + */ + public Output transformedImages() { + return transformedImages; + } + + @Override + public Output asOutput() { + return transformedImages; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "ImageProjectiveTransformV3"; + + private Output transformedImages; + + private ImageProjectiveTransformV3(Operation operation) { + super(operation); + int outputIdx = 0; + transformedImages = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java new file mode 100644 index 00000000000..725592351ae --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java @@ -0,0 +1,274 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.image; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TNumber; + +/** + * Generate a randomly distorted bounding box for an image deterministically. + *

+ * Bounding box annotations are often supplied in addition to ground-truth labels + * in image recognition or object localization tasks. A common technique for + * training such a system is to randomly distort an image while preserving its + * content, i.e. data augmentation. This Op, given the same `seed`, + * deterministically outputs a randomly distorted localization of an object, i.e. + * bounding box, given an `image_size`, `bounding_boxes` and a series of + * constraints. + *

+ * The output of this Op is a single bounding box that may be used to crop the + * original image. The output is returned as 3 tensors: `begin`, `size` and + * `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the + * image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize + * what the bounding box looks like. + *

+ * Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The + * bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and + * the height of the underlying image. + *

+ * The output of this Op is guaranteed to be the same given the same `seed` and is + * independent of how many times the function is called, and independent of global + * seed settings (e.g. `tf.random.set_seed`). + *

+ * Example usage: + *

+ * >>> image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) + * >>> bbox = tf.constant( + * ... [0.0, 0.0, 1.0, 1.0], dtype=tf.float32, shape=[1, 1, 4]) + * >>> seed = (1, 2) + * >>> # Generate a single distorted bounding box. + * >>> bbox_begin, bbox_size, bbox_draw = ( + * ... tf.image.stateless_sample_distorted_bounding_box( + * ... tf.shape(image), bounding_boxes=bbox, seed=seed)) + * >>> # Employ the bounding box to distort the image. + * >>> tf.slice(image, bbox_begin, bbox_size) + * + * >>> # Draw the bounding box in an image summary. + * >>> colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) + * >>> tf.image.draw_bounding_boxes( + * ... tf.expand_dims(tf.cast(image, tf.float32),0), bbox_draw, colors) + * + *

+ * Note that if no bounding box information is available, setting + * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit + * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + * false and no bounding boxes are supplied, an error is raised. + * + * @param data type for {@code begin()} output + */ +@Operator(group = "image") +public final class StatelessSampleDistortedBoundingBox extends RawOp { + + /** + * Optional attributes for {@link org.tensorflow.op.image.StatelessSampleDistortedBoundingBox} + */ + public static class Options { + + /** + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + */ + public Options aspectRatioRange(List aspectRatioRange) { + this.aspectRatioRange = aspectRatioRange; + return this; + } + + /** + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + */ + public Options areaRange(List areaRange) { + this.areaRange = areaRange; + return this; + } + + /** + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After `max_attempts` failures, return the entire + * image. + */ + public Options maxAttempts(Long maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + /** + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + */ + public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; + return this; + } + + private List aspectRatioRange; + private List areaRange; + private Long maxAttempts; + private Boolean useImageIfNoBoundingBoxes; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new StatelessSampleDistortedBoundingBox operation. + * + * @param scope current scope + * @param imageSize 1-D, containing `[height, width, channels]`. + * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * associated with the image. + * @param minObjectCovered The cropped area of the image must contain at least this + * fraction of any bounding box supplied. The value of this parameter should be + * non-negative. In the case of 0, the cropped area does not need to overlap + * any of the bounding boxes supplied. + * @param seed 1-D with shape `[2]`. The seed to the random number generator. Must have dtype + * `int32` or `int64`. (When using XLA, only `int32` is allowed.) + * @param options carries optional attributes values + * @return a new instance of StatelessSampleDistortedBoundingBox + */ + @Endpoint(describeByClass = true) + public static StatelessSampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Operand seed, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessSampleDistortedBoundingBox", scope.makeOpName("StatelessSampleDistortedBoundingBox")); + opBuilder.addInput(imageSize.asOutput()); + opBuilder.addInput(boundingBoxes.asOutput()); + opBuilder.addInput(minObjectCovered.asOutput()); + opBuilder.addInput(seed.asOutput()); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.aspectRatioRange != null) { + float[] aspectRatioRangeArray = new float[opts.aspectRatioRange.size()]; + for (int i = 0; i < aspectRatioRangeArray.length; ++i) { + aspectRatioRangeArray[i] = opts.aspectRatioRange.get(i); + } + opBuilder.setAttr("aspect_ratio_range", aspectRatioRangeArray); + } + if (opts.areaRange != null) { + float[] areaRangeArray = new float[opts.areaRange.size()]; + for (int i = 0; i < areaRangeArray.length; ++i) { + areaRangeArray[i] = opts.areaRange.get(i); + } + opBuilder.setAttr("area_range", areaRangeArray); + } + if (opts.maxAttempts != null) { + opBuilder.setAttr("max_attempts", opts.maxAttempts); + } + if (opts.useImageIfNoBoundingBoxes != null) { + opBuilder.setAttr("use_image_if_no_bounding_boxes", opts.useImageIfNoBoundingBoxes); + } + } + } + return new StatelessSampleDistortedBoundingBox(opBuilder.build()); + } + + /** + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + */ + public static Options aspectRatioRange(List aspectRatioRange) { + return new Options().aspectRatioRange(aspectRatioRange); + } + + /** + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + */ + public static Options areaRange(List areaRange) { + return new Options().areaRange(areaRange); + } + + /** + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After `max_attempts` failures, return the entire + * image. + */ + public static Options maxAttempts(Long maxAttempts) { + return new Options().maxAttempts(maxAttempts); + } + + /** + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + */ + public static Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + return new Options().useImageIfNoBoundingBoxes(useImageIfNoBoundingBoxes); + } + + /** + * 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to + * `tf.slice`. + */ + public Output begin() { + return begin; + } + + /** + * 1-D, containing `[target_height, target_width, -1]`. Provide as input to + * `tf.slice`. + */ + public Output size() { + return size; + } + + /** + * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. + * Provide as input to `tf.image.draw_bounding_boxes`. + */ + public Output bboxes() { + return bboxes; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessSampleDistortedBoundingBox"; + + private Output begin; + private Output size; + private Output bboxes; + + private StatelessSampleDistortedBoundingBox(Operation operation) { + super(operation); + int outputIdx = 0; + begin = operation.output(outputIdx++); + size = operation.output(outputIdx++); + bboxes = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java index f190790437d..7152fceefe8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java @@ -28,10 +28,9 @@ import org.tensorflow.types.family.TType; /** - * Computes the inverse of one or more square invertible matrices or their - *

- * adjoints (conjugate transposes). + * Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). *

+ * * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions * form square matrices. The output is a tensor of the same shape as the input * containing the inverse for all input submatrices `[..., :, :]`. diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java index baedbe76043..082d8c96fb7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java @@ -35,9 +35,9 @@ * The input is a tensor of shape `[N, M, M]` whose inner-most 2 dimensions * form square matrices. The outputs are two tensors containing the signs and * absolute values of the log determinants for all N input submatrices - * `[..., :, :]` such that the determinant = sign*exp(log_abs_determinant). - * The log_abs_determinant is computed as det(P)*sum(log(diag(LU))) where LU - * is the LU decomposition of the input and P is the corresponding + * `[..., :, :]` such that `determinant = sign*exp(log_abs_determinant)`. + * The `log_abs_determinant` is computed as `det(P)*sum(log(diag(LU)))` where `LU` + * is the `LU` decomposition of the input and `P` is the corresponding * permutation matrix. * * @param data type for {@code sign()} output diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java index 7aa6631af3a..9335adb16c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java @@ -32,6 +32,10 @@ *

* Computes the QR decomposition of each inner matrix in `tensor` such that * `tensor[..., :, :] = q[..., :, :] * r[..., :,:])` + *

+ * Currently, the gradient for the QR decomposition is well-defined only when + * the first `P` columns of the inner matrix are linearly independent, where + * `P` is the minimum of `M` and `N`, the 2 inner-most dimmensions of `tensor`. *

{@code
  * # a is a tensor.
  * # q is a tensor of orthonormal matrices.
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java
index daccee535af..8e0c146d03b 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java
@@ -29,6 +29,12 @@
 
 /**
  * Computes acos of x element-wise.
+ * 

+ * + * Provided an input tensor, the `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`. + *

+ * Input range is `[-1, 1]` and the output has a range of `[0, pi]`. + * * * @param data type for {@code y()} output */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java index b8bf6421944..5ec4a7e295a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java @@ -32,6 +32,11 @@ *

* NOTE: `math.Add` supports broadcasting. `AddN` does not. More about broadcasting * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

+ * Given two input tensors, the `tf.add` operation computes the sum for every element in the tensor. + *

+ * Both input and output have a range `(-inf, inf)`. + * * * @param data type for {@code z()} output */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java index 4f1e0306df8..4874e3db903 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java @@ -28,7 +28,7 @@ import org.tensorflow.types.family.TType; /** - * Returns (x - y)(x - y) element-wise. + * Returns conj(x - y)(x - y) element-wise. *

* NOTE: `math.SquaredDifference` supports broadcasting. More about broadcasting * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java index 86a2b74e72f..5f71c39cd78 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java @@ -34,10 +34,11 @@ * element in the tensor. Input range is `[-inf, inf]` and * output range is `[-1,1]`. *

- *

{@code
- *   x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
- *   tf.math.tanh(x) ==> [-1. -0.99990916 -0.46211717 0.7615942 0.8336547 0.9640276 0.9950547 1.]
- *   }
+ * >>> x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) + * >>> tf.math.tanh(x) + * * * * @param data type for {@code y()} output diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java index 7b675fc816e..b75ad74af9a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java @@ -30,6 +30,9 @@ /** * Performs 3D average pooling on the input. + *

+ * Each entry in `output` is the mean of the corresponding size `ksize` window in + * `value`. * * @param data type for {@code output()} output */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java index 6f8799f0e68..78f640b17f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java @@ -28,9 +28,29 @@ import org.tensorflow.types.family.TNumber; /** - * Returns the permuted vector/tensor in the destination data format given the + * Permute input tensor from `src_format` to `dst_format`. *

- * one in the source data format. + * Input tensor must be a vector of size 4, or a 4x2 tensor. + *

+ * For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and inputs: + *

{@code
+ * [1, 2, 3, 4]
+ * }
+ * and + *
{@code
+ * [[1, 2, 3, 4],
+ *  [5, 6, 7, 8]]
+ * }
+ * , the outputs will be (respectively): + *
{@code
+ * [1, 4, 2, 3]
+ * }
+ * and + *
{@code
+ * [[1, 4, 2, 3],
+ *  [5, 8, 6, 7]]
+ * }
+ * * * @param data type for {@code y()} output */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java new file mode 100644 index 00000000000..d6ebf48bd75 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java @@ -0,0 +1,95 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.nn; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Solves a batch of isotonic regression problems. + * + * @param data type for {@code output()} output + */ +public final class IsotonicRegression extends RawOp { + + /** + * Factory method to create a class wrapping a new IsotonicRegression operation. + * + * @param scope current scope + * @param input A (batch_size, dim)-tensor holding a batch of inputs. + * @param outputDtype Dtype of output. + * @return a new instance of IsotonicRegression + */ + @Endpoint(describeByClass = true) + public static IsotonicRegression create(Scope scope, Operand input, Class outputDtype) { + OperationBuilder opBuilder = scope.env().opBuilder("IsotonicRegression", scope.makeOpName("IsotonicRegression")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); + return new IsotonicRegression(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new IsotonicRegression operation using default output types. + * + * @param scope current scope + * @param input A (batch_size, dim)-tensor holding a batch of inputs. + * @return a new instance of IsotonicRegression + */ + @Endpoint(describeByClass = true) + public static IsotonicRegression create(Scope scope, Operand input) { + return create(scope, input, TFloat32.class); + } + + /** + * A (batch_size, dim)-tensor holding the per-batch element solutions. + */ + public Output output() { + return output; + } + + /** + * An int32 (batch_size, dim)-tensor with the segments. + */ + public Output segments() { + return segments; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "IsotonicRegression"; + + private Output output; + private Output segments; + + private IsotonicRegression(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + segments = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java new file mode 100644 index 00000000000..d91c6d89fb4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java @@ -0,0 +1,175 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.quantization; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Quantizes then dequantizes a tensor. + *

+ * This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a + * tensor, so its value can change during training. + * + * @param data type for {@code output()} output + */ +@Operator(group = "quantization") +public final class QuantizeAndDequantizeV3 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV3} + */ + public static class Options { + + /** + * @param signedInput + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * @param rangeGiven + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * @param narrowRange + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * @param axis + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } + + private Boolean signedInput; + private Boolean rangeGiven; + private Boolean narrowRange; + private Long axis; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. + * + * @param scope current scope + * @param input + * @param inputMin + * @param inputMax + * @param numBits + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV3 + */ + @Endpoint(describeByClass = true) + public static QuantizeAndDequantizeV3 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV3", scope.makeOpName("QuantizeAndDequantizeV3")); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(inputMin.asOutput()); + opBuilder.addInput(inputMax.asOutput()); + opBuilder.addInput(numBits.asOutput()); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.signedInput != null) { + opBuilder.setAttr("signed_input", opts.signedInput); + } + if (opts.rangeGiven != null) { + opBuilder.setAttr("range_given", opts.rangeGiven); + } + if (opts.narrowRange != null) { + opBuilder.setAttr("narrow_range", opts.narrowRange); + } + if (opts.axis != null) { + opBuilder.setAttr("axis", opts.axis); + } + } + } + return new QuantizeAndDequantizeV3(opBuilder.build()); + } + + /** + * @param signedInput + */ + public static Options signedInput(Boolean signedInput) { + return new Options().signedInput(signedInput); + } + + /** + * @param rangeGiven + */ + public static Options rangeGiven(Boolean rangeGiven) { + return new Options().rangeGiven(rangeGiven); + } + + /** + * @param narrowRange + */ + public static Options narrowRange(Boolean narrowRange) { + return new Options().narrowRange(narrowRange); + } + + /** + * @param axis + */ + public static Options axis(Long axis) { + return new Options().axis(axis); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "QuantizeAndDequantizeV3"; + + private Output output; + + private QuantizeAndDequantizeV3(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java new file mode 100644 index 00000000000..60517531020 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java @@ -0,0 +1,210 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.quantization; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Returns the gradient of `quantization.QuantizeAndDequantizeV4`. + *

+ * This is almost identical to QuantizeAndDequantizeV2, except that it returns a + * gradient of 1 for inputs that are within the quantization range, or 0 otherwise. + * + * @param data type for {@code output()} output + */ +@Operator(group = "quantization") +public final class QuantizeAndDequantizeV4 extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4} + */ + public static class Options { + + /** + * @param signedInput + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * @param numBits + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * @param rangeGiven + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * @param roundMode + */ + public Options roundMode(String roundMode) { + this.roundMode = roundMode; + return this; + } + + /** + * @param narrowRange + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * @param axis + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } + + private Boolean signedInput; + private Long numBits; + private Boolean rangeGiven; + private String roundMode; + private Boolean narrowRange; + private Long axis; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new QuantizeAndDequantizeV4 operation. + * + * @param scope current scope + * @param input + * @param inputMin + * @param inputMax + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV4 + */ + @Endpoint(describeByClass = true) + public static QuantizeAndDequantizeV4 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4", scope.makeOpName("QuantizeAndDequantizeV4")); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(inputMin.asOutput()); + opBuilder.addInput(inputMax.asOutput()); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.signedInput != null) { + opBuilder.setAttr("signed_input", opts.signedInput); + } + if (opts.numBits != null) { + opBuilder.setAttr("num_bits", opts.numBits); + } + if (opts.rangeGiven != null) { + opBuilder.setAttr("range_given", opts.rangeGiven); + } + if (opts.roundMode != null) { + opBuilder.setAttr("round_mode", opts.roundMode); + } + if (opts.narrowRange != null) { + opBuilder.setAttr("narrow_range", opts.narrowRange); + } + if (opts.axis != null) { + opBuilder.setAttr("axis", opts.axis); + } + } + } + return new QuantizeAndDequantizeV4(opBuilder.build()); + } + + /** + * @param signedInput + */ + public static Options signedInput(Boolean signedInput) { + return new Options().signedInput(signedInput); + } + + /** + * @param numBits + */ + public static Options numBits(Long numBits) { + return new Options().numBits(numBits); + } + + /** + * @param rangeGiven + */ + public static Options rangeGiven(Boolean rangeGiven) { + return new Options().rangeGiven(rangeGiven); + } + + /** + * @param roundMode + */ + public static Options roundMode(String roundMode) { + return new Options().roundMode(roundMode); + } + + /** + * @param narrowRange + */ + public static Options narrowRange(Boolean narrowRange) { + return new Options().narrowRange(narrowRange); + } + + /** + * @param axis + */ + public static Options axis(Long axis) { + return new Options().axis(axis); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "QuantizeAndDequantizeV4"; + + private Output output; + + private QuantizeAndDequantizeV4(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java new file mode 100644 index 00000000000..4934e23dcab --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java @@ -0,0 +1,128 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.quantization; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; + +/** + * Returns the gradient of `QuantizeAndDequantizeV4`. + *

+ * Returns a gradient of 1 for inputs that are within the quantization range, + * or 0 otherwise. + * + * @param data type for {@code inputBackprop()} output + */ +@Operator(group = "quantization") +public final class QuantizeAndDequantizeV4Grad extends RawOp { + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad} + */ + public static class Options { + + /** + * @param axis + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } + + private Long axis; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new QuantizeAndDequantizeV4Grad operation. + * + * @param scope current scope + * @param gradients + * @param input + * @param inputMin + * @param inputMax + * @param options carries optional attributes values + * @return a new instance of QuantizeAndDequantizeV4Grad + */ + @Endpoint(describeByClass = true) + public static QuantizeAndDequantizeV4Grad create(Scope scope, Operand gradients, Operand input, Operand inputMin, Operand inputMax, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4Grad", scope.makeOpName("QuantizeAndDequantizeV4Grad")); + opBuilder.addInput(gradients.asOutput()); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(inputMin.asOutput()); + opBuilder.addInput(inputMax.asOutput()); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.axis != null) { + opBuilder.setAttr("axis", opts.axis); + } + } + } + return new QuantizeAndDequantizeV4Grad(opBuilder.build()); + } + + /** + * @param axis + */ + public static Options axis(Long axis) { + return new Options().axis(axis); + } + + /** + */ + public Output inputBackprop() { + return inputBackprop; + } + + /** + */ + public Output inputMinBackprop() { + return inputMinBackprop; + } + + /** + */ + public Output inputMaxBackprop() { + return inputMaxBackprop; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "QuantizeAndDequantizeV4Grad"; + + private Output inputBackprop; + private Output inputMinBackprop; + private Output inputMaxBackprop; + + private QuantizeAndDequantizeV4Grad(Operation operation) { + super(operation); + int outputIdx = 0; + inputBackprop = operation.output(outputIdx++); + inputMinBackprop = operation.output(outputIdx++); + inputMaxBackprop = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java new file mode 100644 index 00000000000..b753910f048 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java @@ -0,0 +1,89 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.ragged; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Helper used to compute the gradient for `RaggedTensorToVariant`. + *

+ * Computes the gradient for the dense_values input to the RaggedTensorToVariant + * op, given the variant-encoded ragged gradients of the outputs, along with + * the outer row-splits and the shape of the dense-values that were provided as + * inputs to the RaggedTensorToVariant op. + * + * @param data type for {@code denseValuesGrad()} output + */ +public final class RaggedTensorToVariantGradient extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new RaggedTensorToVariantGradient operation. + * + * @param scope current scope + * @param encodedRaggedGrad A `variant` Tensor containing encoded `RaggedTensor` gradients. + * @param rowSplits Outermost row-splits that were used as input to the RaggedTensorToVariant op. + * @param denseValuesShape Shape of the dense_values that was used as an input to the + * RaggedTensorToVariant op. + * @param Tvalues + * @return a new instance of RaggedTensorToVariantGradient + */ + @Endpoint(describeByClass = true) + public static RaggedTensorToVariantGradient create(Scope scope, Operand encodedRaggedGrad, Operand rowSplits, Operand denseValuesShape, Class Tvalues) { + OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToVariantGradient", scope.makeOpName("RaggedTensorToVariantGradient")); + opBuilder.addInput(encodedRaggedGrad.asOutput()); + opBuilder.addInput(rowSplits.asOutput()); + opBuilder.addInput(denseValuesShape.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); + return new RaggedTensorToVariantGradient(opBuilder.build()); + } + + /** + * Gradient for the dense_values of the RaggedTensorToVariant op. + */ + public Output denseValuesGrad() { + return denseValuesGrad; + } + + @Override + public Output asOutput() { + return denseValuesGrad; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "RaggedTensorToVariantGradient"; + + private Output denseValuesGrad; + + private RaggedTensorToVariantGradient(Operation operation) { + super(operation); + int outputIdx = 0; + denseValuesGrad = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java new file mode 100644 index 00000000000..b75a3836503 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java @@ -0,0 +1,82 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; + +/** + * Advance the counter of a counter-based RNG. + *

+ * The state of the RNG after + * `rng_read_and_skip(n)` will be the same as that after `uniform([n])` + * (or any other distribution). The actual increment added to the + * counter is an unspecified implementation choice. + */ +public final class RngReadAndSkip extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new RngReadAndSkip operation. + * + * @param scope current scope + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param alg The RNG algorithm. + * @param delta The amount of advancement. + * @return a new instance of RngReadAndSkip + */ + @Endpoint(describeByClass = true) + public static RngReadAndSkip create(Scope scope, Operand resource, Operand alg, Operand delta) { + OperationBuilder opBuilder = scope.env().opBuilder("RngReadAndSkip", scope.makeOpName("RngReadAndSkip")); + opBuilder.addInput(resource.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder.addInput(delta.asOutput()); + opBuilder = scope.apply(opBuilder); + return new RngReadAndSkip(opBuilder.build()); + } + + /** + * The old value of the resource variable, before incrementing. Since state size is algorithm-dependent, this output will be right-padded with zeros to reach shape int64[3] (the current maximal state size among algorithms). + */ + public Output value() { + return value; + } + + @Override + public Output asOutput() { + return value; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "RngReadAndSkip"; + + private Output value; + + private RngReadAndSkip(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java new file mode 100644 index 00000000000..60e4646b816 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java @@ -0,0 +1,88 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Picks the best algorithm based on device, and scrambles seed into key and counter. + *

+ * This op picks the best counter-based RNG algorithm based on device, and scrambles a shape-[2] seed into a key and a counter, both needed by the counter-based algorithm. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers). + */ +public final class StatelessRandomGetKeyCounterAlg extends RawOp { + + /** + * Factory method to create a class wrapping a new StatelessRandomGetKeyCounterAlg operation. + * + * @param scope current scope + * @param seed 2 seeds (shape [2]). + * @return a new instance of StatelessRandomGetKeyCounterAlg + */ + @Endpoint(describeByClass = true) + public static StatelessRandomGetKeyCounterAlg create(Scope scope, Operand seed) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomGetKeyCounterAlg", scope.makeOpName("StatelessRandomGetKeyCounterAlg")); + opBuilder.addInput(seed.asOutput()); + opBuilder = scope.apply(opBuilder); + return new StatelessRandomGetKeyCounterAlg(opBuilder.build()); + } + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public Output key() { + return key; + } + + /** + * Counter for the counter-based RNG algorithm. Since counter size is algorithm-dependent, this output will be right-padded with zeros to reach shape uint64[2] (the current maximal counter size among algorithms). + */ + public Output counter() { + return counter; + } + + /** + * The RNG algorithm (shape int32[]). + */ + public Output alg() { + return alg; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessRandomGetKeyCounterAlg"; + + private Output key; + private Output counter; + private Output alg; + + private StatelessRandomGetKeyCounterAlg(Operation operation) { + super(operation); + int outputIdx = 0; + key = operation.output(outputIdx++); + counter = operation.output(outputIdx++); + alg = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java new file mode 100644 index 00000000000..b8dc52febf2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java @@ -0,0 +1,104 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs deterministic pseudorandom values from a normal distribution. + *

+ * The generated values will have mean 0 and standard deviation 1. + *

+ * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. + * + * @param data type for {@code output()} output + */ +public final class StatelessRandomNormalV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @param dtype The type of the output. + * @return a new instance of StatelessRandomNormalV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormalV2", scope.makeOpName("StatelessRandomNormalV2")); + opBuilder.addInput(shape.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new StatelessRandomNormalV2(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation using default output types. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @return a new instance of StatelessRandomNormalV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + return create(scope, shape, key, counter, alg, TFloat32.class); + } + + /** + * Random values with specified shape. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessRandomNormalV2"; + + private Output output; + + private StatelessRandomNormalV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java new file mode 100644 index 00000000000..8e9e2d572e2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java @@ -0,0 +1,88 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + *

+ * The generated values are uniform integers covering the whole range of `dtype`. + *

+ * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. + * + * @param data type for {@code output()} output + */ +public final class StatelessRandomUniformFullIntV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new StatelessRandomUniformFullIntV2 operation. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @param dtype The type of the output. + * @return a new instance of StatelessRandomUniformFullIntV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomUniformFullIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformFullIntV2", scope.makeOpName("StatelessRandomUniformFullIntV2")); + opBuilder.addInput(shape.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new StatelessRandomUniformFullIntV2(opBuilder.build()); + } + + /** + * Random values with specified shape. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessRandomUniformFullIntV2"; + + private Output output; + + private StatelessRandomUniformFullIntV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java new file mode 100644 index 00000000000..885c6440764 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java @@ -0,0 +1,89 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + *

+ * The generated values follow a uniform distribution in the range `[minval, maxval)`. + *

+ * The outputs are a deterministic function of `shape`, `key`, `counter`, `alg`, `minval` and `maxval`. + * + * @param data type for {@code output()} output + */ +public final class StatelessRandomUniformIntV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new StatelessRandomUniformIntV2 operation. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @param minval Minimum value (inclusive, scalar). + * @param maxval Maximum value (exclusive, scalar). + * @return a new instance of StatelessRandomUniformIntV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomUniformIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Operand minval, Operand maxval) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformIntV2", scope.makeOpName("StatelessRandomUniformIntV2")); + opBuilder.addInput(shape.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder.addInput(minval.asOutput()); + opBuilder.addInput(maxval.asOutput()); + opBuilder = scope.apply(opBuilder); + return new StatelessRandomUniformIntV2(opBuilder.build()); + } + + /** + * Random values with specified shape. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessRandomUniformIntV2"; + + private Output output; + + private StatelessRandomUniformIntV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java new file mode 100644 index 00000000000..0fa51757aef --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java @@ -0,0 +1,105 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs deterministic pseudorandom random values from a uniform distribution. + *

+ * The generated values follow a uniform distribution in the range `[0, 1)`. The + * lower bound 0 is included in the range, while the upper bound 1 is excluded. + *

+ * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. + * + * @param data type for {@code output()} output + */ +public final class StatelessRandomUniformV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @param dtype The type of the output. + * @return a new instance of StatelessRandomUniformV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformV2", scope.makeOpName("StatelessRandomUniformV2")); + opBuilder.addInput(shape.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new StatelessRandomUniformV2(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation using default output types. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @return a new instance of StatelessRandomUniformV2 + */ + @Endpoint(describeByClass = true) + public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + return create(scope, shape, key, counter, alg, TFloat32.class); + } + + /** + * Random values with specified shape. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessRandomUniformV2"; + + private Output output; + + private StatelessRandomUniformV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java new file mode 100644 index 00000000000..02146b32b27 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java @@ -0,0 +1,106 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.random; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs deterministic pseudorandom values from a truncated normal distribution. + *

+ * The generated values follow a normal distribution with mean 0 and standard + * deviation 1, except that values whose magnitude is more than 2 standard + * deviations from the mean are dropped and re-picked. + *

+ * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. + * + * @param data type for {@code output()} output + */ +public final class StatelessTruncatedNormalV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @param dtype The type of the output. + * @return a new instance of StatelessTruncatedNormalV2 + */ + @Endpoint(describeByClass = true) + public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormalV2", scope.makeOpName("StatelessTruncatedNormalV2")); + opBuilder.addInput(shape.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new StatelessTruncatedNormalV2(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation using default output types. + * + * @param scope current scope + * @param shape The shape of the output tensor. + * @param key Key for the counter-based RNG algorithm (shape uint64[1]). + * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. + * @param alg The RNG algorithm (shape int32[]). + * @return a new instance of StatelessTruncatedNormalV2 + */ + @Endpoint(describeByClass = true) + public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + return create(scope, shape, key, counter, alg, TFloat32.class); + } + + /** + * Random values with specified shape. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "StatelessTruncatedNormalV2"; + + private Output output; + + private StatelessTruncatedNormalV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java index db0efe71844..a3ec471d2b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java @@ -32,7 +32,15 @@ *

* This operation converts Unicode code points to script codes corresponding to * each code point. Script codes correspond to International Components for - * Unicode (ICU) UScriptCode values. See http://icu-project.org/apiref/icu4c/uscript_8h.html. + * Unicode (ICU) UScriptCode values. + *

+ * See + * [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) + * for more details on script codes. + *

+ * For an example, see the unicode strings guide on [unicode scripts] + * (https://www.tensorflow.org/tutorials/load_data/unicode#representing_unicode). + *

* Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will * match input shape. *

diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java index bbc738acce8..e905a1b0291 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java @@ -29,6 +29,10 @@ import org.tensorflow.types.TString; /** + * Writes an audio summary. + *

+ * Writes encoded audio summary `tensor` at `step` with `tag` using summary `writer`. + * `sample_rate` is the audio sample rate is Hz. */ public final class WriteAudioSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java index 9ec1b35c0b2..054c478815b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java @@ -28,6 +28,9 @@ import org.tensorflow.types.TString; /** + * Writes a graph summary. + *

+ * Writes TensorFlow graph `tensor` at `step` using summary `writer`. */ public final class WriteGraphSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java index 11b2b4e942d..24543c08b7c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java @@ -29,6 +29,9 @@ import org.tensorflow.types.family.TNumber; /** + * Writes a histogram summary. + *

+ * Writes histogram `values` at `step` with `tag` using summary `writer`. */ public final class WriteHistogramSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java index 51436c8e07e..e3be2892cd0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java @@ -30,6 +30,10 @@ import org.tensorflow.types.family.TNumber; /** + * Writes an image summary. + *

+ * Writes image `tensor` at `step` with `tag` using summary `writer`. + * `tensor` is image with shape [height, width, channels]. */ public final class WriteImageSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteRawProtoSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteRawProtoSummary.java index 6a2eefcb5f3..76fda8646b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteRawProtoSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteRawProtoSummary.java @@ -28,6 +28,9 @@ import org.tensorflow.types.TString; /** + * Writes a serialized proto summary. + *

+ * Writes `tensor`, a serialized proto at `step` using summary `writer`. */ public final class WriteRawProtoSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java index 9f68f48e4bb..5fddaff353c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java @@ -29,6 +29,9 @@ import org.tensorflow.types.family.TNumber; /** + * Writes a scalar summary. + *

+ * Writes scalar `value` at `step` with `tag` using summary `writer`. */ public final class WriteScalarSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java index a27ceff133e..337c585a8c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java @@ -29,6 +29,9 @@ import org.tensorflow.types.family.TType; /** + * Writes a tensor summary. + *

+ * Writes `tensor` at `step` with `tag` using summary `writer`. */ public final class WriteSummary extends RawOp { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java new file mode 100644 index 00000000000..bd0cbda42c4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java @@ -0,0 +1,73 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * Returns the result of a TPU compilation. + *

+ * This operation returns the result of a TPU compilation as a serialized + * CompilationResultProto, which holds a status and an error message if an error + * occurred during compilation. + */ +public final class CompilationResult extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new CompilationResult operation. + * + * @param scope current scope + * @return a new instance of CompilationResult + */ + @Endpoint(describeByClass = true) + public static CompilationResult create(Scope scope) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUCompilationResult", scope.makeOpName("CompilationResult")); + opBuilder = scope.apply(opBuilder); + return new CompilationResult(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUCompilationResult"; + + private Output output; + + private CompilationResult(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java new file mode 100644 index 00000000000..bf5abddcdd2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java @@ -0,0 +1,60 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * Asserts that compilation succeeded. This op produces no output and closes the + *

+ * device during failure to ensure all pending device interactions fail. + *

+ * 'compilation_status' is a serialized CompilationResultProto. + */ +@Operator(group = "tpu") +public final class CompileSucceededAssert extends RawOp { + + /** + * Factory method to create a class wrapping a new CompileSucceededAssert operation. + * + * @param scope current scope + * @param compilationStatus + * @return a new instance of CompileSucceededAssert + */ + @Endpoint(describeByClass = true) + public static CompileSucceededAssert create(Scope scope, Operand compilationStatus) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUCompileSucceededAssert", scope.makeOpName("CompileSucceededAssert")); + opBuilder.addInput(compilationStatus.asOutput()); + opBuilder = scope.apply(opBuilder); + return new CompileSucceededAssert(opBuilder.build()); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUCompileSucceededAssert"; + + private CompileSucceededAssert(Operation operation) { + super(operation); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java new file mode 100644 index 00000000000..88547e9358d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java @@ -0,0 +1,85 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * An op enabling differentiation of TPU Embeddings. + *

+ * This op simply returns its first input, which is assumed to have been sliced + * from the Tensors returned by TPUEmbeddingDequeueActivations. The presence of + * this op, and its first argument being a trainable Variable, enables automatic + * differentiation of graphs containing embeddings via the TPU Embedding Python + * libraries. + */ +public final class EmbeddingActivations extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new EmbeddingActivations operation. + * + * @param scope current scope + * @param embeddingVariable A trainable variable, enabling optimizers to find this op. + * @param slicedActivations The embedding activations Tensor to return. + * @param tableId The id of the table in the embedding layer configuration from which + * these activations were computed. + * @param lookupId Identifier of the set of embedding indices which produced these + * activations. + * @return a new instance of EmbeddingActivations + */ + @Endpoint(describeByClass = true) + public static EmbeddingActivations create(Scope scope, Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUEmbeddingActivations", scope.makeOpName("EmbeddingActivations")); + opBuilder.addInput(embeddingVariable.asOutput()); + opBuilder.addInput(slicedActivations.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("table_id", tableId); + opBuilder.setAttr("lookup_id", lookupId); + return new EmbeddingActivations(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUEmbeddingActivations"; + + private Output output; + + private EmbeddingActivations(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java new file mode 100644 index 00000000000..dfcb6333097 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java @@ -0,0 +1,86 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Op that loads and executes a TPU program on a TPU device. + *

+ * For the internal use of the distributed TPU compiler. + */ +@Operator(group = "tpu") +public final class Execute extends RawOp implements Iterable> { + + /** + * Factory method to create a class wrapping a new Execute operation. + * + * @param scope current scope + * @param args + * @param key + * @param Tresults + * @return a new instance of Execute + */ + @Endpoint(describeByClass = true) + public static Execute create(Scope scope, Iterable> args, Operand key, List> Tresults) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUExecute", scope.makeOpName("Execute")); + opBuilder.addInputList(Operands.asOutputs(args)); + opBuilder.addInput(key.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); + return new Execute(opBuilder.build()); + } + + /** + */ + public List> results() { + return results; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) results.iterator(); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUExecute"; + + private List> results; + + private Execute(Operation operation) { + super(operation); + int outputIdx = 0; + int resultsLength = operation.outputListLength("results"); + results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); + outputIdx += resultsLength; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java new file mode 100644 index 00000000000..74269767bd1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java @@ -0,0 +1,104 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Op that executes a program with optional in-place variable updates. + *

+ * It (optionally) reads device variables, loads and executes a TPU program on a + * TPU device, and then (optionally) in-place updates variables using the program + * outputs, as specified in attributes device_var_reads_indices (program input + * indices from directly reading variables) and device_var_updates_indices (program + * output indices used to update variables, -1 means no-update/read-only). Such + * program outputs are consumed by these variables will not appear in the op + * output. For the internal use of the distributed TPU compiler. + */ +@Operator(group = "tpu") +public final class ExecuteAndUpdateVariables extends RawOp implements Iterable> { + + /** + * Factory method to create a class wrapping a new ExecuteAndUpdateVariables operation. + * + * @param scope current scope + * @param args + * @param key + * @param Tresults + * @param deviceVarReadsIndices + * @param deviceVarUpdatesIndices + * @return a new instance of ExecuteAndUpdateVariables + */ + @Endpoint(describeByClass = true) + public static ExecuteAndUpdateVariables create(Scope scope, Iterable> args, Operand key, List> Tresults, List deviceVarReadsIndices, List deviceVarUpdatesIndices) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUExecuteAndUpdateVariables", scope.makeOpName("ExecuteAndUpdateVariables")); + opBuilder.addInputList(Operands.asOutputs(args)); + opBuilder.addInput(key.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); + long[] deviceVarReadsIndicesArray = new long[deviceVarReadsIndices.size()]; + for (int i = 0; i < deviceVarReadsIndicesArray.length; ++i) { + deviceVarReadsIndicesArray[i] = deviceVarReadsIndices.get(i); + } + opBuilder.setAttr("device_var_reads_indices", deviceVarReadsIndicesArray); + long[] deviceVarUpdatesIndicesArray = new long[deviceVarUpdatesIndices.size()]; + for (int i = 0; i < deviceVarUpdatesIndicesArray.length; ++i) { + deviceVarUpdatesIndicesArray[i] = deviceVarUpdatesIndices.get(i); + } + opBuilder.setAttr("device_var_updates_indices", deviceVarUpdatesIndicesArray); + return new ExecuteAndUpdateVariables(opBuilder.build()); + } + + /** + */ + public List> results() { + return results; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) results.iterator(); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUExecuteAndUpdateVariables"; + + private List> results; + + private ExecuteAndUpdateVariables(Operation operation) { + super(operation); + int outputIdx = 0; + int resultsLength = operation.outputListLength("results"); + results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); + outputIdx += resultsLength; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUOrdinalSelector.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUOrdinalSelector.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java index 1cfdfbbf901..1490def25ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUOrdinalSelector.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java @@ -34,19 +34,19 @@ * (for regular inference) to execute the TPU program on. The output is * consumed by TPUPartitionedCall. */ -public final class TPUOrdinalSelector extends RawOp implements Operand { +public final class OrdinalSelector extends RawOp implements Operand { /** - * Factory method to create a class wrapping a new TPUOrdinalSelector operation. + * Factory method to create a class wrapping a new OrdinalSelector operation. * * @param scope current scope - * @return a new instance of TPUOrdinalSelector + * @return a new instance of OrdinalSelector */ @Endpoint(describeByClass = true) - public static TPUOrdinalSelector create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUOrdinalSelector", scope.makeOpName("TPUOrdinalSelector")); + public static OrdinalSelector create(Scope scope) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUOrdinalSelector", scope.makeOpName("OrdinalSelector")); opBuilder = scope.apply(opBuilder); - return new TPUOrdinalSelector(opBuilder.build()); + return new OrdinalSelector(opBuilder.build()); } /** @@ -66,7 +66,7 @@ public Output asOutput() { private Output deviceOrdinals; - private TPUOrdinalSelector(Operation operation) { + private OrdinalSelector(Operation operation) { super(operation); int outputIdx = 0; deviceOrdinals = operation.output(outputIdx++); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java new file mode 100644 index 00000000000..b3eb52c50c6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java @@ -0,0 +1,95 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Retrieve multiple values from the computation outfeed. Device ordinal is a + * tensor allowing dynamic outfeed. + *

+ * This operation will block indefinitely until data is available. Output `i` + * corresponds to XLA tuple element `i`. + */ +public final class OutfeedDequeueTupleV2 extends RawOp implements Iterable> { + + /** + * Factory method to create a class wrapping a new OutfeedDequeueTupleV2 operation. + * + * @param scope current scope + * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when + * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @param dtypes The element types of each element in `outputs`. + * @param shapes The shapes of each tensor in `outputs`. + * @return a new instance of OutfeedDequeueTupleV2 + */ + @Endpoint(describeByClass = true) + public static OutfeedDequeueTupleV2 create(Scope scope, Operand deviceOrdinal, List> dtypes, List shapes) { + OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTupleV2", scope.makeOpName("OutfeedDequeueTupleV2")); + opBuilder.addInput(deviceOrdinal.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); + Shape[] shapesArray = new Shape[shapes.size()]; + for (int i = 0; i < shapesArray.length; ++i) { + shapesArray[i] = shapes.get(i); + } + opBuilder.setAttr("shapes", shapesArray); + return new OutfeedDequeueTupleV2(opBuilder.build()); + } + + /** + * A list of tensors that will be read from the outfeed. + */ + public List> outputs() { + return outputs; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outputs.iterator(); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "OutfeedDequeueTupleV2"; + + private List> outputs; + + private OutfeedDequeueTupleV2(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java new file mode 100644 index 00000000000..a461869f5bc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java @@ -0,0 +1,86 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Retrieves a single tensor from the computation outfeed. Device ordinal is a + * tensor allowing dynamic outfeed. + *

+ * This operation will block indefinitely until data is available. + * + * @param data type for {@code output()} output + */ +public final class OutfeedDequeueV2 extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new OutfeedDequeueV2 operation. + * + * @param scope current scope + * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when + * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @param dtype The type of elements in the tensor. + * @param shape The shape of the tensor. + * @return a new instance of OutfeedDequeueV2 + */ + @Endpoint(describeByClass = true) + public static OutfeedDequeueV2 create(Scope scope, Operand deviceOrdinal, Class dtype, Shape shape) { + OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueV2", scope.makeOpName("OutfeedDequeueV2")); + opBuilder.addInput(deviceOrdinal.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + opBuilder.setAttr("shape", shape); + return new OutfeedDequeueV2(opBuilder.build()); + } + + /** + * A tensor that will be read from the device outfeed. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "OutfeedDequeueV2"; + + private Output output; + + private OutfeedDequeueV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java new file mode 100644 index 00000000000..6d93c007546 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java @@ -0,0 +1,112 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * An op that groups a list of partitioned inputs together. This op + * + * @param data type for {@code output()} output + */ +@Operator(group = "tpu") +public final class PartitionedInput extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} + */ + public static class Options { + + /** + * @param partitionDim An integer describles which dimension is partitioned. -1 means + * those inputs are replicated. + */ + public Options partitionDim(Long partitionDim) { + this.partitionDim = partitionDim; + return this; + } + + private Long partitionDim; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new PartitionedInput operation. + * + * @param scope current scope + * @param inputs A list of partitioned inputs which must have the same shape. + * @param options carries optional attributes values + * @return a new instance of PartitionedInput + */ + @Endpoint(describeByClass = true) + public static PartitionedInput create(Scope scope, Iterable> inputs, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedInput", scope.makeOpName("PartitionedInput")); + opBuilder.addInputList(Operands.asOutputs(inputs)); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.partitionDim != null) { + opBuilder.setAttr("partition_dim", opts.partitionDim); + } + } + } + return new PartitionedInput(opBuilder.build()); + } + + /** + * @param partitionDim An integer describles which dimension is partitioned. -1 means + * those inputs are replicated. + */ + public static Options partitionDim(Long partitionDim) { + return new Options().partitionDim(partitionDim); + } + + /** + * A handle which represents the full shape of partitioned tensors. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUPartitionedInput"; + + private Output output; + + private PartitionedInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java new file mode 100644 index 00000000000..6d14d2fd307 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java @@ -0,0 +1,120 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned + *

+ * outputs outside the XLA computation. + * + * @param data type for {@code output()} output + */ +@Operator(group = "tpu") +public final class PartitionedOutput extends RawOp implements Iterable> { + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedOutput} + */ + public static class Options { + + /** + * @param partitionDim An integer describles which dimension is partitioned. + */ + public Options partitionDim(Long partitionDim) { + this.partitionDim = partitionDim; + return this; + } + + private Long partitionDim; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new PartitionedOutput operation. + * + * @param scope current scope + * @param inputs A tensor which represents the full shape of partitioned tensors. + * @param numSplits + * @param options carries optional attributes values + * @return a new instance of PartitionedOutput + */ + @Endpoint(describeByClass = true) + public static PartitionedOutput create(Scope scope, Operand inputs, Long numSplits, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedOutput", scope.makeOpName("PartitionedOutput")); + opBuilder.addInput(inputs.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("num_splits", numSplits); + if (options != null) { + for (Options opts : options) { + if (opts.partitionDim != null) { + opBuilder.setAttr("partition_dim", opts.partitionDim); + } + } + } + return new PartitionedOutput(opBuilder.build()); + } + + /** + * @param partitionDim An integer describles which dimension is partitioned. + */ + public static Options partitionDim(Long partitionDim) { + return new Options().partitionDim(partitionDim); + } + + /** + * A list of partitioned inputs which must have the same shape. + */ + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) output.iterator(); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUPartitionedOutput"; + + private List> output; + + @SuppressWarnings("unchecked") + private PartitionedOutput(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java new file mode 100644 index 00000000000..99ef67f0fd4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java @@ -0,0 +1,277 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.List; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; + +/** + * Metadata indicating how the TPU computation should be replicated. + *

+ * This operation holds the metadata common to operations of a `tpu.replicate()` computation subgraph. + */ +public final class ReplicateMetadata extends RawOp { + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ReplicateMetadata} + */ + public static class Options { + + /** + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + */ + public Options numCoresPerReplica(Long numCoresPerReplica) { + this.numCoresPerReplica = numCoresPerReplica; + return this; + } + + /** + * @param topology TopologyProto indicating the topology of the TPU pod slice. + */ + public Options topology(String topology) { + this.topology = topology; + return this; + } + + /** + * @param useTpu Whether to place the computation on the TPU. + */ + public Options useTpu(Boolean useTpu) { + this.useTpu = useTpu; + return this; + } + + /** + * @param deviceAssignment The assignment of devices for the computation. + */ + public Options deviceAssignment(List deviceAssignment) { + this.deviceAssignment = deviceAssignment; + return this; + } + + /** + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + */ + public Options computationShape(List computationShape) { + this.computationShape = computationShape; + return this; + } + + /** + * @param hostComputeCore + */ + public Options hostComputeCore(List hostComputeCore) { + this.hostComputeCore = hostComputeCore; + return this; + } + + /** + * @param paddingMap + */ + public Options paddingMap(List paddingMap) { + this.paddingMap = paddingMap; + return this; + } + + /** + * @param stepMarkerLocation + */ + public Options stepMarkerLocation(String stepMarkerLocation) { + this.stepMarkerLocation = stepMarkerLocation; + return this; + } + + /** + * @param allowSoftPlacement + */ + public Options allowSoftPlacement(Boolean allowSoftPlacement) { + this.allowSoftPlacement = allowSoftPlacement; + return this; + } + + /** + * @param useSpmdForXlaPartitioning + */ + public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; + return this; + } + + private Long numCoresPerReplica; + private String topology; + private Boolean useTpu; + private List deviceAssignment; + private List computationShape; + private List hostComputeCore; + private List paddingMap; + private String stepMarkerLocation; + private Boolean allowSoftPlacement; + private Boolean useSpmdForXlaPartitioning; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new ReplicateMetadata operation. + * + * @param scope current scope + * @param numReplicas Number of replicas of the computation + * @param options carries optional attributes values + * @return a new instance of ReplicateMetadata + */ + @Endpoint(describeByClass = true) + public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicateMetadata", scope.makeOpName("ReplicateMetadata")); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("num_replicas", numReplicas); + if (options != null) { + for (Options opts : options) { + if (opts.numCoresPerReplica != null) { + opBuilder.setAttr("num_cores_per_replica", opts.numCoresPerReplica); + } + if (opts.topology != null) { + opBuilder.setAttr("topology", opts.topology); + } + if (opts.useTpu != null) { + opBuilder.setAttr("use_tpu", opts.useTpu); + } + if (opts.deviceAssignment != null) { + long[] deviceAssignmentArray = new long[opts.deviceAssignment.size()]; + for (int i = 0; i < deviceAssignmentArray.length; ++i) { + deviceAssignmentArray[i] = opts.deviceAssignment.get(i); + } + opBuilder.setAttr("device_assignment", deviceAssignmentArray); + } + if (opts.computationShape != null) { + long[] computationShapeArray = new long[opts.computationShape.size()]; + for (int i = 0; i < computationShapeArray.length; ++i) { + computationShapeArray[i] = opts.computationShape.get(i); + } + opBuilder.setAttr("computation_shape", computationShapeArray); + } + if (opts.hostComputeCore != null) { + String[] hostComputeCoreArray = new String[opts.hostComputeCore.size()]; + for (int i = 0; i < hostComputeCoreArray.length; ++i) { + hostComputeCoreArray[i] = opts.hostComputeCore.get(i); + } + opBuilder.setAttr("host_compute_core", hostComputeCoreArray); + } + if (opts.paddingMap != null) { + String[] paddingMapArray = new String[opts.paddingMap.size()]; + for (int i = 0; i < paddingMapArray.length; ++i) { + paddingMapArray[i] = opts.paddingMap.get(i); + } + opBuilder.setAttr("padding_map", paddingMapArray); + } + if (opts.stepMarkerLocation != null) { + opBuilder.setAttr("step_marker_location", opts.stepMarkerLocation); + } + if (opts.allowSoftPlacement != null) { + opBuilder.setAttr("allow_soft_placement", opts.allowSoftPlacement); + } + if (opts.useSpmdForXlaPartitioning != null) { + opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); + } + } + } + return new ReplicateMetadata(opBuilder.build()); + } + + /** + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + */ + public static Options numCoresPerReplica(Long numCoresPerReplica) { + return new Options().numCoresPerReplica(numCoresPerReplica); + } + + /** + * @param topology TopologyProto indicating the topology of the TPU pod slice. + */ + public static Options topology(String topology) { + return new Options().topology(topology); + } + + /** + * @param useTpu Whether to place the computation on the TPU. + */ + public static Options useTpu(Boolean useTpu) { + return new Options().useTpu(useTpu); + } + + /** + * @param deviceAssignment The assignment of devices for the computation. + */ + public static Options deviceAssignment(List deviceAssignment) { + return new Options().deviceAssignment(deviceAssignment); + } + + /** + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + */ + public static Options computationShape(List computationShape) { + return new Options().computationShape(computationShape); + } + + /** + * @param hostComputeCore + */ + public static Options hostComputeCore(List hostComputeCore) { + return new Options().hostComputeCore(hostComputeCore); + } + + /** + * @param paddingMap + */ + public static Options paddingMap(List paddingMap) { + return new Options().paddingMap(paddingMap); + } + + /** + * @param stepMarkerLocation + */ + public static Options stepMarkerLocation(String stepMarkerLocation) { + return new Options().stepMarkerLocation(stepMarkerLocation); + } + + /** + * @param allowSoftPlacement + */ + public static Options allowSoftPlacement(Boolean allowSoftPlacement) { + return new Options().allowSoftPlacement(allowSoftPlacement); + } + + /** + * @param useSpmdForXlaPartitioning + */ + public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUReplicateMetadata"; + + private ReplicateMetadata(Operation operation) { + super(operation); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java new file mode 100644 index 00000000000..b6092c934ee --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java @@ -0,0 +1,158 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Connects N inputs to an N-way replicated TPU computation. + *

+ * This operation holds a replicated input to a `tpu.replicate()` computation subgraph. + * Each replicated input has the same shape and type alongside the output. + *

+ * For example: + *

{@code
+ * %a = "tf.opA"()
+ * %b = "tf.opB"()
+ * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
+ * %computation = "tf.Computation"(%replicated_input)
+ * }
+ * The above computation has a replicated input of two replicas. + * + * @param data type for {@code output()} output + */ +public final class ReplicatedInput extends RawOp implements Operand { + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ReplicatedInput} + */ + public static class Options { + + /** + * @param isMirroredVariable + */ + public Options isMirroredVariable(Boolean isMirroredVariable) { + this.isMirroredVariable = isMirroredVariable; + return this; + } + + /** + * @param index + */ + public Options index(Long index) { + this.index = index; + return this; + } + + /** + * @param isPacked + */ + public Options isPacked(Boolean isPacked) { + this.isPacked = isPacked; + return this; + } + + private Boolean isMirroredVariable; + private Long index; + private Boolean isPacked; + + private Options() { + } + } + + /** + * Factory method to create a class wrapping a new ReplicatedInput operation. + * + * @param scope current scope + * @param inputs + * @param options carries optional attributes values + * @return a new instance of ReplicatedInput + */ + @Endpoint(describeByClass = true) + public static ReplicatedInput create(Scope scope, Iterable> inputs, Options... options) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("ReplicatedInput")); + opBuilder.addInputList(Operands.asOutputs(inputs)); + opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.isMirroredVariable != null) { + opBuilder.setAttr("is_mirrored_variable", opts.isMirroredVariable); + } + if (opts.index != null) { + opBuilder.setAttr("index", opts.index); + } + if (opts.isPacked != null) { + opBuilder.setAttr("is_packed", opts.isPacked); + } + } + } + return new ReplicatedInput(opBuilder.build()); + } + + /** + * @param isMirroredVariable + */ + public static Options isMirroredVariable(Boolean isMirroredVariable) { + return new Options().isMirroredVariable(isMirroredVariable); + } + + /** + * @param index + */ + public static Options index(Long index) { + return new Options().index(index); + } + + /** + * @param isPacked + */ + public static Options isPacked(Boolean isPacked) { + return new Options().isPacked(isPacked); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUReplicatedInput"; + + private Output output; + + private ReplicatedInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java new file mode 100644 index 00000000000..d092faa8df9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java @@ -0,0 +1,92 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.tpu; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Connects N outputs from an N-way replicated TPU computation. + *

+ * This operation holds a replicated output from a `tpu.replicate()` computation subgraph. + * Each replicated output has the same shape and type alongside the input. + *

+ * For example: + *

{@code
+ * %computation = "tf.Computation"()
+ * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
+ * }
+ * The above computation has a replicated output of two replicas. + * + * @param data type for {@code outputs()} output + */ +public final class ReplicatedOutput extends RawOp implements Iterable> { + + /** + * Factory method to create a class wrapping a new ReplicatedOutput operation. + * + * @param scope current scope + * @param input + * @param numReplicas + * @return a new instance of ReplicatedOutput + */ + @Endpoint(describeByClass = true) + public static ReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { + OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedOutput", scope.makeOpName("ReplicatedOutput")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("num_replicas", numReplicas); + return new ReplicatedOutput(opBuilder.build()); + } + + /** + */ + public List> outputs() { + return outputs; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outputs.iterator(); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "TPUReplicatedOutput"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private ReplicatedOutput(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java index cb0212ce2ec..32d9db030d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java @@ -109,6 +109,14 @@ public Options allowSoftPlacement(Boolean allowSoftPlacement) { return this; } + /** + * @param useSpmdForXlaPartitioning + */ + public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; + return this; + } + private Long numCoresPerReplica; private String topology; private Boolean useTpu; @@ -118,6 +126,7 @@ public Options allowSoftPlacement(Boolean allowSoftPlacement) { private List paddingMap; private String stepMarkerLocation; private Boolean allowSoftPlacement; + private Boolean useSpmdForXlaPartitioning; private Options() { } @@ -181,6 +190,9 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options if (opts.allowSoftPlacement != null) { opBuilder.setAttr("allow_soft_placement", opts.allowSoftPlacement); } + if (opts.useSpmdForXlaPartitioning != null) { + opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); + } } } return new TPUReplicateMetadata(opBuilder.build()); @@ -249,6 +261,13 @@ public static Options allowSoftPlacement(Boolean allowSoftPlacement) { return new Options().allowSoftPlacement(allowSoftPlacement); } + /** + * @param useSpmdForXlaPartitioning + */ + public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); + } + /** The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "TPUReplicateMetadata"; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java index 1ff4778eba9..a56382a9044 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java @@ -85,7 +85,7 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java new file mode 100644 index 00000000000..fb02d2b47aa --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java @@ -0,0 +1,71 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.train; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; + +/** + * Computes the static batch size of a dataset sans partial batches. + */ +public final class ComputeBatchSize extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new ComputeBatchSize operation. + * + * @param scope current scope + * @param inputDataset + * @return a new instance of ComputeBatchSize + */ + @Endpoint(describeByClass = true) + public static ComputeBatchSize create(Scope scope, Operand inputDataset) { + OperationBuilder opBuilder = scope.env().opBuilder("ComputeBatchSize", scope.makeOpName("ComputeBatchSize")); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder = scope.apply(opBuilder); + return new ComputeBatchSize(opBuilder.build()); + } + + /** + */ + public Output batchSize() { + return batchSize; + } + + @Override + public Output asOutput() { + return batchSize; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "ComputeBatchSize"; + + private Output batchSize; + + private ComputeBatchSize(Operation operation) { + super(operation); + int outputIdx = 0; + batchSize = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java index 36c94fb2f16..722555f4f20 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java @@ -82,7 +82,7 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java new file mode 100644 index 00000000000..64790e8a5bc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java @@ -0,0 +1,85 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.xla; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * An op to receive a tensor from the host. + *

+ * output: the tensor that will be received from the host. + * Toutput: element type for output. + * shape: shape for output. + * key: A unique identifier for this region used to match up host transfers. + * + * @param data type for {@code output()} output + */ +@Operator(group = "xla") +public final class XlaRecvFromHost extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new XlaRecvFromHost operation. + * + * @param scope current scope + * @param Toutput + * @param shape + * @param key + * @return a new instance of XlaRecvFromHost + */ + @Endpoint(describeByClass = true) + public static XlaRecvFromHost create(Scope scope, Class Toutput, Shape shape, String key) { + OperationBuilder opBuilder = scope.env().opBuilder("XlaRecvFromHost", scope.makeOpName("XlaRecvFromHost")); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); + opBuilder.setAttr("shape", shape); + opBuilder.setAttr("key", key); + return new XlaRecvFromHost(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "XlaRecvFromHost"; + + private Output output; + + private XlaRecvFromHost(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java new file mode 100644 index 00000000000..61c296710a4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java @@ -0,0 +1,62 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.xla; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * An op to send a tensor to the host. + *

+ * input: the tensor that will be sent to the host. + * Tinput: element type for input. + * key: A unique identifier for this region used to match up host transfers. + */ +@Operator(group = "xla") +public final class XlaSendToHost extends RawOp { + + /** + * Factory method to create a class wrapping a new XlaSendToHost operation. + * + * @param scope current scope + * @param input + * @param key + * @return a new instance of XlaSendToHost + */ + @Endpoint(describeByClass = true) + public static XlaSendToHost create(Scope scope, Operand input, String key) { + OperationBuilder opBuilder = scope.env().opBuilder("XlaSendToHost", scope.makeOpName("XlaSendToHost")); + opBuilder.addInput(input.asOutput()); + opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("key", key); + return new XlaSendToHost(opBuilder.build()); + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "XlaSendToHost"; + + private XlaSendToHost(Operation operation) { + super(operation); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java new file mode 100644 index 00000000000..2ae6581abc0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java @@ -0,0 +1,76 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.xla; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * Set a bound for the given input value as a hint to Xla compiler, + *

+ * returns the same value. + */ +@Operator(group = "xla") +public final class XlaSetBound extends RawOp implements Operand { + + /** + * Factory method to create a class wrapping a new XlaSetBound operation. + * + * @param scope current scope + * @param input + * @param bound + * @return a new instance of XlaSetBound + */ + @Endpoint(describeByClass = true) + public static XlaSetBound create(Scope scope, Operand input, Operand bound) { + OperationBuilder opBuilder = scope.env().opBuilder("XlaSetBound", scope.makeOpName("XlaSetBound")); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(bound.asOutput()); + opBuilder = scope.apply(opBuilder); + return new XlaSetBound(opBuilder.build()); + } + + /** + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** The name of this op, as known by TensorFlow core engine */ + public static final String OP_NAME = "XlaSetBound"; + + private Output output; + + private XlaSetBound(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java new file mode 100644 index 00000000000..33ea43d5005 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java @@ -0,0 +1,2418 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/protobuf/data/experimental/service_config.proto + +package org.tensorflow.proto.data.experimental; + +public final class ServiceConfig { + private ServiceConfig() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DispatcherConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.DispatcherConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *

+     * The port for the dispatcher to bind to. A value of 0 indicates that the
+     * dispatcher may bind to any available port.
+     * 
+ * + * int64 port = 1; + */ + long getPort(); + + /** + *
+     * The protocol for the dispatcher to use when connecting to workers.
+     * 
+ * + * string protocol = 2; + */ + java.lang.String getProtocol(); + /** + *
+     * The protocol for the dispatcher to use when connecting to workers.
+     * 
+ * + * string protocol = 2; + */ + com.google.protobuf.ByteString + getProtocolBytes(); + + /** + *
+     * A work directory to use for storing dispatcher state, and for recovering
+     * during restarts. The empty string indicates not to use any work directory.
+     * 
+ * + * string work_dir = 3; + */ + java.lang.String getWorkDir(); + /** + *
+     * A work directory to use for storing dispatcher state, and for recovering
+     * during restarts. The empty string indicates not to use any work directory.
+     * 
+ * + * string work_dir = 3; + */ + com.google.protobuf.ByteString + getWorkDirBytes(); + + /** + *
+     * Whether to run in fault tolerant mode, where dispatcher state is saved
+     * across restarts. Requires that `work_dir` is nonempty.
+     * 
+ * + * bool fault_tolerant_mode = 4; + */ + boolean getFaultTolerantMode(); + + /** + *
+     * How often the dispatcher should scan through to delete old and unused jobs.
+     * 
+ * + * int64 job_gc_check_interval_ms = 5; + */ + long getJobGcCheckIntervalMs(); + + /** + *
+     * How long a job needs to be unused before it becomes a candidate for garbage
+     * collection.
+     * 
+ * + * int64 job_gc_timeout_ms = 6; + */ + long getJobGcTimeoutMs(); + } + /** + *
+   * Configuration for a tf.data service DispatchServer.
+   * 
+ * + * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} + */ + public static final class DispatcherConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.DispatcherConfig) + DispatcherConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DispatcherConfig.newBuilder() to construct. + private DispatcherConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DispatcherConfig() { + protocol_ = ""; + workDir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DispatcherConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DispatcherConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + port_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + protocol_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + workDir_ = s; + break; + } + case 32: { + + faultTolerantMode_ = input.readBool(); + break; + } + case 40: { + + jobGcCheckIntervalMs_ = input.readInt64(); + break; + } + case 48: { + + jobGcTimeoutMs_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class); + } + + public static final int PORT_FIELD_NUMBER = 1; + private long port_; + /** + *
+     * The port for the dispatcher to bind to. A value of 0 indicates that the
+     * dispatcher may bind to any available port.
+     * 
+ * + * int64 port = 1; + */ + public long getPort() { + return port_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + private volatile java.lang.Object protocol_; + /** + *
+     * The protocol for the dispatcher to use when connecting to workers.
+     * 
+ * + * string protocol = 2; + */ + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocol_ = s; + return s; + } + } + /** + *
+     * The protocol for the dispatcher to use when connecting to workers.
+     * 
+ * + * string protocol = 2; + */ + public com.google.protobuf.ByteString + getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORK_DIR_FIELD_NUMBER = 3; + private volatile java.lang.Object workDir_; + /** + *
+     * A work directory to use for storing dispatcher state, and for recovering
+     * during restarts. The empty string indicates not to use any work directory.
+     * 
+ * + * string work_dir = 3; + */ + public java.lang.String getWorkDir() { + java.lang.Object ref = workDir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workDir_ = s; + return s; + } + } + /** + *
+     * A work directory to use for storing dispatcher state, and for recovering
+     * during restarts. The empty string indicates not to use any work directory.
+     * 
+ * + * string work_dir = 3; + */ + public com.google.protobuf.ByteString + getWorkDirBytes() { + java.lang.Object ref = workDir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAULT_TOLERANT_MODE_FIELD_NUMBER = 4; + private boolean faultTolerantMode_; + /** + *
+     * Whether to run in fault tolerant mode, where dispatcher state is saved
+     * across restarts. Requires that `work_dir` is nonempty.
+     * 
+ * + * bool fault_tolerant_mode = 4; + */ + public boolean getFaultTolerantMode() { + return faultTolerantMode_; + } + + public static final int JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER = 5; + private long jobGcCheckIntervalMs_; + /** + *
+     * How often the dispatcher should scan through to delete old and unused jobs.
+     * 
+ * + * int64 job_gc_check_interval_ms = 5; + */ + public long getJobGcCheckIntervalMs() { + return jobGcCheckIntervalMs_; + } + + public static final int JOB_GC_TIMEOUT_MS_FIELD_NUMBER = 6; + private long jobGcTimeoutMs_; + /** + *
+     * How long a job needs to be unused before it becomes a candidate for garbage
+     * collection.
+     * 
+ * + * int64 job_gc_timeout_ms = 6; + */ + public long getJobGcTimeoutMs() { + return jobGcTimeoutMs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (port_ != 0L) { + output.writeInt64(1, port_); + } + if (!getProtocolBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_); + } + if (!getWorkDirBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workDir_); + } + if (faultTolerantMode_ != false) { + output.writeBool(4, faultTolerantMode_); + } + if (jobGcCheckIntervalMs_ != 0L) { + output.writeInt64(5, jobGcCheckIntervalMs_); + } + if (jobGcTimeoutMs_ != 0L) { + output.writeInt64(6, jobGcTimeoutMs_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (port_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, port_); + } + if (!getProtocolBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_); + } + if (!getWorkDirBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, workDir_); + } + if (faultTolerantMode_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, faultTolerantMode_); + } + if (jobGcCheckIntervalMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, jobGcCheckIntervalMs_); + } + if (jobGcTimeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, jobGcTimeoutMs_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) obj; + + if (getPort() + != other.getPort()) return false; + if (!getProtocol() + .equals(other.getProtocol())) return false; + if (!getWorkDir() + .equals(other.getWorkDir())) return false; + if (getFaultTolerantMode() + != other.getFaultTolerantMode()) return false; + if (getJobGcCheckIntervalMs() + != other.getJobGcCheckIntervalMs()) return false; + if (getJobGcTimeoutMs() + != other.getJobGcTimeoutMs()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPort()); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol().hashCode(); + hash = (37 * hash) + WORK_DIR_FIELD_NUMBER; + hash = (53 * hash) + getWorkDir().hashCode(); + hash = (37 * hash) + FAULT_TOLERANT_MODE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFaultTolerantMode()); + hash = (37 * hash) + JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getJobGcCheckIntervalMs()); + hash = (37 * hash) + JOB_GC_TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getJobGcTimeoutMs()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Configuration for a tf.data service DispatchServer.
+     * 
+ * + * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.DispatcherConfig) + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + port_ = 0L; + + protocol_ = ""; + + workDir_ = ""; + + faultTolerantMode_ = false; + + jobGcCheckIntervalMs_ = 0L; + + jobGcTimeoutMs_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig build() { + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig buildPartial() { + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig(this); + result.port_ = port_; + result.protocol_ = protocol_; + result.workDir_ = workDir_; + result.faultTolerantMode_ = faultTolerantMode_; + result.jobGcCheckIntervalMs_ = jobGcCheckIntervalMs_; + result.jobGcTimeoutMs_ = jobGcTimeoutMs_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) { + return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other) { + if (other == org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance()) return this; + if (other.getPort() != 0L) { + setPort(other.getPort()); + } + if (!other.getProtocol().isEmpty()) { + protocol_ = other.protocol_; + onChanged(); + } + if (!other.getWorkDir().isEmpty()) { + workDir_ = other.workDir_; + onChanged(); + } + if (other.getFaultTolerantMode() != false) { + setFaultTolerantMode(other.getFaultTolerantMode()); + } + if (other.getJobGcCheckIntervalMs() != 0L) { + setJobGcCheckIntervalMs(other.getJobGcCheckIntervalMs()); + } + if (other.getJobGcTimeoutMs() != 0L) { + setJobGcTimeoutMs(other.getJobGcTimeoutMs()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long port_ ; + /** + *
+       * The port for the dispatcher to bind to. A value of 0 indicates that the
+       * dispatcher may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public long getPort() { + return port_; + } + /** + *
+       * The port for the dispatcher to bind to. A value of 0 indicates that the
+       * dispatcher may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public Builder setPort(long value) { + + port_ = value; + onChanged(); + return this; + } + /** + *
+       * The port for the dispatcher to bind to. A value of 0 indicates that the
+       * dispatcher may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public Builder clearPort() { + + port_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object protocol_ = ""; + /** + *
+       * The protocol for the dispatcher to use when connecting to workers.
+       * 
+ * + * string protocol = 2; + */ + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocol_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The protocol for the dispatcher to use when connecting to workers.
+       * 
+ * + * string protocol = 2; + */ + public com.google.protobuf.ByteString + getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The protocol for the dispatcher to use when connecting to workers.
+       * 
+ * + * string protocol = 2; + */ + public Builder setProtocol( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + protocol_ = value; + onChanged(); + return this; + } + /** + *
+       * The protocol for the dispatcher to use when connecting to workers.
+       * 
+ * + * string protocol = 2; + */ + public Builder clearProtocol() { + + protocol_ = getDefaultInstance().getProtocol(); + onChanged(); + return this; + } + /** + *
+       * The protocol for the dispatcher to use when connecting to workers.
+       * 
+ * + * string protocol = 2; + */ + public Builder setProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + protocol_ = value; + onChanged(); + return this; + } + + private java.lang.Object workDir_ = ""; + /** + *
+       * A work directory to use for storing dispatcher state, and for recovering
+       * during restarts. The empty string indicates not to use any work directory.
+       * 
+ * + * string work_dir = 3; + */ + public java.lang.String getWorkDir() { + java.lang.Object ref = workDir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workDir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A work directory to use for storing dispatcher state, and for recovering
+       * during restarts. The empty string indicates not to use any work directory.
+       * 
+ * + * string work_dir = 3; + */ + public com.google.protobuf.ByteString + getWorkDirBytes() { + java.lang.Object ref = workDir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workDir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A work directory to use for storing dispatcher state, and for recovering
+       * during restarts. The empty string indicates not to use any work directory.
+       * 
+ * + * string work_dir = 3; + */ + public Builder setWorkDir( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workDir_ = value; + onChanged(); + return this; + } + /** + *
+       * A work directory to use for storing dispatcher state, and for recovering
+       * during restarts. The empty string indicates not to use any work directory.
+       * 
+ * + * string work_dir = 3; + */ + public Builder clearWorkDir() { + + workDir_ = getDefaultInstance().getWorkDir(); + onChanged(); + return this; + } + /** + *
+       * A work directory to use for storing dispatcher state, and for recovering
+       * during restarts. The empty string indicates not to use any work directory.
+       * 
+ * + * string work_dir = 3; + */ + public Builder setWorkDirBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workDir_ = value; + onChanged(); + return this; + } + + private boolean faultTolerantMode_ ; + /** + *
+       * Whether to run in fault tolerant mode, where dispatcher state is saved
+       * across restarts. Requires that `work_dir` is nonempty.
+       * 
+ * + * bool fault_tolerant_mode = 4; + */ + public boolean getFaultTolerantMode() { + return faultTolerantMode_; + } + /** + *
+       * Whether to run in fault tolerant mode, where dispatcher state is saved
+       * across restarts. Requires that `work_dir` is nonempty.
+       * 
+ * + * bool fault_tolerant_mode = 4; + */ + public Builder setFaultTolerantMode(boolean value) { + + faultTolerantMode_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether to run in fault tolerant mode, where dispatcher state is saved
+       * across restarts. Requires that `work_dir` is nonempty.
+       * 
+ * + * bool fault_tolerant_mode = 4; + */ + public Builder clearFaultTolerantMode() { + + faultTolerantMode_ = false; + onChanged(); + return this; + } + + private long jobGcCheckIntervalMs_ ; + /** + *
+       * How often the dispatcher should scan through to delete old and unused jobs.
+       * 
+ * + * int64 job_gc_check_interval_ms = 5; + */ + public long getJobGcCheckIntervalMs() { + return jobGcCheckIntervalMs_; + } + /** + *
+       * How often the dispatcher should scan through to delete old and unused jobs.
+       * 
+ * + * int64 job_gc_check_interval_ms = 5; + */ + public Builder setJobGcCheckIntervalMs(long value) { + + jobGcCheckIntervalMs_ = value; + onChanged(); + return this; + } + /** + *
+       * How often the dispatcher should scan through to delete old and unused jobs.
+       * 
+ * + * int64 job_gc_check_interval_ms = 5; + */ + public Builder clearJobGcCheckIntervalMs() { + + jobGcCheckIntervalMs_ = 0L; + onChanged(); + return this; + } + + private long jobGcTimeoutMs_ ; + /** + *
+       * How long a job needs to be unused before it becomes a candidate for garbage
+       * collection.
+       * 
+ * + * int64 job_gc_timeout_ms = 6; + */ + public long getJobGcTimeoutMs() { + return jobGcTimeoutMs_; + } + /** + *
+       * How long a job needs to be unused before it becomes a candidate for garbage
+       * collection.
+       * 
+ * + * int64 job_gc_timeout_ms = 6; + */ + public Builder setJobGcTimeoutMs(long value) { + + jobGcTimeoutMs_ = value; + onChanged(); + return this; + } + /** + *
+       * How long a job needs to be unused before it becomes a candidate for garbage
+       * collection.
+       * 
+ * + * int64 job_gc_timeout_ms = 6; + */ + public Builder clearJobGcTimeoutMs() { + + jobGcTimeoutMs_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.DispatcherConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.DispatcherConfig) + private static final org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig(); + } + + public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DispatcherConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DispatcherConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WorkerConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.WorkerConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The port for the worker to bind to. A value of 0 indicates that the
+     * worker may bind to any available port.
+     * 
+ * + * int64 port = 1; + */ + long getPort(); + + /** + *
+     * The protocol for the worker to use when connecting to the dispatcher.
+     * 
+ * + * string protocol = 2; + */ + java.lang.String getProtocol(); + /** + *
+     * The protocol for the worker to use when connecting to the dispatcher.
+     * 
+ * + * string protocol = 2; + */ + com.google.protobuf.ByteString + getProtocolBytes(); + + /** + *
+     * The address of the dispatcher to register with.
+     * 
+ * + * string dispatcher_address = 3; + */ + java.lang.String getDispatcherAddress(); + /** + *
+     * The address of the dispatcher to register with.
+     * 
+ * + * string dispatcher_address = 3; + */ + com.google.protobuf.ByteString + getDispatcherAddressBytes(); + + /** + *
+     * The address of the worker server. The substring "%port%", if specified,
+     * will be replaced with the worker's bound port. This is useful when the port
+     * is set to `0`.
+     * 
+ * + * string worker_address = 4; + */ + java.lang.String getWorkerAddress(); + /** + *
+     * The address of the worker server. The substring "%port%", if specified,
+     * will be replaced with the worker's bound port. This is useful when the port
+     * is set to `0`.
+     * 
+ * + * string worker_address = 4; + */ + com.google.protobuf.ByteString + getWorkerAddressBytes(); + + /** + *
+     * How often the worker should heartbeat to the master.
+     * 
+ * + * int64 heartbeat_interval_ms = 5; + */ + long getHeartbeatIntervalMs(); + + /** + *
+     * How long to retry requests to the dispatcher before giving up and reporting
+     * an error.
+     * 
+ * + * int64 dispatcher_timeout_ms = 6; + */ + long getDispatcherTimeoutMs(); + } + /** + *
+   * Configuration for a tf.data service WorkerServer.
+   * 
+ * + * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} + */ + public static final class WorkerConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.WorkerConfig) + WorkerConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkerConfig.newBuilder() to construct. + private WorkerConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WorkerConfig() { + protocol_ = ""; + dispatcherAddress_ = ""; + workerAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WorkerConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WorkerConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + port_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + protocol_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + dispatcherAddress_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + workerAddress_ = s; + break; + } + case 40: { + + heartbeatIntervalMs_ = input.readInt64(); + break; + } + case 48: { + + dispatcherTimeoutMs_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class); + } + + public static final int PORT_FIELD_NUMBER = 1; + private long port_; + /** + *
+     * The port for the worker to bind to. A value of 0 indicates that the
+     * worker may bind to any available port.
+     * 
+ * + * int64 port = 1; + */ + public long getPort() { + return port_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + private volatile java.lang.Object protocol_; + /** + *
+     * The protocol for the worker to use when connecting to the dispatcher.
+     * 
+ * + * string protocol = 2; + */ + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocol_ = s; + return s; + } + } + /** + *
+     * The protocol for the worker to use when connecting to the dispatcher.
+     * 
+ * + * string protocol = 2; + */ + public com.google.protobuf.ByteString + getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPATCHER_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object dispatcherAddress_; + /** + *
+     * The address of the dispatcher to register with.
+     * 
+ * + * string dispatcher_address = 3; + */ + public java.lang.String getDispatcherAddress() { + java.lang.Object ref = dispatcherAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dispatcherAddress_ = s; + return s; + } + } + /** + *
+     * The address of the dispatcher to register with.
+     * 
+ * + * string dispatcher_address = 3; + */ + public com.google.protobuf.ByteString + getDispatcherAddressBytes() { + java.lang.Object ref = dispatcherAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dispatcherAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKER_ADDRESS_FIELD_NUMBER = 4; + private volatile java.lang.Object workerAddress_; + /** + *
+     * The address of the worker server. The substring "%port%", if specified,
+     * will be replaced with the worker's bound port. This is useful when the port
+     * is set to `0`.
+     * 
+ * + * string worker_address = 4; + */ + public java.lang.String getWorkerAddress() { + java.lang.Object ref = workerAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerAddress_ = s; + return s; + } + } + /** + *
+     * The address of the worker server. The substring "%port%", if specified,
+     * will be replaced with the worker's bound port. This is useful when the port
+     * is set to `0`.
+     * 
+ * + * string worker_address = 4; + */ + public com.google.protobuf.ByteString + getWorkerAddressBytes() { + java.lang.Object ref = workerAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workerAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEARTBEAT_INTERVAL_MS_FIELD_NUMBER = 5; + private long heartbeatIntervalMs_; + /** + *
+     * How often the worker should heartbeat to the master.
+     * 
+ * + * int64 heartbeat_interval_ms = 5; + */ + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + + public static final int DISPATCHER_TIMEOUT_MS_FIELD_NUMBER = 6; + private long dispatcherTimeoutMs_; + /** + *
+     * How long to retry requests to the dispatcher before giving up and reporting
+     * an error.
+     * 
+ * + * int64 dispatcher_timeout_ms = 6; + */ + public long getDispatcherTimeoutMs() { + return dispatcherTimeoutMs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (port_ != 0L) { + output.writeInt64(1, port_); + } + if (!getProtocolBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_); + } + if (!getDispatcherAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dispatcherAddress_); + } + if (!getWorkerAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, workerAddress_); + } + if (heartbeatIntervalMs_ != 0L) { + output.writeInt64(5, heartbeatIntervalMs_); + } + if (dispatcherTimeoutMs_ != 0L) { + output.writeInt64(6, dispatcherTimeoutMs_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (port_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, port_); + } + if (!getProtocolBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_); + } + if (!getDispatcherAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dispatcherAddress_); + } + if (!getWorkerAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, workerAddress_); + } + if (heartbeatIntervalMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, heartbeatIntervalMs_); + } + if (dispatcherTimeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, dispatcherTimeoutMs_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) obj; + + if (getPort() + != other.getPort()) return false; + if (!getProtocol() + .equals(other.getProtocol())) return false; + if (!getDispatcherAddress() + .equals(other.getDispatcherAddress())) return false; + if (!getWorkerAddress() + .equals(other.getWorkerAddress())) return false; + if (getHeartbeatIntervalMs() + != other.getHeartbeatIntervalMs()) return false; + if (getDispatcherTimeoutMs() + != other.getDispatcherTimeoutMs()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPort()); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol().hashCode(); + hash = (37 * hash) + DISPATCHER_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDispatcherAddress().hashCode(); + hash = (37 * hash) + WORKER_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerAddress().hashCode(); + hash = (37 * hash) + HEARTBEAT_INTERVAL_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHeartbeatIntervalMs()); + hash = (37 * hash) + DISPATCHER_TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDispatcherTimeoutMs()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Configuration for a tf.data service WorkerServer.
+     * 
+ * + * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.WorkerConfig) + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + port_ = 0L; + + protocol_ = ""; + + dispatcherAddress_ = ""; + + workerAddress_ = ""; + + heartbeatIntervalMs_ = 0L; + + dispatcherTimeoutMs_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig build() { + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig buildPartial() { + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig(this); + result.port_ = port_; + result.protocol_ = protocol_; + result.dispatcherAddress_ = dispatcherAddress_; + result.workerAddress_ = workerAddress_; + result.heartbeatIntervalMs_ = heartbeatIntervalMs_; + result.dispatcherTimeoutMs_ = dispatcherTimeoutMs_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) { + return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other) { + if (other == org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance()) return this; + if (other.getPort() != 0L) { + setPort(other.getPort()); + } + if (!other.getProtocol().isEmpty()) { + protocol_ = other.protocol_; + onChanged(); + } + if (!other.getDispatcherAddress().isEmpty()) { + dispatcherAddress_ = other.dispatcherAddress_; + onChanged(); + } + if (!other.getWorkerAddress().isEmpty()) { + workerAddress_ = other.workerAddress_; + onChanged(); + } + if (other.getHeartbeatIntervalMs() != 0L) { + setHeartbeatIntervalMs(other.getHeartbeatIntervalMs()); + } + if (other.getDispatcherTimeoutMs() != 0L) { + setDispatcherTimeoutMs(other.getDispatcherTimeoutMs()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long port_ ; + /** + *
+       * The port for the worker to bind to. A value of 0 indicates that the
+       * worker may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public long getPort() { + return port_; + } + /** + *
+       * The port for the worker to bind to. A value of 0 indicates that the
+       * worker may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public Builder setPort(long value) { + + port_ = value; + onChanged(); + return this; + } + /** + *
+       * The port for the worker to bind to. A value of 0 indicates that the
+       * worker may bind to any available port.
+       * 
+ * + * int64 port = 1; + */ + public Builder clearPort() { + + port_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object protocol_ = ""; + /** + *
+       * The protocol for the worker to use when connecting to the dispatcher.
+       * 
+ * + * string protocol = 2; + */ + public java.lang.String getProtocol() { + java.lang.Object ref = protocol_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocol_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The protocol for the worker to use when connecting to the dispatcher.
+       * 
+ * + * string protocol = 2; + */ + public com.google.protobuf.ByteString + getProtocolBytes() { + java.lang.Object ref = protocol_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The protocol for the worker to use when connecting to the dispatcher.
+       * 
+ * + * string protocol = 2; + */ + public Builder setProtocol( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + protocol_ = value; + onChanged(); + return this; + } + /** + *
+       * The protocol for the worker to use when connecting to the dispatcher.
+       * 
+ * + * string protocol = 2; + */ + public Builder clearProtocol() { + + protocol_ = getDefaultInstance().getProtocol(); + onChanged(); + return this; + } + /** + *
+       * The protocol for the worker to use when connecting to the dispatcher.
+       * 
+ * + * string protocol = 2; + */ + public Builder setProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + protocol_ = value; + onChanged(); + return this; + } + + private java.lang.Object dispatcherAddress_ = ""; + /** + *
+       * The address of the dispatcher to register with.
+       * 
+ * + * string dispatcher_address = 3; + */ + public java.lang.String getDispatcherAddress() { + java.lang.Object ref = dispatcherAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dispatcherAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The address of the dispatcher to register with.
+       * 
+ * + * string dispatcher_address = 3; + */ + public com.google.protobuf.ByteString + getDispatcherAddressBytes() { + java.lang.Object ref = dispatcherAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dispatcherAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The address of the dispatcher to register with.
+       * 
+ * + * string dispatcher_address = 3; + */ + public Builder setDispatcherAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dispatcherAddress_ = value; + onChanged(); + return this; + } + /** + *
+       * The address of the dispatcher to register with.
+       * 
+ * + * string dispatcher_address = 3; + */ + public Builder clearDispatcherAddress() { + + dispatcherAddress_ = getDefaultInstance().getDispatcherAddress(); + onChanged(); + return this; + } + /** + *
+       * The address of the dispatcher to register with.
+       * 
+ * + * string dispatcher_address = 3; + */ + public Builder setDispatcherAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dispatcherAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object workerAddress_ = ""; + /** + *
+       * The address of the worker server. The substring "%port%", if specified,
+       * will be replaced with the worker's bound port. This is useful when the port
+       * is set to `0`.
+       * 
+ * + * string worker_address = 4; + */ + public java.lang.String getWorkerAddress() { + java.lang.Object ref = workerAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The address of the worker server. The substring "%port%", if specified,
+       * will be replaced with the worker's bound port. This is useful when the port
+       * is set to `0`.
+       * 
+ * + * string worker_address = 4; + */ + public com.google.protobuf.ByteString + getWorkerAddressBytes() { + java.lang.Object ref = workerAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + workerAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The address of the worker server. The substring "%port%", if specified,
+       * will be replaced with the worker's bound port. This is useful when the port
+       * is set to `0`.
+       * 
+ * + * string worker_address = 4; + */ + public Builder setWorkerAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerAddress_ = value; + onChanged(); + return this; + } + /** + *
+       * The address of the worker server. The substring "%port%", if specified,
+       * will be replaced with the worker's bound port. This is useful when the port
+       * is set to `0`.
+       * 
+ * + * string worker_address = 4; + */ + public Builder clearWorkerAddress() { + + workerAddress_ = getDefaultInstance().getWorkerAddress(); + onChanged(); + return this; + } + /** + *
+       * The address of the worker server. The substring "%port%", if specified,
+       * will be replaced with the worker's bound port. This is useful when the port
+       * is set to `0`.
+       * 
+ * + * string worker_address = 4; + */ + public Builder setWorkerAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerAddress_ = value; + onChanged(); + return this; + } + + private long heartbeatIntervalMs_ ; + /** + *
+       * How often the worker should heartbeat to the master.
+       * 
+ * + * int64 heartbeat_interval_ms = 5; + */ + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + /** + *
+       * How often the worker should heartbeat to the master.
+       * 
+ * + * int64 heartbeat_interval_ms = 5; + */ + public Builder setHeartbeatIntervalMs(long value) { + + heartbeatIntervalMs_ = value; + onChanged(); + return this; + } + /** + *
+       * How often the worker should heartbeat to the master.
+       * 
+ * + * int64 heartbeat_interval_ms = 5; + */ + public Builder clearHeartbeatIntervalMs() { + + heartbeatIntervalMs_ = 0L; + onChanged(); + return this; + } + + private long dispatcherTimeoutMs_ ; + /** + *
+       * How long to retry requests to the dispatcher before giving up and reporting
+       * an error.
+       * 
+ * + * int64 dispatcher_timeout_ms = 6; + */ + public long getDispatcherTimeoutMs() { + return dispatcherTimeoutMs_; + } + /** + *
+       * How long to retry requests to the dispatcher before giving up and reporting
+       * an error.
+       * 
+ * + * int64 dispatcher_timeout_ms = 6; + */ + public Builder setDispatcherTimeoutMs(long value) { + + dispatcherTimeoutMs_ = value; + onChanged(); + return this; + } + /** + *
+       * How long to retry requests to the dispatcher before giving up and reporting
+       * an error.
+       * 
+ * + * int64 dispatcher_timeout_ms = 6; + */ + public Builder clearDispatcherTimeoutMs() { + + dispatcherTimeoutMs_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.WorkerConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.WorkerConfig) + private static final org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig(); + } + + public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkerConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WorkerConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n?tensorflow/core/protobuf/data/experime" + + "ntal/service_config.proto\022\034tensorflow.da" + + "ta.experimental\"\236\001\n\020DispatcherConfig\022\014\n\004" + + "port\030\001 \001(\003\022\020\n\010protocol\030\002 \001(\t\022\020\n\010work_dir" + + "\030\003 \001(\t\022\033\n\023fault_tolerant_mode\030\004 \001(\010\022 \n\030j" + + "ob_gc_check_interval_ms\030\005 \001(\003\022\031\n\021job_gc_" + + "timeout_ms\030\006 \001(\003\"\240\001\n\014WorkerConfig\022\014\n\004por" + + "t\030\001 \001(\003\022\020\n\010protocol\030\002 \001(\t\022\032\n\022dispatcher_" + + "address\030\003 \001(\t\022\026\n\016worker_address\030\004 \001(\t\022\035\n" + + "\025heartbeat_interval_ms\030\005 \001(\003\022\035\n\025dispatch" + + "er_timeout_ms\030\006 \001(\003B(\n&org.tensorflow.pr" + + "oto.data.experimentalb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor, + new java.lang.String[] { "Port", "Protocol", "WorkDir", "FaultTolerantMode", "JobGcCheckIntervalMs", "JobGcTimeoutMs", }); + internal_static_tensorflow_data_experimental_WorkerConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tensorflow_data_experimental_WorkerConfig_descriptor, + new java.lang.String[] { "Port", "Protocol", "DispatcherAddress", "WorkerAddress", "HeartbeatIntervalMs", "DispatcherTimeoutMs", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java similarity index 89% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecord.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java index 36e10e21bb1..696b438c3c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java @@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/protobuf/data/experimental/snapshot.proto -package org.tensorflow.proto.util; +package org.tensorflow.proto.data.experimental; /** *
@@ -135,15 +135,15 @@ private SnapshotMetadataRecord(
   }
   public static final com.google.protobuf.Descriptors.Descriptor
       getDescriptor() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
   }
 
   @java.lang.Override
   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internalGetFieldAccessorTable() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable
         .ensureFieldAccessorsInitialized(
-            org.tensorflow.proto.util.SnapshotMetadataRecord.class, org.tensorflow.proto.util.SnapshotMetadataRecord.Builder.class);
+            org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.Builder.class);
   }
 
   public static final int GRAPH_HASH_FIELD_NUMBER = 1;
@@ -439,10 +439,10 @@ public boolean equals(final java.lang.Object obj) {
     if (obj == this) {
      return true;
     }
-    if (!(obj instanceof org.tensorflow.proto.util.SnapshotMetadataRecord)) {
+    if (!(obj instanceof org.tensorflow.proto.data.experimental.SnapshotMetadataRecord)) {
       return super.equals(obj);
     }
-    org.tensorflow.proto.util.SnapshotMetadataRecord other = (org.tensorflow.proto.util.SnapshotMetadataRecord) obj;
+    org.tensorflow.proto.data.experimental.SnapshotMetadataRecord other = (org.tensorflow.proto.data.experimental.SnapshotMetadataRecord) obj;
 
     if (!getGraphHash()
         .equals(other.getGraphHash())) return false;
@@ -493,69 +493,69 @@ public int hashCode() {
     return hash;
   }
 
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       java.nio.ByteBuffer data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       java.nio.ByteBuffer data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       com.google.protobuf.ByteString data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       com.google.protobuf.ByteString data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(byte[] data)
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(byte[] data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       byte[] data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseDelimitedFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseDelimitedFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseDelimitedFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseDelimitedFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       com.google.protobuf.CodedInputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parseFrom(
       com.google.protobuf.CodedInputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
@@ -568,7 +568,7 @@ public static org.tensorflow.proto.util.SnapshotMetadataRecord parseFrom(
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-  public static Builder newBuilder(org.tensorflow.proto.util.SnapshotMetadataRecord prototype) {
+  public static Builder newBuilder(org.tensorflow.proto.data.experimental.SnapshotMetadataRecord prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
   @java.lang.Override
@@ -593,21 +593,21 @@ protected Builder newBuilderForType(
   public static final class Builder extends
       com.google.protobuf.GeneratedMessageV3.Builder implements
       // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotMetadataRecord)
-      org.tensorflow.proto.util.SnapshotMetadataRecordOrBuilder {
+      org.tensorflow.proto.data.experimental.SnapshotMetadataRecordOrBuilder {
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.tensorflow.proto.util.SnapshotMetadataRecord.class, org.tensorflow.proto.util.SnapshotMetadataRecord.Builder.class);
+              org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.Builder.class);
     }
 
-    // Construct using org.tensorflow.proto.util.SnapshotMetadataRecord.newBuilder()
+    // Construct using org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.newBuilder()
     private Builder() {
       maybeForceBuilderInitialization();
     }
@@ -645,17 +645,17 @@ public Builder clear() {
     @java.lang.Override
     public com.google.protobuf.Descriptors.Descriptor
         getDescriptorForType() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor;
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotMetadataRecord getDefaultInstanceForType() {
-      return org.tensorflow.proto.util.SnapshotMetadataRecord.getDefaultInstance();
+    public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord getDefaultInstanceForType() {
+      return org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.getDefaultInstance();
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotMetadataRecord build() {
-      org.tensorflow.proto.util.SnapshotMetadataRecord result = buildPartial();
+    public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord build() {
+      org.tensorflow.proto.data.experimental.SnapshotMetadataRecord result = buildPartial();
       if (!result.isInitialized()) {
         throw newUninitializedMessageException(result);
       }
@@ -663,8 +663,8 @@ public org.tensorflow.proto.util.SnapshotMetadataRecord build() {
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotMetadataRecord buildPartial() {
-      org.tensorflow.proto.util.SnapshotMetadataRecord result = new org.tensorflow.proto.util.SnapshotMetadataRecord(this);
+    public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord buildPartial() {
+      org.tensorflow.proto.data.experimental.SnapshotMetadataRecord result = new org.tensorflow.proto.data.experimental.SnapshotMetadataRecord(this);
       int from_bitField0_ = bitField0_;
       result.graphHash_ = graphHash_;
       result.runId_ = runId_;
@@ -715,16 +715,16 @@ public Builder addRepeatedField(
     }
     @java.lang.Override
     public Builder mergeFrom(com.google.protobuf.Message other) {
-      if (other instanceof org.tensorflow.proto.util.SnapshotMetadataRecord) {
-        return mergeFrom((org.tensorflow.proto.util.SnapshotMetadataRecord)other);
+      if (other instanceof org.tensorflow.proto.data.experimental.SnapshotMetadataRecord) {
+        return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotMetadataRecord)other);
       } else {
         super.mergeFrom(other);
         return this;
       }
     }
 
-    public Builder mergeFrom(org.tensorflow.proto.util.SnapshotMetadataRecord other) {
-      if (other == org.tensorflow.proto.util.SnapshotMetadataRecord.getDefaultInstance()) return this;
+    public Builder mergeFrom(org.tensorflow.proto.data.experimental.SnapshotMetadataRecord other) {
+      if (other == org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.getDefaultInstance()) return this;
       if (!other.getGraphHash().isEmpty()) {
         graphHash_ = other.graphHash_;
         onChanged();
@@ -770,11 +770,11 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      org.tensorflow.proto.util.SnapshotMetadataRecord parsedMessage = null;
+      org.tensorflow.proto.data.experimental.SnapshotMetadataRecord parsedMessage = null;
       try {
         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        parsedMessage = (org.tensorflow.proto.util.SnapshotMetadataRecord) e.getUnfinishedMessage();
+        parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotMetadataRecord) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
         if (parsedMessage != null) {
@@ -1290,12 +1290,12 @@ public final Builder mergeUnknownFields(
   }
 
   // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotMetadataRecord)
-  private static final org.tensorflow.proto.util.SnapshotMetadataRecord DEFAULT_INSTANCE;
+  private static final org.tensorflow.proto.data.experimental.SnapshotMetadataRecord DEFAULT_INSTANCE;
   static {
-    DEFAULT_INSTANCE = new org.tensorflow.proto.util.SnapshotMetadataRecord();
+    DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotMetadataRecord();
   }
 
-  public static org.tensorflow.proto.util.SnapshotMetadataRecord getDefaultInstance() {
+  public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
 
@@ -1320,7 +1320,7 @@ public com.google.protobuf.Parser getParserForType() {
   }
 
   @java.lang.Override
-  public org.tensorflow.proto.util.SnapshotMetadataRecord getDefaultInstanceForType() {
+  public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord getDefaultInstanceForType() {
     return DEFAULT_INSTANCE;
   }
 
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecordOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java
similarity index 98%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecordOrBuilder.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java
index 13686e12e57..97e3dddd818 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotMetadataRecordOrBuilder.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 public interface SnapshotMetadataRecordOrBuilder extends
     // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotMetadataRecord)
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java
similarity index 96%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotProtos.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java
index 2d8f207c550..b4f4cbceaf4 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 public final class SnapshotProtos {
   private SnapshotProtos() {}
@@ -59,8 +59,9 @@ public static void registerAllExtensions(
       "ShapeProto\022\031\n\021tensor_size_bytes\030\003 \001(\003\"_\n" +
       "\026SnapshotTensorMetadata\022E\n\017tensor_metada" +
       "ta\030\001 \003(\0132,.tensorflow.data.experimental." +
-      "TensorMetadataB-\n\031org.tensorflow.proto.u" +
-      "tilB\016SnapshotProtosP\001b\006proto3"
+      "TensorMetadataB:\n&org.tensorflow.proto.d" +
+      "ata.experimentalB\016SnapshotProtosP\001b\006prot" +
+      "o3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java
similarity index 85%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecord.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java
index 223b22587d7..e6388b928fc 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecord.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 /**
  * 
@@ -89,15 +89,15 @@ private SnapshotRecord(
   }
   public static final com.google.protobuf.Descriptors.Descriptor
       getDescriptor() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
   }
 
   @java.lang.Override
   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internalGetFieldAccessorTable() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable
         .ensureFieldAccessorsInitialized(
-            org.tensorflow.proto.util.SnapshotRecord.class, org.tensorflow.proto.util.SnapshotRecord.Builder.class);
+            org.tensorflow.proto.data.experimental.SnapshotRecord.class, org.tensorflow.proto.data.experimental.SnapshotRecord.Builder.class);
   }
 
   public static final int TENSOR_FIELD_NUMBER = 1;
@@ -175,10 +175,10 @@ public boolean equals(final java.lang.Object obj) {
     if (obj == this) {
      return true;
     }
-    if (!(obj instanceof org.tensorflow.proto.util.SnapshotRecord)) {
+    if (!(obj instanceof org.tensorflow.proto.data.experimental.SnapshotRecord)) {
       return super.equals(obj);
     }
-    org.tensorflow.proto.util.SnapshotRecord other = (org.tensorflow.proto.util.SnapshotRecord) obj;
+    org.tensorflow.proto.data.experimental.SnapshotRecord other = (org.tensorflow.proto.data.experimental.SnapshotRecord) obj;
 
     if (!getTensorList()
         .equals(other.getTensorList())) return false;
@@ -202,69 +202,69 @@ public int hashCode() {
     return hash;
   }
 
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       java.nio.ByteBuffer data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       java.nio.ByteBuffer data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       com.google.protobuf.ByteString data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       com.google.protobuf.ByteString data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(byte[] data)
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(byte[] data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       byte[] data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseDelimitedFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseDelimitedFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseDelimitedFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseDelimitedFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       com.google.protobuf.CodedInputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord parseFrom(
       com.google.protobuf.CodedInputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
@@ -277,7 +277,7 @@ public static org.tensorflow.proto.util.SnapshotRecord parseFrom(
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-  public static Builder newBuilder(org.tensorflow.proto.util.SnapshotRecord prototype) {
+  public static Builder newBuilder(org.tensorflow.proto.data.experimental.SnapshotRecord prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
   @java.lang.Override
@@ -304,21 +304,21 @@ protected Builder newBuilderForType(
   public static final class Builder extends
       com.google.protobuf.GeneratedMessageV3.Builder implements
       // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotRecord)
-      org.tensorflow.proto.util.SnapshotRecordOrBuilder {
+      org.tensorflow.proto.data.experimental.SnapshotRecordOrBuilder {
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.tensorflow.proto.util.SnapshotRecord.class, org.tensorflow.proto.util.SnapshotRecord.Builder.class);
+              org.tensorflow.proto.data.experimental.SnapshotRecord.class, org.tensorflow.proto.data.experimental.SnapshotRecord.Builder.class);
     }
 
-    // Construct using org.tensorflow.proto.util.SnapshotRecord.newBuilder()
+    // Construct using org.tensorflow.proto.data.experimental.SnapshotRecord.newBuilder()
     private Builder() {
       maybeForceBuilderInitialization();
     }
@@ -349,17 +349,17 @@ public Builder clear() {
     @java.lang.Override
     public com.google.protobuf.Descriptors.Descriptor
         getDescriptorForType() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor;
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotRecord getDefaultInstanceForType() {
-      return org.tensorflow.proto.util.SnapshotRecord.getDefaultInstance();
+    public org.tensorflow.proto.data.experimental.SnapshotRecord getDefaultInstanceForType() {
+      return org.tensorflow.proto.data.experimental.SnapshotRecord.getDefaultInstance();
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotRecord build() {
-      org.tensorflow.proto.util.SnapshotRecord result = buildPartial();
+    public org.tensorflow.proto.data.experimental.SnapshotRecord build() {
+      org.tensorflow.proto.data.experimental.SnapshotRecord result = buildPartial();
       if (!result.isInitialized()) {
         throw newUninitializedMessageException(result);
       }
@@ -367,8 +367,8 @@ public org.tensorflow.proto.util.SnapshotRecord build() {
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotRecord buildPartial() {
-      org.tensorflow.proto.util.SnapshotRecord result = new org.tensorflow.proto.util.SnapshotRecord(this);
+    public org.tensorflow.proto.data.experimental.SnapshotRecord buildPartial() {
+      org.tensorflow.proto.data.experimental.SnapshotRecord result = new org.tensorflow.proto.data.experimental.SnapshotRecord(this);
       int from_bitField0_ = bitField0_;
       if (tensorBuilder_ == null) {
         if (((bitField0_ & 0x00000001) != 0)) {
@@ -417,16 +417,16 @@ public Builder addRepeatedField(
     }
     @java.lang.Override
     public Builder mergeFrom(com.google.protobuf.Message other) {
-      if (other instanceof org.tensorflow.proto.util.SnapshotRecord) {
-        return mergeFrom((org.tensorflow.proto.util.SnapshotRecord)other);
+      if (other instanceof org.tensorflow.proto.data.experimental.SnapshotRecord) {
+        return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotRecord)other);
       } else {
         super.mergeFrom(other);
         return this;
       }
     }
 
-    public Builder mergeFrom(org.tensorflow.proto.util.SnapshotRecord other) {
-      if (other == org.tensorflow.proto.util.SnapshotRecord.getDefaultInstance()) return this;
+    public Builder mergeFrom(org.tensorflow.proto.data.experimental.SnapshotRecord other) {
+      if (other == org.tensorflow.proto.data.experimental.SnapshotRecord.getDefaultInstance()) return this;
       if (tensorBuilder_ == null) {
         if (!other.tensor_.isEmpty()) {
           if (tensor_.isEmpty()) {
@@ -468,11 +468,11 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      org.tensorflow.proto.util.SnapshotRecord parsedMessage = null;
+      org.tensorflow.proto.data.experimental.SnapshotRecord parsedMessage = null;
       try {
         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        parsedMessage = (org.tensorflow.proto.util.SnapshotRecord) e.getUnfinishedMessage();
+        parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotRecord) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
         if (parsedMessage != null) {
@@ -739,12 +739,12 @@ public final Builder mergeUnknownFields(
   }
 
   // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotRecord)
-  private static final org.tensorflow.proto.util.SnapshotRecord DEFAULT_INSTANCE;
+  private static final org.tensorflow.proto.data.experimental.SnapshotRecord DEFAULT_INSTANCE;
   static {
-    DEFAULT_INSTANCE = new org.tensorflow.proto.util.SnapshotRecord();
+    DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotRecord();
   }
 
-  public static org.tensorflow.proto.util.SnapshotRecord getDefaultInstance() {
+  public static org.tensorflow.proto.data.experimental.SnapshotRecord getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
 
@@ -769,7 +769,7 @@ public com.google.protobuf.Parser getParserForType() {
   }
 
   @java.lang.Override
-  public org.tensorflow.proto.util.SnapshotRecord getDefaultInstanceForType() {
+  public org.tensorflow.proto.data.experimental.SnapshotRecord getDefaultInstanceForType() {
     return DEFAULT_INSTANCE;
   }
 
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecordOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java
similarity index 95%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecordOrBuilder.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java
index e420dac0f6b..485e1656377 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotRecordOrBuilder.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 public interface SnapshotRecordOrBuilder extends
     // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotRecord)
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java
similarity index 75%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadata.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java
index 2d8d9dc96de..59b0fba153d 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadata.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 /**
  * 
@@ -56,11 +56,11 @@ private SnapshotTensorMetadata(
             break;
           case 10: {
             if (!((mutable_bitField0_ & 0x00000001) != 0)) {
-              tensorMetadata_ = new java.util.ArrayList();
+              tensorMetadata_ = new java.util.ArrayList();
               mutable_bitField0_ |= 0x00000001;
             }
             tensorMetadata_.add(
-                input.readMessage(org.tensorflow.proto.util.TensorMetadata.parser(), extensionRegistry));
+                input.readMessage(org.tensorflow.proto.data.experimental.TensorMetadata.parser(), extensionRegistry));
             break;
           }
           default: {
@@ -87,29 +87,29 @@ private SnapshotTensorMetadata(
   }
   public static final com.google.protobuf.Descriptors.Descriptor
       getDescriptor() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
   }
 
   @java.lang.Override
   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internalGetFieldAccessorTable() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable
         .ensureFieldAccessorsInitialized(
-            org.tensorflow.proto.util.SnapshotTensorMetadata.class, org.tensorflow.proto.util.SnapshotTensorMetadata.Builder.class);
+            org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.class, org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.Builder.class);
   }
 
   public static final int TENSOR_METADATA_FIELD_NUMBER = 1;
-  private java.util.List tensorMetadata_;
+  private java.util.List tensorMetadata_;
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  public java.util.List getTensorMetadataList() {
+  public java.util.List getTensorMetadataList() {
     return tensorMetadata_;
   }
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  public java.util.List 
+  public java.util.List 
       getTensorMetadataOrBuilderList() {
     return tensorMetadata_;
   }
@@ -122,13 +122,13 @@ public int getTensorMetadataCount() {
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  public org.tensorflow.proto.util.TensorMetadata getTensorMetadata(int index) {
+  public org.tensorflow.proto.data.experimental.TensorMetadata getTensorMetadata(int index) {
     return tensorMetadata_.get(index);
   }
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  public org.tensorflow.proto.util.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
+  public org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
       int index) {
     return tensorMetadata_.get(index);
   }
@@ -173,10 +173,10 @@ public boolean equals(final java.lang.Object obj) {
     if (obj == this) {
      return true;
     }
-    if (!(obj instanceof org.tensorflow.proto.util.SnapshotTensorMetadata)) {
+    if (!(obj instanceof org.tensorflow.proto.data.experimental.SnapshotTensorMetadata)) {
       return super.equals(obj);
     }
-    org.tensorflow.proto.util.SnapshotTensorMetadata other = (org.tensorflow.proto.util.SnapshotTensorMetadata) obj;
+    org.tensorflow.proto.data.experimental.SnapshotTensorMetadata other = (org.tensorflow.proto.data.experimental.SnapshotTensorMetadata) obj;
 
     if (!getTensorMetadataList()
         .equals(other.getTensorMetadataList())) return false;
@@ -200,69 +200,69 @@ public int hashCode() {
     return hash;
   }
 
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       java.nio.ByteBuffer data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       java.nio.ByteBuffer data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       com.google.protobuf.ByteString data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       com.google.protobuf.ByteString data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(byte[] data)
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(byte[] data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       byte[] data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseDelimitedFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseDelimitedFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseDelimitedFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseDelimitedFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       com.google.protobuf.CodedInputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parseFrom(
       com.google.protobuf.CodedInputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
@@ -275,7 +275,7 @@ public static org.tensorflow.proto.util.SnapshotTensorMetadata parseFrom(
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-  public static Builder newBuilder(org.tensorflow.proto.util.SnapshotTensorMetadata prototype) {
+  public static Builder newBuilder(org.tensorflow.proto.data.experimental.SnapshotTensorMetadata prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
   @java.lang.Override
@@ -300,21 +300,21 @@ protected Builder newBuilderForType(
   public static final class Builder extends
       com.google.protobuf.GeneratedMessageV3.Builder implements
       // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotTensorMetadata)
-      org.tensorflow.proto.util.SnapshotTensorMetadataOrBuilder {
+      org.tensorflow.proto.data.experimental.SnapshotTensorMetadataOrBuilder {
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.tensorflow.proto.util.SnapshotTensorMetadata.class, org.tensorflow.proto.util.SnapshotTensorMetadata.Builder.class);
+              org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.class, org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.Builder.class);
     }
 
-    // Construct using org.tensorflow.proto.util.SnapshotTensorMetadata.newBuilder()
+    // Construct using org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.newBuilder()
     private Builder() {
       maybeForceBuilderInitialization();
     }
@@ -345,17 +345,17 @@ public Builder clear() {
     @java.lang.Override
     public com.google.protobuf.Descriptors.Descriptor
         getDescriptorForType() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor;
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotTensorMetadata getDefaultInstanceForType() {
-      return org.tensorflow.proto.util.SnapshotTensorMetadata.getDefaultInstance();
+    public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata getDefaultInstanceForType() {
+      return org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.getDefaultInstance();
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotTensorMetadata build() {
-      org.tensorflow.proto.util.SnapshotTensorMetadata result = buildPartial();
+    public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata build() {
+      org.tensorflow.proto.data.experimental.SnapshotTensorMetadata result = buildPartial();
       if (!result.isInitialized()) {
         throw newUninitializedMessageException(result);
       }
@@ -363,8 +363,8 @@ public org.tensorflow.proto.util.SnapshotTensorMetadata build() {
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.SnapshotTensorMetadata buildPartial() {
-      org.tensorflow.proto.util.SnapshotTensorMetadata result = new org.tensorflow.proto.util.SnapshotTensorMetadata(this);
+    public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata buildPartial() {
+      org.tensorflow.proto.data.experimental.SnapshotTensorMetadata result = new org.tensorflow.proto.data.experimental.SnapshotTensorMetadata(this);
       int from_bitField0_ = bitField0_;
       if (tensorMetadataBuilder_ == null) {
         if (((bitField0_ & 0x00000001) != 0)) {
@@ -413,16 +413,16 @@ public Builder addRepeatedField(
     }
     @java.lang.Override
     public Builder mergeFrom(com.google.protobuf.Message other) {
-      if (other instanceof org.tensorflow.proto.util.SnapshotTensorMetadata) {
-        return mergeFrom((org.tensorflow.proto.util.SnapshotTensorMetadata)other);
+      if (other instanceof org.tensorflow.proto.data.experimental.SnapshotTensorMetadata) {
+        return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotTensorMetadata)other);
       } else {
         super.mergeFrom(other);
         return this;
       }
     }
 
-    public Builder mergeFrom(org.tensorflow.proto.util.SnapshotTensorMetadata other) {
-      if (other == org.tensorflow.proto.util.SnapshotTensorMetadata.getDefaultInstance()) return this;
+    public Builder mergeFrom(org.tensorflow.proto.data.experimental.SnapshotTensorMetadata other) {
+      if (other == org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.getDefaultInstance()) return this;
       if (tensorMetadataBuilder_ == null) {
         if (!other.tensorMetadata_.isEmpty()) {
           if (tensorMetadata_.isEmpty()) {
@@ -464,11 +464,11 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      org.tensorflow.proto.util.SnapshotTensorMetadata parsedMessage = null;
+      org.tensorflow.proto.data.experimental.SnapshotTensorMetadata parsedMessage = null;
       try {
         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        parsedMessage = (org.tensorflow.proto.util.SnapshotTensorMetadata) e.getUnfinishedMessage();
+        parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotTensorMetadata) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
         if (parsedMessage != null) {
@@ -479,22 +479,22 @@ public Builder mergeFrom(
     }
     private int bitField0_;
 
-    private java.util.List tensorMetadata_ =
+    private java.util.List tensorMetadata_ =
       java.util.Collections.emptyList();
     private void ensureTensorMetadataIsMutable() {
       if (!((bitField0_ & 0x00000001) != 0)) {
-        tensorMetadata_ = new java.util.ArrayList(tensorMetadata_);
+        tensorMetadata_ = new java.util.ArrayList(tensorMetadata_);
         bitField0_ |= 0x00000001;
        }
     }
 
     private com.google.protobuf.RepeatedFieldBuilderV3<
-        org.tensorflow.proto.util.TensorMetadata, org.tensorflow.proto.util.TensorMetadata.Builder, org.tensorflow.proto.util.TensorMetadataOrBuilder> tensorMetadataBuilder_;
+        org.tensorflow.proto.data.experimental.TensorMetadata, org.tensorflow.proto.data.experimental.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder> tensorMetadataBuilder_;
 
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public java.util.List getTensorMetadataList() {
+    public java.util.List getTensorMetadataList() {
       if (tensorMetadataBuilder_ == null) {
         return java.util.Collections.unmodifiableList(tensorMetadata_);
       } else {
@@ -514,7 +514,7 @@ public int getTensorMetadataCount() {
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public org.tensorflow.proto.util.TensorMetadata getTensorMetadata(int index) {
+    public org.tensorflow.proto.data.experimental.TensorMetadata getTensorMetadata(int index) {
       if (tensorMetadataBuilder_ == null) {
         return tensorMetadata_.get(index);
       } else {
@@ -525,7 +525,7 @@ public org.tensorflow.proto.util.TensorMetadata getTensorMetadata(int index) {
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder setTensorMetadata(
-        int index, org.tensorflow.proto.util.TensorMetadata value) {
+        int index, org.tensorflow.proto.data.experimental.TensorMetadata value) {
       if (tensorMetadataBuilder_ == null) {
         if (value == null) {
           throw new NullPointerException();
@@ -542,7 +542,7 @@ public Builder setTensorMetadata(
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder setTensorMetadata(
-        int index, org.tensorflow.proto.util.TensorMetadata.Builder builderForValue) {
+        int index, org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) {
       if (tensorMetadataBuilder_ == null) {
         ensureTensorMetadataIsMutable();
         tensorMetadata_.set(index, builderForValue.build());
@@ -555,7 +555,7 @@ public Builder setTensorMetadata(
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public Builder addTensorMetadata(org.tensorflow.proto.util.TensorMetadata value) {
+    public Builder addTensorMetadata(org.tensorflow.proto.data.experimental.TensorMetadata value) {
       if (tensorMetadataBuilder_ == null) {
         if (value == null) {
           throw new NullPointerException();
@@ -572,7 +572,7 @@ public Builder addTensorMetadata(org.tensorflow.proto.util.TensorMetadata value)
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder addTensorMetadata(
-        int index, org.tensorflow.proto.util.TensorMetadata value) {
+        int index, org.tensorflow.proto.data.experimental.TensorMetadata value) {
       if (tensorMetadataBuilder_ == null) {
         if (value == null) {
           throw new NullPointerException();
@@ -589,7 +589,7 @@ public Builder addTensorMetadata(
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder addTensorMetadata(
-        org.tensorflow.proto.util.TensorMetadata.Builder builderForValue) {
+        org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) {
       if (tensorMetadataBuilder_ == null) {
         ensureTensorMetadataIsMutable();
         tensorMetadata_.add(builderForValue.build());
@@ -603,7 +603,7 @@ public Builder addTensorMetadata(
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder addTensorMetadata(
-        int index, org.tensorflow.proto.util.TensorMetadata.Builder builderForValue) {
+        int index, org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) {
       if (tensorMetadataBuilder_ == null) {
         ensureTensorMetadataIsMutable();
         tensorMetadata_.add(index, builderForValue.build());
@@ -617,7 +617,7 @@ public Builder addTensorMetadata(
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
     public Builder addAllTensorMetadata(
-        java.lang.Iterable values) {
+        java.lang.Iterable values) {
       if (tensorMetadataBuilder_ == null) {
         ensureTensorMetadataIsMutable();
         com.google.protobuf.AbstractMessageLite.Builder.addAll(
@@ -657,14 +657,14 @@ public Builder removeTensorMetadata(int index) {
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public org.tensorflow.proto.util.TensorMetadata.Builder getTensorMetadataBuilder(
+    public org.tensorflow.proto.data.experimental.TensorMetadata.Builder getTensorMetadataBuilder(
         int index) {
       return getTensorMetadataFieldBuilder().getBuilder(index);
     }
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public org.tensorflow.proto.util.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
+    public org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
         int index) {
       if (tensorMetadataBuilder_ == null) {
         return tensorMetadata_.get(index);  } else {
@@ -674,7 +674,7 @@ public org.tensorflow.proto.util.TensorMetadataOrBuilder getTensorMetadataOrBuil
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public java.util.List 
+    public java.util.List 
          getTensorMetadataOrBuilderList() {
       if (tensorMetadataBuilder_ != null) {
         return tensorMetadataBuilder_.getMessageOrBuilderList();
@@ -685,31 +685,31 @@ public org.tensorflow.proto.util.TensorMetadataOrBuilder getTensorMetadataOrBuil
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public org.tensorflow.proto.util.TensorMetadata.Builder addTensorMetadataBuilder() {
+    public org.tensorflow.proto.data.experimental.TensorMetadata.Builder addTensorMetadataBuilder() {
       return getTensorMetadataFieldBuilder().addBuilder(
-          org.tensorflow.proto.util.TensorMetadata.getDefaultInstance());
+          org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance());
     }
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public org.tensorflow.proto.util.TensorMetadata.Builder addTensorMetadataBuilder(
+    public org.tensorflow.proto.data.experimental.TensorMetadata.Builder addTensorMetadataBuilder(
         int index) {
       return getTensorMetadataFieldBuilder().addBuilder(
-          index, org.tensorflow.proto.util.TensorMetadata.getDefaultInstance());
+          index, org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance());
     }
     /**
      * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
      */
-    public java.util.List 
+    public java.util.List 
          getTensorMetadataBuilderList() {
       return getTensorMetadataFieldBuilder().getBuilderList();
     }
     private com.google.protobuf.RepeatedFieldBuilderV3<
-        org.tensorflow.proto.util.TensorMetadata, org.tensorflow.proto.util.TensorMetadata.Builder, org.tensorflow.proto.util.TensorMetadataOrBuilder> 
+        org.tensorflow.proto.data.experimental.TensorMetadata, org.tensorflow.proto.data.experimental.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder> 
         getTensorMetadataFieldBuilder() {
       if (tensorMetadataBuilder_ == null) {
         tensorMetadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
-            org.tensorflow.proto.util.TensorMetadata, org.tensorflow.proto.util.TensorMetadata.Builder, org.tensorflow.proto.util.TensorMetadataOrBuilder>(
+            org.tensorflow.proto.data.experimental.TensorMetadata, org.tensorflow.proto.data.experimental.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder>(
                 tensorMetadata_,
                 ((bitField0_ & 0x00000001) != 0),
                 getParentForChildren(),
@@ -735,12 +735,12 @@ public final Builder mergeUnknownFields(
   }
 
   // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotTensorMetadata)
-  private static final org.tensorflow.proto.util.SnapshotTensorMetadata DEFAULT_INSTANCE;
+  private static final org.tensorflow.proto.data.experimental.SnapshotTensorMetadata DEFAULT_INSTANCE;
   static {
-    DEFAULT_INSTANCE = new org.tensorflow.proto.util.SnapshotTensorMetadata();
+    DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotTensorMetadata();
   }
 
-  public static org.tensorflow.proto.util.SnapshotTensorMetadata getDefaultInstance() {
+  public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
 
@@ -765,7 +765,7 @@ public com.google.protobuf.Parser getParserForType() {
   }
 
   @java.lang.Override
-  public org.tensorflow.proto.util.SnapshotTensorMetadata getDefaultInstanceForType() {
+  public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata getDefaultInstanceForType() {
     return DEFAULT_INSTANCE;
   }
 
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java
similarity index 71%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadataOrBuilder.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java
index 8c906ffb714..73feb8671a6 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapshotTensorMetadataOrBuilder.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 public interface SnapshotTensorMetadataOrBuilder extends
     // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotTensorMetadata)
@@ -10,12 +10,12 @@ public interface SnapshotTensorMetadataOrBuilder extends
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  java.util.List 
+  java.util.List 
       getTensorMetadataList();
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  org.tensorflow.proto.util.TensorMetadata getTensorMetadata(int index);
+  org.tensorflow.proto.data.experimental.TensorMetadata getTensorMetadata(int index);
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
@@ -23,11 +23,11 @@ public interface SnapshotTensorMetadataOrBuilder extends
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  java.util.List 
+  java.util.List 
       getTensorMetadataOrBuilderList();
   /**
    * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1;
    */
-  org.tensorflow.proto.util.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
+  org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder(
       int index);
 }
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java
similarity index 83%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadata.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java
index c1ac5388ed4..87dfbe8bf78 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadata.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 /**
  * 
@@ -91,15 +91,15 @@ private TensorMetadata(
   }
   public static final com.google.protobuf.Descriptors.Descriptor
       getDescriptor() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
   }
 
   @java.lang.Override
   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internalGetFieldAccessorTable() {
-    return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable
+    return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable
         .ensureFieldAccessorsInitialized(
-            org.tensorflow.proto.util.TensorMetadata.class, org.tensorflow.proto.util.TensorMetadata.Builder.class);
+            org.tensorflow.proto.data.experimental.TensorMetadata.class, org.tensorflow.proto.data.experimental.TensorMetadata.Builder.class);
   }
 
   public static final int TENSOR_SHAPE_FIELD_NUMBER = 2;
@@ -183,10 +183,10 @@ public boolean equals(final java.lang.Object obj) {
     if (obj == this) {
      return true;
     }
-    if (!(obj instanceof org.tensorflow.proto.util.TensorMetadata)) {
+    if (!(obj instanceof org.tensorflow.proto.data.experimental.TensorMetadata)) {
       return super.equals(obj);
     }
-    org.tensorflow.proto.util.TensorMetadata other = (org.tensorflow.proto.util.TensorMetadata) obj;
+    org.tensorflow.proto.data.experimental.TensorMetadata other = (org.tensorflow.proto.data.experimental.TensorMetadata) obj;
 
     if (hasTensorShape() != other.hasTensorShape()) return false;
     if (hasTensorShape()) {
@@ -218,69 +218,69 @@ public int hashCode() {
     return hash;
   }
 
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       java.nio.ByteBuffer data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       java.nio.ByteBuffer data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       com.google.protobuf.ByteString data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       com.google.protobuf.ByteString data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(byte[] data)
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(byte[] data)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       byte[] data,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws com.google.protobuf.InvalidProtocolBufferException {
     return PARSER.parseFrom(data, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseDelimitedFrom(java.io.InputStream input)
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseDelimitedFrom(java.io.InputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseDelimitedFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseDelimitedFrom(
       java.io.InputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       com.google.protobuf.CodedInputStream input)
       throws java.io.IOException {
     return com.google.protobuf.GeneratedMessageV3
         .parseWithIOException(PARSER, input);
   }
-  public static org.tensorflow.proto.util.TensorMetadata parseFrom(
+  public static org.tensorflow.proto.data.experimental.TensorMetadata parseFrom(
       com.google.protobuf.CodedInputStream input,
       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
       throws java.io.IOException {
@@ -293,7 +293,7 @@ public static org.tensorflow.proto.util.TensorMetadata parseFrom(
   public static Builder newBuilder() {
     return DEFAULT_INSTANCE.toBuilder();
   }
-  public static Builder newBuilder(org.tensorflow.proto.util.TensorMetadata prototype) {
+  public static Builder newBuilder(org.tensorflow.proto.data.experimental.TensorMetadata prototype) {
     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
   }
   @java.lang.Override
@@ -318,21 +318,21 @@ protected Builder newBuilderForType(
   public static final class Builder extends
       com.google.protobuf.GeneratedMessageV3.Builder implements
       // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.TensorMetadata)
-      org.tensorflow.proto.util.TensorMetadataOrBuilder {
+      org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder {
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              org.tensorflow.proto.util.TensorMetadata.class, org.tensorflow.proto.util.TensorMetadata.Builder.class);
+              org.tensorflow.proto.data.experimental.TensorMetadata.class, org.tensorflow.proto.data.experimental.TensorMetadata.Builder.class);
     }
 
-    // Construct using org.tensorflow.proto.util.TensorMetadata.newBuilder()
+    // Construct using org.tensorflow.proto.data.experimental.TensorMetadata.newBuilder()
     private Builder() {
       maybeForceBuilderInitialization();
     }
@@ -364,17 +364,17 @@ public Builder clear() {
     @java.lang.Override
     public com.google.protobuf.Descriptors.Descriptor
         getDescriptorForType() {
-      return org.tensorflow.proto.util.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
+      return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor;
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.TensorMetadata getDefaultInstanceForType() {
-      return org.tensorflow.proto.util.TensorMetadata.getDefaultInstance();
+    public org.tensorflow.proto.data.experimental.TensorMetadata getDefaultInstanceForType() {
+      return org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance();
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.TensorMetadata build() {
-      org.tensorflow.proto.util.TensorMetadata result = buildPartial();
+    public org.tensorflow.proto.data.experimental.TensorMetadata build() {
+      org.tensorflow.proto.data.experimental.TensorMetadata result = buildPartial();
       if (!result.isInitialized()) {
         throw newUninitializedMessageException(result);
       }
@@ -382,8 +382,8 @@ public org.tensorflow.proto.util.TensorMetadata build() {
     }
 
     @java.lang.Override
-    public org.tensorflow.proto.util.TensorMetadata buildPartial() {
-      org.tensorflow.proto.util.TensorMetadata result = new org.tensorflow.proto.util.TensorMetadata(this);
+    public org.tensorflow.proto.data.experimental.TensorMetadata buildPartial() {
+      org.tensorflow.proto.data.experimental.TensorMetadata result = new org.tensorflow.proto.data.experimental.TensorMetadata(this);
       if (tensorShapeBuilder_ == null) {
         result.tensorShape_ = tensorShape_;
       } else {
@@ -428,16 +428,16 @@ public Builder addRepeatedField(
     }
     @java.lang.Override
     public Builder mergeFrom(com.google.protobuf.Message other) {
-      if (other instanceof org.tensorflow.proto.util.TensorMetadata) {
-        return mergeFrom((org.tensorflow.proto.util.TensorMetadata)other);
+      if (other instanceof org.tensorflow.proto.data.experimental.TensorMetadata) {
+        return mergeFrom((org.tensorflow.proto.data.experimental.TensorMetadata)other);
       } else {
         super.mergeFrom(other);
         return this;
       }
     }
 
-    public Builder mergeFrom(org.tensorflow.proto.util.TensorMetadata other) {
-      if (other == org.tensorflow.proto.util.TensorMetadata.getDefaultInstance()) return this;
+    public Builder mergeFrom(org.tensorflow.proto.data.experimental.TensorMetadata other) {
+      if (other == org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance()) return this;
       if (other.hasTensorShape()) {
         mergeTensorShape(other.getTensorShape());
       }
@@ -459,11 +459,11 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      org.tensorflow.proto.util.TensorMetadata parsedMessage = null;
+      org.tensorflow.proto.data.experimental.TensorMetadata parsedMessage = null;
       try {
         parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        parsedMessage = (org.tensorflow.proto.util.TensorMetadata) e.getUnfinishedMessage();
+        parsedMessage = (org.tensorflow.proto.data.experimental.TensorMetadata) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
         if (parsedMessage != null) {
@@ -644,12 +644,12 @@ public final Builder mergeUnknownFields(
   }
 
   // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.TensorMetadata)
-  private static final org.tensorflow.proto.util.TensorMetadata DEFAULT_INSTANCE;
+  private static final org.tensorflow.proto.data.experimental.TensorMetadata DEFAULT_INSTANCE;
   static {
-    DEFAULT_INSTANCE = new org.tensorflow.proto.util.TensorMetadata();
+    DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.TensorMetadata();
   }
 
-  public static org.tensorflow.proto.util.TensorMetadata getDefaultInstance() {
+  public static org.tensorflow.proto.data.experimental.TensorMetadata getDefaultInstance() {
     return DEFAULT_INSTANCE;
   }
 
@@ -674,7 +674,7 @@ public com.google.protobuf.Parser getParserForType() {
   }
 
   @java.lang.Override
-  public org.tensorflow.proto.util.TensorMetadata getDefaultInstanceForType() {
+  public org.tensorflow.proto.data.experimental.TensorMetadata getDefaultInstanceForType() {
     return DEFAULT_INSTANCE;
   }
 
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java
similarity index 95%
rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadataOrBuilder.java
rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java
index 0cfa470c9e6..0649aabc2ca 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorMetadataOrBuilder.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java
@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: tensorflow/core/protobuf/data/experimental/snapshot.proto
 
-package org.tensorflow.proto.util;
+package org.tensorflow.proto.data.experimental;
 
 public interface TensorMetadataOrBuilder extends
     // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.TensorMetadata)
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterProtos.java
index 06aa24f0049..af37d726925 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterProtos.java
@@ -43,10 +43,11 @@ public static void registerAllExtensions(
       "tasks\030\002 \003(\0132\035.tensorflow.JobDef.TasksEnt" +
       "ry\032,\n\nTasksEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002" +
       " \001(\t:\0028\001\"-\n\nClusterDef\022\037\n\003job\030\001 \003(\0132\022.te" +
-      "nsorflow.JobDefB\200\001\n org.tensorflow.proto" +
-      ".distruntimeB\rClusterProtosP\001ZHgithub.co" +
+      "nsorflow.JobDefB\215\001\n org.tensorflow.proto" +
+      ".distruntimeB\rClusterProtosP\001ZUgithub.co" +
       "m/tensorflow/tensorflow/tensorflow/go/co" +
-      "re/core_protos_go_proto\370\001\001b\006proto3"
+      "re/protobuf/for_core_protos_go_proto\370\001\001b" +
+      "\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java
index 254d82a2a2a..bd1b5639915 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java
@@ -51,11 +51,11 @@ public static void registerAllExtensions(
       "asksEntry\022\013\n\003key\030\001 \001(\005\022,\n\005value\030\002 \001(\0132\035." +
       "tensorflow.TaskDeviceFilters:\0028\001\"B\n\024Clus" +
       "terDeviceFilters\022*\n\004jobs\030\001 \003(\0132\034.tensorf" +
-      "low.JobDeviceFiltersB\206\001\n org.tensorflow." +
+      "low.JobDeviceFiltersB\223\001\n org.tensorflow." +
       "proto.distruntimeB\023DeviceFiltersProtosP\001" +
-      "ZHgithub.com/tensorflow/tensorflow/tenso" +
-      "rflow/go/core/core_protos_go_proto\370\001\001b\006p" +
-      "roto3"
+      "ZUgithub.com/tensorflow/tensorflow/tenso" +
+      "rflow/go/core/protobuf/for_core_protos_g" +
+      "o_proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerProtos.java
index d5b21d1500d..57b4f858898 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerProtos.java
@@ -38,11 +38,11 @@ public static void registerAllExtensions(
       "\005\0227\n\026default_session_config\030\004 \001(\0132\027.tens" +
       "orflow.ConfigProto\022\020\n\010protocol\030\005 \001(\t\022\014\n\004" +
       "port\030\006 \001(\005\022@\n\026cluster_device_filters\030\007 \001" +
-      "(\0132 .tensorflow.ClusterDeviceFiltersB\177\n " +
-      "org.tensorflow.proto.distruntimeB\014Server" +
-      "ProtosP\001ZHgithub.com/tensorflow/tensorfl" +
-      "ow/tensorflow/go/core/core_protos_go_pro" +
-      "to\370\001\001b\006proto3"
+      "(\0132 .tensorflow.ClusterDeviceFiltersB\214\001\n" +
+      " org.tensorflow.proto.distruntimeB\014Serve" +
+      "rProtosP\001ZUgithub.com/tensorflow/tensorf" +
+      "low/tensorflow/go/core/protobuf/for_core" +
+      "_protos_go_proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TransportOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TransportOptions.java
index f7498e56de5..e5a8e2a11ed 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TransportOptions.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TransportOptions.java
@@ -614,10 +614,10 @@ public org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra getDef
     java.lang.String[] descriptorData = {
       "\n0tensorflow/core/protobuf/transport_opt" +
       "ions.proto\022\ntensorflow\"*\n\020RecvBufRespExt" +
-      "ra\022\026\n\016tensor_content\030\001 \003(\014Bl\n org.tensor" +
-      "flow.proto.distruntimeZHgithub.com/tenso" +
-      "rflow/tensorflow/tensorflow/go/core/core" +
-      "_protos_go_protob\006proto3"
+      "ra\022\026\n\016tensor_content\030\001 \003(\014By\n org.tensor" +
+      "flow.proto.distruntimeZUgithub.com/tenso" +
+      "rflow/tensorflow/tensorflow/go/core/prot" +
+      "obuf/for_core_protos_go_protob\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java
index a1c1e579953..c756a6ef126 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java
@@ -427,6 +427,8 @@ public interface ExperimentalOrBuilder extends
 
     /**
      * 
+     * This field will eventually be deprecated and replaced by
+     * mlir_bridge_rollout (b/166038521).
      * Whether to enable the MLIR-based TF->XLA bridge.
      * This is a replacement to the existing bridge, and not ready for
      * production usage yet.
@@ -443,6 +445,27 @@ public interface ExperimentalOrBuilder extends
      */
     boolean getEnableMlirBridge();
 
+    /**
+     * 
+     * This field is underdevelopment, for now use enable_mlir_bridge
+     * (b/166038521).
+     * Whether to enable the MLIR-based TF->XLA bridge.
+     * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + int getMlirBridgeRolloutValue(); + /** + *
+     * This field is underdevelopment, for now use enable_mlir_bridge
+     * (b/166038521).
+     * Whether to enable the MLIR-based TF->XLA bridge.
+     * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout(); + /** *
      * Whether to enable the MLIR-based Graph optimizations.
@@ -500,6 +523,7 @@ private Experimental(com.google.protobuf.GeneratedMessageV3.Builder builder)
     private Experimental() {
       collectiveGroupLeader_ = "";
       executorType_ = "";
+      mlirBridgeRollout_ = 0;
     }
 
     @java.lang.Override
@@ -617,6 +641,12 @@ private Experimental(
               enableMlirGraphOptimization_ = input.readBool();
               break;
             }
+            case 136: {
+              int rawValue = input.readEnum();
+
+              mlirBridgeRollout_ = rawValue;
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -649,6 +679,143 @@ private Experimental(
               org.tensorflow.proto.framework.ConfigProto.Experimental.class, org.tensorflow.proto.framework.ConfigProto.Experimental.Builder.class);
     }
 
+    /**
+     * 
+     * An enum that describes the state of the MLIR bridge rollout.
+     * 
+ * + * Protobuf enum {@code tensorflow.ConfigProto.Experimental.MlirBridgeRollout} + */ + public enum MlirBridgeRollout + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * If this field is left unspecified, the MLIR bridge may be selectively
+       * enabled on a per graph basis.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_UNSPECIFIED = 0; + */ + MLIR_BRIDGE_ROLLOUT_UNSPECIFIED(0), + /** + *
+       * Enabling the MLIR bridge enables it for all graphs in this session.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_ENABLED = 1; + */ + MLIR_BRIDGE_ROLLOUT_ENABLED(1), + /** + *
+       * Disabling the MLIR bridge disables it for all graphs in this session.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_DISABLED = 2; + */ + MLIR_BRIDGE_ROLLOUT_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + *
+       * If this field is left unspecified, the MLIR bridge may be selectively
+       * enabled on a per graph basis.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_UNSPECIFIED = 0; + */ + public static final int MLIR_BRIDGE_ROLLOUT_UNSPECIFIED_VALUE = 0; + /** + *
+       * Enabling the MLIR bridge enables it for all graphs in this session.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_ENABLED = 1; + */ + public static final int MLIR_BRIDGE_ROLLOUT_ENABLED_VALUE = 1; + /** + *
+       * Disabling the MLIR bridge disables it for all graphs in this session.
+       * 
+ * + * MLIR_BRIDGE_ROLLOUT_DISABLED = 2; + */ + public static final int MLIR_BRIDGE_ROLLOUT_DISABLED_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MlirBridgeRollout valueOf(int value) { + return forNumber(value); + } + + public static MlirBridgeRollout forNumber(int value) { + switch (value) { + case 0: return MLIR_BRIDGE_ROLLOUT_UNSPECIFIED; + case 1: return MLIR_BRIDGE_ROLLOUT_ENABLED; + case 2: return MLIR_BRIDGE_ROLLOUT_DISABLED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MlirBridgeRollout> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MlirBridgeRollout findValueByNumber(int number) { + return MlirBridgeRollout.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.tensorflow.proto.framework.ConfigProto.Experimental.getDescriptor().getEnumTypes().get(0); + } + + private static final MlirBridgeRollout[] VALUES = values(); + + public static MlirBridgeRollout valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MlirBridgeRollout(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.ConfigProto.Experimental.MlirBridgeRollout) + } + public static final int COLLECTIVE_GROUP_LEADER_FIELD_NUMBER = 1; private volatile java.lang.Object collectiveGroupLeader_; /** @@ -915,6 +1082,8 @@ public boolean getOptimizeForStaticGraph() { private boolean enableMlirBridge_; /** *
+     * This field will eventually be deprecated and replaced by
+     * mlir_bridge_rollout (b/166038521).
      * Whether to enable the MLIR-based TF->XLA bridge.
      * This is a replacement to the existing bridge, and not ready for
      * production usage yet.
@@ -933,6 +1102,35 @@ public boolean getEnableMlirBridge() {
       return enableMlirBridge_;
     }
 
+    public static final int MLIR_BRIDGE_ROLLOUT_FIELD_NUMBER = 17;
+    private int mlirBridgeRollout_;
+    /**
+     * 
+     * This field is underdevelopment, for now use enable_mlir_bridge
+     * (b/166038521).
+     * Whether to enable the MLIR-based TF->XLA bridge.
+     * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public int getMlirBridgeRolloutValue() { + return mlirBridgeRollout_; + } + /** + *
+     * This field is underdevelopment, for now use enable_mlir_bridge
+     * (b/166038521).
+     * Whether to enable the MLIR-based TF->XLA bridge.
+     * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout result = org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.valueOf(mlirBridgeRollout_); + return result == null ? org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.UNRECOGNIZED : result; + } + public static final int ENABLE_MLIR_GRAPH_OPTIMIZATION_FIELD_NUMBER = 16; private boolean enableMlirGraphOptimization_; /** @@ -1040,6 +1238,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (enableMlirGraphOptimization_ != false) { output.writeBool(16, enableMlirGraphOptimization_); } + if (mlirBridgeRollout_ != org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.MLIR_BRIDGE_ROLLOUT_UNSPECIFIED.getNumber()) { + output.writeEnum(17, mlirBridgeRollout_); + } unknownFields.writeTo(output); } @@ -1107,6 +1308,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(16, enableMlirGraphOptimization_); } + if (mlirBridgeRollout_ != org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.MLIR_BRIDGE_ROLLOUT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(17, mlirBridgeRollout_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1149,6 +1354,7 @@ public boolean equals(final java.lang.Object obj) { != other.getOptimizeForStaticGraph()) return false; if (getEnableMlirBridge() != other.getEnableMlirBridge()) return false; + if (mlirBridgeRollout_ != other.mlirBridgeRollout_) return false; if (getEnableMlirGraphOptimization() != other.getEnableMlirGraphOptimization()) return false; if (getDisableOutputPartitionGraphs() @@ -1200,6 +1406,8 @@ public int hashCode() { hash = (37 * hash) + ENABLE_MLIR_BRIDGE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getEnableMlirBridge()); + hash = (37 * hash) + MLIR_BRIDGE_ROLLOUT_FIELD_NUMBER; + hash = (53 * hash) + mlirBridgeRollout_; hash = (37 * hash) + ENABLE_MLIR_GRAPH_OPTIMIZATION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getEnableMlirGraphOptimization()); @@ -1376,6 +1584,8 @@ public Builder clear() { enableMlirBridge_ = false; + mlirBridgeRollout_ = 0; + enableMlirGraphOptimization_ = false; disableOutputPartitionGraphs_ = false; @@ -1424,6 +1634,7 @@ public org.tensorflow.proto.framework.ConfigProto.Experimental buildPartial() { } result.optimizeForStaticGraph_ = optimizeForStaticGraph_; result.enableMlirBridge_ = enableMlirBridge_; + result.mlirBridgeRollout_ = mlirBridgeRollout_; result.enableMlirGraphOptimization_ = enableMlirGraphOptimization_; result.disableOutputPartitionGraphs_ = disableOutputPartitionGraphs_; result.xlaFusionAutotunerThresh_ = xlaFusionAutotunerThresh_; @@ -1513,6 +1724,9 @@ public Builder mergeFrom(org.tensorflow.proto.framework.ConfigProto.Experimental if (other.getEnableMlirBridge() != false) { setEnableMlirBridge(other.getEnableMlirBridge()); } + if (other.mlirBridgeRollout_ != 0) { + setMlirBridgeRolloutValue(other.getMlirBridgeRolloutValue()); + } if (other.getEnableMlirGraphOptimization() != false) { setEnableMlirGraphOptimization(other.getEnableMlirGraphOptimization()); } @@ -2311,6 +2525,8 @@ public Builder clearOptimizeForStaticGraph() { private boolean enableMlirBridge_ ; /** *
+       * This field will eventually be deprecated and replaced by
+       * mlir_bridge_rollout (b/166038521).
        * Whether to enable the MLIR-based TF->XLA bridge.
        * This is a replacement to the existing bridge, and not ready for
        * production usage yet.
@@ -2330,6 +2546,8 @@ public boolean getEnableMlirBridge() {
       }
       /**
        * 
+       * This field will eventually be deprecated and replaced by
+       * mlir_bridge_rollout (b/166038521).
        * Whether to enable the MLIR-based TF->XLA bridge.
        * This is a replacement to the existing bridge, and not ready for
        * production usage yet.
@@ -2352,6 +2570,8 @@ public Builder setEnableMlirBridge(boolean value) {
       }
       /**
        * 
+       * This field will eventually be deprecated and replaced by
+       * mlir_bridge_rollout (b/166038521).
        * Whether to enable the MLIR-based TF->XLA bridge.
        * This is a replacement to the existing bridge, and not ready for
        * production usage yet.
@@ -2373,6 +2593,81 @@ public Builder clearEnableMlirBridge() {
         return this;
       }
 
+      private int mlirBridgeRollout_ = 0;
+      /**
+       * 
+       * This field is underdevelopment, for now use enable_mlir_bridge
+       * (b/166038521).
+       * Whether to enable the MLIR-based TF->XLA bridge.
+       * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public int getMlirBridgeRolloutValue() { + return mlirBridgeRollout_; + } + /** + *
+       * This field is underdevelopment, for now use enable_mlir_bridge
+       * (b/166038521).
+       * Whether to enable the MLIR-based TF->XLA bridge.
+       * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public Builder setMlirBridgeRolloutValue(int value) { + mlirBridgeRollout_ = value; + onChanged(); + return this; + } + /** + *
+       * This field is underdevelopment, for now use enable_mlir_bridge
+       * (b/166038521).
+       * Whether to enable the MLIR-based TF->XLA bridge.
+       * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout result = org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.valueOf(mlirBridgeRollout_); + return result == null ? org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout.UNRECOGNIZED : result; + } + /** + *
+       * This field is underdevelopment, for now use enable_mlir_bridge
+       * (b/166038521).
+       * Whether to enable the MLIR-based TF->XLA bridge.
+       * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public Builder setMlirBridgeRollout(org.tensorflow.proto.framework.ConfigProto.Experimental.MlirBridgeRollout value) { + if (value == null) { + throw new NullPointerException(); + } + + mlirBridgeRollout_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * This field is underdevelopment, for now use enable_mlir_bridge
+       * (b/166038521).
+       * Whether to enable the MLIR-based TF->XLA bridge.
+       * 
+ * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + */ + public Builder clearMlirBridgeRollout() { + + mlirBridgeRollout_ = 0; + onChanged(); + return this; + } + private boolean enableMlirGraphOptimization_ ; /** *
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java
index 9a2c79552d6..83eabfe7d8d 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java
@@ -175,7 +175,7 @@ public static void registerAllExtensions(
       "\032\n\022cache_rpc_response\030\004 \001(\010\022*\n\"disable_s" +
       "ession_connection_sharing\030\005 \001(\010\"0\n\017Sessi" +
       "onMetadata\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(" +
-      "\003\"\310\n\n\013ConfigProto\022>\n\014device_count\030\001 \003(\0132" +
+      "\003\"\232\014\n\013ConfigProto\022>\n\014device_count\030\001 \003(\0132" +
       "(.tensorflow.ConfigProto.DeviceCountEntr" +
       "y\022$\n\034intra_op_parallelism_threads\030\002 \001(\005\022" +
       "$\n\034inter_op_parallelism_threads\030\005 \001(\005\022\037\n" +
@@ -194,7 +194,7 @@ public static void registerAllExtensions(
       "evices_in_session\030\021 \001(\010\022:\n\014experimental\030" +
       "\020 \001(\0132$.tensorflow.ConfigProto.Experimen" +
       "tal\0322\n\020DeviceCountEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" +
-      "value\030\002 \001(\005:\0028\001\032\302\004\n\014Experimental\022\037\n\027coll" +
+      "value\030\002 \001(\005:\0028\001\032\224\006\n\014Experimental\022\037\n\027coll" +
       "ective_group_leader\030\001 \001(\t\022\025\n\rexecutor_ty" +
       "pe\030\003 \001(\t\022\032\n\022recv_buf_max_chunk\030\004 \001(\005\022\031\n\021" +
       "use_numa_affinity\030\005 \001(\010\0225\n-collective_de" +
@@ -205,51 +205,57 @@ public static void registerAllExtensions(
       "e_cluster_devices_in_session\030\n \001(\010\0225\n\020se" +
       "ssion_metadata\030\013 \001(\0132\033.tensorflow.Sessio" +
       "nMetadata\022!\n\031optimize_for_static_graph\030\014" +
-      " \001(\010\022\032\n\022enable_mlir_bridge\030\r \001(\010\022&\n\036enab" +
-      "le_mlir_graph_optimization\030\020 \001(\010\022\'\n\037disa" +
-      "ble_output_partition_graphs\030\016 \001(\010\022#\n\033xla" +
-      "_fusion_autotuner_thresh\030\017 \001(\003J\004\010\002\020\003\"\341\004\n" +
-      "\nRunOptions\0226\n\013trace_level\030\001 \001(\0162!.tenso" +
-      "rflow.RunOptions.TraceLevel\022\025\n\rtimeout_i" +
-      "n_ms\030\002 \001(\003\022\034\n\024inter_op_thread_pool\030\003 \001(\005" +
-      "\022\037\n\027output_partition_graphs\030\005 \001(\010\022/\n\rdeb" +
-      "ug_options\030\006 \001(\0132\030.tensorflow.DebugOptio" +
-      "ns\022*\n\"report_tensor_allocations_upon_oom" +
-      "\030\007 \001(\010\0229\n\014experimental\030\010 \001(\0132#.tensorflo" +
-      "w.RunOptions.Experimental\032\322\001\n\014Experiment" +
-      "al\022\034\n\024collective_graph_key\030\001 \001(\003\022\034\n\024use_" +
-      "run_handler_pool\030\002 \001(\010\022[\n\030run_handler_po" +
-      "ol_options\030\003 \001(\01329.tensorflow.RunOptions" +
-      ".Experimental.RunHandlerPoolOptions\032)\n\025R" +
-      "unHandlerPoolOptions\022\020\n\010priority\030\001 \001(\003\"R" +
-      "\n\nTraceLevel\022\014\n\010NO_TRACE\020\000\022\022\n\016SOFTWARE_T" +
-      "RACE\020\001\022\022\n\016HARDWARE_TRACE\020\002\022\016\n\nFULL_TRACE" +
-      "\020\003J\004\010\004\020\005\"\207\003\n\013RunMetadata\022)\n\nstep_stats\030\001" +
-      " \001(\0132\025.tensorflow.StepStats\022,\n\ncost_grap" +
-      "h\030\002 \001(\0132\030.tensorflow.CostGraphDef\022.\n\020par" +
-      "tition_graphs\030\003 \003(\0132\024.tensorflow.GraphDe" +
-      "f\022?\n\017function_graphs\030\004 \003(\0132&.tensorflow." +
-      "RunMetadata.FunctionGraphs\032\255\001\n\016FunctionG" +
-      "raphs\022.\n\020partition_graphs\030\001 \003(\0132\024.tensor" +
-      "flow.GraphDef\0224\n\026pre_optimization_graph\030" +
-      "\002 \001(\0132\024.tensorflow.GraphDef\0225\n\027post_opti" +
-      "mization_graph\030\003 \001(\0132\024.tensorflow.GraphD" +
-      "ef\":\n\020TensorConnection\022\023\n\013from_tensor\030\001 " +
-      "\001(\t\022\021\n\tto_tensor\030\002 \001(\t\"\260\003\n\017CallableOptio" +
-      "ns\022\014\n\004feed\030\001 \003(\t\022\r\n\005fetch\030\002 \003(\t\022\016\n\006targe" +
-      "t\030\003 \003(\t\022+\n\013run_options\030\004 \001(\0132\026.tensorflo" +
-      "w.RunOptions\0227\n\021tensor_connection\030\005 \003(\0132" +
-      "\034.tensorflow.TensorConnection\022B\n\014feed_de" +
-      "vices\030\006 \003(\0132,.tensorflow.CallableOptions" +
-      ".FeedDevicesEntry\022D\n\rfetch_devices\030\007 \003(\013" +
-      "2-.tensorflow.CallableOptions.FetchDevic" +
-      "esEntry\022\027\n\017fetch_skip_sync\030\010 \001(\010\0322\n\020Feed" +
-      "DevicesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" +
-      ":\0028\001\0323\n\021FetchDevicesEntry\022\013\n\003key\030\001 \001(\t\022\r" +
-      "\n\005value\030\002 \001(\t:\0028\001B}\n\036org.tensorflow.prot" +
-      "o.frameworkB\014ConfigProtosP\001ZHgithub.com/" +
-      "tensorflow/tensorflow/tensorflow/go/core" +
-      "/core_protos_go_proto\370\001\001b\006proto3"
+      " \001(\010\022\032\n\022enable_mlir_bridge\030\r \001(\010\022S\n\023mlir" +
+      "_bridge_rollout\030\021 \001(\01626.tensorflow.Confi" +
+      "gProto.Experimental.MlirBridgeRollout\022&\n" +
+      "\036enable_mlir_graph_optimization\030\020 \001(\010\022\'\n" +
+      "\037disable_output_partition_graphs\030\016 \001(\010\022#" +
+      "\n\033xla_fusion_autotuner_thresh\030\017 \001(\003\"{\n\021M" +
+      "lirBridgeRollout\022#\n\037MLIR_BRIDGE_ROLLOUT_" +
+      "UNSPECIFIED\020\000\022\037\n\033MLIR_BRIDGE_ROLLOUT_ENA" +
+      "BLED\020\001\022 \n\034MLIR_BRIDGE_ROLLOUT_DISABLED\020\002" +
+      "J\004\010\002\020\003\"\341\004\n\nRunOptions\0226\n\013trace_level\030\001 \001" +
+      "(\0162!.tensorflow.RunOptions.TraceLevel\022\025\n" +
+      "\rtimeout_in_ms\030\002 \001(\003\022\034\n\024inter_op_thread_" +
+      "pool\030\003 \001(\005\022\037\n\027output_partition_graphs\030\005 " +
+      "\001(\010\022/\n\rdebug_options\030\006 \001(\0132\030.tensorflow." +
+      "DebugOptions\022*\n\"report_tensor_allocation" +
+      "s_upon_oom\030\007 \001(\010\0229\n\014experimental\030\010 \001(\0132#" +
+      ".tensorflow.RunOptions.Experimental\032\322\001\n\014" +
+      "Experimental\022\034\n\024collective_graph_key\030\001 \001" +
+      "(\003\022\034\n\024use_run_handler_pool\030\002 \001(\010\022[\n\030run_" +
+      "handler_pool_options\030\003 \001(\01329.tensorflow." +
+      "RunOptions.Experimental.RunHandlerPoolOp" +
+      "tions\032)\n\025RunHandlerPoolOptions\022\020\n\010priori" +
+      "ty\030\001 \001(\003\"R\n\nTraceLevel\022\014\n\010NO_TRACE\020\000\022\022\n\016" +
+      "SOFTWARE_TRACE\020\001\022\022\n\016HARDWARE_TRACE\020\002\022\016\n\n" +
+      "FULL_TRACE\020\003J\004\010\004\020\005\"\207\003\n\013RunMetadata\022)\n\nst" +
+      "ep_stats\030\001 \001(\0132\025.tensorflow.StepStats\022,\n" +
+      "\ncost_graph\030\002 \001(\0132\030.tensorflow.CostGraph" +
+      "Def\022.\n\020partition_graphs\030\003 \003(\0132\024.tensorfl" +
+      "ow.GraphDef\022?\n\017function_graphs\030\004 \003(\0132&.t" +
+      "ensorflow.RunMetadata.FunctionGraphs\032\255\001\n" +
+      "\016FunctionGraphs\022.\n\020partition_graphs\030\001 \003(" +
+      "\0132\024.tensorflow.GraphDef\0224\n\026pre_optimizat" +
+      "ion_graph\030\002 \001(\0132\024.tensorflow.GraphDef\0225\n" +
+      "\027post_optimization_graph\030\003 \001(\0132\024.tensorf" +
+      "low.GraphDef\":\n\020TensorConnection\022\023\n\013from" +
+      "_tensor\030\001 \001(\t\022\021\n\tto_tensor\030\002 \001(\t\"\260\003\n\017Cal" +
+      "lableOptions\022\014\n\004feed\030\001 \003(\t\022\r\n\005fetch\030\002 \003(" +
+      "\t\022\016\n\006target\030\003 \003(\t\022+\n\013run_options\030\004 \001(\0132\026" +
+      ".tensorflow.RunOptions\0227\n\021tensor_connect" +
+      "ion\030\005 \003(\0132\034.tensorflow.TensorConnection\022" +
+      "B\n\014feed_devices\030\006 \003(\0132,.tensorflow.Calla" +
+      "bleOptions.FeedDevicesEntry\022D\n\rfetch_dev" +
+      "ices\030\007 \003(\0132-.tensorflow.CallableOptions." +
+      "FetchDevicesEntry\022\027\n\017fetch_skip_sync\030\010 \001" +
+      "(\010\0322\n\020FeedDevicesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" +
+      "alue\030\002 \001(\t:\0028\001\0323\n\021FetchDevicesEntry\022\013\n\003k" +
+      "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\212\001\n\036org.tens" +
+      "orflow.proto.frameworkB\014ConfigProtosP\001ZU" +
+      "github.com/tensorflow/tensorflow/tensorf" +
+      "low/go/core/protobuf/for_core_protos_go_" +
+      "proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -326,7 +332,7 @@ public static void registerAllExtensions(
     internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_tensorflow_ConfigProto_Experimental_descriptor,
-        new java.lang.String[] { "CollectiveGroupLeader", "ExecutorType", "RecvBufMaxChunk", "UseNumaAffinity", "CollectiveDeterministicSequentialExecution", "CollectiveNccl", "ShareSessionStateInClusterspecPropagation", "DisableThreadSpinning", "ShareClusterDevicesInSession", "SessionMetadata", "OptimizeForStaticGraph", "EnableMlirBridge", "EnableMlirGraphOptimization", "DisableOutputPartitionGraphs", "XlaFusionAutotunerThresh", });
+        new java.lang.String[] { "CollectiveGroupLeader", "ExecutorType", "RecvBufMaxChunk", "UseNumaAffinity", "CollectiveDeterministicSequentialExecution", "CollectiveNccl", "ShareSessionStateInClusterspecPropagation", "DisableThreadSpinning", "ShareClusterDevicesInSession", "SessionMetadata", "OptimizeForStaticGraph", "EnableMlirBridge", "MlirBridgeRollout", "EnableMlirGraphOptimization", "DisableOutputPartitionGraphs", "XlaFusionAutotunerThresh", });
     internal_static_tensorflow_RunOptions_descriptor =
       getDescriptor().getMessageTypes().get(7);
     internal_static_tensorflow_RunOptions_fieldAccessorTable = new
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java
index 97a565aa465..0177c3eae88 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java
@@ -71,10 +71,10 @@ public static void registerAllExtensions(
       "\001(\0132\025.tensorflow.ValuesDef\022\037\n\027maximum_it" +
       "erations_name\030\013 \001(\t\022:\n\017nested_contexts\030\014" +
       " \003(\0132!.tensorflow.ControlFlowContextDefB" +
-      "\202\001\n\036org.tensorflow.proto.frameworkB\021Cont" +
-      "rolFlowProtosP\001ZHgithub.com/tensorflow/t" +
-      "ensorflow/tensorflow/go/core/core_protos" +
-      "_go_proto\370\001\001b\006proto3"
+      "\217\001\n\036org.tensorflow.proto.frameworkB\021Cont" +
+      "rolFlowProtosP\001ZUgithub.com/tensorflow/t" +
+      "ensorflow/tensorflow/go/core/protobuf/fo" +
+      "r_core_protos_go_proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java
index edc853e9376..300d8a92351 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java
@@ -55,11 +55,11 @@ public static void registerAllExtensions(
       "\001(\t\022\021\n\tfile_path\030\002 \001(\t\022\025\n\rlast_modified\030" +
       "\003 \001(\003\022\r\n\005bytes\030\004 \001(\003\022\r\n\005lines\030\005 \003(\t\"K\n\023D" +
       "ebuggedSourceFiles\0224\n\014source_files\030\001 \003(\013" +
-      "2\036.tensorflow.DebuggedSourceFileB|\n\036org." +
-      "tensorflow.proto.frameworkB\013DebugProtosP" +
-      "\001ZHgithub.com/tensorflow/tensorflow/tens" +
-      "orflow/go/core/core_protos_go_proto\370\001\001b\006" +
-      "proto3"
+      "2\036.tensorflow.DebuggedSourceFileB\211\001\n\036org" +
+      ".tensorflow.proto.frameworkB\013DebugProtos" +
+      "P\001ZUgithub.com/tensorflow/tensorflow/ten" +
+      "sorflow/go/core/protobuf/for_core_protos" +
+      "_go_proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Device.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Device.java
deleted file mode 100644
index 59507a00680..00000000000
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Device.java
+++ /dev/null
@@ -1,977 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: tensorflow/core/protobuf/trace_events.proto
-
-package org.tensorflow.proto.framework;
-
-/**
- * 
- * A 'device' is a physical entity in the system and is comprised of several
- * resources.
- * 
- * - * Protobuf type {@code tensorflow.profiler.Device} - */ -public final class Device extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.Device) - DeviceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Device.newBuilder() to construct. - private Device(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Device() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Device(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Device( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - - deviceId_ = input.readUInt32(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = com.google.protobuf.MapField.newMapField( - ResourcesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - resources__ = input.readMessage( - ResourcesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - resources_.getMutableMap().put( - resources__.getKey(), resources__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetResources(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Device.class, org.tensorflow.proto.framework.Device.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The name of the device.
-   * 
- * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The name of the device.
-   * 
- * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private int deviceId_; - /** - *
-   * The id of this device, unique in a single trace.
-   * 
- * - * uint32 device_id = 2; - */ - public int getDeviceId() { - return deviceId_; - } - - public static final int RESOURCES_FIELD_NUMBER = 3; - private static final class ResourcesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, org.tensorflow.proto.framework.Resource> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_ResourcesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.Resource.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.Resource> resources_; - private com.google.protobuf.MapField - internalGetResources() { - if (resources_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ResourcesDefaultEntryHolder.defaultEntry); - } - return resources_; - } - - public int getResourcesCount() { - return internalGetResources().getMap().size(); - } - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public boolean containsResources( - int key) { - - return internalGetResources().getMap().containsKey(key); - } - /** - * Use {@link #getResourcesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getResources() { - return getResourcesMap(); - } - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public java.util.Map getResourcesMap() { - return internalGetResources().getMap(); - } - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public org.tensorflow.proto.framework.Resource getResourcesOrDefault( - int key, - org.tensorflow.proto.framework.Resource defaultValue) { - - java.util.Map map = - internalGetResources().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public org.tensorflow.proto.framework.Resource getResourcesOrThrow( - int key) { - - java.util.Map map = - internalGetResources().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (deviceId_ != 0) { - output.writeUInt32(2, deviceId_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetResources(), - ResourcesDefaultEntryHolder.defaultEntry, - 3); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (deviceId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, deviceId_); - } - for (java.util.Map.Entry entry - : internalGetResources().getMap().entrySet()) { - com.google.protobuf.MapEntry - resources__ = ResourcesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, resources__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.Device)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.Device other = (org.tensorflow.proto.framework.Device) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getDeviceId() - != other.getDeviceId()) return false; - if (!internalGetResources().equals( - other.internalGetResources())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId(); - if (!internalGetResources().getMap().isEmpty()) { - hash = (37 * hash) + RESOURCES_FIELD_NUMBER; - hash = (53 * hash) + internalGetResources().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.Device parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Device parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Device parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Device parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Device parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Device parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Device parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Device parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Device parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Device parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Device parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Device parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.framework.Device prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A 'device' is a physical entity in the system and is comprised of several
-   * resources.
-   * 
- * - * Protobuf type {@code tensorflow.profiler.Device} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.Device) - org.tensorflow.proto.framework.DeviceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetResources(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 3: - return internalGetMutableResources(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Device.class, org.tensorflow.proto.framework.Device.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.Device.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - deviceId_ = 0; - - internalGetMutableResources().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Device_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Device getDefaultInstanceForType() { - return org.tensorflow.proto.framework.Device.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.Device build() { - org.tensorflow.proto.framework.Device result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Device buildPartial() { - org.tensorflow.proto.framework.Device result = new org.tensorflow.proto.framework.Device(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.deviceId_ = deviceId_; - result.resources_ = internalGetResources(); - result.resources_.makeImmutable(); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.framework.Device) { - return mergeFrom((org.tensorflow.proto.framework.Device)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.Device other) { - if (other == org.tensorflow.proto.framework.Device.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getDeviceId() != 0) { - setDeviceId(other.getDeviceId()); - } - internalGetMutableResources().mergeFrom( - other.internalGetResources()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.framework.Device parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.Device) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * The name of the device.
-     * 
- * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The name of the device.
-     * 
- * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The name of the device.
-     * 
- * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The name of the device.
-     * 
- * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The name of the device.
-     * 
- * - * string name = 1; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int deviceId_ ; - /** - *
-     * The id of this device, unique in a single trace.
-     * 
- * - * uint32 device_id = 2; - */ - public int getDeviceId() { - return deviceId_; - } - /** - *
-     * The id of this device, unique in a single trace.
-     * 
- * - * uint32 device_id = 2; - */ - public Builder setDeviceId(int value) { - - deviceId_ = value; - onChanged(); - return this; - } - /** - *
-     * The id of this device, unique in a single trace.
-     * 
- * - * uint32 device_id = 2; - */ - public Builder clearDeviceId() { - - deviceId_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.Resource> resources_; - private com.google.protobuf.MapField - internalGetResources() { - if (resources_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ResourcesDefaultEntryHolder.defaultEntry); - } - return resources_; - } - private com.google.protobuf.MapField - internalGetMutableResources() { - onChanged();; - if (resources_ == null) { - resources_ = com.google.protobuf.MapField.newMapField( - ResourcesDefaultEntryHolder.defaultEntry); - } - if (!resources_.isMutable()) { - resources_ = resources_.copy(); - } - return resources_; - } - - public int getResourcesCount() { - return internalGetResources().getMap().size(); - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public boolean containsResources( - int key) { - - return internalGetResources().getMap().containsKey(key); - } - /** - * Use {@link #getResourcesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getResources() { - return getResourcesMap(); - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public java.util.Map getResourcesMap() { - return internalGetResources().getMap(); - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public org.tensorflow.proto.framework.Resource getResourcesOrDefault( - int key, - org.tensorflow.proto.framework.Resource defaultValue) { - - java.util.Map map = - internalGetResources().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public org.tensorflow.proto.framework.Resource getResourcesOrThrow( - int key) { - - java.util.Map map = - internalGetResources().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearResources() { - internalGetMutableResources().getMutableMap() - .clear(); - return this; - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public Builder removeResources( - int key) { - - internalGetMutableResources().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableResources() { - return internalGetMutableResources().getMutableMap(); - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - public Builder putResources( - int key, - org.tensorflow.proto.framework.Resource value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableResources().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * The resources on this device, keyed by resource_id;
-     * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - public Builder putAllResources( - java.util.Map values) { - internalGetMutableResources().getMutableMap() - .putAll(values); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.profiler.Device) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.Device) - private static final org.tensorflow.proto.framework.Device DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.Device(); - } - - public static org.tensorflow.proto.framework.Device getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Device parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Device(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Device getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceOrBuilder.java deleted file mode 100644 index 3ce193459ff..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceOrBuilder.java +++ /dev/null @@ -1,90 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -public interface DeviceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.Device) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The name of the device.
-   * 
- * - * string name = 1; - */ - java.lang.String getName(); - /** - *
-   * The name of the device.
-   * 
- * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * The id of this device, unique in a single trace.
-   * 
- * - * uint32 device_id = 2; - */ - int getDeviceId(); - - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - int getResourcesCount(); - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - boolean containsResources( - int key); - /** - * Use {@link #getResourcesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getResources(); - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - java.util.Map - getResourcesMap(); - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - org.tensorflow.proto.framework.Resource getResourcesOrDefault( - int key, - org.tensorflow.proto.framework.Resource defaultValue); - /** - *
-   * The resources on this device, keyed by resource_id;
-   * 
- * - * map<uint32, .tensorflow.profiler.Resource> resources = 3; - */ - - org.tensorflow.proto.framework.Resource getResourcesOrThrow( - int key); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesProtos.java index 7f6f979fca2..6bb89de6ab8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesProtos.java @@ -51,11 +51,11 @@ public static void registerAllExtensions( "ndwidth\030\r \001(\003\0322\n\020EnvironmentEntry\022\013\n\003key" + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"M\n\013NamedDevice" + "\022\014\n\004name\030\001 \001(\t\0220\n\nproperties\030\002 \001(\0132\034.ten" + - "sorflow.DevicePropertiesB\207\001\n\036org.tensorf" + + "sorflow.DevicePropertiesB\224\001\n\036org.tensorf" + "low.proto.frameworkB\026DevicePropertiesPro" + - "tosP\001ZHgithub.com/tensorflow/tensorflow/" + - "tensorflow/go/core/core_protos_go_proto\370" + - "\001\001b\006proto3" + "tosP\001ZUgithub.com/tensorflow/tensorflow/" + + "tensorflow/go/core/protobuf/for_core_pro" + + "tos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodesProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodesProtos.java index 9e424017f74..62a883df465 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodesProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodesProtos.java @@ -34,10 +34,11 @@ public static void registerAllExtensions( "LEMENTED\020\014\022\014\n\010INTERNAL\020\r\022\017\n\013UNAVAILABLE\020" + "\016\022\r\n\tDATA_LOSS\020\017\022K\nGDO_NOT_USE_RESERVED_" + "FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWIT" + - "CH_INSTEAD_\020\024B\201\001\n\036org.tensorflow.proto.f" + - "rameworkB\020ErrorCodesProtosP\001ZHgithub.com" + + "CH_INSTEAD_\020\024B\216\001\n\036org.tensorflow.proto.f" + + "rameworkB\020ErrorCodesProtosP\001ZUgithub.com" + "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/core_protos_go_proto\370\001\001b\006proto3" + "e/protobuf/for_core_protos_go_proto\370\001\001b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpec.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpec.java index 0feaaf41951..08549e9715c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpec.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpec.java @@ -21,6 +21,7 @@ private FunctionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) super(builder); } private FunctionSpec() { + experimentalCompile_ = 0; } @java.lang.Override @@ -84,6 +85,12 @@ private FunctionSpec( break; } + case 48: { + int rawValue = input.readEnum(); + + experimentalCompile_ = rawValue; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -116,6 +123,122 @@ private FunctionSpec( org.tensorflow.proto.framework.FunctionSpec.class, org.tensorflow.proto.framework.FunctionSpec.Builder.class); } + /** + *
+   * Whether the function should be compiled by XLA.
+   * The public interface to `tf.function` uses an optional boolean to
+   * represent three distinct states for this field.  Unfortunately, proto3
+   * removes the ability to explicitly check for the presence or absence of a
+   * field, so we instead map to an enum.
+   * See `tf.function` for details.
+   * 
+ * + * Protobuf enum {@code tensorflow.FunctionSpec.ExperimentalCompile} + */ + public enum ExperimentalCompile + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * ON = 1; + */ + ON(1), + /** + * OFF = 2; + */ + OFF(2), + UNRECOGNIZED(-1), + ; + + /** + * DEFAULT = 0; + */ + public static final int DEFAULT_VALUE = 0; + /** + * ON = 1; + */ + public static final int ON_VALUE = 1; + /** + * OFF = 2; + */ + public static final int OFF_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExperimentalCompile valueOf(int value) { + return forNumber(value); + } + + public static ExperimentalCompile forNumber(int value) { + switch (value) { + case 0: return DEFAULT; + case 1: return ON; + case 2: return OFF; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ExperimentalCompile> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExperimentalCompile findValueByNumber(int number) { + return ExperimentalCompile.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.tensorflow.proto.framework.FunctionSpec.getDescriptor().getEnumTypes().get(0); + } + + private static final ExperimentalCompile[] VALUES = values(); + + public static ExperimentalCompile valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExperimentalCompile(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.FunctionSpec.ExperimentalCompile) + } + public static final int FULLARGSPEC_FIELD_NUMBER = 1; private org.tensorflow.proto.framework.StructuredValue fullargspec_; /** @@ -195,6 +318,23 @@ public org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignature return getInputSignature(); } + public static final int EXPERIMENTAL_COMPILE_FIELD_NUMBER = 6; + private int experimentalCompile_; + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public int getExperimentalCompileValue() { + return experimentalCompile_; + } + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile result = org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.valueOf(experimentalCompile_); + return result == null ? org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -218,6 +358,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (inputSignature_ != null) { output.writeMessage(5, getInputSignature()); } + if (experimentalCompile_ != org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.DEFAULT.getNumber()) { + output.writeEnum(6, experimentalCompile_); + } unknownFields.writeTo(output); } @@ -239,6 +382,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getInputSignature()); } + if (experimentalCompile_ != org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, experimentalCompile_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -266,6 +413,7 @@ public boolean equals(final java.lang.Object obj) { if (!getInputSignature() .equals(other.getInputSignature())) return false; } + if (experimentalCompile_ != other.experimentalCompile_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -288,6 +436,8 @@ public int hashCode() { hash = (37 * hash) + INPUT_SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getInputSignature().hashCode(); } + hash = (37 * hash) + EXPERIMENTAL_COMPILE_FIELD_NUMBER; + hash = (53 * hash) + experimentalCompile_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -440,6 +590,8 @@ public Builder clear() { inputSignature_ = null; inputSignatureBuilder_ = null; } + experimentalCompile_ = 0; + return this; } @@ -477,6 +629,7 @@ public org.tensorflow.proto.framework.FunctionSpec buildPartial() { } else { result.inputSignature_ = inputSignatureBuilder_.build(); } + result.experimentalCompile_ = experimentalCompile_; onBuilt(); return result; } @@ -534,6 +687,9 @@ public Builder mergeFrom(org.tensorflow.proto.framework.FunctionSpec other) { if (other.hasInputSignature()) { mergeInputSignature(other.getInputSignature()); } + if (other.experimentalCompile_ != 0) { + setExperimentalCompileValue(other.getExperimentalCompileValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -906,6 +1062,51 @@ public org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignature } return inputSignatureBuilder_; } + + private int experimentalCompile_ = 0; + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public int getExperimentalCompileValue() { + return experimentalCompile_; + } + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public Builder setExperimentalCompileValue(int value) { + experimentalCompile_ = value; + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile result = org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.valueOf(experimentalCompile_); + return result == null ? org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.UNRECOGNIZED : result; + } + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public Builder setExperimentalCompile(org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile value) { + if (value == null) { + throw new NullPointerException(); + } + + experimentalCompile_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + public Builder clearExperimentalCompile() { + + experimentalCompile_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpecOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpecOrBuilder.java index 8c200ad6323..09ebc013bdc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpecOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpecOrBuilder.java @@ -65,4 +65,13 @@ public interface FunctionSpecOrBuilder extends * .tensorflow.StructuredValue input_signature = 5; */ org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignatureOrBuilder(); + + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + int getExperimentalCompileValue(); + /** + * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; + */ + org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoProtos.java index c206eb2d9cf..109ab5e8322 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoProtos.java @@ -53,10 +53,11 @@ public static void registerAllExtensions( "&.tensorflow.GraphDebugInfo.FileLineCol\032" + "T\n\013TracesEntry\022\013\n\003key\030\001 \001(\t\0224\n\005value\030\002 \001" + "(\0132%.tensorflow.GraphDebugInfo.StackTrac" + - "e:\0028\001B\205\001\n\036org.tensorflow.proto.framework" + - "B\024GraphDebugInfoProtosP\001ZHgithub.com/ten" + - "sorflow/tensorflow/tensorflow/go/core/co" + - "re_protos_go_proto\370\001\001b\006proto3" + "e:\0028\001B\222\001\n\036org.tensorflow.proto.framework" + + "B\024GraphDebugInfoProtosP\001ZUgithub.com/ten" + + "sorflow/tensorflow/tensorflow/go/core/pr" + + "otobuf/for_core_protos_go_proto\370\001\001b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphProtos.java index cd79fd2f986..ceaa684bfbb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphProtos.java @@ -178,11 +178,11 @@ public static void registerAllExtensions( "8\001\032F\n\014OutputsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value" + "\030\002 \001(\0132\026.tensorflow.TensorInfo:\0028\001\"M\n\014As" + "setFileDef\022+\n\013tensor_info\030\001 \001(\0132\026.tensor" + - "flow.TensorInfo\022\020\n\010filename\030\002 \001(\tB\200\001\n\036or" + + "flow.TensorInfo\022\020\n\010filename\030\002 \001(\tB\215\001\n\036or" + "g.tensorflow.proto.frameworkB\017MetaGraphP" + - "rotosP\001ZHgithub.com/tensorflow/tensorflo" + - "w/tensorflow/go/core/core_protos_go_prot" + - "o\370\001\001b\006proto3" + "rotosP\001ZUgithub.com/tensorflow/tensorflo" + + "w/tensorflow/go/core/protobuf/for_core_p" + + "rotos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtos.java index 98685b73c33..1edec7d7488 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtos.java @@ -32,10 +32,11 @@ public static void registerAllExtensions( "proto\022\ntensorflow\032&tensorflow/core/frame" + "work/tensor.proto\"I\n\020NamedTensorProto\022\014\n" + "\004name\030\001 \001(\t\022\'\n\006tensor\030\002 \001(\0132\027.tensorflow" + - ".TensorProtoB\202\001\n\036org.tensorflow.proto.fr" + - "ameworkB\021NamedTensorProtosP\001ZHgithub.com" + + ".TensorProtoB\217\001\n\036org.tensorflow.proto.fr" + + "ameworkB\021NamedTensorProtosP\001ZUgithub.com" + "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/core_protos_go_proto\370\001\001b\006proto3" + "e/protobuf/for_core_protos_go_proto\370\001\001b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerProtos.java index 37a45c16673..bebb320cc0f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerProtos.java @@ -34,11 +34,11 @@ public static void registerAllExtensions( "\022\022\n\nqueue_name\030\001 \001(\t\022\027\n\017enqueue_op_name\030" + "\002 \003(\t\022\025\n\rclose_op_name\030\003 \001(\t\022\026\n\016cancel_o" + "p_name\030\004 \001(\t\022<\n\034queue_closed_exception_t" + - "ypes\030\005 \003(\0162\026.tensorflow.error.CodeB\202\001\n\036o" + + "ypes\030\005 \003(\0162\026.tensorflow.error.CodeB\217\001\n\036o" + "rg.tensorflow.proto.frameworkB\021QueueRunn" + - "erProtosP\001ZHgithub.com/tensorflow/tensor" + - "flow/tensorflow/go/core/core_protos_go_p" + - "roto\370\001\001b\006proto3" + "erProtosP\001ZUgithub.com/tensorflow/tensor" + + "flow/tensorflow/go/core/protobuf/for_cor" + + "e_protos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleProtos.java index 82e7ea5bc2c..71335e14bde 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleProtos.java @@ -44,11 +44,11 @@ public static void registerAllExtensions( "\005\022\016\n\006device\030\003 \001(\t\022\021\n\top_device\030\004 \001(\t\022#\n\005" + "dtype\030\005 \001(\0162\024.tensorflow.DataType\022K\n\032res" + "ource_dtypes_and_shapes\030\006 \003(\0132\'.tensorfl" + - "ow.eager.ResourceDtypeAndShapeB\211\001\n\036org.t" + + "ow.eager.ResourceDtypeAndShapeB\226\001\n\036org.t" + "ensorflow.proto.frameworkB\030RemoteTensorH" + - "andleProtosP\001ZHgithub.com/tensorflow/ten" + - "sorflow/tensorflow/go/core/core_protos_g" + - "o_proto\370\001\001b\006proto3" + "andleProtosP\001ZUgithub.com/tensorflow/ten" + + "sorflow/tensorflow/go/core/protobuf/for_" + + "core_protos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Resource.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Resource.java deleted file mode 100644 index 7743aecf24e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Resource.java +++ /dev/null @@ -1,659 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -/** - *
- * A 'resource' generally is a specific computation component on a device. These
- * can range from threads on CPUs to specific arithmetic units on hardware
- * devices.
- * 
- * - * Protobuf type {@code tensorflow.profiler.Resource} - */ -public final class Resource extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.Resource) - ResourceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Resource.newBuilder() to construct. - private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Resource() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Resource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Resource( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - - resourceId_ = input.readUInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Resource.class, org.tensorflow.proto.framework.Resource.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The name of the resource.
-   * 
- * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The name of the resource.
-   * 
- * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCE_ID_FIELD_NUMBER = 2; - private int resourceId_; - /** - *
-   * The id of the resource. Unique within a device.
-   * 
- * - * uint32 resource_id = 2; - */ - public int getResourceId() { - return resourceId_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (resourceId_ != 0) { - output.writeUInt32(2, resourceId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (resourceId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, resourceId_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.Resource)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.Resource other = (org.tensorflow.proto.framework.Resource) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getResourceId() - != other.getResourceId()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER; - hash = (53 * hash) + getResourceId(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.Resource parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Resource parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Resource parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Resource parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Resource parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Resource parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.framework.Resource prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A 'resource' generally is a specific computation component on a device. These
-   * can range from threads on CPUs to specific arithmetic units on hardware
-   * devices.
-   * 
- * - * Protobuf type {@code tensorflow.profiler.Resource} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.Resource) - org.tensorflow.proto.framework.ResourceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Resource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Resource.class, org.tensorflow.proto.framework.Resource.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.Resource.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - resourceId_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Resource_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Resource getDefaultInstanceForType() { - return org.tensorflow.proto.framework.Resource.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.Resource build() { - org.tensorflow.proto.framework.Resource result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Resource buildPartial() { - org.tensorflow.proto.framework.Resource result = new org.tensorflow.proto.framework.Resource(this); - result.name_ = name_; - result.resourceId_ = resourceId_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.framework.Resource) { - return mergeFrom((org.tensorflow.proto.framework.Resource)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.Resource other) { - if (other == org.tensorflow.proto.framework.Resource.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getResourceId() != 0) { - setResourceId(other.getResourceId()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.framework.Resource parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.Resource) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * The name of the resource.
-     * 
- * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The name of the resource.
-     * 
- * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The name of the resource.
-     * 
- * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The name of the resource.
-     * 
- * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The name of the resource.
-     * 
- * - * string name = 1; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int resourceId_ ; - /** - *
-     * The id of the resource. Unique within a device.
-     * 
- * - * uint32 resource_id = 2; - */ - public int getResourceId() { - return resourceId_; - } - /** - *
-     * The id of the resource. Unique within a device.
-     * 
- * - * uint32 resource_id = 2; - */ - public Builder setResourceId(int value) { - - resourceId_ = value; - onChanged(); - return this; - } - /** - *
-     * The id of the resource. Unique within a device.
-     * 
- * - * uint32 resource_id = 2; - */ - public Builder clearResourceId() { - - resourceId_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.profiler.Resource) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.Resource) - private static final org.tensorflow.proto.framework.Resource DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.Resource(); - } - - public static org.tensorflow.proto.framework.Resource getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Resource parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Resource(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Resource getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceOrBuilder.java deleted file mode 100644 index f6bc0c0d190..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -public interface ResourceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.Resource) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The name of the resource.
-   * 
- * - * string name = 1; - */ - java.lang.String getName(); - /** - *
-   * The name of the resource.
-   * 
- * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * The id of the resource. Unique within a device.
-   * 
- * - * uint32 resource_id = 2; - */ - int getResourceId(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java index fe1571856ee..9665f55231c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java @@ -21,6 +21,7 @@ private RewriterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder super(builder); } private RewriterConfig() { + cpuLayoutConversion_ = 0; layoutOptimizer_ = 0; constantFolding_ = 0; shapeOptimization_ = 0; @@ -233,6 +234,17 @@ private RewriterConfig( autoMixedPrecisionMkl_ = rawValue; break; } + case 208: { + + experimentalDisableCompressedTensorOptimization_ = input.readBool(); + break; + } + case 400: { + int rawValue = input.readEnum(); + + cpuLayoutConversion_ = rawValue; + break; + } case 802: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { @@ -443,6 +455,117 @@ private Toggle(int value) { // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.Toggle) } + /** + *
+   * Enum for layout conversion between NCHW and NHWC on CPU. Default is OFF.
+   * 
+ * + * Protobuf enum {@code tensorflow.RewriterConfig.CpuLayout} + */ + public enum CpuLayout + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NO_CONVERSION_ON_CPU = 0; + */ + NO_CONVERSION_ON_CPU(0), + /** + * NCHW_TO_NHWC = 1; + */ + NCHW_TO_NHWC(1), + /** + * NHWC_TO_NCHW = 2; + */ + NHWC_TO_NCHW(2), + UNRECOGNIZED(-1), + ; + + /** + * NO_CONVERSION_ON_CPU = 0; + */ + public static final int NO_CONVERSION_ON_CPU_VALUE = 0; + /** + * NCHW_TO_NHWC = 1; + */ + public static final int NCHW_TO_NHWC_VALUE = 1; + /** + * NHWC_TO_NCHW = 2; + */ + public static final int NHWC_TO_NCHW_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CpuLayout valueOf(int value) { + return forNumber(value); + } + + public static CpuLayout forNumber(int value) { + switch (value) { + case 0: return NO_CONVERSION_ON_CPU; + case 1: return NCHW_TO_NHWC; + case 2: return NHWC_TO_NCHW; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CpuLayout> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CpuLayout findValueByNumber(int number) { + return CpuLayout.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.tensorflow.proto.framework.RewriterConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final CpuLayout[] VALUES = values(); + + public static CpuLayout valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CpuLayout(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.CpuLayout) + } + /** *
    * Enum controlling the number of times to run optimizers. The default is to
@@ -529,7 +652,7 @@ public NumIterationsType findValueByNumber(int number) {
     }
     public static final com.google.protobuf.Descriptors.EnumDescriptor
         getDescriptor() {
-      return org.tensorflow.proto.framework.RewriterConfig.getDescriptor().getEnumTypes().get(1);
+      return org.tensorflow.proto.framework.RewriterConfig.getDescriptor().getEnumTypes().get(2);
     }
 
     private static final NumIterationsType[] VALUES = values();
@@ -734,7 +857,7 @@ public MemOptType findValueByNumber(int number) {
     }
     public static final com.google.protobuf.Descriptors.EnumDescriptor
         getDescriptor() {
-      return org.tensorflow.proto.framework.RewriterConfig.getDescriptor().getEnumTypes().get(2);
+      return org.tensorflow.proto.framework.RewriterConfig.getDescriptor().getEnumTypes().get(3);
     }
 
     private static final MemOptType[] VALUES = values();
@@ -1633,6 +1756,31 @@ public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getDef
 
   }
 
+  public static final int CPU_LAYOUT_CONVERSION_FIELD_NUMBER = 50;
+  private int cpuLayoutConversion_;
+  /**
+   * 
+   * CPU Conversion settings between NHCW and NCHW.
+   * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public int getCpuLayoutConversionValue() { + return cpuLayoutConversion_; + } + /** + *
+   * CPU Conversion settings between NHCW and NCHW.
+   * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public org.tensorflow.proto.framework.RewriterConfig.CpuLayout getCpuLayoutConversion() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.RewriterConfig.CpuLayout result = org.tensorflow.proto.framework.RewriterConfig.CpuLayout.valueOf(cpuLayoutConversion_); + return result == null ? org.tensorflow.proto.framework.RewriterConfig.CpuLayout.UNRECOGNIZED : result; + } + public static final int LAYOUT_OPTIMIZER_FIELD_NUMBER = 1; private int layoutOptimizer_; /** @@ -2107,6 +2255,20 @@ public int getMinGraphNodes() { return minGraphNodes_; } + public static final int EXPERIMENTAL_DISABLE_COMPRESSED_TENSOR_OPTIMIZATION_FIELD_NUMBER = 26; + private boolean experimentalDisableCompressedTensorOptimization_; + /** + *
+   * Disable optimizations that assume compressed tensors. Note that this flag
+   * is experimental and may be removed in the future.
+   * 
+ * + * bool experimental_disable_compressed_tensor_optimization = 26; + */ + public boolean getExperimentalDisableCompressedTensorOptimization() { + return experimentalDisableCompressedTensorOptimization_; + } + public static final int MEMORY_OPTIMIZATION_FIELD_NUMBER = 4; private int memoryOptimization_; /** @@ -2573,6 +2735,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (autoMixedPrecisionMkl_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { output.writeEnum(25, autoMixedPrecisionMkl_); } + if (experimentalDisableCompressedTensorOptimization_ != false) { + output.writeBool(26, experimentalDisableCompressedTensorOptimization_); + } + if (cpuLayoutConversion_ != org.tensorflow.proto.framework.RewriterConfig.CpuLayout.NO_CONVERSION_ON_CPU.getNumber()) { + output.writeEnum(50, cpuLayoutConversion_); + } for (int i = 0; i < optimizers_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 100, optimizers_.getRaw(i)); } @@ -2693,6 +2861,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeEnumSize(25, autoMixedPrecisionMkl_); } + if (experimentalDisableCompressedTensorOptimization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(26, experimentalDisableCompressedTensorOptimization_); + } + if (cpuLayoutConversion_ != org.tensorflow.proto.framework.RewriterConfig.CpuLayout.NO_CONVERSION_ON_CPU.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(50, cpuLayoutConversion_); + } { int dataSize = 0; for (int i = 0; i < optimizers_.size(); i++) { @@ -2728,6 +2904,7 @@ public boolean equals(final java.lang.Object obj) { } org.tensorflow.proto.framework.RewriterConfig other = (org.tensorflow.proto.framework.RewriterConfig) obj; + if (cpuLayoutConversion_ != other.cpuLayoutConversion_) return false; if (layoutOptimizer_ != other.layoutOptimizer_) return false; if (constantFolding_ != other.constantFolding_) return false; if (shapeOptimization_ != other.shapeOptimization_) return false; @@ -2750,6 +2927,8 @@ public boolean equals(final java.lang.Object obj) { if (metaOptimizerIterations_ != other.metaOptimizerIterations_) return false; if (getMinGraphNodes() != other.getMinGraphNodes()) return false; + if (getExperimentalDisableCompressedTensorOptimization() + != other.getExperimentalDisableCompressedTensorOptimization()) return false; if (memoryOptimization_ != other.memoryOptimization_) return false; if (!getMemoryOptimizerTargetNodeNameScope() .equals(other.getMemoryOptimizerTargetNodeNameScope())) return false; @@ -2792,6 +2971,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPU_LAYOUT_CONVERSION_FIELD_NUMBER; + hash = (53 * hash) + cpuLayoutConversion_; hash = (37 * hash) + LAYOUT_OPTIMIZER_FIELD_NUMBER; hash = (53 * hash) + layoutOptimizer_; hash = (37 * hash) + CONSTANT_FOLDING_FIELD_NUMBER; @@ -2832,6 +3013,9 @@ public int hashCode() { hash = (53 * hash) + metaOptimizerIterations_; hash = (37 * hash) + MIN_GRAPH_NODES_FIELD_NUMBER; hash = (53 * hash) + getMinGraphNodes(); + hash = (37 * hash) + EXPERIMENTAL_DISABLE_COMPRESSED_TENSOR_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getExperimentalDisableCompressedTensorOptimization()); hash = (37 * hash) + MEMORY_OPTIMIZATION_FIELD_NUMBER; hash = (53 * hash) + memoryOptimization_; hash = (37 * hash) + MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER; @@ -3005,6 +3189,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + cpuLayoutConversion_ = 0; + layoutOptimizer_ = 0; constantFolding_ = 0; @@ -3043,6 +3229,8 @@ public Builder clear() { minGraphNodes_ = 0; + experimentalDisableCompressedTensorOptimization_ = false; + memoryOptimization_ = 0; memoryOptimizerTargetNodeNameScope_ = ""; @@ -3110,6 +3298,7 @@ public org.tensorflow.proto.framework.RewriterConfig build() { public org.tensorflow.proto.framework.RewriterConfig buildPartial() { org.tensorflow.proto.framework.RewriterConfig result = new org.tensorflow.proto.framework.RewriterConfig(this); int from_bitField0_ = bitField0_; + result.cpuLayoutConversion_ = cpuLayoutConversion_; result.layoutOptimizer_ = layoutOptimizer_; result.constantFolding_ = constantFolding_; result.shapeOptimization_ = shapeOptimization_; @@ -3129,6 +3318,7 @@ public org.tensorflow.proto.framework.RewriterConfig buildPartial() { result.disableMetaOptimizer_ = disableMetaOptimizer_; result.metaOptimizerIterations_ = metaOptimizerIterations_; result.minGraphNodes_ = minGraphNodes_; + result.experimentalDisableCompressedTensorOptimization_ = experimentalDisableCompressedTensorOptimization_; result.memoryOptimization_ = memoryOptimization_; result.memoryOptimizerTargetNodeNameScope_ = memoryOptimizerTargetNodeNameScope_; result.metaOptimizerTimeoutMs_ = metaOptimizerTimeoutMs_; @@ -3215,6 +3405,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(org.tensorflow.proto.framework.RewriterConfig other) { if (other == org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance()) return this; + if (other.cpuLayoutConversion_ != 0) { + setCpuLayoutConversionValue(other.getCpuLayoutConversionValue()); + } if (other.layoutOptimizer_ != 0) { setLayoutOptimizerValue(other.getLayoutOptimizerValue()); } @@ -3272,6 +3465,9 @@ public Builder mergeFrom(org.tensorflow.proto.framework.RewriterConfig other) { if (other.getMinGraphNodes() != 0) { setMinGraphNodes(other.getMinGraphNodes()); } + if (other.getExperimentalDisableCompressedTensorOptimization() != false) { + setExperimentalDisableCompressedTensorOptimization(other.getExperimentalDisableCompressedTensorOptimization()); + } if (other.memoryOptimization_ != 0) { setMemoryOptimizationValue(other.getMemoryOptimizationValue()); } @@ -3363,6 +3559,71 @@ public Builder mergeFrom( } private int bitField0_; + private int cpuLayoutConversion_ = 0; + /** + *
+     * CPU Conversion settings between NHCW and NCHW.
+     * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public int getCpuLayoutConversionValue() { + return cpuLayoutConversion_; + } + /** + *
+     * CPU Conversion settings between NHCW and NCHW.
+     * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public Builder setCpuLayoutConversionValue(int value) { + cpuLayoutConversion_ = value; + onChanged(); + return this; + } + /** + *
+     * CPU Conversion settings between NHCW and NCHW.
+     * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public org.tensorflow.proto.framework.RewriterConfig.CpuLayout getCpuLayoutConversion() { + @SuppressWarnings("deprecation") + org.tensorflow.proto.framework.RewriterConfig.CpuLayout result = org.tensorflow.proto.framework.RewriterConfig.CpuLayout.valueOf(cpuLayoutConversion_); + return result == null ? org.tensorflow.proto.framework.RewriterConfig.CpuLayout.UNRECOGNIZED : result; + } + /** + *
+     * CPU Conversion settings between NHCW and NCHW.
+     * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public Builder setCpuLayoutConversion(org.tensorflow.proto.framework.RewriterConfig.CpuLayout value) { + if (value == null) { + throw new NullPointerException(); + } + + cpuLayoutConversion_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * CPU Conversion settings between NHCW and NCHW.
+     * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + public Builder clearCpuLayoutConversion() { + + cpuLayoutConversion_ = 0; + onChanged(); + return this; + } + private int layoutOptimizer_ = 0; /** *
@@ -4606,6 +4867,47 @@ public Builder clearMinGraphNodes() {
       return this;
     }
 
+    private boolean experimentalDisableCompressedTensorOptimization_ ;
+    /**
+     * 
+     * Disable optimizations that assume compressed tensors. Note that this flag
+     * is experimental and may be removed in the future.
+     * 
+ * + * bool experimental_disable_compressed_tensor_optimization = 26; + */ + public boolean getExperimentalDisableCompressedTensorOptimization() { + return experimentalDisableCompressedTensorOptimization_; + } + /** + *
+     * Disable optimizations that assume compressed tensors. Note that this flag
+     * is experimental and may be removed in the future.
+     * 
+ * + * bool experimental_disable_compressed_tensor_optimization = 26; + */ + public Builder setExperimentalDisableCompressedTensorOptimization(boolean value) { + + experimentalDisableCompressedTensorOptimization_ = value; + onChanged(); + return this; + } + /** + *
+     * Disable optimizations that assume compressed tensors. Note that this flag
+     * is experimental and may be removed in the future.
+     * 
+ * + * bool experimental_disable_compressed_tensor_optimization = 26; + */ + public Builder clearExperimentalDisableCompressedTensorOptimization() { + + experimentalDisableCompressedTensorOptimization_ = false; + onChanged(); + return this; + } + private int memoryOptimization_ = 0; /** *
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java
index a8a1c6f1ed0..baad17a9738 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java
@@ -7,6 +7,23 @@ public interface RewriterConfigOrBuilder extends
     // @@protoc_insertion_point(interface_extends:tensorflow.RewriterConfig)
     com.google.protobuf.MessageOrBuilder {
 
+  /**
+   * 
+   * CPU Conversion settings between NHCW and NCHW.
+   * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + int getCpuLayoutConversionValue(); + /** + *
+   * CPU Conversion settings between NHCW and NCHW.
+   * 
+ * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + */ + org.tensorflow.proto.framework.RewriterConfig.CpuLayout getCpuLayoutConversion(); + /** *
    * Optimize tensor layouts (default is ON)
@@ -341,6 +358,16 @@ public interface RewriterConfigOrBuilder extends
    */
   int getMinGraphNodes();
 
+  /**
+   * 
+   * Disable optimizations that assume compressed tensors. Note that this flag
+   * is experimental and may be removed in the future.
+   * 
+ * + * bool experimental_disable_compressed_tensor_optimization = 26; + */ + boolean getExperimentalDisableCompressedTensorOptimization(); + /** *
    * Configures memory optimization passes through the meta-optimizer. Has no
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java
index 01debd9ea7f..fd75fc78d94 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java
@@ -54,66 +54,71 @@ public static void registerAllExtensions(
       "e/protobuf/verifier_config.proto\";\n\023Auto" +
       "ParallelOptions\022\016\n\006enable\030\001 \001(\010\022\024\n\014num_r" +
       "eplicas\030\002 \001(\005\"+\n\026ScopedAllocatorOptions\022" +
-      "\021\n\tenable_op\030\001 \003(\t\"\225\021\n\016RewriterConfig\022;\n" +
-      "\020layout_optimizer\030\001 \001(\0162!.tensorflow.Rew" +
-      "riterConfig.Toggle\022;\n\020constant_folding\030\003" +
-      " \001(\0162!.tensorflow.RewriterConfig.Toggle\022" +
-      "=\n\022shape_optimization\030\r \001(\0162!.tensorflow" +
-      ".RewriterConfig.Toggle\0224\n\tremapping\030\016 \001(" +
-      "\0162!.tensorflow.RewriterConfig.Toggle\022F\n\033" +
-      "common_subgraph_elimination\030\030 \001(\0162!.tens" +
-      "orflow.RewriterConfig.Toggle\022B\n\027arithmet" +
-      "ic_optimization\030\007 \001(\0162!.tensorflow.Rewri" +
-      "terConfig.Toggle\022B\n\027dependency_optimizat" +
-      "ion\030\010 \001(\0162!.tensorflow.RewriterConfig.To" +
-      "ggle\022<\n\021loop_optimization\030\t \001(\0162!.tensor" +
-      "flow.RewriterConfig.Toggle\022@\n\025function_o" +
-      "ptimization\030\n \001(\0162!.tensorflow.RewriterC" +
-      "onfig.Toggle\0229\n\016debug_stripper\030\013 \001(\0162!.t" +
-      "ensorflow.RewriterConfig.Toggle\022\035\n\025disab" +
-      "le_model_pruning\030\002 \001(\010\022H\n\035scoped_allocat" +
-      "or_optimization\030\017 \001(\0162!.tensorflow.Rewri" +
-      "terConfig.Toggle\022C\n\030pin_to_host_optimiza" +
-      "tion\030\022 \001(\0162!.tensorflow.RewriterConfig.T" +
-      "oggle\022B\n\027implementation_selector\030\026 \001(\0162!" +
-      ".tensorflow.RewriterConfig.Toggle\022?\n\024aut" +
-      "o_mixed_precision\030\027 \001(\0162!.tensorflow.Rew" +
-      "riterConfig.Toggle\022C\n\030auto_mixed_precisi" +
-      "on_mkl\030\031 \001(\0162!.tensorflow.RewriterConfig" +
-      ".Toggle\022\036\n\026disable_meta_optimizer\030\023 \001(\010\022" +
-      "O\n\031meta_optimizer_iterations\030\014 \001(\0162,.ten" +
-      "sorflow.RewriterConfig.NumIterationsType" +
-      "\022\027\n\017min_graph_nodes\030\021 \001(\005\022B\n\023memory_opti" +
-      "mization\030\004 \001(\0162%.tensorflow.RewriterConf" +
-      "ig.MemOptType\022/\n\'memory_optimizer_target" +
-      "_node_name_scope\030\006 \001(\t\022!\n\031meta_optimizer" +
-      "_timeout_ms\030\024 \001(\003\0226\n\rauto_parallel\030\005 \001(\013" +
-      "2\037.tensorflow.AutoParallelOptions\022 \n\030fai" +
-      "l_on_optimizer_errors\030\025 \001(\010\022A\n\025scoped_al" +
-      "locator_opts\030\020 \001(\0132\".tensorflow.ScopedAl" +
-      "locatorOptions\022\022\n\noptimizers\030d \003(\t\022K\n\021cu" +
-      "stom_optimizers\030\310\001 \003(\0132/.tensorflow.Rewr" +
-      "iterConfig.CustomGraphOptimizer\022D\n\037inter" +
-      "_optimizer_verifier_config\030\254\002 \001(\0132\032.tens" +
-      "orflow.VerifierConfig\022F\n!post_optimizati" +
-      "on_verifier_config\030\255\002 \001(\0132\032.tensorflow.V" +
-      "erifierConfig\032\312\001\n\024CustomGraphOptimizer\022\014" +
-      "\n\004name\030\001 \001(\t\022X\n\rparameter_map\030\002 \003(\0132A.te" +
-      "nsorflow.RewriterConfig.CustomGraphOptim" +
-      "izer.ParameterMapEntry\032J\n\021ParameterMapEn" +
-      "try\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensor" +
-      "flow.AttrValue:\0028\001\"6\n\006Toggle\022\013\n\007DEFAULT\020" +
-      "\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002\022\016\n\nAGGRESSIVE\020\003\"<\n\021Nu" +
-      "mIterationsType\022\025\n\021DEFAULT_NUM_ITERS\020\000\022\007" +
-      "\n\003ONE\020\001\022\007\n\003TWO\020\002\"\237\001\n\nMemOptType\022\023\n\017DEFAU" +
-      "LT_MEM_OPT\020\000\022\016\n\nNO_MEM_OPT\020\001\022\n\n\006MANUAL\020\002" +
-      "\022\027\n\023SWAPPING_HEURISTICS\020\004\022\034\n\030RECOMPUTATI" +
-      "ON_HEURISTICS\020\005\022\031\n\025SCHEDULING_HEURISTICS" +
-      "\020\006\022\016\n\nHEURISTICS\020\003B\205\001\n\036org.tensorflow.pr" +
-      "oto.frameworkB\024RewriterConfigProtosP\001ZHg" +
-      "ithub.com/tensorflow/tensorflow/tensorfl" +
-      "ow/go/core/core_protos_go_proto\370\001\001b\006prot" +
-      "o3"
+      "\021\n\tenable_op\030\001 \003(\t\"\342\022\n\016RewriterConfig\022C\n" +
+      "\025cpu_layout_conversion\0302 \001(\0162$.tensorflo" +
+      "w.RewriterConfig.CpuLayout\022;\n\020layout_opt" +
+      "imizer\030\001 \001(\0162!.tensorflow.RewriterConfig" +
+      ".Toggle\022;\n\020constant_folding\030\003 \001(\0162!.tens" +
+      "orflow.RewriterConfig.Toggle\022=\n\022shape_op" +
+      "timization\030\r \001(\0162!.tensorflow.RewriterCo" +
+      "nfig.Toggle\0224\n\tremapping\030\016 \001(\0162!.tensorf" +
+      "low.RewriterConfig.Toggle\022F\n\033common_subg" +
+      "raph_elimination\030\030 \001(\0162!.tensorflow.Rewr" +
+      "iterConfig.Toggle\022B\n\027arithmetic_optimiza" +
+      "tion\030\007 \001(\0162!.tensorflow.RewriterConfig.T" +
+      "oggle\022B\n\027dependency_optimization\030\010 \001(\0162!" +
+      ".tensorflow.RewriterConfig.Toggle\022<\n\021loo" +
+      "p_optimization\030\t \001(\0162!.tensorflow.Rewrit" +
+      "erConfig.Toggle\022@\n\025function_optimization" +
+      "\030\n \001(\0162!.tensorflow.RewriterConfig.Toggl" +
+      "e\0229\n\016debug_stripper\030\013 \001(\0162!.tensorflow.R" +
+      "ewriterConfig.Toggle\022\035\n\025disable_model_pr" +
+      "uning\030\002 \001(\010\022H\n\035scoped_allocator_optimiza" +
+      "tion\030\017 \001(\0162!.tensorflow.RewriterConfig.T" +
+      "oggle\022C\n\030pin_to_host_optimization\030\022 \001(\0162" +
+      "!.tensorflow.RewriterConfig.Toggle\022B\n\027im" +
+      "plementation_selector\030\026 \001(\0162!.tensorflow" +
+      ".RewriterConfig.Toggle\022?\n\024auto_mixed_pre" +
+      "cision\030\027 \001(\0162!.tensorflow.RewriterConfig" +
+      ".Toggle\022C\n\030auto_mixed_precision_mkl\030\031 \001(" +
+      "\0162!.tensorflow.RewriterConfig.Toggle\022\036\n\026" +
+      "disable_meta_optimizer\030\023 \001(\010\022O\n\031meta_opt" +
+      "imizer_iterations\030\014 \001(\0162,.tensorflow.Rew" +
+      "riterConfig.NumIterationsType\022\027\n\017min_gra" +
+      "ph_nodes\030\021 \001(\005\022;\n3experimental_disable_c" +
+      "ompressed_tensor_optimization\030\032 \001(\010\022B\n\023m" +
+      "emory_optimization\030\004 \001(\0162%.tensorflow.Re" +
+      "writerConfig.MemOptType\022/\n\'memory_optimi" +
+      "zer_target_node_name_scope\030\006 \001(\t\022!\n\031meta" +
+      "_optimizer_timeout_ms\030\024 \001(\003\0226\n\rauto_para" +
+      "llel\030\005 \001(\0132\037.tensorflow.AutoParallelOpti" +
+      "ons\022 \n\030fail_on_optimizer_errors\030\025 \001(\010\022A\n" +
+      "\025scoped_allocator_opts\030\020 \001(\0132\".tensorflo" +
+      "w.ScopedAllocatorOptions\022\022\n\noptimizers\030d" +
+      " \003(\t\022K\n\021custom_optimizers\030\310\001 \003(\0132/.tenso" +
+      "rflow.RewriterConfig.CustomGraphOptimize" +
+      "r\022D\n\037inter_optimizer_verifier_config\030\254\002 " +
+      "\001(\0132\032.tensorflow.VerifierConfig\022F\n!post_" +
+      "optimization_verifier_config\030\255\002 \001(\0132\032.te" +
+      "nsorflow.VerifierConfig\032\312\001\n\024CustomGraphO" +
+      "ptimizer\022\014\n\004name\030\001 \001(\t\022X\n\rparameter_map\030" +
+      "\002 \003(\0132A.tensorflow.RewriterConfig.Custom" +
+      "GraphOptimizer.ParameterMapEntry\032J\n\021Para" +
+      "meterMapEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(" +
+      "\0132\025.tensorflow.AttrValue:\0028\001\"6\n\006Toggle\022\013" +
+      "\n\007DEFAULT\020\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002\022\016\n\nAGGRESSI" +
+      "VE\020\003\"I\n\tCpuLayout\022\030\n\024NO_CONVERSION_ON_CP" +
+      "U\020\000\022\020\n\014NCHW_TO_NHWC\020\001\022\020\n\014NHWC_TO_NCHW\020\002\"" +
+      "<\n\021NumIterationsType\022\025\n\021DEFAULT_NUM_ITER" +
+      "S\020\000\022\007\n\003ONE\020\001\022\007\n\003TWO\020\002\"\237\001\n\nMemOptType\022\023\n\017" +
+      "DEFAULT_MEM_OPT\020\000\022\016\n\nNO_MEM_OPT\020\001\022\n\n\006MAN" +
+      "UAL\020\002\022\027\n\023SWAPPING_HEURISTICS\020\004\022\034\n\030RECOMP" +
+      "UTATION_HEURISTICS\020\005\022\031\n\025SCHEDULING_HEURI" +
+      "STICS\020\006\022\016\n\nHEURISTICS\020\003B\222\001\n\036org.tensorfl" +
+      "ow.proto.frameworkB\024RewriterConfigProtos" +
+      "P\001ZUgithub.com/tensorflow/tensorflow/ten" +
+      "sorflow/go/core/protobuf/for_core_protos" +
+      "_go_proto\370\001\001b\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -138,7 +143,7 @@ public static void registerAllExtensions(
     internal_static_tensorflow_RewriterConfig_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_tensorflow_RewriterConfig_descriptor,
-        new java.lang.String[] { "LayoutOptimizer", "ConstantFolding", "ShapeOptimization", "Remapping", "CommonSubgraphElimination", "ArithmeticOptimization", "DependencyOptimization", "LoopOptimization", "FunctionOptimization", "DebugStripper", "DisableModelPruning", "ScopedAllocatorOptimization", "PinToHostOptimization", "ImplementationSelector", "AutoMixedPrecision", "AutoMixedPrecisionMkl", "DisableMetaOptimizer", "MetaOptimizerIterations", "MinGraphNodes", "MemoryOptimization", "MemoryOptimizerTargetNodeNameScope", "MetaOptimizerTimeoutMs", "AutoParallel", "FailOnOptimizerErrors", "ScopedAllocatorOpts", "Optimizers", "CustomOptimizers", "InterOptimizerVerifierConfig", "PostOptimizationVerifierConfig", });
+        new java.lang.String[] { "CpuLayoutConversion", "LayoutOptimizer", "ConstantFolding", "ShapeOptimization", "Remapping", "CommonSubgraphElimination", "ArithmeticOptimization", "DependencyOptimization", "LoopOptimization", "FunctionOptimization", "DebugStripper", "DisableModelPruning", "ScopedAllocatorOptimization", "PinToHostOptimization", "ImplementationSelector", "AutoMixedPrecision", "AutoMixedPrecisionMkl", "DisableMetaOptimizer", "MetaOptimizerIterations", "MinGraphNodes", "ExperimentalDisableCompressedTensorOptimization", "MemoryOptimization", "MemoryOptimizerTargetNodeNameScope", "MetaOptimizerTimeoutMs", "AutoParallel", "FailOnOptimizerErrors", "ScopedAllocatorOpts", "Optimizers", "CustomOptimizers", "InterOptimizerVerifierConfig", "PostOptimizationVerifierConfig", });
     internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor =
       internal_static_tensorflow_RewriterConfig_descriptor.getNestedTypes().get(0);
     internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable = new
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunction.java
index e7fadf9f362..84ac9936dcd 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunction.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunction.java
@@ -71,6 +71,19 @@ private SavedBareConcreteFunction(
             allowedPositionalArguments_ = input.readInt64();
             break;
           }
+          case 34: {
+            org.tensorflow.proto.framework.FunctionSpec.Builder subBuilder = null;
+            if (functionSpec_ != null) {
+              subBuilder = functionSpec_.toBuilder();
+            }
+            functionSpec_ = input.readMessage(org.tensorflow.proto.framework.FunctionSpec.parser(), extensionRegistry);
+            if (subBuilder != null) {
+              subBuilder.mergeFrom(functionSpec_);
+              functionSpec_ = subBuilder.buildPartial();
+            }
+
+            break;
+          }
           default: {
             if (!parseUnknownField(
                 input, unknownFields, extensionRegistry, tag)) {
@@ -206,6 +219,54 @@ public long getAllowedPositionalArguments() {
     return allowedPositionalArguments_;
   }
 
+  public static final int FUNCTION_SPEC_FIELD_NUMBER = 4;
+  private org.tensorflow.proto.framework.FunctionSpec functionSpec_;
+  /**
+   * 
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public boolean hasFunctionSpec() { + return functionSpec_ != null; + } + /** + *
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public org.tensorflow.proto.framework.FunctionSpec getFunctionSpec() { + return functionSpec_ == null ? org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; + } + /** + *
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + return getFunctionSpec(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -229,6 +290,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (allowedPositionalArguments_ != 0L) { output.writeInt64(3, allowedPositionalArguments_); } + if (functionSpec_ != null) { + output.writeMessage(4, getFunctionSpec()); + } unknownFields.writeTo(output); } @@ -253,6 +317,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, allowedPositionalArguments_); } + if (functionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getFunctionSpec()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -274,6 +342,11 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getArgumentKeywordsList())) return false; if (getAllowedPositionalArguments() != other.getAllowedPositionalArguments()) return false; + if (hasFunctionSpec() != other.hasFunctionSpec()) return false; + if (hasFunctionSpec()) { + if (!getFunctionSpec() + .equals(other.getFunctionSpec())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -294,6 +367,10 @@ public int hashCode() { hash = (37 * hash) + ALLOWED_POSITIONAL_ARGUMENTS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getAllowedPositionalArguments()); + if (hasFunctionSpec()) { + hash = (37 * hash) + FUNCTION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getFunctionSpec().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -433,6 +510,12 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); allowedPositionalArguments_ = 0L; + if (functionSpecBuilder_ == null) { + functionSpec_ = null; + } else { + functionSpec_ = null; + functionSpecBuilder_ = null; + } return this; } @@ -467,6 +550,11 @@ public org.tensorflow.proto.framework.SavedBareConcreteFunction buildPartial() { } result.argumentKeywords_ = argumentKeywords_; result.allowedPositionalArguments_ = allowedPositionalArguments_; + if (functionSpecBuilder_ == null) { + result.functionSpec_ = functionSpec_; + } else { + result.functionSpec_ = functionSpecBuilder_.build(); + } onBuilt(); return result; } @@ -532,6 +620,9 @@ public Builder mergeFrom(org.tensorflow.proto.framework.SavedBareConcreteFunctio if (other.getAllowedPositionalArguments() != 0L) { setAllowedPositionalArguments(other.getAllowedPositionalArguments()); } + if (other.hasFunctionSpec()) { + mergeFunctionSpec(other.getFunctionSpec()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -818,6 +909,204 @@ public Builder clearAllowedPositionalArguments() { onChanged(); return this; } + + private org.tensorflow.proto.framework.FunctionSpec functionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.framework.FunctionSpec, org.tensorflow.proto.framework.FunctionSpec.Builder, org.tensorflow.proto.framework.FunctionSpecOrBuilder> functionSpecBuilder_; + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public boolean hasFunctionSpec() { + return functionSpecBuilder_ != null || functionSpec_ != null; + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public org.tensorflow.proto.framework.FunctionSpec getFunctionSpec() { + if (functionSpecBuilder_ == null) { + return functionSpec_ == null ? org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; + } else { + return functionSpecBuilder_.getMessage(); + } + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public Builder setFunctionSpec(org.tensorflow.proto.framework.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + functionSpec_ = value; + onChanged(); + } else { + functionSpecBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public Builder setFunctionSpec( + org.tensorflow.proto.framework.FunctionSpec.Builder builderForValue) { + if (functionSpecBuilder_ == null) { + functionSpec_ = builderForValue.build(); + onChanged(); + } else { + functionSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public Builder mergeFunctionSpec(org.tensorflow.proto.framework.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (functionSpec_ != null) { + functionSpec_ = + org.tensorflow.proto.framework.FunctionSpec.newBuilder(functionSpec_).mergeFrom(value).buildPartial(); + } else { + functionSpec_ = value; + } + onChanged(); + } else { + functionSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public Builder clearFunctionSpec() { + if (functionSpecBuilder_ == null) { + functionSpec_ = null; + onChanged(); + } else { + functionSpec_ = null; + functionSpecBuilder_ = null; + } + + return this; + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public org.tensorflow.proto.framework.FunctionSpec.Builder getFunctionSpecBuilder() { + + onChanged(); + return getFunctionSpecFieldBuilder().getBuilder(); + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + public org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + if (functionSpecBuilder_ != null) { + return functionSpecBuilder_.getMessageOrBuilder(); + } else { + return functionSpec_ == null ? + org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; + } + } + /** + *
+     * The spec of the function that this ConcreteFunction is traced from. This
+     * allows the ConcreteFunction to be called with nest structure inputs. This
+     * field may not be populated. If this field is absent, the concrete function
+     * can only be called with flat inputs.
+     * TODO(b/169361281): support calling saved ConcreteFunction with structured
+     * inputs in C++ SavedModel API.
+     * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.framework.FunctionSpec, org.tensorflow.proto.framework.FunctionSpec.Builder, org.tensorflow.proto.framework.FunctionSpecOrBuilder> + getFunctionSpecFieldBuilder() { + if (functionSpecBuilder_ == null) { + functionSpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.framework.FunctionSpec, org.tensorflow.proto.framework.FunctionSpec.Builder, org.tensorflow.proto.framework.FunctionSpecOrBuilder>( + getFunctionSpec(), + getParentForChildren(), + isClean()); + functionSpec_ = null; + } + return functionSpecBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunctionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunctionOrBuilder.java index cf9a625e8b3..8cb7224059b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunctionOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunctionOrBuilder.java @@ -68,4 +68,44 @@ public interface SavedBareConcreteFunctionOrBuilder extends * int64 allowed_positional_arguments = 3; */ long getAllowedPositionalArguments(); + + /** + *
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + boolean hasFunctionSpec(); + /** + *
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + org.tensorflow.proto.framework.FunctionSpec getFunctionSpec(); + /** + *
+   * The spec of the function that this ConcreteFunction is traced from. This
+   * allows the ConcreteFunction to be called with nest structure inputs. This
+   * field may not be populated. If this field is absent, the concrete function
+   * can only be called with flat inputs.
+   * TODO(b/169361281): support calling saved ConcreteFunction with structured
+   * inputs in C++ SavedModel API.
+   * 
+ * + * .tensorflow.FunctionSpec function_spec = 4; + */ + org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelProtos.java index 05b4edd36f5..9067e27030c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelProtos.java @@ -32,11 +32,11 @@ public static void registerAllExtensions( "roto\022\ntensorflow\032)tensorflow/core/protob" + "uf/meta_graph.proto\"_\n\nSavedModel\022\"\n\032sav" + "ed_model_schema_version\030\001 \001(\003\022-\n\013meta_gr" + - "aphs\030\002 \003(\0132\030.tensorflow.MetaGraphDefB\201\001\n" + + "aphs\030\002 \003(\0132\030.tensorflow.MetaGraphDefB\216\001\n" + "\036org.tensorflow.proto.frameworkB\020SavedMo" + - "delProtosP\001ZHgithub.com/tensorflow/tenso" + - "rflow/tensorflow/go/core/core_protos_go_" + - "proto\370\001\001b\006proto3" + "delProtosP\001ZUgithub.com/tensorflow/tenso" + + "rflow/tensorflow/go/core/protobuf/for_co" + + "re_protos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java index a7baea2d222..9405d43b87d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java @@ -135,27 +135,34 @@ public static void registerAllExtensions( "ound_inputs\030\002 \003(\005\022B\n\035canonicalized_input" + "_signature\030\003 \001(\0132\033.tensorflow.Structured" + "Value\0225\n\020output_signature\030\004 \001(\0132\033.tensor" + - "flow.StructuredValue\"|\n\031SavedBareConcret" + - "eFunction\022\036\n\026concrete_function_name\030\001 \001(" + - "\t\022\031\n\021argument_keywords\030\002 \003(\t\022$\n\034allowed_" + - "positional_arguments\030\003 \001(\003\"\"\n\rSavedConst" + - "ant\022\021\n\toperation\030\001 \001(\t\"\366\001\n\rSavedVariable" + - "\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.DataType\022+\n" + - "\005shape\030\002 \001(\0132\034.tensorflow.TensorShapePro" + - "to\022\021\n\ttrainable\030\003 \001(\010\022<\n\017synchronization" + - "\030\004 \001(\0162#.tensorflow.VariableSynchronizat" + - "ion\0224\n\013aggregation\030\005 \001(\0162\037.tensorflow.Va" + - "riableAggregation\022\014\n\004name\030\006 \001(\t\"\225\001\n\014Func" + - "tionSpec\0220\n\013fullargspec\030\001 \001(\0132\033.tensorfl" + - "ow.StructuredValue\022\021\n\tis_method\030\002 \001(\010\0224\n" + - "\017input_signature\030\005 \001(\0132\033.tensorflow.Stru" + - "cturedValueJ\004\010\003\020\004J\004\010\004\020\005\"\037\n\rSavedResource" + - "\022\016\n\006device\030\001 \001(\t\"A\n\016SaveableObject\022\025\n\rsa" + - "ve_function\030\002 \001(\005\022\030\n\020restore_function\030\003 " + - "\001(\005B\207\001\n\036org.tensorflow.proto.frameworkB\026" + - "SavedObjectGraphProtosP\001ZHgithub.com/ten" + - "sorflow/tensorflow/tensorflow/go/core/co" + - "re_protos_go_proto\370\001\001b\006proto3" + "flow.StructuredValue\"\255\001\n\031SavedBareConcre" + + "teFunction\022\036\n\026concrete_function_name\030\001 \001" + + "(\t\022\031\n\021argument_keywords\030\002 \003(\t\022$\n\034allowed" + + "_positional_arguments\030\003 \001(\003\022/\n\rfunction_" + + "spec\030\004 \001(\0132\030.tensorflow.FunctionSpec\"\"\n\r" + + "SavedConstant\022\021\n\toperation\030\001 \001(\t\"\327\002\n\rSav" + + "edVariable\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.D" + + "ataType\022+\n\005shape\030\002 \001(\0132\034.tensorflow.Tens" + + "orShapeProto\022\021\n\ttrainable\030\003 \001(\010\022<\n\017synch" + + "ronization\030\004 \001(\0162#.tensorflow.VariableSy" + + "nchronization\0224\n\013aggregation\030\005 \001(\0162\037.ten" + + "sorflow.VariableAggregation\022\014\n\004name\030\006 \001(" + + "\t\022\016\n\006device\030\007 \001(\t\022O\n,experimental_distri" + + "buted_variable_components\030\010 \003(\0132\031.tensor" + + "flow.SavedVariable\"\226\002\n\014FunctionSpec\0220\n\013f" + + "ullargspec\030\001 \001(\0132\033.tensorflow.Structured" + + "Value\022\021\n\tis_method\030\002 \001(\010\0224\n\017input_signat" + + "ure\030\005 \001(\0132\033.tensorflow.StructuredValue\022J" + + "\n\024experimental_compile\030\006 \001(\0162,.tensorflo" + + "w.FunctionSpec.ExperimentalCompile\"3\n\023Ex" + + "perimentalCompile\022\013\n\007DEFAULT\020\000\022\006\n\002ON\020\001\022\007" + + "\n\003OFF\020\002J\004\010\003\020\004J\004\010\004\020\005\"\037\n\rSavedResource\022\016\n\006" + + "device\030\001 \001(\t\"A\n\016SaveableObject\022\025\n\rsave_f" + + "unction\030\002 \001(\005\022\030\n\020restore_function\030\003 \001(\005B" + + "\224\001\n\036org.tensorflow.proto.frameworkB\026Save" + + "dObjectGraphProtosP\001ZUgithub.com/tensorf" + + "low/tensorflow/tensorflow/go/core/protob" + + "uf/for_core_protos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -220,7 +227,7 @@ public static void registerAllExtensions( internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_SavedBareConcreteFunction_descriptor, - new java.lang.String[] { "ConcreteFunctionName", "ArgumentKeywords", "AllowedPositionalArguments", }); + new java.lang.String[] { "ConcreteFunctionName", "ArgumentKeywords", "AllowedPositionalArguments", "FunctionSpec", }); internal_static_tensorflow_SavedConstant_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_tensorflow_SavedConstant_fieldAccessorTable = new @@ -232,13 +239,13 @@ public static void registerAllExtensions( internal_static_tensorflow_SavedVariable_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_SavedVariable_descriptor, - new java.lang.String[] { "Dtype", "Shape", "Trainable", "Synchronization", "Aggregation", "Name", }); + new java.lang.String[] { "Dtype", "Shape", "Trainable", "Synchronization", "Aggregation", "Name", "Device", "ExperimentalDistributedVariableComponents", }); internal_static_tensorflow_FunctionSpec_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_tensorflow_FunctionSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_FunctionSpec_descriptor, - new java.lang.String[] { "Fullargspec", "IsMethod", "InputSignature", }); + new java.lang.String[] { "Fullargspec", "IsMethod", "InputSignature", "ExperimentalCompile", }); internal_static_tensorflow_SavedResource_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_tensorflow_SavedResource_fieldAccessorTable = new diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariable.java index 17ce45af6d7..d42893242d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariable.java @@ -25,6 +25,8 @@ private SavedVariable() { synchronization_ = 0; aggregation_ = 0; name_ = ""; + device_ = ""; + experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -47,6 +49,7 @@ private SavedVariable( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -99,6 +102,21 @@ private SavedVariable( name_ = s; break; } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + device_ = s; + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + experimentalDistributedVariableComponents_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + experimentalDistributedVariableComponents_.add( + input.readMessage(org.tensorflow.proto.framework.SavedVariable.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -114,6 +132,9 @@ private SavedVariable( throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + experimentalDistributedVariableComponents_ = java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -246,6 +267,110 @@ public java.lang.String getName() { } } + public static final int DEVICE_FIELD_NUMBER = 7; + private volatile java.lang.Object device_; + /** + * string device = 7; + */ + public java.lang.String getDevice() { + java.lang.Object ref = device_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + device_ = s; + return s; + } + } + /** + * string device = 7; + */ + public com.google.protobuf.ByteString + getDeviceBytes() { + java.lang.Object ref = device_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + device_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPERIMENTAL_DISTRIBUTED_VARIABLE_COMPONENTS_FIELD_NUMBER = 8; + private java.util.List experimentalDistributedVariableComponents_; + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public java.util.List getExperimentalDistributedVariableComponentsList() { + return experimentalDistributedVariableComponents_; + } + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public java.util.List + getExperimentalDistributedVariableComponentsOrBuilderList() { + return experimentalDistributedVariableComponents_; + } + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public int getExperimentalDistributedVariableComponentsCount() { + return experimentalDistributedVariableComponents_.size(); + } + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariable getExperimentalDistributedVariableComponents(int index) { + return experimentalDistributedVariableComponents_.get(index); + } + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariableOrBuilder getExperimentalDistributedVariableComponentsOrBuilder( + int index) { + return experimentalDistributedVariableComponents_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -278,6 +403,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); } + if (!getDeviceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, device_); + } + for (int i = 0; i < experimentalDistributedVariableComponents_.size(); i++) { + output.writeMessage(8, experimentalDistributedVariableComponents_.get(i)); + } unknownFields.writeTo(output); } @@ -310,6 +441,13 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, name_); } + if (!getDeviceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, device_); + } + for (int i = 0; i < experimentalDistributedVariableComponents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, experimentalDistributedVariableComponents_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -337,6 +475,10 @@ public boolean equals(final java.lang.Object obj) { if (aggregation_ != other.aggregation_) return false; if (!getName() .equals(other.getName())) return false; + if (!getDevice() + .equals(other.getDevice())) return false; + if (!getExperimentalDistributedVariableComponentsList() + .equals(other.getExperimentalDistributedVariableComponentsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -363,6 +505,12 @@ public int hashCode() { hash = (53 * hash) + aggregation_; hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + if (getExperimentalDistributedVariableComponentsCount() > 0) { + hash = (37 * hash) + EXPERIMENTAL_DISTRIBUTED_VARIABLE_COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getExperimentalDistributedVariableComponentsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -496,6 +644,7 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getExperimentalDistributedVariableComponentsFieldBuilder(); } } @java.lang.Override @@ -517,6 +666,14 @@ public Builder clear() { name_ = ""; + device_ = ""; + + if (experimentalDistributedVariableComponentsBuilder_ == null) { + experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + experimentalDistributedVariableComponentsBuilder_.clear(); + } return this; } @@ -543,6 +700,7 @@ public org.tensorflow.proto.framework.SavedVariable build() { @java.lang.Override public org.tensorflow.proto.framework.SavedVariable buildPartial() { org.tensorflow.proto.framework.SavedVariable result = new org.tensorflow.proto.framework.SavedVariable(this); + int from_bitField0_ = bitField0_; result.dtype_ = dtype_; if (shapeBuilder_ == null) { result.shape_ = shape_; @@ -553,6 +711,16 @@ public org.tensorflow.proto.framework.SavedVariable buildPartial() { result.synchronization_ = synchronization_; result.aggregation_ = aggregation_; result.name_ = name_; + result.device_ = device_; + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + experimentalDistributedVariableComponents_ = java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.experimentalDistributedVariableComponents_ = experimentalDistributedVariableComponents_; + } else { + result.experimentalDistributedVariableComponents_ = experimentalDistributedVariableComponentsBuilder_.build(); + } onBuilt(); return result; } @@ -620,6 +788,36 @@ public Builder mergeFrom(org.tensorflow.proto.framework.SavedVariable other) { name_ = other.name_; onChanged(); } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + onChanged(); + } + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (!other.experimentalDistributedVariableComponents_.isEmpty()) { + if (experimentalDistributedVariableComponents_.isEmpty()) { + experimentalDistributedVariableComponents_ = other.experimentalDistributedVariableComponents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.addAll(other.experimentalDistributedVariableComponents_); + } + onChanged(); + } + } else { + if (!other.experimentalDistributedVariableComponents_.isEmpty()) { + if (experimentalDistributedVariableComponentsBuilder_.isEmpty()) { + experimentalDistributedVariableComponentsBuilder_.dispose(); + experimentalDistributedVariableComponentsBuilder_ = null; + experimentalDistributedVariableComponents_ = other.experimentalDistributedVariableComponents_; + bitField0_ = (bitField0_ & ~0x00000001); + experimentalDistributedVariableComponentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getExperimentalDistributedVariableComponentsFieldBuilder() : null; + } else { + experimentalDistributedVariableComponentsBuilder_.addAllMessages(other.experimentalDistributedVariableComponents_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -648,6 +846,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private int dtype_ = 0; /** @@ -995,6 +1194,441 @@ public Builder setNameBytes( onChanged(); return this; } + + private java.lang.Object device_ = ""; + /** + * string device = 7; + */ + public java.lang.String getDevice() { + java.lang.Object ref = device_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + device_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string device = 7; + */ + public com.google.protobuf.ByteString + getDeviceBytes() { + java.lang.Object ref = device_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + device_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string device = 7; + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + device_ = value; + onChanged(); + return this; + } + /** + * string device = 7; + */ + public Builder clearDevice() { + + device_ = getDefaultInstance().getDevice(); + onChanged(); + return this; + } + /** + * string device = 7; + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + device_ = value; + onChanged(); + return this; + } + + private java.util.List experimentalDistributedVariableComponents_ = + java.util.Collections.emptyList(); + private void ensureExperimentalDistributedVariableComponentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + experimentalDistributedVariableComponents_ = new java.util.ArrayList(experimentalDistributedVariableComponents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder> experimentalDistributedVariableComponentsBuilder_; + + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public java.util.List getExperimentalDistributedVariableComponentsList() { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); + } else { + return experimentalDistributedVariableComponentsBuilder_.getMessageList(); + } + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public int getExperimentalDistributedVariableComponentsCount() { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + return experimentalDistributedVariableComponents_.size(); + } else { + return experimentalDistributedVariableComponentsBuilder_.getCount(); + } + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariable getExperimentalDistributedVariableComponents(int index) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + return experimentalDistributedVariableComponents_.get(index); + } else { + return experimentalDistributedVariableComponentsBuilder_.getMessage(index); + } + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder setExperimentalDistributedVariableComponents( + int index, org.tensorflow.proto.framework.SavedVariable value) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.set(index, value); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder setExperimentalDistributedVariableComponents( + int index, org.tensorflow.proto.framework.SavedVariable.Builder builderForValue) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.set(index, builderForValue.build()); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder addExperimentalDistributedVariableComponents(org.tensorflow.proto.framework.SavedVariable value) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.add(value); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder addExperimentalDistributedVariableComponents( + int index, org.tensorflow.proto.framework.SavedVariable value) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.add(index, value); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder addExperimentalDistributedVariableComponents( + org.tensorflow.proto.framework.SavedVariable.Builder builderForValue) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.add(builderForValue.build()); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder addExperimentalDistributedVariableComponents( + int index, org.tensorflow.proto.framework.SavedVariable.Builder builderForValue) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.add(index, builderForValue.build()); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder addAllExperimentalDistributedVariableComponents( + java.lang.Iterable values) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, experimentalDistributedVariableComponents_); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder clearExperimentalDistributedVariableComponents() { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.clear(); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public Builder removeExperimentalDistributedVariableComponents(int index) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.remove(index); + onChanged(); + } else { + experimentalDistributedVariableComponentsBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariable.Builder getExperimentalDistributedVariableComponentsBuilder( + int index) { + return getExperimentalDistributedVariableComponentsFieldBuilder().getBuilder(index); + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariableOrBuilder getExperimentalDistributedVariableComponentsOrBuilder( + int index) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + return experimentalDistributedVariableComponents_.get(index); } else { + return experimentalDistributedVariableComponentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public java.util.List + getExperimentalDistributedVariableComponentsOrBuilderList() { + if (experimentalDistributedVariableComponentsBuilder_ != null) { + return experimentalDistributedVariableComponentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); + } + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariable.Builder addExperimentalDistributedVariableComponentsBuilder() { + return getExperimentalDistributedVariableComponentsFieldBuilder().addBuilder( + org.tensorflow.proto.framework.SavedVariable.getDefaultInstance()); + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public org.tensorflow.proto.framework.SavedVariable.Builder addExperimentalDistributedVariableComponentsBuilder( + int index) { + return getExperimentalDistributedVariableComponentsFieldBuilder().addBuilder( + index, org.tensorflow.proto.framework.SavedVariable.getDefaultInstance()); + } + /** + *
+     * List of component variables for a distributed variable.
+     * When this field is non-empty, the SavedVariable will be assumed
+     * to be a distributed variable defined by the components listed here.
+     * This is only supported by experimental loaders at the moment.
+     * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + public java.util.List + getExperimentalDistributedVariableComponentsBuilderList() { + return getExperimentalDistributedVariableComponentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder> + getExperimentalDistributedVariableComponentsFieldBuilder() { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + experimentalDistributedVariableComponentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder>( + experimentalDistributedVariableComponents_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + experimentalDistributedVariableComponents_ = null; + } + return experimentalDistributedVariableComponentsBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariableOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariableOrBuilder.java index 27da7b6abfa..b16be7224e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariableOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariableOrBuilder.java @@ -61,4 +61,73 @@ public interface SavedVariableOrBuilder extends */ com.google.protobuf.ByteString getNameBytes(); + + /** + * string device = 7; + */ + java.lang.String getDevice(); + /** + * string device = 7; + */ + com.google.protobuf.ByteString + getDeviceBytes(); + + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + java.util.List + getExperimentalDistributedVariableComponentsList(); + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + org.tensorflow.proto.framework.SavedVariable getExperimentalDistributedVariableComponents(int index); + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + int getExperimentalDistributedVariableComponentsCount(); + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + java.util.List + getExperimentalDistributedVariableComponentsOrBuilderList(); + /** + *
+   * List of component variables for a distributed variable.
+   * When this field is non-empty, the SavedVariable will be assumed
+   * to be a distributed variable defined by the components listed here.
+   * This is only supported by experimental loaders at the moment.
+   * 
+ * + * repeated .tensorflow.SavedVariable experimental_distributed_variable_components = 8; + */ + org.tensorflow.proto.framework.SavedVariableOrBuilder getExperimentalDistributedVariableComponentsOrBuilder( + int index); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SpecializedType.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SpecializedType.java new file mode 100644 index 00000000000..8af9cfa82cc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SpecializedType.java @@ -0,0 +1,126 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/types.proto + +package org.tensorflow.proto.framework; + +/** + *
+ * For identifying the underlying type of a variant. For variants, the types
+ * listed here are a subset of the types in the variant type registry,
+ * corresponding to commonly used variants which must occasionally be
+ * special-cased.
+ * 
+ * + * Protobuf enum {@code tensorflow.SpecializedType} + */ +public enum SpecializedType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Invalid/unknown specialized type.
+   * 
+ * + * ST_INVALID = 0; + */ + ST_INVALID(0), + /** + *
+   * "tensorflow::TensorList" in the variant type registry.
+   * 
+ * + * ST_TENSOR_LIST = 1; + */ + ST_TENSOR_LIST(1), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Invalid/unknown specialized type.
+   * 
+ * + * ST_INVALID = 0; + */ + public static final int ST_INVALID_VALUE = 0; + /** + *
+   * "tensorflow::TensorList" in the variant type registry.
+   * 
+ * + * ST_TENSOR_LIST = 1; + */ + public static final int ST_TENSOR_LIST_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SpecializedType valueOf(int value) { + return forNumber(value); + } + + public static SpecializedType forNumber(int value) { + switch (value) { + case 0: return ST_INVALID; + case 1: return ST_TENSOR_LIST; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SpecializedType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SpecializedType findValueByNumber(int number) { + return SpecializedType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.tensorflow.proto.framework.TypesProtos.getDescriptor().getEnumTypes().get(1); + } + + private static final SpecializedType[] VALUES = values(); + + public static SpecializedType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SpecializedType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.SpecializedType) +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java index 6b25fbe0fa5..f5b217be8b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java @@ -117,21 +117,21 @@ public static void registerAllExtensions( "hapeProto\022#\n\005dtype\030\003 \001(\0162\024.tensorflow.Da" + "taType\022(\n\007minimum\030\004 \001(\0132\027.tensorflow.Ten" + "sorProto\022(\n\007maximum\030\005 \001(\0132\027.tensorflow.T" + - "ensorProto\"\242\003\n\rTypeSpecProto\022@\n\017type_spe" + + "ensorProto\"\264\003\n\rTypeSpecProto\022@\n\017type_spe" + "c_class\030\001 \001(\0162\'.tensorflow.TypeSpecProto" + ".TypeSpecClass\022/\n\ntype_state\030\002 \001(\0132\033.ten" + "sorflow.StructuredValue\022\034\n\024type_spec_cla" + - "ss_name\030\003 \001(\t\"\377\001\n\rTypeSpecClass\022\013\n\007UNKNO" + + "ss_name\030\003 \001(\t\"\221\002\n\rTypeSpecClass\022\013\n\007UNKNO" + "WN\020\000\022\026\n\022SPARSE_TENSOR_SPEC\020\001\022\027\n\023INDEXED_" + "SLICES_SPEC\020\002\022\026\n\022RAGGED_TENSOR_SPEC\020\003\022\025\n" + "\021TENSOR_ARRAY_SPEC\020\004\022\025\n\021DATA_DATASET_SPE" + "C\020\005\022\026\n\022DATA_ITERATOR_SPEC\020\006\022\021\n\rOPTIONAL_" + "SPEC\020\007\022\024\n\020PER_REPLICA_SPEC\020\010\022\021\n\rVARIABLE" + - "_SPEC\020\t\022\026\n\022ROW_PARTITION_SPEC\020\nBz\n\036org.t" + - "ensorflow.proto.frameworkB\014StructProtosP" + - "\001ZHgithub.com/tensorflow/tensorflow/tens" + - "orflow/go/core/core_protos_go_protob\006pro" + - "to3" + "_SPEC\020\t\022\026\n\022ROW_PARTITION_SPEC\020\n\022\020\n\014NDARR" + + "AY_SPEC\020\013B\207\001\n\036org.tensorflow.proto.frame" + + "workB\014StructProtosP\001ZUgithub.com/tensorf" + + "low/tensorflow/tensorflow/go/core/protob" + + "uf/for_core_protos_go_protob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Trace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Trace.java deleted file mode 100644 index 09d97221dde..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Trace.java +++ /dev/null @@ -1,1193 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -/** - *
- * A 'Trace' contains metadata for the individual traces of a system.
- * 
- * - * Protobuf type {@code tensorflow.profiler.Trace} - */ -public final class Trace extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.Trace) - TraceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Trace.newBuilder() to construct. - private Trace(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Trace() { - traceEvents_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Trace(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Trace( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = com.google.protobuf.MapField.newMapField( - DevicesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - devices__ = input.readMessage( - DevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - devices_.getMutableMap().put( - devices__.getKey(), devices__.getValue()); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - traceEvents_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - traceEvents_.add( - input.readMessage(org.tensorflow.proto.framework.TraceEvent.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - traceEvents_ = java.util.Collections.unmodifiableList(traceEvents_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Trace.class, org.tensorflow.proto.framework.Trace.Builder.class); - } - - public static final int DEVICES_FIELD_NUMBER = 1; - private static final class DevicesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, org.tensorflow.proto.framework.Device> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_DevicesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.Device.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.Device> devices_; - private com.google.protobuf.MapField - internalGetDevices() { - if (devices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - DevicesDefaultEntryHolder.defaultEntry); - } - return devices_; - } - - public int getDevicesCount() { - return internalGetDevices().getMap().size(); - } - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public boolean containsDevices( - int key) { - - return internalGetDevices().getMap().containsKey(key); - } - /** - * Use {@link #getDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getDevices() { - return getDevicesMap(); - } - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public java.util.Map getDevicesMap() { - return internalGetDevices().getMap(); - } - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public org.tensorflow.proto.framework.Device getDevicesOrDefault( - int key, - org.tensorflow.proto.framework.Device defaultValue) { - - java.util.Map map = - internalGetDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public org.tensorflow.proto.framework.Device getDevicesOrThrow( - int key) { - - java.util.Map map = - internalGetDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int TRACE_EVENTS_FIELD_NUMBER = 4; - private java.util.List traceEvents_; - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public java.util.List getTraceEventsList() { - return traceEvents_; - } - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public java.util.List - getTraceEventsOrBuilderList() { - return traceEvents_; - } - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public int getTraceEventsCount() { - return traceEvents_.size(); - } - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEvent getTraceEvents(int index) { - return traceEvents_.get(index); - } - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEventOrBuilder getTraceEventsOrBuilder( - int index) { - return traceEvents_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetDevices(), - DevicesDefaultEntryHolder.defaultEntry, - 1); - for (int i = 0; i < traceEvents_.size(); i++) { - output.writeMessage(4, traceEvents_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (java.util.Map.Entry entry - : internalGetDevices().getMap().entrySet()) { - com.google.protobuf.MapEntry - devices__ = DevicesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, devices__); - } - for (int i = 0; i < traceEvents_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, traceEvents_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.Trace)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.Trace other = (org.tensorflow.proto.framework.Trace) obj; - - if (!internalGetDevices().equals( - other.internalGetDevices())) return false; - if (!getTraceEventsList() - .equals(other.getTraceEventsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (!internalGetDevices().getMap().isEmpty()) { - hash = (37 * hash) + DEVICES_FIELD_NUMBER; - hash = (53 * hash) + internalGetDevices().hashCode(); - } - if (getTraceEventsCount() > 0) { - hash = (37 * hash) + TRACE_EVENTS_FIELD_NUMBER; - hash = (53 * hash) + getTraceEventsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.Trace parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Trace parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Trace parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Trace parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Trace parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Trace parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.framework.Trace prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A 'Trace' contains metadata for the individual traces of a system.
-   * 
- * - * Protobuf type {@code tensorflow.profiler.Trace} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.Trace) - org.tensorflow.proto.framework.TraceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Trace.class, org.tensorflow.proto.framework.Trace.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.Trace.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTraceEventsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - internalGetMutableDevices().clear(); - if (traceEventsBuilder_ == null) { - traceEvents_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - traceEventsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_Trace_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Trace getDefaultInstanceForType() { - return org.tensorflow.proto.framework.Trace.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.Trace build() { - org.tensorflow.proto.framework.Trace result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Trace buildPartial() { - org.tensorflow.proto.framework.Trace result = new org.tensorflow.proto.framework.Trace(this); - int from_bitField0_ = bitField0_; - result.devices_ = internalGetDevices(); - result.devices_.makeImmutable(); - if (traceEventsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - traceEvents_ = java.util.Collections.unmodifiableList(traceEvents_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.traceEvents_ = traceEvents_; - } else { - result.traceEvents_ = traceEventsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.framework.Trace) { - return mergeFrom((org.tensorflow.proto.framework.Trace)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.Trace other) { - if (other == org.tensorflow.proto.framework.Trace.getDefaultInstance()) return this; - internalGetMutableDevices().mergeFrom( - other.internalGetDevices()); - if (traceEventsBuilder_ == null) { - if (!other.traceEvents_.isEmpty()) { - if (traceEvents_.isEmpty()) { - traceEvents_ = other.traceEvents_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureTraceEventsIsMutable(); - traceEvents_.addAll(other.traceEvents_); - } - onChanged(); - } - } else { - if (!other.traceEvents_.isEmpty()) { - if (traceEventsBuilder_.isEmpty()) { - traceEventsBuilder_.dispose(); - traceEventsBuilder_ = null; - traceEvents_ = other.traceEvents_; - bitField0_ = (bitField0_ & ~0x00000002); - traceEventsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTraceEventsFieldBuilder() : null; - } else { - traceEventsBuilder_.addAllMessages(other.traceEvents_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.framework.Trace parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.Trace) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.Device> devices_; - private com.google.protobuf.MapField - internalGetDevices() { - if (devices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - DevicesDefaultEntryHolder.defaultEntry); - } - return devices_; - } - private com.google.protobuf.MapField - internalGetMutableDevices() { - onChanged();; - if (devices_ == null) { - devices_ = com.google.protobuf.MapField.newMapField( - DevicesDefaultEntryHolder.defaultEntry); - } - if (!devices_.isMutable()) { - devices_ = devices_.copy(); - } - return devices_; - } - - public int getDevicesCount() { - return internalGetDevices().getMap().size(); - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public boolean containsDevices( - int key) { - - return internalGetDevices().getMap().containsKey(key); - } - /** - * Use {@link #getDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getDevices() { - return getDevicesMap(); - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public java.util.Map getDevicesMap() { - return internalGetDevices().getMap(); - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public org.tensorflow.proto.framework.Device getDevicesOrDefault( - int key, - org.tensorflow.proto.framework.Device defaultValue) { - - java.util.Map map = - internalGetDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public org.tensorflow.proto.framework.Device getDevicesOrThrow( - int key) { - - java.util.Map map = - internalGetDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearDevices() { - internalGetMutableDevices().getMutableMap() - .clear(); - return this; - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public Builder removeDevices( - int key) { - - internalGetMutableDevices().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableDevices() { - return internalGetMutableDevices().getMutableMap(); - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - public Builder putDevices( - int key, - org.tensorflow.proto.framework.Device value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableDevices().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * The devices that this trace has information about. Maps from device_id to
-     * more data about the specific device.
-     * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - public Builder putAllDevices( - java.util.Map values) { - internalGetMutableDevices().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List traceEvents_ = - java.util.Collections.emptyList(); - private void ensureTraceEventsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - traceEvents_ = new java.util.ArrayList(traceEvents_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TraceEvent, org.tensorflow.proto.framework.TraceEvent.Builder, org.tensorflow.proto.framework.TraceEventOrBuilder> traceEventsBuilder_; - - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public java.util.List getTraceEventsList() { - if (traceEventsBuilder_ == null) { - return java.util.Collections.unmodifiableList(traceEvents_); - } else { - return traceEventsBuilder_.getMessageList(); - } - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public int getTraceEventsCount() { - if (traceEventsBuilder_ == null) { - return traceEvents_.size(); - } else { - return traceEventsBuilder_.getCount(); - } - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEvent getTraceEvents(int index) { - if (traceEventsBuilder_ == null) { - return traceEvents_.get(index); - } else { - return traceEventsBuilder_.getMessage(index); - } - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder setTraceEvents( - int index, org.tensorflow.proto.framework.TraceEvent value) { - if (traceEventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTraceEventsIsMutable(); - traceEvents_.set(index, value); - onChanged(); - } else { - traceEventsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder setTraceEvents( - int index, org.tensorflow.proto.framework.TraceEvent.Builder builderForValue) { - if (traceEventsBuilder_ == null) { - ensureTraceEventsIsMutable(); - traceEvents_.set(index, builderForValue.build()); - onChanged(); - } else { - traceEventsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder addTraceEvents(org.tensorflow.proto.framework.TraceEvent value) { - if (traceEventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTraceEventsIsMutable(); - traceEvents_.add(value); - onChanged(); - } else { - traceEventsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder addTraceEvents( - int index, org.tensorflow.proto.framework.TraceEvent value) { - if (traceEventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTraceEventsIsMutable(); - traceEvents_.add(index, value); - onChanged(); - } else { - traceEventsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder addTraceEvents( - org.tensorflow.proto.framework.TraceEvent.Builder builderForValue) { - if (traceEventsBuilder_ == null) { - ensureTraceEventsIsMutable(); - traceEvents_.add(builderForValue.build()); - onChanged(); - } else { - traceEventsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder addTraceEvents( - int index, org.tensorflow.proto.framework.TraceEvent.Builder builderForValue) { - if (traceEventsBuilder_ == null) { - ensureTraceEventsIsMutable(); - traceEvents_.add(index, builderForValue.build()); - onChanged(); - } else { - traceEventsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder addAllTraceEvents( - java.lang.Iterable values) { - if (traceEventsBuilder_ == null) { - ensureTraceEventsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, traceEvents_); - onChanged(); - } else { - traceEventsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder clearTraceEvents() { - if (traceEventsBuilder_ == null) { - traceEvents_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - traceEventsBuilder_.clear(); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public Builder removeTraceEvents(int index) { - if (traceEventsBuilder_ == null) { - ensureTraceEventsIsMutable(); - traceEvents_.remove(index); - onChanged(); - } else { - traceEventsBuilder_.remove(index); - } - return this; - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEvent.Builder getTraceEventsBuilder( - int index) { - return getTraceEventsFieldBuilder().getBuilder(index); - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEventOrBuilder getTraceEventsOrBuilder( - int index) { - if (traceEventsBuilder_ == null) { - return traceEvents_.get(index); } else { - return traceEventsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public java.util.List - getTraceEventsOrBuilderList() { - if (traceEventsBuilder_ != null) { - return traceEventsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(traceEvents_); - } - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEvent.Builder addTraceEventsBuilder() { - return getTraceEventsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TraceEvent.getDefaultInstance()); - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public org.tensorflow.proto.framework.TraceEvent.Builder addTraceEventsBuilder( - int index) { - return getTraceEventsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TraceEvent.getDefaultInstance()); - } - /** - *
-     * All trace events capturing in the profiling period.
-     * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - public java.util.List - getTraceEventsBuilderList() { - return getTraceEventsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TraceEvent, org.tensorflow.proto.framework.TraceEvent.Builder, org.tensorflow.proto.framework.TraceEventOrBuilder> - getTraceEventsFieldBuilder() { - if (traceEventsBuilder_ == null) { - traceEventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TraceEvent, org.tensorflow.proto.framework.TraceEvent.Builder, org.tensorflow.proto.framework.TraceEventOrBuilder>( - traceEvents_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - traceEvents_ = null; - } - return traceEventsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.profiler.Trace) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.Trace) - private static final org.tensorflow.proto.framework.Trace DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.Trace(); - } - - public static org.tensorflow.proto.framework.Trace getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Trace parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Trace(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Trace getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEvent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEvent.java deleted file mode 100644 index 8f34acfde34..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEvent.java +++ /dev/null @@ -1,1208 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.profiler.TraceEvent} - */ -public final class TraceEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.TraceEvent) - TraceEventOrBuilder { -private static final long serialVersionUID = 0L; - // Use TraceEvent.newBuilder() to construct. - private TraceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TraceEvent() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TraceEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TraceEvent( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - deviceId_ = input.readUInt32(); - break; - } - case 16: { - - resourceId_ = input.readUInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 72: { - - timestampPs_ = input.readUInt64(); - break; - } - case 80: { - - durationPs_ = input.readUInt64(); - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - args_ = com.google.protobuf.MapField.newMapField( - ArgsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - args__ = input.readMessage( - ArgsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - args_.getMutableMap().put( - args__.getKey(), args__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetArgs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TraceEvent.class, org.tensorflow.proto.framework.TraceEvent.Builder.class); - } - - public static final int DEVICE_ID_FIELD_NUMBER = 1; - private int deviceId_; - /** - *
-   * The id of the device that this event occurred on. The full dataset should
-   * have this device present in the Trace object.
-   * 
- * - * uint32 device_id = 1; - */ - public int getDeviceId() { - return deviceId_; - } - - public static final int RESOURCE_ID_FIELD_NUMBER = 2; - private int resourceId_; - /** - *
-   * The id of the resource that this event occurred on. The full dataset should
-   * have this resource present in the Device object of the Trace object. A
-   * resource_id is unique on a specific device, but not necessarily within the
-   * trace.
-   * 
- * - * uint32 resource_id = 2; - */ - public int getResourceId() { - return resourceId_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - *
-   * The name of this trace event.
-   * 
- * - * string name = 3; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The name of this trace event.
-   * 
- * - * string name = 3; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_PS_FIELD_NUMBER = 9; - private long timestampPs_; - /** - *
-   * The timestamp that this event occurred at (in picos since tracing started).
-   * 
- * - * uint64 timestamp_ps = 9; - */ - public long getTimestampPs() { - return timestampPs_; - } - - public static final int DURATION_PS_FIELD_NUMBER = 10; - private long durationPs_; - /** - *
-   * The duration of the event in picoseconds if applicable.
-   * Events without duration are called instant events.
-   * 
- * - * uint64 duration_ps = 10; - */ - public long getDurationPs() { - return durationPs_; - } - - public static final int ARGS_FIELD_NUMBER = 11; - private static final class ArgsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> args_; - private com.google.protobuf.MapField - internalGetArgs() { - if (args_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ArgsDefaultEntryHolder.defaultEntry); - } - return args_; - } - - public int getArgsCount() { - return internalGetArgs().getMap().size(); - } - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - public boolean containsArgs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetArgs().getMap().containsKey(key); - } - /** - * Use {@link #getArgsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getArgs() { - return getArgsMap(); - } - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - public java.util.Map getArgsMap() { - return internalGetArgs().getMap(); - } - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - public java.lang.String getArgsOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetArgs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - public java.lang.String getArgsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetArgs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (deviceId_ != 0) { - output.writeUInt32(1, deviceId_); - } - if (resourceId_ != 0) { - output.writeUInt32(2, resourceId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (timestampPs_ != 0L) { - output.writeUInt64(9, timestampPs_); - } - if (durationPs_ != 0L) { - output.writeUInt64(10, durationPs_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetArgs(), - ArgsDefaultEntryHolder.defaultEntry, - 11); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (deviceId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, deviceId_); - } - if (resourceId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, resourceId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (timestampPs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(9, timestampPs_); - } - if (durationPs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(10, durationPs_); - } - for (java.util.Map.Entry entry - : internalGetArgs().getMap().entrySet()) { - com.google.protobuf.MapEntry - args__ = ArgsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, args__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.TraceEvent)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TraceEvent other = (org.tensorflow.proto.framework.TraceEvent) obj; - - if (getDeviceId() - != other.getDeviceId()) return false; - if (getResourceId() - != other.getResourceId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (getTimestampPs() - != other.getTimestampPs()) return false; - if (getDurationPs() - != other.getDurationPs()) return false; - if (!internalGetArgs().equals( - other.internalGetArgs())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId(); - hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER; - hash = (53 * hash) + getResourceId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + TIMESTAMP_PS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimestampPs()); - hash = (37 * hash) + DURATION_PS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDurationPs()); - if (!internalGetArgs().getMap().isEmpty()) { - hash = (37 * hash) + ARGS_FIELD_NUMBER; - hash = (53 * hash) + internalGetArgs().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.TraceEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TraceEvent parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TraceEvent parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.framework.TraceEvent prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code tensorflow.profiler.TraceEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.TraceEvent) - org.tensorflow.proto.framework.TraceEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetArgs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 11: - return internalGetMutableArgs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TraceEvent.class, org.tensorflow.proto.framework.TraceEvent.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TraceEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - deviceId_ = 0; - - resourceId_ = 0; - - name_ = ""; - - timestampPs_ = 0L; - - durationPs_ = 0L; - - internalGetMutableArgs().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TraceEventsProtos.internal_static_tensorflow_profiler_TraceEvent_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TraceEvent getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TraceEvent.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TraceEvent build() { - org.tensorflow.proto.framework.TraceEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TraceEvent buildPartial() { - org.tensorflow.proto.framework.TraceEvent result = new org.tensorflow.proto.framework.TraceEvent(this); - int from_bitField0_ = bitField0_; - result.deviceId_ = deviceId_; - result.resourceId_ = resourceId_; - result.name_ = name_; - result.timestampPs_ = timestampPs_; - result.durationPs_ = durationPs_; - result.args_ = internalGetArgs(); - result.args_.makeImmutable(); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.framework.TraceEvent) { - return mergeFrom((org.tensorflow.proto.framework.TraceEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TraceEvent other) { - if (other == org.tensorflow.proto.framework.TraceEvent.getDefaultInstance()) return this; - if (other.getDeviceId() != 0) { - setDeviceId(other.getDeviceId()); - } - if (other.getResourceId() != 0) { - setResourceId(other.getResourceId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getTimestampPs() != 0L) { - setTimestampPs(other.getTimestampPs()); - } - if (other.getDurationPs() != 0L) { - setDurationPs(other.getDurationPs()); - } - internalGetMutableArgs().mergeFrom( - other.internalGetArgs()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.framework.TraceEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TraceEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int deviceId_ ; - /** - *
-     * The id of the device that this event occurred on. The full dataset should
-     * have this device present in the Trace object.
-     * 
- * - * uint32 device_id = 1; - */ - public int getDeviceId() { - return deviceId_; - } - /** - *
-     * The id of the device that this event occurred on. The full dataset should
-     * have this device present in the Trace object.
-     * 
- * - * uint32 device_id = 1; - */ - public Builder setDeviceId(int value) { - - deviceId_ = value; - onChanged(); - return this; - } - /** - *
-     * The id of the device that this event occurred on. The full dataset should
-     * have this device present in the Trace object.
-     * 
- * - * uint32 device_id = 1; - */ - public Builder clearDeviceId() { - - deviceId_ = 0; - onChanged(); - return this; - } - - private int resourceId_ ; - /** - *
-     * The id of the resource that this event occurred on. The full dataset should
-     * have this resource present in the Device object of the Trace object. A
-     * resource_id is unique on a specific device, but not necessarily within the
-     * trace.
-     * 
- * - * uint32 resource_id = 2; - */ - public int getResourceId() { - return resourceId_; - } - /** - *
-     * The id of the resource that this event occurred on. The full dataset should
-     * have this resource present in the Device object of the Trace object. A
-     * resource_id is unique on a specific device, but not necessarily within the
-     * trace.
-     * 
- * - * uint32 resource_id = 2; - */ - public Builder setResourceId(int value) { - - resourceId_ = value; - onChanged(); - return this; - } - /** - *
-     * The id of the resource that this event occurred on. The full dataset should
-     * have this resource present in the Device object of the Trace object. A
-     * resource_id is unique on a specific device, but not necessarily within the
-     * trace.
-     * 
- * - * uint32 resource_id = 2; - */ - public Builder clearResourceId() { - - resourceId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * The name of this trace event.
-     * 
- * - * string name = 3; - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The name of this trace event.
-     * 
- * - * string name = 3; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The name of this trace event.
-     * 
- * - * string name = 3; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The name of this trace event.
-     * 
- * - * string name = 3; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The name of this trace event.
-     * 
- * - * string name = 3; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private long timestampPs_ ; - /** - *
-     * The timestamp that this event occurred at (in picos since tracing started).
-     * 
- * - * uint64 timestamp_ps = 9; - */ - public long getTimestampPs() { - return timestampPs_; - } - /** - *
-     * The timestamp that this event occurred at (in picos since tracing started).
-     * 
- * - * uint64 timestamp_ps = 9; - */ - public Builder setTimestampPs(long value) { - - timestampPs_ = value; - onChanged(); - return this; - } - /** - *
-     * The timestamp that this event occurred at (in picos since tracing started).
-     * 
- * - * uint64 timestamp_ps = 9; - */ - public Builder clearTimestampPs() { - - timestampPs_ = 0L; - onChanged(); - return this; - } - - private long durationPs_ ; - /** - *
-     * The duration of the event in picoseconds if applicable.
-     * Events without duration are called instant events.
-     * 
- * - * uint64 duration_ps = 10; - */ - public long getDurationPs() { - return durationPs_; - } - /** - *
-     * The duration of the event in picoseconds if applicable.
-     * Events without duration are called instant events.
-     * 
- * - * uint64 duration_ps = 10; - */ - public Builder setDurationPs(long value) { - - durationPs_ = value; - onChanged(); - return this; - } - /** - *
-     * The duration of the event in picoseconds if applicable.
-     * Events without duration are called instant events.
-     * 
- * - * uint64 duration_ps = 10; - */ - public Builder clearDurationPs() { - - durationPs_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> args_; - private com.google.protobuf.MapField - internalGetArgs() { - if (args_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ArgsDefaultEntryHolder.defaultEntry); - } - return args_; - } - private com.google.protobuf.MapField - internalGetMutableArgs() { - onChanged();; - if (args_ == null) { - args_ = com.google.protobuf.MapField.newMapField( - ArgsDefaultEntryHolder.defaultEntry); - } - if (!args_.isMutable()) { - args_ = args_.copy(); - } - return args_; - } - - public int getArgsCount() { - return internalGetArgs().getMap().size(); - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public boolean containsArgs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetArgs().getMap().containsKey(key); - } - /** - * Use {@link #getArgsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getArgs() { - return getArgsMap(); - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public java.util.Map getArgsMap() { - return internalGetArgs().getMap(); - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public java.lang.String getArgsOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetArgs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public java.lang.String getArgsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetArgs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearArgs() { - internalGetMutableArgs().getMutableMap() - .clear(); - return this; - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public Builder removeArgs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableArgs().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableArgs() { - return internalGetMutableArgs().getMutableMap(); - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - public Builder putArgs( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableArgs().getMutableMap() - .put(key, value); - return this; - } - /** - *
-     * Extra arguments that will be displayed in trace view.
-     * 
- * - * map<string, string> args = 11; - */ - - public Builder putAllArgs( - java.util.Map values) { - internalGetMutableArgs().getMutableMap() - .putAll(values); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.profiler.TraceEvent) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.TraceEvent) - private static final org.tensorflow.proto.framework.TraceEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TraceEvent(); - } - - public static org.tensorflow.proto.framework.TraceEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TraceEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TraceEvent(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TraceEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventOrBuilder.java deleted file mode 100644 index 2bebd63d083..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventOrBuilder.java +++ /dev/null @@ -1,122 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -public interface TraceEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.TraceEvent) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The id of the device that this event occurred on. The full dataset should
-   * have this device present in the Trace object.
-   * 
- * - * uint32 device_id = 1; - */ - int getDeviceId(); - - /** - *
-   * The id of the resource that this event occurred on. The full dataset should
-   * have this resource present in the Device object of the Trace object. A
-   * resource_id is unique on a specific device, but not necessarily within the
-   * trace.
-   * 
- * - * uint32 resource_id = 2; - */ - int getResourceId(); - - /** - *
-   * The name of this trace event.
-   * 
- * - * string name = 3; - */ - java.lang.String getName(); - /** - *
-   * The name of this trace event.
-   * 
- * - * string name = 3; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * The timestamp that this event occurred at (in picos since tracing started).
-   * 
- * - * uint64 timestamp_ps = 9; - */ - long getTimestampPs(); - - /** - *
-   * The duration of the event in picoseconds if applicable.
-   * Events without duration are called instant events.
-   * 
- * - * uint64 duration_ps = 10; - */ - long getDurationPs(); - - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - int getArgsCount(); - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - boolean containsArgs( - java.lang.String key); - /** - * Use {@link #getArgsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getArgs(); - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - java.util.Map - getArgsMap(); - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - java.lang.String getArgsOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
-   * Extra arguments that will be displayed in trace view.
-   * 
- * - * map<string, string> args = 11; - */ - - java.lang.String getArgsOrThrow( - java.lang.String key); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventsProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventsProtos.java deleted file mode 100644 index 4e2e8c8d80a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceEventsProtos.java +++ /dev/null @@ -1,133 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -public final class TraceEventsProtos { - private TraceEventsProtos() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_Trace_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_Trace_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_Trace_DevicesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_Trace_DevicesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_Device_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_Device_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_Device_ResourcesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_Device_ResourcesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_Resource_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_Resource_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_TraceEvent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_TraceEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n+tensorflow/core/protobuf/trace_events." + - "proto\022\023tensorflow.profiler\"\305\001\n\005Trace\0228\n\007" + - "devices\030\001 \003(\0132\'.tensorflow.profiler.Trac" + - "e.DevicesEntry\0225\n\014trace_events\030\004 \003(\0132\037.t" + - "ensorflow.profiler.TraceEvent\032K\n\014Devices" + - "Entry\022\013\n\003key\030\001 \001(\r\022*\n\005value\030\002 \001(\0132\033.tens" + - "orflow.profiler.Device:\0028\001\"\271\001\n\006Device\022\014\n" + - "\004name\030\001 \001(\t\022\021\n\tdevice_id\030\002 \001(\r\022=\n\tresour" + - "ces\030\003 \003(\0132*.tensorflow.profiler.Device.R" + - "esourcesEntry\032O\n\016ResourcesEntry\022\013\n\003key\030\001" + - " \001(\r\022,\n\005value\030\002 \001(\0132\035.tensorflow.profile" + - "r.Resource:\0028\001\"-\n\010Resource\022\014\n\004name\030\001 \001(\t" + - "\022\023\n\013resource_id\030\002 \001(\r\"\323\001\n\nTraceEvent\022\021\n\t" + - "device_id\030\001 \001(\r\022\023\n\013resource_id\030\002 \001(\r\022\014\n\004" + - "name\030\003 \001(\t\022\024\n\014timestamp_ps\030\t \001(\004\022\023\n\013dura" + - "tion_ps\030\n \001(\004\0227\n\004args\030\013 \003(\0132).tensorflow" + - ".profiler.TraceEvent.ArgsEntry\032+\n\tArgsEn" + - "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\202\001\n\036" + - "org.tensorflow.proto.frameworkB\021TraceEve" + - "ntsProtosP\001ZHgithub.com/tensorflow/tenso" + - "rflow/tensorflow/go/core/core_protos_go_" + - "proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_profiler_Trace_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_profiler_Trace_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_Trace_descriptor, - new java.lang.String[] { "Devices", "TraceEvents", }); - internal_static_tensorflow_profiler_Trace_DevicesEntry_descriptor = - internal_static_tensorflow_profiler_Trace_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_profiler_Trace_DevicesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_Trace_DevicesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_profiler_Device_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_profiler_Device_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_Device_descriptor, - new java.lang.String[] { "Name", "DeviceId", "Resources", }); - internal_static_tensorflow_profiler_Device_ResourcesEntry_descriptor = - internal_static_tensorflow_profiler_Device_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_profiler_Device_ResourcesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_Device_ResourcesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_profiler_Resource_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_profiler_Resource_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_Resource_descriptor, - new java.lang.String[] { "Name", "ResourceId", }); - internal_static_tensorflow_profiler_TraceEvent_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_profiler_TraceEvent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_TraceEvent_descriptor, - new java.lang.String[] { "DeviceId", "ResourceId", "Name", "TimestampPs", "DurationPs", "Args", }); - internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_descriptor = - internal_static_tensorflow_profiler_TraceEvent_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_TraceEvent_ArgsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceOrBuilder.java deleted file mode 100644 index 78fa25b0aa9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TraceOrBuilder.java +++ /dev/null @@ -1,112 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trace_events.proto - -package org.tensorflow.proto.framework; - -public interface TraceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.Trace) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - int getDevicesCount(); - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - boolean containsDevices( - int key); - /** - * Use {@link #getDevicesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getDevices(); - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - java.util.Map - getDevicesMap(); - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - org.tensorflow.proto.framework.Device getDevicesOrDefault( - int key, - org.tensorflow.proto.framework.Device defaultValue); - /** - *
-   * The devices that this trace has information about. Maps from device_id to
-   * more data about the specific device.
-   * 
- * - * map<uint32, .tensorflow.profiler.Device> devices = 1; - */ - - org.tensorflow.proto.framework.Device getDevicesOrThrow( - int key); - - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - java.util.List - getTraceEventsList(); - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - org.tensorflow.proto.framework.TraceEvent getTraceEvents(int index); - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - int getTraceEventsCount(); - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - java.util.List - getTraceEventsOrBuilderList(); - /** - *
-   * All trace events capturing in the profiling period.
-   * 
- * - * repeated .tensorflow.profiler.TraceEvent trace_events = 4; - */ - org.tensorflow.proto.framework.TraceEventOrBuilder getTraceEventsOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphProtos.java index 22a3eef371a..6bde2fbe86e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphProtos.java @@ -65,11 +65,11 @@ public static void registerAllExtensions( "ckpoint_key\030\003 \001(\t\022\030\n\020optional_restore\030\004 " + "\001(\010\032l\n\025SlotVariableReference\022!\n\031original" + "_variable_node_id\030\001 \001(\005\022\021\n\tslot_name\030\002 \001" + - "(\t\022\035\n\025slot_variable_node_id\030\003 \001(\005B\213\001\n\036or" + + "(\t\022\035\n\025slot_variable_node_id\030\003 \001(\005B\230\001\n\036or" + "g.tensorflow.proto.frameworkB\032TrackableO" + - "bjectGraphProtosP\001ZHgithub.com/tensorflo" + - "w/tensorflow/tensorflow/go/core/core_pro" + - "tos_go_proto\370\001\001b\006proto3" + "bjectGraphProtosP\001ZUgithub.com/tensorflo" + + "w/tensorflow/tensorflow/go/core/protobuf" + + "/for_core_protos_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProto.java index 10c64eeb41c..da8535cd530 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProto.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProto.java @@ -200,6 +200,14 @@ public enum TypeSpecClass * ROW_PARTITION_SPEC = 10; */ ROW_PARTITION_SPEC(10), + /** + *
+     * TF Numpy NDarray spec
+     * 
+ * + * NDARRAY_SPEC = 11; + */ + NDARRAY_SPEC(11), UNRECOGNIZED(-1), ; @@ -287,6 +295,14 @@ public enum TypeSpecClass * ROW_PARTITION_SPEC = 10; */ public static final int ROW_PARTITION_SPEC_VALUE = 10; + /** + *
+     * TF Numpy NDarray spec
+     * 
+ * + * NDARRAY_SPEC = 11; + */ + public static final int NDARRAY_SPEC_VALUE = 11; public final int getNumber() { @@ -318,6 +334,7 @@ public static TypeSpecClass forNumber(int value) { case 8: return PER_REPLICA_SPEC; case 9: return VARIABLE_SPEC; case 10: return ROW_PARTITION_SPEC; + case 11: return NDARRAY_SPEC; default: return null; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypesProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypesProtos.java index 9c343efcb7c..b575702424b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypesProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypesProtos.java @@ -44,11 +44,12 @@ public static void registerAllExtensions( "_REF\020t\022\021\n\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX1" + "28_REF\020v\022\017\n\013DT_HALF_REF\020w\022\023\n\017DT_RESOURCE" + "_REF\020x\022\022\n\016DT_VARIANT_REF\020y\022\021\n\rDT_UINT32_" + - "REF\020z\022\021\n\rDT_UINT64_REF\020{B\200\001\n\036org.tensorf" + - "low.proto.frameworkB\013TypesProtosP\001ZLgith" + - "ub.com/tensorflow/tensorflow/tensorflow/" + - "go/core/framework/types_go_proto\370\001\001b\006pro" + - "to3" + "REF\020z\022\021\n\rDT_UINT64_REF\020{*5\n\017SpecializedT" + + "ype\022\016\n\nST_INVALID\020\000\022\022\n\016ST_TENSOR_LIST\020\001B" + + "\200\001\n\036org.tensorflow.proto.frameworkB\013Type" + + "sProtosP\001ZLgithub.com/tensorflow/tensorf" + + "low/tensorflow/go/core/framework/types_g" + + "o_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigProtos.java index 45b39000486..f0c11d7b318 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigProtos.java @@ -33,11 +33,11 @@ public static void registerAllExtensions( "\"\n\032verification_timeout_in_ms\030\001 \001(\003\022=\n\022s" + "tructure_verifier\030\002 \001(\0162!.tensorflow.Ver" + "ifierConfig.Toggle\"&\n\006Toggle\022\013\n\007DEFAULT\020" + - "\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002B\205\001\n\036org.tensorflow.pr" + - "oto.frameworkB\024VerifierConfigProtosP\001ZHg" + + "\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002B\222\001\n\036org.tensorflow.pr" + + "oto.frameworkB\024VerifierConfigProtosP\001ZUg" + "ithub.com/tensorflow/tensorflow/tensorfl" + - "ow/go/core/core_protos_go_proto\370\001\001b\006prot" + - "o3" + "ow/go/core/protobuf/for_core_protos_go_p" + + "roto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptions.java index 1a071369549..ac974d89c17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptions.java @@ -4,6 +4,10 @@ package org.tensorflow.proto.profiler; /** + *
+ * Next ID: 11
+ * 
+ * * Protobuf type {@code tensorflow.ProfileOptions} */ public final class ProfileOptions extends @@ -17,6 +21,7 @@ private ProfileOptions(com.google.protobuf.GeneratedMessageV3.Builder builder } private ProfileOptions() { deviceType_ = 0; + repositoryPath_ = ""; } @java.lang.Override @@ -85,6 +90,22 @@ private ProfileOptions( enableHloProto_ = input.readBool(); break; } + case 64: { + + startTimestampNs_ = input.readUInt64(); + break; + } + case 72: { + + durationMs_ = input.readUInt64(); + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + repositoryPath_ = s; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -359,6 +380,75 @@ public boolean getEnableHloProto() { return enableHloProto_; } + public static final int START_TIMESTAMP_NS_FIELD_NUMBER = 8; + private long startTimestampNs_; + /** + *
+   * The local profiler starts profiling at this Unix timestamp in nanoseconds.
+   * 
+ * + * uint64 start_timestamp_ns = 8; + */ + public long getStartTimestampNs() { + return startTimestampNs_; + } + + public static final int DURATION_MS_FIELD_NUMBER = 9; + private long durationMs_; + /** + *
+   * The local profiler collects `duration_ms` milliseconds of data. If the
+   * value is 0, profiling continues until interrupted.
+   * 
+ * + * uint64 duration_ms = 9; + */ + public long getDurationMs() { + return durationMs_; + } + + public static final int REPOSITORY_PATH_FIELD_NUMBER = 10; + private volatile java.lang.Object repositoryPath_; + /** + *
+   * Directory to save profile data to. No-op when empty.
+   * 
+ * + * string repository_path = 10; + */ + public java.lang.String getRepositoryPath() { + java.lang.Object ref = repositoryPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repositoryPath_ = s; + return s; + } + } + /** + *
+   * Directory to save profile data to. No-op when empty.
+   * 
+ * + * string repository_path = 10; + */ + public com.google.protobuf.ByteString + getRepositoryPathBytes() { + java.lang.Object ref = repositoryPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repositoryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -394,6 +484,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (enableHloProto_ != false) { output.writeBool(7, enableHloProto_); } + if (startTimestampNs_ != 0L) { + output.writeUInt64(8, startTimestampNs_); + } + if (durationMs_ != 0L) { + output.writeUInt64(9, durationMs_); + } + if (!getRepositoryPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, repositoryPath_); + } unknownFields.writeTo(output); } @@ -431,6 +530,17 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(7, enableHloProto_); } + if (startTimestampNs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(8, startTimestampNs_); + } + if (durationMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(9, durationMs_); + } + if (!getRepositoryPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, repositoryPath_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -459,6 +569,12 @@ public boolean equals(final java.lang.Object obj) { != other.getPythonTracerLevel()) return false; if (getEnableHloProto() != other.getEnableHloProto()) return false; + if (getStartTimestampNs() + != other.getStartTimestampNs()) return false; + if (getDurationMs() + != other.getDurationMs()) return false; + if (!getRepositoryPath() + .equals(other.getRepositoryPath())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -486,6 +602,14 @@ public int hashCode() { hash = (37 * hash) + ENABLE_HLO_PROTO_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getEnableHloProto()); + hash = (37 * hash) + START_TIMESTAMP_NS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestampNs()); + hash = (37 * hash) + DURATION_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDurationMs()); + hash = (37 * hash) + REPOSITORY_PATH_FIELD_NUMBER; + hash = (53 * hash) + getRepositoryPath().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -582,6 +706,10 @@ protected Builder newBuilderForType( return builder; } /** + *
+   * Next ID: 11
+   * 
+ * * Protobuf type {@code tensorflow.ProfileOptions} */ public static final class Builder extends @@ -633,6 +761,12 @@ public Builder clear() { enableHloProto_ = false; + startTimestampNs_ = 0L; + + durationMs_ = 0L; + + repositoryPath_ = ""; + return this; } @@ -666,6 +800,9 @@ public org.tensorflow.proto.profiler.ProfileOptions buildPartial() { result.deviceTracerLevel_ = deviceTracerLevel_; result.pythonTracerLevel_ = pythonTracerLevel_; result.enableHloProto_ = enableHloProto_; + result.startTimestampNs_ = startTimestampNs_; + result.durationMs_ = durationMs_; + result.repositoryPath_ = repositoryPath_; onBuilt(); return result; } @@ -735,6 +872,16 @@ public Builder mergeFrom(org.tensorflow.proto.profiler.ProfileOptions other) { if (other.getEnableHloProto() != false) { setEnableHloProto(other.getEnableHloProto()); } + if (other.getStartTimestampNs() != 0L) { + setStartTimestampNs(other.getStartTimestampNs()); + } + if (other.getDurationMs() != 0L) { + setDurationMs(other.getDurationMs()); + } + if (!other.getRepositoryPath().isEmpty()) { + repositoryPath_ = other.repositoryPath_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1121,6 +1268,174 @@ public Builder clearEnableHloProto() { onChanged(); return this; } + + private long startTimestampNs_ ; + /** + *
+     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
+     * 
+ * + * uint64 start_timestamp_ns = 8; + */ + public long getStartTimestampNs() { + return startTimestampNs_; + } + /** + *
+     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
+     * 
+ * + * uint64 start_timestamp_ns = 8; + */ + public Builder setStartTimestampNs(long value) { + + startTimestampNs_ = value; + onChanged(); + return this; + } + /** + *
+     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
+     * 
+ * + * uint64 start_timestamp_ns = 8; + */ + public Builder clearStartTimestampNs() { + + startTimestampNs_ = 0L; + onChanged(); + return this; + } + + private long durationMs_ ; + /** + *
+     * The local profiler collects `duration_ms` milliseconds of data. If the
+     * value is 0, profiling continues until interrupted.
+     * 
+ * + * uint64 duration_ms = 9; + */ + public long getDurationMs() { + return durationMs_; + } + /** + *
+     * The local profiler collects `duration_ms` milliseconds of data. If the
+     * value is 0, profiling continues until interrupted.
+     * 
+ * + * uint64 duration_ms = 9; + */ + public Builder setDurationMs(long value) { + + durationMs_ = value; + onChanged(); + return this; + } + /** + *
+     * The local profiler collects `duration_ms` milliseconds of data. If the
+     * value is 0, profiling continues until interrupted.
+     * 
+ * + * uint64 duration_ms = 9; + */ + public Builder clearDurationMs() { + + durationMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object repositoryPath_ = ""; + /** + *
+     * Directory to save profile data to. No-op when empty.
+     * 
+ * + * string repository_path = 10; + */ + public java.lang.String getRepositoryPath() { + java.lang.Object ref = repositoryPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repositoryPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Directory to save profile data to. No-op when empty.
+     * 
+ * + * string repository_path = 10; + */ + public com.google.protobuf.ByteString + getRepositoryPathBytes() { + java.lang.Object ref = repositoryPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repositoryPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Directory to save profile data to. No-op when empty.
+     * 
+ * + * string repository_path = 10; + */ + public Builder setRepositoryPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repositoryPath_ = value; + onChanged(); + return this; + } + /** + *
+     * Directory to save profile data to. No-op when empty.
+     * 
+ * + * string repository_path = 10; + */ + public Builder clearRepositoryPath() { + + repositoryPath_ = getDefaultInstance().getRepositoryPath(); + onChanged(); + return this; + } + /** + *
+     * Directory to save profile data to. No-op when empty.
+     * 
+ * + * string repository_path = 10; + */ + public Builder setRepositoryPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repositoryPath_ = value; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptionsOrBuilder.java index e508bb52c79..ca6fa82f415 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptionsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptionsOrBuilder.java @@ -100,4 +100,41 @@ public interface ProfileOptionsOrBuilder extends * bool enable_hlo_proto = 7; */ boolean getEnableHloProto(); + + /** + *
+   * The local profiler starts profiling at this Unix timestamp in nanoseconds.
+   * 
+ * + * uint64 start_timestamp_ns = 8; + */ + long getStartTimestampNs(); + + /** + *
+   * The local profiler collects `duration_ms` milliseconds of data. If the
+   * value is 0, profiling continues until interrupted.
+   * 
+ * + * uint64 duration_ms = 9; + */ + long getDurationMs(); + + /** + *
+   * Directory to save profile data to. No-op when empty.
+   * 
+ * + * string repository_path = 10; + */ + java.lang.String getRepositoryPath(); + /** + *
+   * Directory to save profile data to. No-op when empty.
+   * 
+ * + * string repository_path = 10; + */ + com.google.protobuf.ByteString + getRepositoryPathBytes(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfilerOptionsProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfilerOptionsProtos.java index 669d1ee04b5..de30001ade0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfilerOptionsProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfilerOptionsProtos.java @@ -19,6 +19,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tensorflow_ProfileOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -29,16 +34,23 @@ public static void registerAllExtensions( static { java.lang.String[] descriptorData = { "\n/tensorflow/core/profiler/profiler_opti" + - "ons.proto\022\ntensorflow\"\243\002\n\016ProfileOptions" + + "ons.proto\022\ntensorflow\"\355\002\n\016ProfileOptions" + "\022\017\n\007version\030\005 \001(\r\022:\n\013device_type\030\006 \001(\0162%" + ".tensorflow.ProfileOptions.DeviceType\022\033\n" + "\023include_dataset_ops\030\001 \001(\010\022\031\n\021host_trace" + "r_level\030\002 \001(\r\022\033\n\023device_tracer_level\030\003 \001" + "(\r\022\033\n\023python_tracer_level\030\004 \001(\r\022\030\n\020enabl" + - "e_hlo_proto\030\007 \001(\010\"8\n\nDeviceType\022\017\n\013UNSPE" + - "CIFIED\020\000\022\007\n\003CPU\020\001\022\007\n\003GPU\020\002\022\007\n\003TPU\020\003B8\n\035o" + - "rg.tensorflow.proto.profilerB\025ProfilerOp" + - "tionsProtosP\001b\006proto3" + "e_hlo_proto\030\007 \001(\010\022\032\n\022start_timestamp_ns\030" + + "\010 \001(\004\022\023\n\013duration_ms\030\t \001(\004\022\027\n\017repository" + + "_path\030\n \001(\t\"8\n\nDeviceType\022\017\n\013UNSPECIFIED" + + "\020\000\022\007\n\003CPU\020\001\022\007\n\003GPU\020\002\022\007\n\003TPU\020\003\"\320\001\n#Remote" + + "ProfilerSessionManagerOptions\0224\n\020profile" + + "r_options\030\001 \001(\0132\032.tensorflow.ProfileOpti" + + "ons\022\031\n\021service_addresses\030\002 \003(\t\022%\n\035sessio" + + "n_creation_timestamp_ns\030\003 \001(\004\022\037\n\027max_ses" + + "sion_duration_ms\030\004 \001(\004\022\020\n\010delay_ms\030\005 \001(\004" + + "B8\n\035org.tensorflow.proto.profilerB\025Profi" + + "lerOptionsProtosP\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -49,7 +61,13 @@ public static void registerAllExtensions( internal_static_tensorflow_ProfileOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_ProfileOptions_descriptor, - new java.lang.String[] { "Version", "DeviceType", "IncludeDatasetOps", "HostTracerLevel", "DeviceTracerLevel", "PythonTracerLevel", "EnableHloProto", }); + new java.lang.String[] { "Version", "DeviceType", "IncludeDatasetOps", "HostTracerLevel", "DeviceTracerLevel", "PythonTracerLevel", "EnableHloProto", "StartTimestampNs", "DurationMs", "RepositoryPath", }); + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor, + new java.lang.String[] { "ProfilerOptions", "ServiceAddresses", "SessionCreationTimestampNs", "MaxSessionDurationMs", "DelayMs", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptions.java new file mode 100644 index 00000000000..f138785b0ce --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptions.java @@ -0,0 +1,1117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/profiler/profiler_options.proto + +package org.tensorflow.proto.profiler; + +/** + *
+ * Options for remote profiler session manager.
+ * Next ID: 6
+ * 
+ * + * Protobuf type {@code tensorflow.RemoteProfilerSessionManagerOptions} + */ +public final class RemoteProfilerSessionManagerOptions extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:tensorflow.RemoteProfilerSessionManagerOptions) + RemoteProfilerSessionManagerOptionsOrBuilder { +private static final long serialVersionUID = 0L; + // Use RemoteProfilerSessionManagerOptions.newBuilder() to construct. + private RemoteProfilerSessionManagerOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RemoteProfilerSessionManagerOptions() { + serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RemoteProfilerSessionManagerOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RemoteProfilerSessionManagerOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.profiler.ProfileOptions.Builder subBuilder = null; + if (profilerOptions_ != null) { + subBuilder = profilerOptions_.toBuilder(); + } + profilerOptions_ = input.readMessage(org.tensorflow.proto.profiler.ProfileOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(profilerOptions_); + profilerOptions_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + serviceAddresses_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceAddresses_.add(s); + break; + } + case 24: { + + sessionCreationTimestampNs_ = input.readUInt64(); + break; + } + case 32: { + + maxSessionDurationMs_ = input.readUInt64(); + break; + } + case 40: { + + delayMs_ = input.readUInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + serviceAddresses_ = serviceAddresses_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.Builder.class); + } + + public static final int PROFILER_OPTIONS_FIELD_NUMBER = 1; + private org.tensorflow.proto.profiler.ProfileOptions profilerOptions_; + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public boolean hasProfilerOptions() { + return profilerOptions_ != null; + } + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.profiler.ProfileOptions getProfilerOptions() { + return profilerOptions_ == null ? org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_; + } + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.profiler.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() { + return getProfilerOptions(); + } + + public static final int SERVICE_ADDRESSES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList serviceAddresses_; + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + public com.google.protobuf.ProtocolStringList + getServiceAddressesList() { + return serviceAddresses_; + } + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + public int getServiceAddressesCount() { + return serviceAddresses_.size(); + } + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + public java.lang.String getServiceAddresses(int index) { + return serviceAddresses_.get(index); + } + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + public com.google.protobuf.ByteString + getServiceAddressesBytes(int index) { + return serviceAddresses_.getByteString(index); + } + + public static final int SESSION_CREATION_TIMESTAMP_NS_FIELD_NUMBER = 3; + private long sessionCreationTimestampNs_; + /** + *
+   * Unix timestamp of when the session was started.
+   * 
+ * + * uint64 session_creation_timestamp_ns = 3; + */ + public long getSessionCreationTimestampNs() { + return sessionCreationTimestampNs_; + } + + public static final int MAX_SESSION_DURATION_MS_FIELD_NUMBER = 4; + private long maxSessionDurationMs_; + /** + *
+   * Maximum time (in milliseconds) a profiling session manager waits for all
+   * profilers to finish after issuing gRPC request. If value is 0, session
+   * continues until interrupted. Otherwise, value must be greater than
+   * profiler_options.duration_ms.
+   * 
+ * + * uint64 max_session_duration_ms = 4; + */ + public long getMaxSessionDurationMs() { + return maxSessionDurationMs_; + } + + public static final int DELAY_MS_FIELD_NUMBER = 5; + private long delayMs_; + /** + *
+   * Start of profiling is delayed by this much (in milliseconds).
+   * 
+ * + * uint64 delay_ms = 5; + */ + public long getDelayMs() { + return delayMs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (profilerOptions_ != null) { + output.writeMessage(1, getProfilerOptions()); + } + for (int i = 0; i < serviceAddresses_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceAddresses_.getRaw(i)); + } + if (sessionCreationTimestampNs_ != 0L) { + output.writeUInt64(3, sessionCreationTimestampNs_); + } + if (maxSessionDurationMs_ != 0L) { + output.writeUInt64(4, maxSessionDurationMs_); + } + if (delayMs_ != 0L) { + output.writeUInt64(5, delayMs_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (profilerOptions_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProfilerOptions()); + } + { + int dataSize = 0; + for (int i = 0; i < serviceAddresses_.size(); i++) { + dataSize += computeStringSizeNoTag(serviceAddresses_.getRaw(i)); + } + size += dataSize; + size += 1 * getServiceAddressesList().size(); + } + if (sessionCreationTimestampNs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, sessionCreationTimestampNs_); + } + if (maxSessionDurationMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, maxSessionDurationMs_); + } + if (delayMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, delayMs_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions other = (org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions) obj; + + if (hasProfilerOptions() != other.hasProfilerOptions()) return false; + if (hasProfilerOptions()) { + if (!getProfilerOptions() + .equals(other.getProfilerOptions())) return false; + } + if (!getServiceAddressesList() + .equals(other.getServiceAddressesList())) return false; + if (getSessionCreationTimestampNs() + != other.getSessionCreationTimestampNs()) return false; + if (getMaxSessionDurationMs() + != other.getMaxSessionDurationMs()) return false; + if (getDelayMs() + != other.getDelayMs()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProfilerOptions()) { + hash = (37 * hash) + PROFILER_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getProfilerOptions().hashCode(); + } + if (getServiceAddressesCount() > 0) { + hash = (37 * hash) + SERVICE_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getServiceAddressesList().hashCode(); + } + hash = (37 * hash) + SESSION_CREATION_TIMESTAMP_NS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSessionCreationTimestampNs()); + hash = (37 * hash) + MAX_SESSION_DURATION_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxSessionDurationMs()); + hash = (37 * hash) + DELAY_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDelayMs()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Options for remote profiler session manager.
+   * Next ID: 6
+   * 
+ * + * Protobuf type {@code tensorflow.RemoteProfilerSessionManagerOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RemoteProfilerSessionManagerOptions) + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (profilerOptionsBuilder_ == null) { + profilerOptions_ = null; + } else { + profilerOptions_ = null; + profilerOptionsBuilder_ = null; + } + serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + sessionCreationTimestampNs_ = 0L; + + maxSessionDurationMs_ = 0L; + + delayMs_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions build() { + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions buildPartial() { + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions result = new org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions(this); + int from_bitField0_ = bitField0_; + if (profilerOptionsBuilder_ == null) { + result.profilerOptions_ = profilerOptions_; + } else { + result.profilerOptions_ = profilerOptionsBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + serviceAddresses_ = serviceAddresses_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceAddresses_ = serviceAddresses_; + result.sessionCreationTimestampNs_ = sessionCreationTimestampNs_; + result.maxSessionDurationMs_ = maxSessionDurationMs_; + result.delayMs_ = delayMs_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions) { + return mergeFrom((org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions other) { + if (other == org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.getDefaultInstance()) return this; + if (other.hasProfilerOptions()) { + mergeProfilerOptions(other.getProfilerOptions()); + } + if (!other.serviceAddresses_.isEmpty()) { + if (serviceAddresses_.isEmpty()) { + serviceAddresses_ = other.serviceAddresses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceAddressesIsMutable(); + serviceAddresses_.addAll(other.serviceAddresses_); + } + onChanged(); + } + if (other.getSessionCreationTimestampNs() != 0L) { + setSessionCreationTimestampNs(other.getSessionCreationTimestampNs()); + } + if (other.getMaxSessionDurationMs() != 0L) { + setMaxSessionDurationMs(other.getMaxSessionDurationMs()); + } + if (other.getDelayMs() != 0L) { + setDelayMs(other.getDelayMs()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.tensorflow.proto.profiler.ProfileOptions profilerOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder> profilerOptionsBuilder_; + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public boolean hasProfilerOptions() { + return profilerOptionsBuilder_ != null || profilerOptions_ != null; + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.profiler.ProfileOptions getProfilerOptions() { + if (profilerOptionsBuilder_ == null) { + return profilerOptions_ == null ? org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_; + } else { + return profilerOptionsBuilder_.getMessage(); + } + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder setProfilerOptions(org.tensorflow.proto.profiler.ProfileOptions value) { + if (profilerOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + profilerOptions_ = value; + onChanged(); + } else { + profilerOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder setProfilerOptions( + org.tensorflow.proto.profiler.ProfileOptions.Builder builderForValue) { + if (profilerOptionsBuilder_ == null) { + profilerOptions_ = builderForValue.build(); + onChanged(); + } else { + profilerOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder mergeProfilerOptions(org.tensorflow.proto.profiler.ProfileOptions value) { + if (profilerOptionsBuilder_ == null) { + if (profilerOptions_ != null) { + profilerOptions_ = + org.tensorflow.proto.profiler.ProfileOptions.newBuilder(profilerOptions_).mergeFrom(value).buildPartial(); + } else { + profilerOptions_ = value; + } + onChanged(); + } else { + profilerOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder clearProfilerOptions() { + if (profilerOptionsBuilder_ == null) { + profilerOptions_ = null; + onChanged(); + } else { + profilerOptions_ = null; + profilerOptionsBuilder_ = null; + } + + return this; + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.profiler.ProfileOptions.Builder getProfilerOptionsBuilder() { + + onChanged(); + return getProfilerOptionsFieldBuilder().getBuilder(); + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.profiler.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() { + if (profilerOptionsBuilder_ != null) { + return profilerOptionsBuilder_.getMessageOrBuilder(); + } else { + return profilerOptions_ == null ? + org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_; + } + } + /** + *
+     * Options for each local profiler.
+     * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder> + getProfilerOptionsFieldBuilder() { + if (profilerOptionsBuilder_ == null) { + profilerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder>( + getProfilerOptions(), + getParentForChildren(), + isClean()); + profilerOptions_ = null; + } + return profilerOptionsBuilder_; + } + + private com.google.protobuf.LazyStringList serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureServiceAddressesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceAddresses_ = new com.google.protobuf.LazyStringArrayList(serviceAddresses_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public com.google.protobuf.ProtocolStringList + getServiceAddressesList() { + return serviceAddresses_.getUnmodifiableView(); + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public int getServiceAddressesCount() { + return serviceAddresses_.size(); + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public java.lang.String getServiceAddresses(int index) { + return serviceAddresses_.get(index); + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public com.google.protobuf.ByteString + getServiceAddressesBytes(int index) { + return serviceAddresses_.getByteString(index); + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public Builder setServiceAddresses( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceAddressesIsMutable(); + serviceAddresses_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public Builder addServiceAddresses( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceAddressesIsMutable(); + serviceAddresses_.add(value); + onChanged(); + return this; + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public Builder addAllServiceAddresses( + java.lang.Iterable values) { + ensureServiceAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceAddresses_); + onChanged(); + return this; + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public Builder clearServiceAddresses() { + serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * List of servers to profile. Supported formats: host:port.
+     * 
+ * + * repeated string service_addresses = 2; + */ + public Builder addServiceAddressesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureServiceAddressesIsMutable(); + serviceAddresses_.add(value); + onChanged(); + return this; + } + + private long sessionCreationTimestampNs_ ; + /** + *
+     * Unix timestamp of when the session was started.
+     * 
+ * + * uint64 session_creation_timestamp_ns = 3; + */ + public long getSessionCreationTimestampNs() { + return sessionCreationTimestampNs_; + } + /** + *
+     * Unix timestamp of when the session was started.
+     * 
+ * + * uint64 session_creation_timestamp_ns = 3; + */ + public Builder setSessionCreationTimestampNs(long value) { + + sessionCreationTimestampNs_ = value; + onChanged(); + return this; + } + /** + *
+     * Unix timestamp of when the session was started.
+     * 
+ * + * uint64 session_creation_timestamp_ns = 3; + */ + public Builder clearSessionCreationTimestampNs() { + + sessionCreationTimestampNs_ = 0L; + onChanged(); + return this; + } + + private long maxSessionDurationMs_ ; + /** + *
+     * Maximum time (in milliseconds) a profiling session manager waits for all
+     * profilers to finish after issuing gRPC request. If value is 0, session
+     * continues until interrupted. Otherwise, value must be greater than
+     * profiler_options.duration_ms.
+     * 
+ * + * uint64 max_session_duration_ms = 4; + */ + public long getMaxSessionDurationMs() { + return maxSessionDurationMs_; + } + /** + *
+     * Maximum time (in milliseconds) a profiling session manager waits for all
+     * profilers to finish after issuing gRPC request. If value is 0, session
+     * continues until interrupted. Otherwise, value must be greater than
+     * profiler_options.duration_ms.
+     * 
+ * + * uint64 max_session_duration_ms = 4; + */ + public Builder setMaxSessionDurationMs(long value) { + + maxSessionDurationMs_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum time (in milliseconds) a profiling session manager waits for all
+     * profilers to finish after issuing gRPC request. If value is 0, session
+     * continues until interrupted. Otherwise, value must be greater than
+     * profiler_options.duration_ms.
+     * 
+ * + * uint64 max_session_duration_ms = 4; + */ + public Builder clearMaxSessionDurationMs() { + + maxSessionDurationMs_ = 0L; + onChanged(); + return this; + } + + private long delayMs_ ; + /** + *
+     * Start of profiling is delayed by this much (in milliseconds).
+     * 
+ * + * uint64 delay_ms = 5; + */ + public long getDelayMs() { + return delayMs_; + } + /** + *
+     * Start of profiling is delayed by this much (in milliseconds).
+     * 
+ * + * uint64 delay_ms = 5; + */ + public Builder setDelayMs(long value) { + + delayMs_ = value; + onChanged(); + return this; + } + /** + *
+     * Start of profiling is delayed by this much (in milliseconds).
+     * 
+ * + * uint64 delay_ms = 5; + */ + public Builder clearDelayMs() { + + delayMs_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:tensorflow.RemoteProfilerSessionManagerOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RemoteProfilerSessionManagerOptions) + private static final org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions(); + } + + public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoteProfilerSessionManagerOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RemoteProfilerSessionManagerOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptionsOrBuilder.java new file mode 100644 index 00000000000..6adf91f203f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptionsOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/profiler/profiler_options.proto + +package org.tensorflow.proto.profiler; + +public interface RemoteProfilerSessionManagerOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RemoteProfilerSessionManagerOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + boolean hasProfilerOptions(); + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + org.tensorflow.proto.profiler.ProfileOptions getProfilerOptions(); + /** + *
+   * Options for each local profiler.
+   * 
+ * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + org.tensorflow.proto.profiler.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder(); + + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + java.util.List + getServiceAddressesList(); + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + int getServiceAddressesCount(); + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + java.lang.String getServiceAddresses(int index); + /** + *
+   * List of servers to profile. Supported formats: host:port.
+   * 
+ * + * repeated string service_addresses = 2; + */ + com.google.protobuf.ByteString + getServiceAddressesBytes(int index); + + /** + *
+   * Unix timestamp of when the session was started.
+   * 
+ * + * uint64 session_creation_timestamp_ns = 3; + */ + long getSessionCreationTimestampNs(); + + /** + *
+   * Maximum time (in milliseconds) a profiling session manager waits for all
+   * profilers to finish after issuing gRPC request. If value is 0, session
+   * continues until interrupted. Otherwise, value must be greater than
+   * profiler_options.duration_ms.
+   * 
+ * + * uint64 max_session_duration_ms = 4; + */ + long getMaxSessionDurationMs(); + + /** + *
+   * Start of profiling is delayed by this much (in milliseconds).
+   * 
+ * + * uint64 delay_ms = 5; + */ + long getDelayMs(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEvent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEvent.java index 2921881fee2..edc7854d97e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEvent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEvent.java @@ -219,6 +219,7 @@ public long getDurationPs() { /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -229,6 +230,7 @@ public java.util.List getStatsList() { /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -240,6 +242,7 @@ public java.util.List getStatsList() { /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -250,6 +253,7 @@ public int getStatsCount() { /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -260,6 +264,7 @@ public org.tensorflow.proto.profiler.XStat getStats(int index) { /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -912,6 +917,7 @@ private void ensureStatsIsMutable() { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -926,6 +932,7 @@ public java.util.List getStatsList() { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -940,6 +947,7 @@ public int getStatsCount() { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -954,6 +962,7 @@ public org.tensorflow.proto.profiler.XStat getStats(int index) { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -975,6 +984,7 @@ public Builder setStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -993,6 +1003,7 @@ public Builder setStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1013,6 +1024,7 @@ public Builder addStats(org.tensorflow.proto.profiler.XStat value) { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1034,6 +1046,7 @@ public Builder addStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1052,6 +1065,7 @@ public Builder addStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1070,6 +1084,7 @@ public Builder addStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1089,6 +1104,7 @@ public Builder addAllStats( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1106,6 +1122,7 @@ public Builder clearStats() { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1123,6 +1140,7 @@ public Builder removeStats(int index) { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1134,6 +1152,7 @@ public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1148,6 +1167,7 @@ public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1163,6 +1183,7 @@ public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1174,6 +1195,7 @@ public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() { /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -1186,6 +1208,7 @@ public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder( /** *
      * XStats associated with the event.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 4; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadata.java index c7551d7f4f5..1085ab6ecce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadata.java @@ -5,8 +5,9 @@ /** *
- * Metadata for an XEvent, shared by all instances of the same event.
- * Next ID: 5
+ * Metadata for an XEvent, corresponds to an event type and is shared by
+ * all XEvents with the same metadata_id.
+ * Next ID: 6
  * 
* * Protobuf type {@code tensorflow.profiler.XEventMetadata} @@ -24,6 +25,7 @@ private XEventMetadata() { name_ = ""; displayName_ = ""; metadata_ = com.google.protobuf.ByteString.EMPTY; + stats_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -46,6 +48,7 @@ private XEventMetadata( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -78,6 +81,15 @@ private XEventMetadata( displayName_ = s; break; } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stats_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stats_.add( + input.readMessage(org.tensorflow.proto.profiler.XStat.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -93,6 +105,9 @@ private XEventMetadata( throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -220,6 +235,66 @@ public com.google.protobuf.ByteString getMetadata() { return metadata_; } + public static final int STATS_FIELD_NUMBER = 5; + private java.util.List stats_; + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public java.util.List getStatsList() { + return stats_; + } + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public java.util.List + getStatsOrBuilderList() { + return stats_; + } + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public int getStatsCount() { + return stats_.size(); + } + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStat getStats(int index) { + return stats_.get(index); + } + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( + int index) { + return stats_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -246,6 +321,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getDisplayNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); } + for (int i = 0; i < stats_.size(); i++) { + output.writeMessage(5, stats_.get(i)); + } unknownFields.writeTo(output); } @@ -269,6 +347,10 @@ public int getSerializedSize() { if (!getDisplayNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); } + for (int i = 0; i < stats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, stats_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -292,6 +374,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getDisplayName())) return false; if (!getMetadata() .equals(other.getMetadata())) return false; + if (!getStatsList() + .equals(other.getStatsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -312,6 +396,10 @@ public int hashCode() { hash = (53 * hash) + getDisplayName().hashCode(); hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + getMetadata().hashCode(); + if (getStatsCount() > 0) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStatsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -409,8 +497,9 @@ protected Builder newBuilderForType( } /** *
-   * Metadata for an XEvent, shared by all instances of the same event.
-   * Next ID: 5
+   * Metadata for an XEvent, corresponds to an event type and is shared by
+   * all XEvents with the same metadata_id.
+   * Next ID: 6
    * 
* * Protobuf type {@code tensorflow.profiler.XEventMetadata} @@ -445,6 +534,7 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getStatsFieldBuilder(); } } @java.lang.Override @@ -458,6 +548,12 @@ public Builder clear() { metadata_ = com.google.protobuf.ByteString.EMPTY; + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + statsBuilder_.clear(); + } return this; } @@ -484,10 +580,20 @@ public org.tensorflow.proto.profiler.XEventMetadata build() { @java.lang.Override public org.tensorflow.proto.profiler.XEventMetadata buildPartial() { org.tensorflow.proto.profiler.XEventMetadata result = new org.tensorflow.proto.profiler.XEventMetadata(this); + int from_bitField0_ = bitField0_; result.id_ = id_; result.name_ = name_; result.displayName_ = displayName_; result.metadata_ = metadata_; + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } onBuilt(); return result; } @@ -550,6 +656,32 @@ public Builder mergeFrom(org.tensorflow.proto.profiler.XEventMetadata other) { if (other.getMetadata() != com.google.protobuf.ByteString.EMPTY) { setMetadata(other.getMetadata()); } + if (statsBuilder_ == null) { + if (!other.stats_.isEmpty()) { + if (stats_.isEmpty()) { + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStatsIsMutable(); + stats_.addAll(other.stats_); + } + onChanged(); + } + } else { + if (!other.stats_.isEmpty()) { + if (statsBuilder_.isEmpty()) { + statsBuilder_.dispose(); + statsBuilder_ = null; + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000001); + statsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getStatsFieldBuilder() : null; + } else { + statsBuilder_.addAllMessages(other.stats_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -578,6 +710,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private long id_ ; /** @@ -835,6 +968,336 @@ public Builder clearMetadata() { onChanged(); return this; } + + private java.util.List stats_ = + java.util.Collections.emptyList(); + private void ensureStatsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stats_ = new java.util.ArrayList(stats_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder> statsBuilder_; + + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public java.util.List getStatsList() { + if (statsBuilder_ == null) { + return java.util.Collections.unmodifiableList(stats_); + } else { + return statsBuilder_.getMessageList(); + } + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public int getStatsCount() { + if (statsBuilder_ == null) { + return stats_.size(); + } else { + return statsBuilder_.getCount(); + } + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStat getStats(int index) { + if (statsBuilder_ == null) { + return stats_.get(index); + } else { + return statsBuilder_.getMessage(index); + } + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.XStat value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.set(index, value); + onChanged(); + } else { + statsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.set(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder addStats(org.tensorflow.proto.profiler.XStat value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(value); + onChanged(); + } else { + statsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.XStat value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(index, value); + onChanged(); + } else { + statsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder addStats( + org.tensorflow.proto.profiler.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder addAllStats( + java.lang.Iterable values) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, stats_); + onChanged(); + } else { + statsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder clearStats() { + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + statsBuilder_.clear(); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public Builder removeStats(int index) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.remove(index); + onChanged(); + } else { + statsBuilder_.remove(index); + } + return this; + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder( + int index) { + return getStatsFieldBuilder().getBuilder(index); + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( + int index) { + if (statsBuilder_ == null) { + return stats_.get(index); } else { + return statsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public java.util.List + getStatsOrBuilderList() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stats_); + } + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() { + return getStatsFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.XStat.getDefaultInstance()); + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder( + int index) { + return getStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.XStat.getDefaultInstance()); + } + /** + *
+     * XStats that are constant for all XEvents with the same metadata_id.
+     * Each of these XStats should have a different metadata_id.
+     * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + public java.util.List + getStatsBuilderList() { + return getStatsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder>( + stats_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadataOrBuilder.java index b150f6e1850..4f865d87b0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadataOrBuilder.java @@ -60,4 +60,53 @@ public interface XEventMetadataOrBuilder extends * bytes metadata = 3; */ com.google.protobuf.ByteString getMetadata(); + + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + java.util.List + getStatsList(); + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + org.tensorflow.proto.profiler.XStat getStats(int index); + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + int getStatsCount(); + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + java.util.List + getStatsOrBuilderList(); + /** + *
+   * XStats that are constant for all XEvents with the same metadata_id.
+   * Each of these XStats should have a different metadata_id.
+   * 
+ * + * repeated .tensorflow.profiler.XStat stats = 5; + */ + org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( + int index); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventOrBuilder.java index 3d9e4c2eec5..4769931cb4e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventOrBuilder.java @@ -47,6 +47,7 @@ public interface XEventOrBuilder extends /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -56,6 +57,7 @@ public interface XEventOrBuilder extends /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -64,6 +66,7 @@ public interface XEventOrBuilder extends /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -72,6 +75,7 @@ public interface XEventOrBuilder extends /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; @@ -81,6 +85,7 @@ public interface XEventOrBuilder extends /** *
    * XStats associated with the event.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 4; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlane.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlane.java index 7668a7f1d74..f63470466e8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlane.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlane.java @@ -473,6 +473,7 @@ public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -483,6 +484,7 @@ public java.util.List getStatsList() { /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -494,6 +496,7 @@ public java.util.List getStatsList() { /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -504,6 +507,7 @@ public int getStatsCount() { /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -514,6 +518,7 @@ public org.tensorflow.proto.profiler.XStat getStats(int index) { /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1817,6 +1822,7 @@ private void ensureStatsIsMutable() { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1831,6 +1837,7 @@ public java.util.List getStatsList() { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1845,6 +1852,7 @@ public int getStatsCount() { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1859,6 +1867,7 @@ public org.tensorflow.proto.profiler.XStat getStats(int index) { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1880,6 +1889,7 @@ public Builder setStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1898,6 +1908,7 @@ public Builder setStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1918,6 +1929,7 @@ public Builder addStats(org.tensorflow.proto.profiler.XStat value) { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1939,6 +1951,7 @@ public Builder addStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1957,6 +1970,7 @@ public Builder addStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1975,6 +1989,7 @@ public Builder addStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -1994,6 +2009,7 @@ public Builder addAllStats( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2011,6 +2027,7 @@ public Builder clearStats() { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2028,6 +2045,7 @@ public Builder removeStats(int index) { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2039,6 +2057,7 @@ public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2053,6 +2072,7 @@ public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2068,6 +2088,7 @@ public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2079,6 +2100,7 @@ public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() { /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -2091,6 +2113,7 @@ public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder( /** *
      * XStats associated with this plane, e.g. device capabilities.
+     * Each of these XStats should have a different metadata_id.
      * 
* * repeated .tensorflow.profiler.XStat stats = 6; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneOrBuilder.java index a6b97a4c6dd..1600cdece2b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneOrBuilder.java @@ -200,6 +200,7 @@ org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -209,6 +210,7 @@ org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -217,6 +219,7 @@ org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -225,6 +228,7 @@ org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; @@ -234,6 +238,7 @@ org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( /** *
    * XStats associated with this plane, e.g. device capabilities.
+   * Each of these XStats should have a different metadata_id.
    * 
* * repeated .tensorflow.profiler.XStat stats = 6; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneProtos.java index 4fdb2cce99d..4da0ce0a22e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneProtos.java @@ -69,39 +69,40 @@ public static void registerAllExtensions( static { java.lang.String[] descriptorData = { "\n.tensorflow/core/profiler/protobuf/xpla" + - "ne.proto\022\023tensorflow.profiler\"W\n\006XSpace\022" + + "ne.proto\022\023tensorflow.profiler\"j\n\006XSpace\022" + "+\n\006planes\030\001 \003(\0132\033.tensorflow.profiler.XP" + - "lane\022\016\n\006errors\030\002 \003(\t\022\020\n\010warnings\030\003 \003(\t\"\272" + - "\003\n\006XPlane\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022)\n\005l" + - "ines\030\003 \003(\0132\032.tensorflow.profiler.XLine\022F" + - "\n\016event_metadata\030\004 \003(\0132..tensorflow.prof" + - "iler.XPlane.EventMetadataEntry\022D\n\rstat_m" + - "etadata\030\005 \003(\0132-.tensorflow.profiler.XPla" + - "ne.StatMetadataEntry\022)\n\005stats\030\006 \003(\0132\032.te" + - "nsorflow.profiler.XStat\032Y\n\022EventMetadata" + - "Entry\022\013\n\003key\030\001 \001(\003\0222\n\005value\030\002 \001(\0132#.tens" + - "orflow.profiler.XEventMetadata:\0028\001\032W\n\021St" + - "atMetadataEntry\022\013\n\003key\030\001 \001(\003\0221\n\005value\030\002 " + - "\001(\0132\".tensorflow.profiler.XStatMetadata:" + - "\0028\001\"\273\001\n\005XLine\022\n\n\002id\030\001 \001(\003\022\022\n\ndisplay_id\030" + - "\n \001(\003\022\014\n\004name\030\002 \001(\t\022\024\n\014display_name\030\013 \001(" + - "\t\022\024\n\014timestamp_ns\030\003 \001(\003\022\023\n\013duration_ps\030\t" + - " \001(\003\022+\n\006events\030\004 \003(\0132\033.tensorflow.profil" + - "er.XEventJ\004\010\005\020\006J\004\010\006\020\007J\004\010\007\020\010J\004\010\010\020\t\"\225\001\n\006XE" + - "vent\022\023\n\013metadata_id\030\001 \001(\003\022\023\n\toffset_ps\030\002" + - " \001(\003H\000\022\031\n\017num_occurrences\030\005 \001(\003H\000\022\023\n\013dur" + - "ation_ps\030\003 \001(\003\022)\n\005stats\030\004 \003(\0132\032.tensorfl" + - "ow.profiler.XStatB\006\n\004data\"\255\001\n\005XStat\022\023\n\013m" + - "etadata_id\030\001 \001(\003\022\026\n\014double_value\030\002 \001(\001H\000" + - "\022\026\n\014uint64_value\030\003 \001(\004H\000\022\025\n\013int64_value\030" + - "\004 \001(\003H\000\022\023\n\tstr_value\030\005 \001(\tH\000\022\025\n\013bytes_va" + - "lue\030\006 \001(\014H\000\022\023\n\tref_value\030\007 \001(\004H\000B\007\n\005valu" + - "e\"R\n\016XEventMetadata\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030" + - "\002 \001(\t\022\024\n\014display_name\030\004 \001(\t\022\020\n\010metadata\030" + - "\003 \001(\014\">\n\rXStatMetadata\022\n\n\002id\030\001 \001(\003\022\014\n\004na" + - "me\030\002 \001(\t\022\023\n\013description\030\003 \001(\tB2\n\035org.ten" + - "sorflow.proto.profilerB\014XPlaneProtosP\001\370\001" + - "\001b\006proto3" + "lane\022\016\n\006errors\030\002 \003(\t\022\020\n\010warnings\030\003 \003(\t\022\021" + + "\n\thostnames\030\004 \003(\t\"\272\003\n\006XPlane\022\n\n\002id\030\001 \001(\003" + + "\022\014\n\004name\030\002 \001(\t\022)\n\005lines\030\003 \003(\0132\032.tensorfl" + + "ow.profiler.XLine\022F\n\016event_metadata\030\004 \003(" + + "\0132..tensorflow.profiler.XPlane.EventMeta" + + "dataEntry\022D\n\rstat_metadata\030\005 \003(\0132-.tenso" + + "rflow.profiler.XPlane.StatMetadataEntry\022" + + ")\n\005stats\030\006 \003(\0132\032.tensorflow.profiler.XSt" + + "at\032Y\n\022EventMetadataEntry\022\013\n\003key\030\001 \001(\003\0222\n" + + "\005value\030\002 \001(\0132#.tensorflow.profiler.XEven" + + "tMetadata:\0028\001\032W\n\021StatMetadataEntry\022\013\n\003ke" + + "y\030\001 \001(\003\0221\n\005value\030\002 \001(\0132\".tensorflow.prof" + + "iler.XStatMetadata:\0028\001\"\273\001\n\005XLine\022\n\n\002id\030\001" + + " \001(\003\022\022\n\ndisplay_id\030\n \001(\003\022\014\n\004name\030\002 \001(\t\022\024" + + "\n\014display_name\030\013 \001(\t\022\024\n\014timestamp_ns\030\003 \001" + + "(\003\022\023\n\013duration_ps\030\t \001(\003\022+\n\006events\030\004 \003(\0132" + + "\033.tensorflow.profiler.XEventJ\004\010\005\020\006J\004\010\006\020\007" + + "J\004\010\007\020\010J\004\010\010\020\t\"\225\001\n\006XEvent\022\023\n\013metadata_id\030\001" + + " \001(\003\022\023\n\toffset_ps\030\002 \001(\003H\000\022\031\n\017num_occurre" + + "nces\030\005 \001(\003H\000\022\023\n\013duration_ps\030\003 \001(\003\022)\n\005sta" + + "ts\030\004 \003(\0132\032.tensorflow.profiler.XStatB\006\n\004" + + "data\"\255\001\n\005XStat\022\023\n\013metadata_id\030\001 \001(\003\022\026\n\014d" + + "ouble_value\030\002 \001(\001H\000\022\026\n\014uint64_value\030\003 \001(" + + "\004H\000\022\025\n\013int64_value\030\004 \001(\003H\000\022\023\n\tstr_value\030" + + "\005 \001(\tH\000\022\025\n\013bytes_value\030\006 \001(\014H\000\022\023\n\tref_va" + + "lue\030\007 \001(\004H\000B\007\n\005value\"}\n\016XEventMetadata\022\n" + + "\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\024\n\014display_name" + + "\030\004 \001(\t\022\020\n\010metadata\030\003 \001(\014\022)\n\005stats\030\005 \003(\0132" + + "\032.tensorflow.profiler.XStat\">\n\rXStatMeta" + + "data\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\023\n\013descri" + + "ption\030\003 \001(\tB2\n\035org.tensorflow.proto.prof" + + "ilerB\014XPlaneProtosP\001\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -112,7 +113,7 @@ public static void registerAllExtensions( internal_static_tensorflow_profiler_XSpace_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_profiler_XSpace_descriptor, - new java.lang.String[] { "Planes", "Errors", "Warnings", }); + new java.lang.String[] { "Planes", "Errors", "Warnings", "Hostnames", }); internal_static_tensorflow_profiler_XPlane_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_profiler_XPlane_fieldAccessorTable = new @@ -154,7 +155,7 @@ public static void registerAllExtensions( internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_tensorflow_profiler_XEventMetadata_descriptor, - new java.lang.String[] { "Id", "Name", "DisplayName", "Metadata", }); + new java.lang.String[] { "Id", "Name", "DisplayName", "Metadata", "Stats", }); internal_static_tensorflow_profiler_XStatMetadata_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable = new diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpace.java index 956b5ab793b..1c15a523498 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpace.java @@ -6,7 +6,7 @@ /** *
  * A container of parallel XPlanes, generated by one or more profiling sources.
- * Next ID: 4
+ * Next ID: 5
  * 
* * Protobuf type {@code tensorflow.profiler.XSpace} @@ -24,6 +24,7 @@ private XSpace() { planes_ = java.util.Collections.emptyList(); errors_ = com.google.protobuf.LazyStringArrayList.EMPTY; warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + hostnames_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -84,6 +85,15 @@ private XSpace( warnings_.add(s); break; } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + hostnames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + hostnames_.add(s); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -108,6 +118,9 @@ private XSpace( if (((mutable_bitField0_ & 0x00000004) != 0)) { warnings_ = warnings_.getUnmodifiableView(); } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + hostnames_ = hostnames_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -250,6 +263,51 @@ public java.lang.String getWarnings(int index) { return warnings_.getByteString(index); } + public static final int HOSTNAMES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList hostnames_; + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + public com.google.protobuf.ProtocolStringList + getHostnamesList() { + return hostnames_; + } + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + public int getHostnamesCount() { + return hostnames_.size(); + } + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + public java.lang.String getHostnames(int index) { + return hostnames_.get(index); + } + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + public com.google.protobuf.ByteString + getHostnamesBytes(int index) { + return hostnames_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -273,6 +331,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < warnings_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, warnings_.getRaw(i)); } + for (int i = 0; i < hostnames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hostnames_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -302,6 +363,14 @@ public int getSerializedSize() { size += dataSize; size += 1 * getWarningsList().size(); } + { + int dataSize = 0; + for (int i = 0; i < hostnames_.size(); i++) { + dataSize += computeStringSizeNoTag(hostnames_.getRaw(i)); + } + size += dataSize; + size += 1 * getHostnamesList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -323,6 +392,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getErrorsList())) return false; if (!getWarningsList() .equals(other.getWarningsList())) return false; + if (!getHostnamesList() + .equals(other.getHostnamesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -346,6 +417,10 @@ public int hashCode() { hash = (37 * hash) + WARNINGS_FIELD_NUMBER; hash = (53 * hash) + getWarningsList().hashCode(); } + if (getHostnamesCount() > 0) { + hash = (37 * hash) + HOSTNAMES_FIELD_NUMBER; + hash = (53 * hash) + getHostnamesList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -444,7 +519,7 @@ protected Builder newBuilderForType( /** *
    * A container of parallel XPlanes, generated by one or more profiling sources.
-   * Next ID: 4
+   * Next ID: 5
    * 
* * Protobuf type {@code tensorflow.profiler.XSpace} @@ -495,6 +570,8 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000002); warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); + hostnames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -541,6 +618,11 @@ public org.tensorflow.proto.profiler.XSpace buildPartial() { bitField0_ = (bitField0_ & ~0x00000004); } result.warnings_ = warnings_; + if (((bitField0_ & 0x00000008) != 0)) { + hostnames_ = hostnames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.hostnames_ = hostnames_; onBuilt(); return result; } @@ -635,6 +717,16 @@ public Builder mergeFrom(org.tensorflow.proto.profiler.XSpace other) { } onChanged(); } + if (!other.hostnames_.isEmpty()) { + if (hostnames_.isEmpty()) { + hostnames_ = other.hostnames_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureHostnamesIsMutable(); + hostnames_.addAll(other.hostnames_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1164,6 +1256,136 @@ public Builder addWarningsBytes( onChanged(); return this; } + + private com.google.protobuf.LazyStringList hostnames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureHostnamesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + hostnames_ = new com.google.protobuf.LazyStringArrayList(hostnames_); + bitField0_ |= 0x00000008; + } + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public com.google.protobuf.ProtocolStringList + getHostnamesList() { + return hostnames_.getUnmodifiableView(); + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public int getHostnamesCount() { + return hostnames_.size(); + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public java.lang.String getHostnames(int index) { + return hostnames_.get(index); + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public com.google.protobuf.ByteString + getHostnamesBytes(int index) { + return hostnames_.getByteString(index); + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public Builder setHostnames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostnamesIsMutable(); + hostnames_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public Builder addHostnames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureHostnamesIsMutable(); + hostnames_.add(value); + onChanged(); + return this; + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public Builder addAllHostnames( + java.lang.Iterable values) { + ensureHostnamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, hostnames_); + onChanged(); + return this; + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public Builder clearHostnames() { + hostnames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
+     * List of hostnames that XPlanes are generated from.
+     * 
+ * + * repeated string hostnames = 4; + */ + public Builder addHostnamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureHostnamesIsMutable(); + hostnames_.add(value); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpaceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpaceOrBuilder.java index dd081ad954f..06a0a5b45ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpaceOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpaceOrBuilder.java @@ -100,4 +100,39 @@ org.tensorflow.proto.profiler.XPlaneOrBuilder getPlanesOrBuilder( */ com.google.protobuf.ByteString getWarningsBytes(int index); + + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + java.util.List + getHostnamesList(); + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + int getHostnamesCount(); + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + java.lang.String getHostnames(int index); + /** + *
+   * List of hostnames that XPlanes are generated from.
+   * 
+ * + * repeated string hostnames = 4; + */ + com.google.protobuf.ByteString + getHostnamesBytes(int index); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadata.java index 8967f6e6c1e..007fbb4aa12 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadata.java @@ -5,7 +5,8 @@ /** *
- * Metadata for an XStat, shared by all instances of the same stat.
+ * Metadata for an XStat, corresponds to a stat type and is shared by all
+ * XStats with the same metadata_id.
  * Next ID: 4
  * 
* @@ -122,6 +123,7 @@ public long getId() { /** *
    * Name of the stat (should be short).
+   * Two XStatMetadata with different id should have different names.
    * 
* * string name = 2; @@ -141,6 +143,7 @@ public java.lang.String getName() { /** *
    * Name of the stat (should be short).
+   * Two XStatMetadata with different id should have different names.
    * 
* * string name = 2; @@ -379,7 +382,8 @@ protected Builder newBuilderForType( } /** *
-   * Metadata for an XStat, shared by all instances of the same stat.
+   * Metadata for an XStat, corresponds to a stat type and is shared by all
+   * XStats with the same metadata_id.
    * Next ID: 4
    * 
* @@ -585,6 +589,7 @@ public Builder clearId() { /** *
      * Name of the stat (should be short).
+     * Two XStatMetadata with different id should have different names.
      * 
* * string name = 2; @@ -604,6 +609,7 @@ public java.lang.String getName() { /** *
      * Name of the stat (should be short).
+     * Two XStatMetadata with different id should have different names.
      * 
* * string name = 2; @@ -624,6 +630,7 @@ public java.lang.String getName() { /** *
      * Name of the stat (should be short).
+     * Two XStatMetadata with different id should have different names.
      * 
* * string name = 2; @@ -641,6 +648,7 @@ public Builder setName( /** *
      * Name of the stat (should be short).
+     * Two XStatMetadata with different id should have different names.
      * 
* * string name = 2; @@ -654,6 +662,7 @@ public Builder clearName() { /** *
      * Name of the stat (should be short).
+     * Two XStatMetadata with different id should have different names.
      * 
* * string name = 2; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadataOrBuilder.java index ebd901428ad..26b174f6b3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadataOrBuilder.java @@ -19,6 +19,7 @@ public interface XStatMetadataOrBuilder extends /** *
    * Name of the stat (should be short).
+   * Two XStatMetadata with different id should have different names.
    * 
* * string name = 2; @@ -27,6 +28,7 @@ public interface XStatMetadataOrBuilder extends /** *
    * Name of the stat (should be short).
+   * Two XStatMetadata with different id should have different names.
    * 
* * string name = 2; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BfcMemoryMapProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BfcMemoryMapProtos.java index b5870cc34d5..d92aacf04eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BfcMemoryMapProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BfcMemoryMapProtos.java @@ -67,10 +67,11 @@ public static void registerAllExtensions( "nsorflow.BinSummary\022#\n\005chunk\030\003 \003(\0132\024.ten" + "sorflow.MemChunk\022\'\n\tsnap_shot\030\004 \003(\0132\024.te" + "nsorflow.SnapShot\022,\n\005stats\030\005 \001(\0132\035.tenso" + - "rflow.MemAllocatorStatsB{\n\031org.tensorflo" + - "w.proto.utilB\022BfcMemoryMapProtosP\001ZHgith" + - "ub.com/tensorflow/tensorflow/tensorflow/" + - "go/core/core_protos_go_protob\006proto3" + "rflow.MemAllocatorStatsB\210\001\n\031org.tensorfl" + + "ow.proto.utilB\022BfcMemoryMapProtosP\001ZUgit" + + "hub.com/tensorflow/tensorflow/tensorflow" + + "/go/core/protobuf/for_core_protos_go_pro" + + "tob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventProtos.java index 411b002619a..52b391e8520 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventProtos.java @@ -126,10 +126,11 @@ public static void registerAllExtensions( "\022\017\n\013CURT_HEALTH\020\002\022\022\n\016CONCISE_HEALTH\020\003\022\017\n" + "\013FULL_HEALTH\020\004\022\t\n\005SHAPE\020\005\022\021\n\rFULL_NUMERI" + "CS\020\006\022\017\n\013FULL_TENSOR\020\007\022\036\n\032REDUCE_INF_NAN_" + - "THREE_SLOTS\020\010B|\n\031org.tensorflow.proto.ut" + - "ilB\020DebugEventProtosP\001ZHgithub.com/tenso" + - "rflow/tensorflow/tensorflow/go/core/core" + - "_protos_go_proto\370\001\001b\006proto3" + "THREE_SLOTS\020\010B\211\001\n\031org.tensorflow.proto.u" + + "tilB\020DebugEventProtosP\001ZUgithub.com/tens" + + "orflow/tensorflow/tensorflow/go/core/pro" + + "tobuf/for_core_protos_go_proto\370\001\001b\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventProtos.java index 121a7223e1d..7259855e6f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventProtos.java @@ -98,8 +98,10 @@ public static void registerAllExtensions( "TTING_DOWN\020\003*k\n\022WorkerShutdownMode\022\013\n\007DE" + "FAULT\020\000\022\022\n\016NOT_CONFIGURED\020\001\022\030\n\024WAIT_FOR_" + "COORDINATOR\020\002\022\032\n\026SHUTDOWN_AFTER_TIMEOUT\020" + - "\003B-\n\031org.tensorflow.proto.utilB\013EventPro" + - "tosP\001\370\001\001b\006proto3" + "\003Bv\n\031org.tensorflow.proto.utilB\013EventPro" + + "tosP\001ZGgithub.com/tensorflow/tensorflow/" + + "tensorflow/go/core/util/event_go_proto\370\001" + + "\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverProtos.java index 8739b58bf4f..279140f5a3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverProtos.java @@ -36,10 +36,11 @@ public static void registerAllExtensions( "t_every_n_hours\030\006 \001(\002\022=\n\007version\030\007 \001(\0162," + ".tensorflow.SaverDef.CheckpointFormatVer" + "sion\"5\n\027CheckpointFormatVersion\022\n\n\006LEGAC" + - "Y\020\000\022\006\n\002V1\020\001\022\006\n\002V2\020\002Bw\n\031org.tensorflow.pr" + - "oto.utilB\013SaverProtosP\001ZHgithub.com/tens" + - "orflow/tensorflow/tensorflow/go/core/cor" + - "e_protos_go_proto\370\001\001b\006proto3" + "Y\020\000\022\006\n\002V1\020\001\022\006\n\002V2\020\002B\204\001\n\031org.tensorflow.p" + + "roto.utilB\013SaverProtosP\001ZUgithub.com/ten" + + "sorflow/tensorflow/tensorflow/go/core/pr" + + "otobuf/for_core_protos_go_proto\370\001\001b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorBundleProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorBundleProtos.java index 3de209fb5a9..a3ba9d49dce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorBundleProtos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorBundleProtos.java @@ -48,10 +48,11 @@ public static void registerAllExtensions( " \001(\0132\034.tensorflow.TensorShapeProto\022\020\n\010sh" + "ard_id\030\003 \001(\005\022\016\n\006offset\030\004 \001(\003\022\014\n\004size\030\005 \001" + "(\003\022\016\n\006crc32c\030\006 \001(\007\022,\n\006slices\030\007 \003(\0132\034.ten" + - "sorflow.TensorSliceProtoB~\n\031org.tensorfl" + - "ow.proto.utilB\022TensorBundleProtosP\001ZHgit" + - "hub.com/tensorflow/tensorflow/tensorflow" + - "/go/core/core_protos_go_proto\370\001\001b\006proto3" + "sorflow.TensorSliceProtoB\213\001\n\031org.tensorf" + + "low.proto.utilB\022TensorBundleProtosP\001ZUgi" + + "thub.com/tensorflow/tensorflow/tensorflo" + + "w/go/core/protobuf/for_core_protos_go_pr" + + "oto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/ByteSequenceTensorBuffer.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/ByteSequenceTensorBuffer.java index e3b9152c6ba..3bcbd7f8022 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/ByteSequenceTensorBuffer.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/ByteSequenceTensorBuffer.java @@ -17,11 +17,20 @@ package org.tensorflow.internal.buffer; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_Assign; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_Copy; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_Init; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_GetDataPointer; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_GetSize; + import java.nio.ReadOnlyBufferException; import java.util.function.Function; -import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.bytedeco.javacpp.BytePointer; +import org.bytedeco.javacpp.Loader; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.internal.c_api.TF_TString; import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; import org.tensorflow.ndarray.impl.buffer.Validator; import org.tensorflow.ndarray.NdArray; @@ -29,19 +38,8 @@ /** * Buffer for storing string tensor data. * - *

The values are stored a sequence of bytes, with their length and offset in the tensor. - * Given a string tensor of n elements, data is stored in the buffer as followed: - *

- * off0, off1, ..., offn-1, len0, bytes0, len1, bytes1, ..., lenn-1, bytesn-1
- * 
- * - *

Each offset is a 64-bit integer that indicates the location of the string in the tensor, i.e. - * the position of the first byte of its length value. - * - *

The length of the string, which is the number of bytes in the sequence, is encoded as a varint - * and is one byte long or more depending on its value. - * - *

The string bytes starts right after the varint length value. + *

The values are stored as an array of {@link TF_TString}, internally wrapped with + * {@code tensorflow::tstring}, which is essentially a portable version of {@code std::string}. * *

The data of the buffer must be initialized only once, by calling {@link #init(NdArray, Function)}, * and the buffer must have been allocated with enough space (use {@link #computeSize(NdArray, Function)} @@ -59,14 +57,8 @@ public class ByteSequenceTensorBuffer extends AbstractDataBuffer { * @return number of bytes required to store the data. */ public static long computeSize(ByteSequenceProvider byteSequenceProvider) { - // reserve space to store 64-bit offsets - long size = byteSequenceProvider.numSequences() * Long.BYTES; - - // reserve space to store length and data of each values - for (byte[] elementBytes : byteSequenceProvider) { - size += elementBytes.length + ByteSequenceTensorBuffer.varintLength(elementBytes.length); - } - return size; + // reserve space to store TF_TString objects + return byteSequenceProvider.numSequences() * Loader.sizeof(TF_TString.class); } /** @@ -86,30 +78,15 @@ public void init(ByteSequenceProvider byteSequenceProvider) { @Override public long size() { - return offsets.size(); + return data.capacity() - data.position(); } @Override public byte[] getObject(long index) { Validator.getArgs(this, index); - long offset = offsets.getLong(index); - - // Read string length as a varint from the given offset - byte b; - int pos = 0; - int length = 0; - do { - b = data.getByte(offset++); - length |= (b & 0x7F) << pos; - pos += 7; - } while ((b & 0x80) != 0); - - // Read string of the given length - byte[] bytes = new byte[length]; - if (length > 0) { - data.offset(offset).read(bytes); - } - return bytes; + TF_TString tstring = data.getPointer(index); + BytePointer ptr = TF_TString_GetDataPointer(tstring).capacity(TF_TString_GetSize(tstring)); + return ptr.getStringBytes(); } @Override @@ -126,68 +103,35 @@ public boolean isReadOnly() { public DataBuffer copyTo(DataBuffer dst, long size) { if (size == size() && dst instanceof ByteSequenceTensorBuffer) { ByteSequenceTensorBuffer tensorDst = (ByteSequenceTensorBuffer) dst; - if (offsets.size() != size || data.size() != size) { - throw new IllegalArgumentException( - "Cannot copy string tensor data to another tensor of a different size"); + for (int i = 0; i < size; i++) { + TF_TString_Assign(tensorDst.data.getPointer(i), data.getPointer(i)); } - offsets.copyTo(tensorDst.offsets, size); - data.copyTo(tensorDst.data, size); } else { slowCopyTo(dst, size); } return this; } - @Override - public DataBuffer offset(long index) { - return new ByteSequenceTensorBuffer(offsets.offset(index), data); - } - - @Override - public DataBuffer narrow(long size) { - return new ByteSequenceTensorBuffer(offsets.narrow(size), data); - } - @Override public DataBuffer slice(long index, long size) { - return new ByteSequenceTensorBuffer(offsets.slice(index, size), data); + return new ByteSequenceTensorBuffer(data.getPointer(index), size); } - ByteSequenceTensorBuffer(LongDataBuffer offsets, ByteDataBuffer data) { - this.offsets = offsets; - this.data = data; + ByteSequenceTensorBuffer(Pointer tensorMemory, long numElements) { + this.data = new TF_TString(tensorMemory).capacity(tensorMemory.position() + numElements); } private class InitDataWriter { - long offsetIndex = 0; - long dataIndex = 0; + long index = 0; void writeNext(byte[] bytes) { - offsets.setLong(dataIndex, offsetIndex++); - - // Encode string length as a varint first - int v = bytes.length; - while (v >= 0x80) { - data.setByte((byte) ((v & 0x7F) | 0x80), dataIndex++); - v >>= 7; + try (PointerScope scope = new PointerScope()) { + TF_TString tstring = data.getPointer(index++); + TF_TString_Init(tstring); + TF_TString_Copy(tstring, new BytePointer(bytes), bytes.length); } - data.setByte((byte) v, dataIndex++); - - // Then write string data bytes - data.offset(dataIndex).write(bytes); - dataIndex += bytes.length; - } - } - - private static int varintLength(int length) { - int len = 1; - while (length >= 0x80) { - length >>= 7; - len++; } - return len; } - private final LongDataBuffer offsets; - private final ByteDataBuffer data; + private final TF_TString data; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java index 415c5ca35ef..5cf2716c083 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java @@ -164,16 +164,7 @@ public static ByteSequenceTensorBuffer toStrings(TF_Tensor nativeTensor, long nu if (numElements > Integer.MAX_VALUE) { throw new IllegalArgumentException("Cannot map string tensor of " + numElements + " elements"); } - ByteBuffer dataBuffer = tensorMemory.asByteBuffer(); - - LongBuffer offsetBuffer = dataBuffer.asLongBuffer(); - offsetBuffer.limit((int)numElements); - LongDataBuffer offsets = DataBuffers.of(offsetBuffer.slice()); - - dataBuffer.position((int)numElements * Long.BYTES); - ByteDataBuffer data = DataBuffers.of(dataBuffer.slice()); - - return new ByteSequenceTensorBuffer(offsets, data); + return new ByteSequenceTensorBuffer(tensorMemory, numElements); } private static Pointer tensorMemory(TF_Tensor nativeTensor) { diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java index dbaf31f1dcc..7539fad9abf 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java @@ -58,12 +58,6 @@ static BooleanDataBuffer mapTensorToBooleans(Pointer tensorMemory) { } static ByteSequenceTensorBuffer mapTensorToStrings(Pointer tensorMemory, long numElements) { - long offsetByteSize = numElements * Long.BYTES; - LongDataBuffer offsets = mapNativeLongs(tensorMemory.address(), offsetByteSize, false); - ByteDataBuffer data = mapNativeBytes( - tensorMemory.address() + offsetByteSize, - tensorMemory.capacity() - offsetByteSize, - false); - return new ByteSequenceTensorBuffer(offsets, data); + return new ByteSequenceTensorBuffer(tensorMemory, numElements); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java index 07227bf778a..17bf9dbf79a 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java @@ -38,11 +38,15 @@ value = {"linux", "macosx", "windows"}, compiler = "cpp11", include = { + "tensorflow/core/platform/ctstring_internal.h", + "tensorflow/core/platform/ctstring.h", "tensorflow/core/util/port.h", "tensorflow/c/tf_attrtype.h", + "tensorflow/c/c_api_macros.h", "tensorflow/c/tf_datatype.h", "tensorflow/c/tf_status.h", "tensorflow/c/tf_tensor.h", + "tensorflow/c/tf_tstring.h", "tensorflow/c/c_api.h", // "tensorflow/c/env.h", "tensorflow/c/kernels.h", @@ -157,20 +161,29 @@ public class tensorflow implements LoadEnabled, InfoMapper { if (!Loader.isLoadLibraries() || extension == null || !extension.endsWith("-gpu")) { return; } - String[] libs = {"cudart", "cublasLt", "cublas", "cufft", "curand", "cusolver", "cusparse", "cudnn", "nccl", "nvinfer"}; + String[] libs = {"cudart", "cublasLt", "cublas", "cufft", "curand", "cusolver", "cusparse", "cudnn", "nccl", "nvrtc", "myelin", "nvinfer", + "cudnn_ops_infer", "cudnn_ops_train", "cudnn_adv_infer", "cudnn_adv_train", "cudnn_cnn_infer", "cudnn_cnn_train"}; for (String lib : libs) { - switch (platform) { - case "linux-arm64": - case "linux-ppc64le": - case "linux-x86_64": - case "macosx-x86_64": - lib += lib.equals("cudnn") ? "@.7" : lib.equals("nccl") ? "@.2" : lib.equals("nvinfer") ? "@.6" : lib.equals("cudart") ? "@.10.1" : "@.10"; - break; - case "windows-x86_64": - lib += lib.equals("cudnn") ? "64_7" : lib.equals("cudart") ? "64_101" : "64_10"; - break; - default: - continue; // no CUDA + if (platform.startsWith("linux")) { + lib += lib.startsWith("cudnn") ? "@.8" + : lib.equals("nccl") ? "@.2" + : lib.equals("myelin") ? "@.1" + : lib.equals("nvinfer") ? "@.7" + : lib.equals("cufft") || lib.equals("curand") || lib.equals("cusolver") ? "@.10" + : lib.equals("cudart") ? "@.11.0" + : lib.equals("nvrtc") ? "@.11.0" + : "@.11"; + } else if (platform.startsWith("windows")) { + lib += lib.startsWith("cudnn") ? "64_8" + : lib.equals("nccl") ? "64_2" + : lib.equals("myelin") ? "64_1" + : lib.equals("nvinfer") ? "64_7" + : lib.equals("cufft") || lib.equals("curand") || lib.equals("cusolver") ? "64_10" + : lib.equals("cudart") ? "64_110" + : lib.equals("nvrtc") ? "64_110_0" + : "64_11"; + } else { + continue; // no CUDA } if (!preloads.contains(lib)) { preloads.add(i++, lib); @@ -183,7 +196,7 @@ public class tensorflow implements LoadEnabled, InfoMapper { } public void map(InfoMap infoMap) { - infoMap.put(new Info("TF_CAPI_EXPORT").cppTypes().annotations()) + infoMap.put(new Info("TF_CAPI_EXPORT", "TF_Bool").cppTypes().annotations()) .put(new Info("TF_Buffer::data").javaText("public native @Const Pointer data(); public native TF_Buffer data(Pointer data);")) .put(new Info("TF_Status").pointerTypes("TF_Status").base("org.tensorflow.internal.c_api.AbstractTF_Status")) .put(new Info("TF_Buffer").pointerTypes("TF_Buffer").base("org.tensorflow.internal.c_api.AbstractTF_Buffer")) diff --git a/tensorflow-core/tensorflow-core-platform-mkl-gpu/pom.xml b/tensorflow-core/tensorflow-core-platform-mkl-gpu/pom.xml index b3a1075ca6c..3f5f6d52553 100644 --- a/tensorflow-core/tensorflow-core-platform-mkl-gpu/pom.xml +++ b/tensorflow-core/tensorflow-core-platform-mkl-gpu/pom.xml @@ -51,23 +51,6 @@ ${javacpp.version} ${javacpp.platform.windows-x86_64} - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - ${javacpp.platform.linux-x86_64} - - ${project.groupId} ${javacpp.moduleId} diff --git a/tensorflow-core/tensorflow-core-platform-mkl/pom.xml b/tensorflow-core/tensorflow-core-platform-mkl/pom.xml index 63a020d4f7f..03d84e3840d 100644 --- a/tensorflow-core/tensorflow-core-platform-mkl/pom.xml +++ b/tensorflow-core/tensorflow-core-platform-mkl/pom.xml @@ -57,29 +57,6 @@ ${javacpp.version} ${javacpp.platform.windows-x86_64} - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - ${javacpp.platform.linux-x86_64} - - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - ${javacpp.platform.macosx-x86_64} - - - org.bytedeco - mkl-dnn - ${mkl-dnn.version} - ${javacpp.platform.windows-x86_64} - ${project.groupId} ${javacpp.moduleId}